An e-commerce online live broadcast method based on the Internet

By building a multi-dimensional user portrait and multi-layer collaborative filtering neural network model, combined with a random forest algorithm, the problem of cold-start users and long-tail product recommendations in the e-commerce recommendation system is solved, personalized recommendations and diverse recommendations are realized, and recommendations are improved. System effect.

CN117788105BActive Publication Date: 2024-11-05BEIJING ELEMENTS STARTING POINT TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311793736.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-25
Publication Date
2024-11-05
Estimated Expiration
2043-12-25

AI Technical Summary

Technical Problem

The existing e-commerce recommendation system has poor recommendations for cold-start users, and cannot quickly capture user interests, and has serious homogeneity of recommendations, which cannot meet users' needs for long-tail products, and cannot deeply explore potential characteristics in multi-source heterogeneous user data. .

Method used

By collecting user behavior data, building multi-dimensional user portraits, and using the TensorFlow framework to build a multi-layer collaborative filtering neural network model, combining the random forest algorithm to realize personalized product recommendations, recommend long-tail products, and avoid homogeneity.

Benefits of technology

It improves the recommendation accuracy and diversity of the recommendation system, and can quickly generate personalized recommendations for new users and recommend long-tail products, avoid homogeneous recommendation results, and meet users' diverse needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117788105B_ABST
    Figure CN117788105B_ABST
Patent Text Reader

Abstract

The present application discloses an e-commerce online live broadcast method based on the Internet, which relates to the field of e-commerce live broadcast technology, including: collecting user behavior data on the e-commerce platform; establishing a MySQL database to store the collected user behavior data; using a supervised learning algorithm, based on the collected user behavior data and product ID data, constructing and training the user's product ID preference model to generate a multi-dimensional portrait of the user; based on the TensorFlow machine learning framework, constructing a multi-layer collaborative filtering neural network model, and using the generated user's multi-dimensional portrait to train the constructed multi-layer collaborative filtering neural network model; using the trained multi-layer collaborative filtering neural network model, according to the user's real-time request, generating a product ID recommendation list for the user. In response to the problem of homogeneity of e-commerce recommendation schemes in the prior art, the present application improves the multi-scheme difference recommendation for users in the online live broadcast of e-commerce on the Internet by aligning user features with product features.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of e-commerce live broadcasting, and in particular to an e-commerce online live broadcasting method based on the Internet. Background Art

[0002] With the rapid development of mobile Internet and e-commerce, the number of products and users on major e-commerce platforms has increased rapidly, which has put forward higher requirements for product recommendation systems. High-quality personalized product recommendation services can not only improve users' shopping experience, but also be the key to e-commerce platforms gaining competitive advantages.

[0003] However, traditional recommendation algorithms based on content filtering or collaborative filtering have the following problems: the recommendation effect on cold start users is poor and cannot quickly capture user interests; the recommendations are highly homogeneous and cannot meet user demand for long-tail products; it is impossible to deeply mine the potential features in multi-source heterogeneous user data, and the recommendations tend to be homogeneous.

[0004] In the related art, for example, Chinese patent document CN113709576A provides an Internet-based e-commerce online live broadcast method and system, wherein the method includes: obtaining first selling product information; obtaining first product category; constructing a product purchasing user group portrait data set; inputting the first product category into the product purchasing user group portrait data set to obtain the first product purchasing user group portrait information; obtaining the matching first online sales host information; obtaining the first live broadcast interface image; obtaining the second live broadcast interface image; constructing the first purchase VR image information according to the first live broadcast interface image and the second live broadcast interface image; obtaining the first marked purchase product information; transmitting the first marked purchase product information back to the first live broadcast interface image information to realize the network direct sales of the first product. However, in this scheme, matching recommendations are mainly based on the product category and the user group portrait, which relies too much on the product category dimension to determine the recommendation results, and lacks fine-grained modeling of individual user interests and preferences, so the recommendation scheme has the problem of homogeneity. Summary of the invention

[0005] 1. Technical issues to be solved

[0006] In response to the problem of homogeneity of e-commerce recommendation solutions in the prior art, the present application provides an e-commerce online live broadcast method based on the Internet, which improves the differentiated recommendation of multiple solutions for users in the Internet e-commerce online live broadcast by aligning user characteristics with product characteristics.

[0007] 2. Technical solution

[0008] The purpose of this application is achieved through the following technical solutions.

[0009] The embodiment of the present specification provides an e-commerce online live broadcast method based on the Internet, including: collecting user behavior data on the e-commerce platform; establishing a MySQL database to store the collected user behavior data; using a supervised learning algorithm to build and train the user's product ID preference model based on the collected user behavior data and product ID data, and generate a multi-dimensional portrait of the user; based on the TensorFlow machine learning framework, building a multi-layer collaborative filtering neural network model, and using the generated multi-dimensional portrait of the user to train the built multi-layer collaborative filtering neural network model; using the trained multi-layer collaborative filtering neural network model to generate a product ID recommendation list for the user according to the user's real-time request.

[0010] Among them, various types of user behavior data on the e-commerce platform, including behavior logs such as clicks, favorites, adding to shopping carts, placing orders, and purchases, as well as basic user information, are collected and stored in a MySQL database. By analyzing the collected behavior data, supervised learning algorithms such as Bayes classifiers are applied to train the product ID preference model and generate a multidimensional feature vector representing the user's interest dimension. The following supervised learning algorithms can also be used: the XGBoost algorithm can be used to model the user's multidimensional features, realize the learning of the user's personalized interests, and make accurate personalized product recommendations. A recommender based on a deep neural network can be constructed, and a highly abstract representation of user interests can be achieved through nonlinear transformation of the hidden layer, generating new personalized recommendation results. The attention network can be used to give different weights to different user behaviors, thereby modeling the user's personalized interests and recommending long-tail products that the user is interested in but not mainstream. Based on the TensorFlow framework, a collaborative filtering neural network model that integrates a multi-layer fully connected network is constructed. The input layer represents the user feature vector. After multiple layers of nonlinear transformation, the output layer gives a product recommendation list for different users. The collaborative filtering network model is initialized using the user's multi-dimensional feature vector, and the user's nonlinear interest pattern is learned through model training. When a user requests a recommendation, the corresponding user's feature vector is extracted in real time, input into the collaborative filtering network model, and a personalized product recommendation list is output. As user behavior accumulates, the network model is regularly retrained with new data to achieve incremental optimization of the model.

[0011] Furthermore, generating a product ID recommendation list for a user also includes: using the constructed multi-layer collaborative filtering neural network model to generate a first recommendation list for the user according to the user's real-time request. The constructed multi-layer collaborative filtering neural network model has been trained in advance and can generate product recommendation lists for different users. When a user initiates a product recommendation request, the corresponding user feature vector is found according to the user ID as the model input. The user feature vector is input into the collaborative filtering model, and the network is activated for forward calculation to obtain the recommendation probability of each product. According to the recommendation probability values ​​of all products, the N products with the highest probability are selected as the first recommendation list. In order to obtain more personalized recommendations, the first recommendation list can be input into the collaborative filtering model again. The model outputs the secondary recommendation probability for the products in the first recommendation list. According to the probability ranking of the secondary recommendation, the top M products are selected as personalized recommendation results. Finally, the first round of mainstream recommendations and the second round of personalized recommendations are merged to construct a product recommendation list for the user.

[0012] A statistical unit is set after the output layer of the constructed multi-layer collaborative filtering neural network model. The statistical unit contains multiple counters. By mapping the product ID, the total number of times each product ID appears in the multi-layer collaborative filtering neural network model is counted. Wherein, the statistical unit structure is added after the output layer of the multi-layer collaborative filtering neural network. The statistical unit contains a counter array, the length of the array is the total number of products, and each counter is mapped to the corresponding array index through the product ID. When the neural network model is trained, the output layer generates a recommended list of products each time. For each product ID in the recommended list, the statistical unit finds the corresponding counter through the product ID mapping. Adding 1 to the counter value indicates that the product has obtained a recommended output. As the training proceeds, the statistical unit counts the total number of times each product ID is output by the network in real time. After the training is completed, the statistical unit records the heat information of each product in the model. According to the sorting of the counter values, the most popular products in the world can be obtained. The heat distribution of each product in the model can also be obtained as a novelty score.

[0013] According to the total number of occurrences of each product ID counted by the statistical unit, the information entropy of the product ID distribution is calculated as the novelty index; when the novelty index is lower than the threshold, a cold start recommendation generator based on the random forest algorithm of Sklearn is constructed; wherein, after the number of occurrences of each product in the model is obtained based on the statistical unit statistics. The distribution of the number of occurrences of all products is calculated to generate a probability distribution. The information entropy is calculated for the probability distribution as the novelty index of the overall recommendation list. A novelty threshold is set. When the calculated information entropy is lower than the threshold, it means that the recommendation is not novel enough. In this case, it is necessary to start the cold start recommendation generator to provide more personalized recommendations. The cold start generator uses Sklearn to build a random forest model. The multidimensional feature vector of the user is used as the input of the random forest model. The model outputs the recommendation probability for each product to form a personalized candidate list. Secondary filtering is performed from the candidate list according to the novelty requirements to generate novel cold start recommendation results. The cold start results are combined with the main model results as the final recommendation output.

[0014] Among them, the multi-dimensional portrait of the input user represents the basic characteristics and behavioral preferences of the user. The cold start recommendation generator uses collaborative filtering or content-based algorithms. If collaborative filtering is used, find the K neighbor users who are most similar to the current user in terms of portrait. Retrieve the historical purchase / browsing products of these K users as the candidate set. If a content-based method is used, directly retrieve the qualified products as the candidate set based on the product preferences reflected in the user portrait. For the products in the candidate set, retrieve their product feature vectors. Calculate the similarity between the user's multi-dimensional portrait vector and the product feature vector. Select the N products with the highest similarity to the user portrait vector as the generated recommendation set. Further deduplicate the recommendation set to ensure that the products in it have not appeared in other lists. Finally, a product recommendation set that meets the user's interests and preferences and is novel and non-repetitive is obtained.

[0015] The generated product ID set is concatenated with the first recommendation list to generate a second recommendation list as a product ID recommendation list for the user. Among them, the first recommendation list based on collaborative filtering has been generated, which contains K1 popular products. The cold start generator generates K2 long-tail products that meet the user's profile. To ensure the overall quality of the recommendation list, the top K products are first retained from the first list according to the popularity of the products. Secondly, the K3 products with the highest novelty are selected from the cold start results. The retained K popular products are combined with the novel K3 long-tail products. The display order of the combined results can be randomly disrupted. The number ratio of popular products and long-tail products can also be dynamically adjusted according to the recommendation strategies at different stages. For example, the proportion of cold start products can be increased in the user cold start stage. When user interaction data is accumulated, the number of cold start products can be appropriately reduced. The new list generated by the above strategy is used as a more balanced recommendation result.

[0016] Furthermore, generating a set of product IDs that match the multi-dimensional portrait of the user and are not recommended also includes: encoding the user's behavior data using the One Hot Encoder based on Sklearn to generate a user feature vector; encoding the product ID data to generate a product feature vector; calculating the matching degree between the user and the product ID according to the user feature vector and the product feature vector; wherein, collecting various types of user interaction behavior data, such as clicks, adding to shopping carts, and favorites. Using Sklearn's One Hot Encoder to perform One Hot encoding on different behavior types, a sparse feature vector of user behavior is generated. At the same time, the product ID is also One Hot encoded to obtain a feature vector of the product. Calculating the cosine similarity between the user behavior feature vector and each product feature vector. A high similarity indicates that the product matches the user's behavior preference. A similarity threshold can be set to select products whose similarity to the user behavior vector is greater than the threshold. Filter out products that have appeared in other lists to ensure novelty. It is also possible to encode and generate user features in combination with the user's basic attribute data, and calculate the product matching degree. Finally, a set of products that conform to the user's portrait and preferences and are novel is obtained.

[0017] A Bloom filter based on Pybloom is constructed in the cold start generator. The Bloom filter generates a recommended product ID set S according to the product ID recommendation list. The cold start recommendation generator randomly extracts product IDs from the MySQL database as candidate sets. The Bloom filter uses a hash function to determine whether the product IDs in the candidate set are in the recommended product ID set S. The product IDs with a matching degree higher than the threshold and not in the recommended product ID set S are regarded as a set of product IDs that match the user's multi-dimensional profile and are not recommended. In the cold start generator, Pybloom is used to construct a Bloom filter. First, all the recommended product ID sets S are stored in the Bloom filter. A batch of products are randomly extracted from the MySQL database as the candidate set. For each product ID in the candidate set, the hash function of the Bloom filter is used to determine whether it is in the set S. If not, the matching degree of the product with the user's multi-dimensional profile is calculated. For products with a matching degree greater than the set threshold, it is considered to be in line with the user's interest preference. This part of the matching products is added to the result set as the cold start recommendation list. The products in the final result set are consistent with the user profile and will not be repeated with the recommended products. In addition, paid content or delisted products can be removed from the result set according to business needs. The cold start recommendation list is obtained after deduplication optimization.

[0018] Furthermore, the product ID data is encoded to generate a product feature vector, which also includes: the product ID data includes the product title and product details page; the text content of the product title and product details page is extracted using the Text Rank algorithm; wherein, the text content of the product title and details page is collected, and the text is cleaned and preprocessed. The Text Rank algorithm is used to construct a graph model representation of the text: each word is represented as a node. The co-occurrence relationship between words constructs edges. Different weights are assigned to edges according to the number of co-occurrences. The Text Rank algorithm is executed iteratively: the importance score of each word is updated according to the importance of its connected terms. Repeat the iteration until the score converges. Sort by the final Text Rank score of the word. Select the top N words with the highest scores as the keywords of the product content. Convert the keywords into word vector representation. Construct a text feature vector for the product. Compared with directly using word frequency methods such as TF IDF, Text Rank can extract words that are more important in meaning.

[0019] Construct a TF IDF word frequency matrix of product ID data based on the extracted keywords; obtain words with a word frequency greater than a threshold in the TF IDF word frequency matrix, and generate a word set representing the product ID attribute; wherein, extract keywords from the title and detail page of each product to obtain a keyword list. Construct a keyword table for all products, count the word frequency of each keyword in each product, and form a word frequency matrix. Perform TF IDF conversion on the word frequency matrix to obtain a TF IDF weight matrix of product keywords. Set a word frequency threshold and select keywords with a TF IDF weight greater than the threshold. These keywords represent the main attribute words of the product. You can set upper and lower limits on the number of words to prevent the dimension from being too large or too small. Convert the selected words into word vectors to construct a low-dimensional dense vector of the product content. Connect the vectors with features such as product ID to form a structured feature expression of the product. Subsequently, the correlation between products can be calculated based on the similarity of the meaning of the word vectors.

[0020] For the words in the vocabulary set, the semantic vector representation is obtained through the pre-trained BERT language model; according to the weights corresponding to the words in the TFIDF word frequency matrix, the semantic vectors are weighted averaged to generate the product feature vector.

[0021] Furthermore, two layers of Bloom filters are set; the bit array size of the first layer of Bloom filters is set to N1 bits; the bit array size of the second layer of Bloom filters is set to N2 bits, where N2 is greater than N1.

[0022] Furthermore, it also includes: setting M different hash functions to generate M different hash values ​​for the same product ID; mapping each product ID in the product ID recommendation list to the bit arrays of the two layers of Bloom filters using M hash functions; generating M corresponding hash values ​​for the product ID in the input candidate set through M different hash functions; in the first layer of Bloom filter, if the positions of the bit arrays corresponding to the M corresponding hash values ​​generated are all zero, the corresponding product ID is sent to the second layer of Bloom filter; only when the positions of all the bit arrays corresponding to the first layer of Bloom filter and the second layer of Bloom filter are all zero, it is determined that the corresponding product ID is not in the recommendation list.

[0023] Among them, multiple hash functions are used to solve the problem of e-commerce homogeneity. MD5 and SHA-1-encrypted hash functions can be used. The output hash value is evenly distributed and the probability of collision is small. Murmur Hash is a high-performance non-encrypted hash function. The hash function in Redis uses this algorithm. FNV Hash is a hash algorithm with simple calculation and good performance, and the output is evenly distributed. CityHash is a fast and high-quality hash algorithm open sourced by Google with a low collision rate. XxHash is a non-encrypted hash function with the same speed and good quality. Farm Hash is a fast hash algorithm for short strings studied by Google. Sip Hash is a cryptographically secure PRF hash algorithm that resists DoS attacks.

[0024] Furthermore, the user's behavior data is encoded using One Hot Encoder based on Sklearn to generate a user feature vector, which also includes: dividing the collected user's behavior data into multiple session sequences according to the timestamp; inputting the acquired session sequence into a pre-trained LSTM network, and outputting a feature matrix A reflecting the user's time preference; encoding the user's formal data using One Hot Encoder to generate a vector B representing the user's basic features; horizontally splicing the matrix A and the vector B by columns through the hstack function in numpy to generate a user feature matrix C; and flattening the generated user feature matrix into a user feature vector.

[0025] Among them, in this application, user behavior data includes: browsing behavior: the ID of the product that the user has browsed, and the corresponding browsing timestamp; collection behavior: the ID of the product that the user has collected, and the corresponding collection timestamp; purchase behavior: the ID of the product that the user has purchased, and the corresponding purchase timestamp; comment behavior: the content of the comment posted by the user on the product, and the corresponding comment timestamp; click behavior: the ID of the product that the user has clicked, and the corresponding click timestamp. Through these different types of user behavior data and the corresponding time tags, multiple user session sequences can be extracted to learn the user's time preference characteristics.

[0026] Furthermore, the pre-trained LSTM network is a bidirectional LSTM network. Bidirectional LSTM learns sequences from two directions, which can more comprehensively mine user behavior patterns. The forward LSTM learns sequential features, and the reverse LSTM learns reverse features. The combination of the two can enhance the pattern extraction capability. The user vector output by the bidirectional LSTM integrates the forward and reverse feature learning, so it can produce more personalized user expressions.

[0027] Furthermore, calculating the matching degree between the user and product IDs also includes: taking the user feature vector as a query vector and inputting the nearest neighbor search index based on Annoy; taking the product feature vector as input and constructing the nearest neighbor search index of the product feature vector through Annoy; in the constructed nearest neighbor search index of the product feature vector, using cosine similarity as a distance metric to search for the first K1 product feature vectors that are most similar to the user feature vector; calculating the cosine similarity between the searched first K1 product feature vectors and the user feature vector as the matching degree between the user and the product ID.

[0028] In which, the user feature vector is regarded as the query vector. All product feature vectors are input into Annoy to construct an approximate nearest neighbor index of the product. In the Annoy index, the user feature vector is used as the query and the cosine similarity is used as the distance metric. Search for the top K1 nearest neighbor product vectors that are most similar to the user vector. Calculate the cosine similarity between these K1 product vectors and the user vector as the matching degree. The cosine similarity formula is: sim=cosθ=(A·B) / (|A||B|), where A is the user feature vector and B is the product feature vector. The larger the sim value, the more similar the two are. Return a list of products similar to the user's Top K1 as the recommendation result. Annoy index makes neighbor search more efficient.

[0029] Furthermore, the generated product ID set is concatenated with the first recommendation list to generate a second recommendation list as a product ID recommendation list for the user, which also includes: extracting the first K2 product IDs from the first recommendation list according to the number of clicks and purchases of the products; selecting the K3 product IDs with the highest matching degree based on the matching degree between the user and the product ID; calculating the combination of K2 product IDs and K3 product IDs through Cartesian product; sorting the generated combinations according to the sum of the matching degrees between the user and the product ID corresponding to each product ID in the combination; and selecting the W combinations with the highest ranking as the second recommendation list according to the sorting results.

[0030] Among them, the first K2 popular products with the highest number of clicks and purchases are extracted from the first recommendation list. According to the user-product matching degree, the K3 products with the highest matching degree are selected. K2 and K3 are combined by Cartesian product to generate K2xK3 product combinations. For each combination, the sum of the user-product matching degrees of each product in the combination is calculated as the matching degree of the combination. All combinations are sorted according to the sum of matching degrees. The first W combinations with the highest ranking are selected as the second recommendation list. This list takes into account both product popularity and personalized matching. Popular products can increase user acceptance, and personalized products increase satisfaction. The fusion of the two lists can balance various factors and optimize the recommendation effect.

[0031] 3. Beneficial effects

[0032] Compared with the prior art, the advantages of this application are:

[0033] (1) By constructing a collaborative filtering neural network based on deep learning, accurate mainstream recommendations for popular products are achieved, which meets the user's demand for popular products and improves the recommendation accuracy of the recommendation system. This application utilizes the multi-dimensional characteristics of users, realizes deep learning of user interest patterns, and generates personalized mainstream recommendation results;

[0034] (2) By combining with the cold start recommendation of the random forest algorithm, the cold start problem of new users is effectively improved. Even if the user does not have much historical behavior, he can quickly obtain personalized recommendations. The combination method of this application combines content-based personalized recommendations with collaborative filtering recommendations to avoid users only being able to obtain popular products when they enter the system;

[0035] (3) By constructing a matching model between user multi-dimensional features and product content features, novel long-tail products can be recommended to users, effectively increasing the diversity of the recommendation list and avoiding the homogenization of recommendation results. The matching model realizes the alignment of expression-level features, calculates personalized user-product matching, and recommends long-tail products that are of interest to target users but not mainstream.

[0036] In summary, by constructing a collaborative filtering neural network to achieve mainstream recommendations for popular products, and combining the personalized recommendation results of the random forest algorithm with popular products, the cold start problem can be improved. At the same time, by matching the multi-dimensional behavioral characteristics of users with the content characteristics of products, personalized long-tail recommendations are generated, which effectively optimizes the diversity of recommendation results and solves the homogeneity problem. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] This specification will be further described in the form of exemplary embodiments, which will be described in detail by the accompanying drawings. These embodiments are not restrictive, and in these embodiments, the same number represents the same structure, wherein:

[0038] Figure 1 is an exemplary flow chart of an Internet-based e-commerce online live broadcast method according to some embodiments of this specification;

[0039] Figure 2 is an exemplary flow chart of generating a second recommendation list according to some embodiments of this specification;

[0040] Figure 3 is an exemplary flow chart for generating a set of product IDs that match a user's multi-dimensional portrait and are not recommended according to some embodiments of this specification;

[0041] Figure 4 is an exemplary flow chart of generating a commodity feature vector according to some embodiments of this specification;

[0042] Figure 5 is an exemplary flow chart of generating a user feature vector according to some embodiments of this specification;

[0043] Figure 6 This is an exemplary flow chart of calculating the matching degree between a user and a product ID according to some embodiments of this specification. DETAILED DESCRIPTION

[0044] The method and system provided in the embodiments of this specification are described in detail below with reference to the accompanying drawings.

[0045] Figure 1 This is an exemplary flow chart of an e-commerce online live broadcast method based on the Internet as shown in some embodiments of this specification. The embodiments of this specification provide an e-commerce online live broadcast method based on the Internet, including: S100 collecting user behavior data on the e-commerce platform; S200 establishing a MySQL database to store the collected user behavior data; S300 using a supervised learning algorithm to build and train the user's product ID preference model based on the collected user behavior data and product ID data, and generate a multi-dimensional portrait of the user; S400 based on the TensorFlow machine learning framework, build a multi-layer collaborative filtering neural network model, and use the generated multi-dimensional portrait of the user to train the built multi-layer collaborative filtering neural network model; S500 using the trained multi-layer collaborative filtering neural network model to generate a product ID recommendation list for the user according to the user's real-time request.

[0046] Among them, various types of user behavior data on the e-commerce platform, including behavior logs such as clicks, favorites, adding to shopping carts, placing orders, and purchases, as well as basic user information, are collected and stored in a MySQL database. By analyzing the collected behavior data, supervised learning algorithms such as Bayes classifiers are applied to train the product ID preference model and generate a multidimensional feature vector representing the user's interest dimension. The following supervised learning algorithms can also be used: the XGBoost algorithm can be used to model the user's multidimensional features, realize the learning of the user's personalized interests, and make accurate personalized product recommendations. A recommender based on a deep neural network can be constructed, and a highly abstract representation of user interests can be achieved through nonlinear transformation of the hidden layer, generating new personalized recommendation results. The attention network can be used to give different weights to different user behaviors, thereby modeling the user's personalized interests and recommending long-tail products that the user is interested in but not mainstream. Based on the TensorFlow framework, a collaborative filtering neural network model that integrates a multi-layer fully connected network is constructed. The input layer represents the user feature vector. After multiple layers of nonlinear transformation, the output layer gives a product recommendation list for different users. The collaborative filtering network model is initialized using the user's multi-dimensional feature vector, and the user's nonlinear interest pattern is learned through model training. When a user requests a recommendation, the corresponding user's feature vector is extracted in real time, input into the collaborative filtering network model, and a personalized product recommendation list is output. As user behavior accumulates, the network model is regularly retrained with new data to achieve incremental optimization of the model.

[0047] Specifically, in this application, a multidimensional portrait representing user interests is generated: user behavior data of different categories are collected, such as user clicks, browsing, collections, purchase records, etc. One Hot encoding is performed on different behavior types to obtain sparse feature representation. Statistical methods are used to generate attribute features for user basic attribute data such as age and occupation. Natural language processing is performed on the user's search word feedback, and semantic features are obtained through word vector technology. For the products that the user has interacted with historically, the product word vector is used to obtain the user's product interest representation. The features of the above dimensions are spliced ​​together to form a multidimensional sparse feature vector of the user. The feature vector is input into a multi-layer perceptron to classify the user, and the classification result is obtained as a user portrait. Clustering algorithms such as K-Means can also be used to analyze the user's behavior and obtain user group categories as portraits. It is also possible to train a hidden semantic model based on user features, and the output hidden layer vector is a multidimensional user portrait. In summary, by collecting features from different dimensions such as behavior, attributes, and content, and comprehensively processing them through machine learning, a multidimensional feature vector representing the user's interests can be generated, which is a user portrait.

[0048] Specifically, in this application, a multi-layer collaborative filtering neural network model is constructed based on TensorFlow: Input layer: represents the user's multi-dimensional feature vector, and the vector dimension is the user's interest dimension, such as user historical behavior, basic attributes, etc. The first hidden layer: a fully connected network layer with N1 nodes and ReLU as the activation function, which learns the low-order abstract features of user interests. The second hidden layer: also a fully connected network layer with N2 nodes, which continues to learn high-order abstract features of interests. The third hidden layer: set to a multi-layer perceptron structure to learn the user's preferences for different categories of goods respectively. Output layer: for each product, the predicted user product preference is given to form a product candidate list. Model training: the network model is trained using the user's multi-dimensional feature vector, and a pairwise learning method is used to maximize the preference of positive samples.

[0049] TensorFlow components use the Estimator API to implement the model's training, evaluation, and prediction processes, and use Early Stopping to prevent overfitting. In this way, a hybrid model that includes both a multi-layer perceptron and a fully connected network is built through TensorFlow, which can support user collaborative filtering and personalized content recommendation at the same time.

[0050] More specifically, in the present application, the first layer of Bloom filter is set to 5 million bits, that is, N1 = 5,000,000, and the second layer of Bloom filter is set to 10 million bits, that is, N2 = 10,000,000. N2 is about twice that of N1. The 5 million bit Bloom filter has an error rate of about 0.1%, and the 10 million bit Bloom filter has an error rate that can be controlled at about 0.01%. The first layer filters out most of the non-hot products, and the second layer deduplicates the hot products to further reduce false positives. The ability of the two layers to filter duplicate products is enhanced successively, while considering the balance between storage space and error rate.

[0051] Figure 2The exemplary flow chart of generating the second recommendation list according to some embodiments of the present specification, generating a product ID recommendation list for a user, also includes: S510 using the constructed multi-layer collaborative filtering neural network model, according to the user's real-time request, to generate a first recommendation list for the user. Among them, the constructed multi-layer collaborative filtering neural network model has been trained in advance and can generate product recommendation lists for different users. When a user initiates a product recommendation request, the corresponding user feature vector is found according to the user ID as the model input. The user feature vector is input into the collaborative filtering model, and the network is activated for forward calculation to obtain the recommendation probability of each product. According to the recommendation probability values ​​of all products, the N products with the highest probability are selected as the first recommendation list. In order to obtain more personalized recommendations, the first recommendation list can be input into the collaborative filtering model again. The model outputs the secondary recommendation probability for the products in the first recommendation list. According to the probability ranking of the secondary recommendation, the top M products are selected as personalized recommendation results. Finally, the first round of mainstream recommendations and the second round of personalized recommendations are merged to construct a product recommendation list for the user.

[0052] S520 sets a statistical unit after the output layer of the constructed multi-layer collaborative filtering neural network model. The statistical unit includes multiple counters. By mapping the product ID, the total number of times each product ID appears in the multi-layer collaborative filtering neural network model is counted. Among them, the statistical unit structure is added after the output layer of the multi-layer collaborative filtering neural network. The statistical unit includes a counter array, the array length is the total number of products, and each counter is mapped to the corresponding array index through the product ID. When the neural network model is trained, the output layer generates a recommended list of products each time. For each product ID in the recommended list, the statistical unit finds the corresponding counter through the product ID mapping. Adding 1 to the counter value indicates that the product has obtained a recommended output. As the training proceeds, the statistical unit counts the total number of times each product ID is output by the network in real time. After the training is completed, the statistical unit records the heat information of each product in the model. According to the sorting of the counter values, the most popular products in the world can be obtained. The heat distribution of each product in the model can also be obtained as a novelty score.

[0053] S530 calculates the information entropy of the product ID distribution as a novelty index based on the total number of times each product ID appears counted by the statistical unit; S540 constructs a cold start recommendation generator based on the random forest algorithm of Sklearn when the novelty index is lower than the threshold. Among them, after the number of occurrences of each product in the model is obtained based on the statistical unit statistics. Calculate the distribution of the number of occurrences of all products and generate a probability distribution. Calculate the information entropy for the probability distribution as the novelty index of the overall recommendation list. Set a novelty threshold. When the calculated information entropy is lower than the threshold, it means that the recommendation is not novel enough. In this case, it is necessary to start the cold start recommendation generator to provide more personalized recommendations. The cold start generator uses Sklearn to build a random forest model. The user's multidimensional feature vector is used as the input of the random forest model. The model outputs the recommendation probability for each product to form a personalized candidate list. Perform secondary filtering from the candidate list according to the novelty requirements to generate novel cold start recommendation results. Combine the cold start results with the main model results as the final recommendation output.

[0054] Specifically, the Sklearn random forest algorithm is a Tree-based ensemble learning algorithm that builds multiple decision trees on the training set and uses an average or majority voting method for prediction to improve the stability and accuracy of the algorithm. The algorithm can be used for classification and regression. In this application, the Sklearn random forest algorithm is used as a cold start recommendation. The random forest algorithm can process high-dimensional sparse data and is suitable for user portrait features; by integrating multiple decision trees, the nonlinear pattern of user interests can be learned; the tree model has good model interpretability, which is conducive to analyzing the differences between different user groups; the random forest algorithm has a fast training speed and is suitable for incremental update models; the algorithm itself contains randomness, which can increase the diversity of recommendation results and produce more novel long-tail recommendations. The random forest algorithm can learn the user's personalized interest preference model, produce novel and diverse recommendation results that meet the user's specific portrait, and effectively solve the cold start problem.

[0055] Specifically, the cold start recommendation generator refers to a specific recommendation used for new users or when user data is extremely scarce, and personalized recommendations cannot be generated for users directly through recommendation algorithms such as collaborative filtering. The cold start recommendation generator does not rely on user historical data, but mainly uses user basic attributes or initial interactive behaviors; it usually uses content filtering or artificial intelligence algorithms; it can produce recommendation results with higher novelty, but the accuracy is lower than collaborative filtering; the output recommendation list can be used in combination with collaborative filtering results; it can also be used during the user's cold start period and gradually reduce the number of recommendations.

[0056] The S550 cold start recommendation generator generates a set of product IDs that match the user's multidimensional portrait and are not recommended based on the user's multidimensional portrait. Among them, the input user's multidimensional portrait represents the user's basic characteristics and behavioral preferences. The cold start recommendation generator uses collaborative filtering or content-based algorithms. If collaborative filtering is used, the K neighbor users who are most similar to the current user in terms of portrait are found. The historical purchase / browsing products of these K users are retrieved as a candidate set. If a content-based method is used, the products that meet the requirements are directly retrieved as a candidate set based on the product preferences reflected in the user portrait. For the products in the candidate set, their product feature vectors are retrieved. The similarity between the user's multidimensional portrait vector and the product feature vector is calculated. The N products with the highest similarity to the user portrait vector are selected as the generated recommendation set. The recommendation set is further deduplicated to ensure that the products in it have not appeared in other lists. Finally, a product recommendation set that meets the user's interest preferences and is novel and non-repetitive is obtained.

[0057] Specifically, in this application, basic information of new users, such as age, gender, occupation, etc., is collected to generate a basic feature vector A, and a pre-trained model is used to infer the user's consumption capacity and brand preference to generate a feature vector B; A and B are concatenated to obtain a comprehensive user portrait vector P, and the titles, labels, descriptions and other texts of all products are extracted. The text feature vector Qi is obtained through the NLP model, and for each product vector Qi, its cosine similarity sim(P, Qi) with the user portrait vector P is calculated. The threshold θ=0.6 is set to filter out all products with sim(P, Qi)>θ, and the products in the user's historical purchase records are filtered out from the candidate set to obtain a set of products {I1, I2, ...In} that are highly matched with the user portrait but have not been recommended. K products are randomly sampled as primary recommendation results. As user behavior data accumulates, collaborative filtering and other algorithms are added for optimization.

[0058] S560 concatenates the generated product ID set with the first recommendation list to generate a second recommendation list as a product ID recommendation list for the user. Among them, the first recommendation list based on collaborative filtering has been generated, which contains K1 popular products. The cold start generator generates K2 long-tail products that meet the user's profile. To ensure the overall quality of the recommendation list, the top K products are first retained from the first list according to the popularity of the products. Secondly, the K3 products with the highest novelty are selected from the cold start results. The retained K popular products are combined with the novel K3 long-tail products. The display order of the combination results can be randomly disrupted, or the number ratio of popular products and long-tail products can be dynamically adjusted according to the recommendation strategies at different stages. For example, the proportion of cold start products can be increased in the user cold start stage. When user interaction data is accumulated, the number of cold start products can be appropriately reduced. The new list generated by the above strategy is used as a more balanced recommendation result.

[0059] Figure 3 This is an exemplary flowchart for generating a set of product IDs that match the user's multi-dimensional portrait and are not recommended according to some embodiments of this specification. Generating a set of product IDs that match the user's multi-dimensional portrait and are not recommended also includes: S551 encoding the product ID data to generate a product feature vector; S552 using One HotEncoder based on Sklearn to encode the user's behavior data to generate a user feature vector; S553 calculating the matching degree between the user and the product ID based on the user feature vector and the product feature vector.

[0060] Among them, various types of user interaction behavior data are collected, such as clicks, adding to shopping carts, and favorites. Use Sklearn's One Hot Encoder to perform One Hot encoding on different behavior types to generate a sparse feature vector of user behavior. At the same time, the product ID is also One Hot encoded to obtain the feature vector of the product. Calculate the cosine similarity between the user behavior feature vector and each product feature vector. A high similarity indicates that the product matches the user's behavior preference. You can set a similarity threshold to select products whose similarity to the user behavior vector is greater than the threshold. Filter out products that have appeared in other lists to ensure novelty. You can also combine the user's basic attribute data to encode and generate user features, and calculate the product matching degree. Finally, you get a set of novel products that meet the user's portrait and preferences.

[0061] Specifically, Sklearn is a popular machine learning library in Python, and its full name is Sklearn. SklearnOne Hot Encoder: An encoding converter in the Sklearn library that can convert categorical feature values ​​into sparse vectors represented by one-hot encoding. Convert categorical feature values ​​such as user interaction behavior categories and product IDs into sparse vector representations. Use the vector space model to calculate the similarity between user behavior vectors and product vectors. One Hot Encoder realizes the vectorization of category features, provides input for content-based recommendation algorithms, and calculates the user-product matching degree.

[0062] S554 builds a Pybloom-based Bloom filter in the cold start generator. The Bloom filter generates a recommended product ID set S based on the product ID recommendation list. The cold start recommendation generator randomly extracts product IDs from the MySQL database as candidate sets. The Bloom filter uses a hash function to determine whether the product IDs in the candidate set are in the recommended product ID set S. The product IDs with a matching degree higher than the threshold and not in the recommended product ID set S are used as a set of product IDs that match the user's multi-dimensional portrait and are not recommended. In the cold start generator, Pybloom is used to build a Bloom filter. First, all the recommended product ID sets S are stored in the Bloom filter.

[0063] S555 randomly extracts a batch of products from the MySQL database as the candidate set. S556 uses the hash function of the Bloom filter to determine whether each product ID in the candidate set is in the set S. If not, the matching degree between the product and the user's multi-dimensional portrait is calculated. Products with a matching degree greater than the set threshold are considered to be in line with the user's interests and preferences. These matching products are added to the result set as a cold start recommendation list. The products in the final result set are consistent with the user portrait and will not be repeated with the recommended products. In addition, paid content or delisted products can be removed from the result set according to business needs. A deduplicated and optimized cold start recommendation list is obtained.

[0064] Specifically, Bloom Filter is an efficient probabilistic data structure used to detect whether an element belongs to a set. Its main advantages are that its space efficiency and query time far exceed those of general algorithms. Pybloom is a library for implementing Bloom filters in Python, which provides an interface for building Bloom filters; supports custom hash functions and filter capacity parameters; and implements interfaces for adding elements and quickly finding elements. In this application, the main purpose of using Pybloom's Bloom filter is to: store the recommended product ID set into the Bloom filter; quickly determine whether the randomly selected candidate products have been recommended; and avoid duplicate product recommendations in the cold start results. In this way, the space and time efficiency of the Bloom filter can be used to improve the deduplication ability of the recommendation system. Specifically, a hash function is a function that maps input data of arbitrary length to fixed-length output. In this application, the following hash functions can be used: encrypted hash functions such as MD5 and SHA1.

[0065] Specifically, in the present application, the size m of the Bloom filter is defined, a hash function H is selected, and all bits are initialized to 0. For each element x in the recommended product ID set S, k hash values ​​are calculated: h1=H1(x), h2=H2(x),..., hk=Hk(x). According to each hash value hi, the corresponding bit of the Bloom filter array is set to 1. For each product IDy in the candidate set C, k hash values ​​are also calculated. Check whether all k corresponding bits in the Bloom filter are 1. If any bit is 0, it means that y is not in the set S and has not been recommended. If they are all 1, it means that y is likely in the set S and cannot be recommended as a new product. Due to hash conflicts, there may be a small probability of misjudgment. Repeat the judgment of all products to obtain brand new products in the recommendation set.

[0066] Figure 4 This is an exemplary flowchart for generating a product feature vector according to some embodiments of this specification, encoding the product ID data to generate a product feature vector, and also includes: S551A The product ID data includes the product title and the product details page; for the text content of the product title and the product details page, using the Text Rank algorithm to extract keywords.

[0067] Specifically, the Text Rank algorithm is a keyword extraction algorithm based on a graph model. In product data processing, Text Rank can automatically extract keywords from product titles and detail pages, and construct product content features for matching user interests. Collect the text content of product titles and detail pages, and perform text cleaning and preprocessing. Use the TextRank algorithm to construct a graph model representation of text: each word is represented as a node. The co-occurrence relationship between words builds edges. Different weights are assigned to edges according to the number of co-occurrences. Perform iterative calculations of the Text Rank algorithm: the importance score of each word is updated according to the importance of its connected terms. Repeat the iteration until the score converges. Sort by the final Text Rank score of the word. Select the top N words with the highest scores as keywords for the product content. Convert keywords to word vector representations. Construct a text feature vector for the product. Compared with directly using word frequency methods such as TF IDF, Text Rank can extract words that are more important in meaning.

[0068] S551B constructs a TFIDF word frequency matrix of product ID data based on the extracted keywords; S551C obtains the words with a frequency greater than a threshold in the TFIDF word frequency matrix, and generates a word set representing the attributes of the product ID; wherein, keywords are extracted from the title and detail page of each product to obtain a keyword list. A keyword table of all products is constructed, and the word frequency of each keyword in each product is counted to form a word frequency matrix. The word frequency matrix is ​​converted to TFIDF to obtain a TFIDF weight matrix of product keywords. A word frequency threshold is set, and keywords with a TFIDF weight greater than the threshold are selected. These keywords represent the main attribute words of the product. The upper and lower limits of the number of words can be set to prevent the dimension from being too large or too small. The selected words are converted to word vectors to construct a low-dimensional dense vector of the product content. The vector is connected to features such as the product ID to form a structured feature expression of the product. The correlation between products can be calculated based on the meaning similarity of the word vectors.

[0069] Specifically, in the present application, a word frequency threshold is set, and the following scheme is adopted: Calculate the TFIDF weight values ​​of all words in the word frequency matrix. Draw a TFIDF weight distribution histogram of the words. Observe the distribution of the TFIDF values ​​of the words on the histogram. Generally, it shows an exponential downward trend. The TFIDF value at the inflection point in the histogram can be selected as the word frequency threshold. The high-frequency words before the inflection point can be regarded as the main attribute vocabulary of the product. You can also manually check the words corresponding to different TFIDF segments and select a suitable threshold. If the vocabulary is too large, the threshold can be appropriately increased; if the vocabulary is too small, the threshold can be lowered. You can first quickly iterate on a small data set to determine a suitable threshold. This threshold is directly used on a large data set to avoid repeated calculations.

[0070] S551D obtains semantic vector representations for words in the vocabulary set through the pre-trained BERT language model; S551E performs weighted averaging of the semantic vectors according to the weights corresponding to the words in the TF IDF word frequency matrix to generate a product feature vector. Specifically, BERT (Bidirectional Encoder Representations from Transformers) is a language representation model with a transformer structure. In this application, the role of BERT is to input product keywords and output the semantic vectors of the keywords. The semantic vector integration obtains the content feature representation of the product. Utilizing the semantic modeling capability of BERT, the product content vector reflects semantic level information. This is beneficial to the subsequent semantic similarity calculation and user interest matching.

[0071] Specifically, in the present application, the extracted product keyword vocabulary is segmented and processed into a word sequence. The word sequence is input using a pre-trained BERT model. The BERT model outputs a semantic vector representation of each word. For each keyword, the BERT vector of its last word fragment is taken as the keyword vector. All keyword vectors are combined and weighted averaged according to the TF IDF weights of Keywords. The weighted average formula is: Keyword_vec = Σ(tfidf_i*word_veci) / Σ(tfidf_i); where word_veci is the BERT vector of the i-th keyword, and tfidf_i is its TF IDF weight. The obtained Keyword_vec is the semantic vector representation of the product keyword set. The vector is connected to features such as product ID to form a structured content feature of the product. The semantic information of the words is extracted through the BERT model, and the product content feature vector is constructed so that the vector can reflect the similarity at the word meaning level, which is conducive to matching user interests and hobbies.

[0072] Furthermore, two layers of Bloom filters are set; the bit array size of the first layer of Bloom filters is set to N1 bits; the bit array size of the second layer of Bloom filters is set to N2 bits, where N2 is greater than N1. Specifically, in the present application, a first layer of Bloom filter BF1 of size N1 bits is created, using a hash function H1. For the recommended product ID set S, H1 is used to calculate the hash, and the corresponding bit of BF1 is set to 1. Similarly, a second layer of filter BF2 of size N2 bits and N2>N1 is created, using a hash function H2. For the set S, H2 is used to calculate the hash, and the corresponding bit of BF2 is set to 1. For the product IDy in the candidate set, H1 is used to calculate the hash value and query it in BF1. If BF1 indicates that y may be in S, H2 is used to verify it in BF2. Only when both layers of filters indicate that y is in S, is it determined that product y is not recommended. Using two layers of filtering can reduce the false positive rate and improve space utilization. BF2 only needs to store the part of the product ID that BF1 cannot determine.

[0073] More specifically, the homogeneity problem refers to the situation where users receive too many recommendations for similar products, which reduces the novelty of the recommendations. A single-layer filter easily judges different but similar products as recommended, filtering out a large number of potential novel products. Set up two layers of filters, with the first layer quickly filtering out obvious duplicate content. The second layer confirms the products that are ambiguous in the first layer. The two-layer filtering and repeated judgment can greatly reduce the mis-filtering of similar products. More novel options that are not recommended are reserved for users. The N2>N1 design reasonably controls space utilization and only stores necessary products. At the same time, two judgments are used to reduce the misjudgment rate. The overall effect is that more products with novel styles and rich content can be recommended. Effectively reduce homogeneity and improve user experience.

[0074] Furthermore, it also includes: setting M different hash functions to generate M different hash values ​​for the same product ID; mapping each product ID in the product ID recommendation list to the bit arrays of the two layers of Bloom filters using M hash functions; generating M corresponding hash values ​​for the product ID in the input candidate set through M different hash functions; in the first layer of Bloom filter, if the positions of the bit arrays corresponding to the M corresponding hash values ​​generated are all zero, the corresponding product ID is sent to the second layer of Bloom filter; only when the positions of all the bit arrays corresponding to the first layer of Bloom filter and the second layer of Bloom filter are all zero, it is determined that the corresponding product ID is not in the recommendation list.

[0075] Among them, multiple hash functions are used to solve the problem of e-commerce homogeneity. MD5 and SHA-1 can be used - cryptographic hash functions, the output hash value is evenly distributed, and the probability of collision is small. Murmur Hash, a high-performance non-cryptographic hash function, is used in the hash function of Redis. FNV Hash - a hash algorithm with simple calculation and good performance, and the output is evenly distributed. CityHash, Google's open source fast and high-quality hash algorithm, has a low collision rate. Xx Hash, a non-cryptographic hash function with high speed and good quality. Farm Hash, a fast hash algorithm for short strings studied by Google. Sip Hash, a cryptographically secure PRF hash algorithm that resists DoS attacks.

[0076] Specifically, in the present application, M different hash functions H1, H2, ..., Hm are defined; for each recommended product ID, each hash function is used to calculate the hash value. Set 1 at the corresponding M positions of the first-layer filter BF1. Similarly, set 1 at the M positions of the second-layer filter BF2. For the input candidate product ID, calculate M hash values. Search at the M positions of BF1, and if any position is 0, send it to BF2. Search at the M positions of BF2, and only when all M bits are 1, it is determined to be a recommended product. This can reduce the misjudgment rate caused by hash conflicts. At the same time, the filter size is also controlled and will not expand linearly. Two layers of filtering and repeated judgment can provide a more accurate deduplication effect.

[0077] More specifically, in the present application, the first layer of filtering quickly excludes obviously duplicate products, avoiding a large number of unnecessary secondary judgments and improving efficiency. Only products that cannot be clearly judged in the first layer enter the second layer of filters, saving space. Two layers of filtering and repeated judgment can reduce the misjudgment rate caused by hash conflicts and improve the accuracy of judgment. The multi-hash design increases the dimension of each product and further reduces the probability of hash conflicts for different products. Reasonably control the false alarm rate of the filter and leave more non-duplicate but similar products for recommendation selection. The combined effect of two layers of filtering, repeated judgment and multi-hash design is that it can effectively reduce the recommendation of duplicate products. At the same time, retain the unrecommended novel products to the maximum extent. Thereby alleviating the problem of homogeneity and improving the diversity and accuracy of recommendations.

[0078] Figure 5 This is an exemplary flowchart of generating a user feature vector according to some embodiments of the present specification, using One Hot Encoder based on Sklearn to encode the user's behavior data to generate a user feature vector, and also includes: S552A divides the collected user behavior data into multiple session sequences according to timestamps; S552B inputs the acquired session sequences into a pre-trained LSTM network, and outputs a feature matrix A reflecting the user's time preference; S552C uses One Hot Encoder to encode the user's formal data to generate a vector B representing the user's basic features; S552D uses the hstack function in numpy to horizontally splice the matrix A and the vector B by column to generate a user feature matrix C; S552E flattens the generated user feature matrix into a user feature vector.

[0079] Among them, in this application, user behavior data includes: browsing behavior: the ID of the product that the user has browsed, and the corresponding browsing timestamp; collection behavior, the ID of the product that the user has collected, and the corresponding collection timestamp; purchase behavior, the ID of the product that the user has purchased, and the corresponding purchase timestamp; comment behavior, the content of the comment posted by the user on the product, and the corresponding comment timestamp; click behavior, the ID of the product that the user has clicked, and the corresponding click timestamp. Through these different types of user behavior data and the corresponding time tags, multiple user session sequences can be extracted to learn the user's time preference characteristics.

[0080] Specifically, in this application, user behavior data is collected, including different behavior types and occurrence timestamps. Behaviors are divided into multiple session sequences according to timestamps. One Hot Encoder is used to encode different behaviors to obtain 0 / 1 vectors of behaviors. The encoded behavior sequence is input into a pre-trained LSTM model. The LSTM model learns the behavior sequence features and outputs the feature matrix A of the user's time preference. At the same time, One Hot Encode is used to generate vector B for the user's basic information. The hstack function in numpy is used to horizontally splice matrix A and vector B. Obtain the user's comprehensive feature matrix C. Flatten matrix C into a long vector. The vector comprehensively reflects the user's behavior preferences and basic feature information. The vector can be input later to calculate the similarity between users.

[0081] More specifically, in this application, to flatten the matrix C into a long vector, you can use: directly use numpy.reshape to reshape the matrix C into a one-dimensional vector. For example: vector = numpy.reshape(C, (1, -1)); use numpy.ravel to flatten the matrix C into a one-dimensional vector: vector = C.ravel(·); use a double-layer for loop to traverse the matrix C and assign the elements to a predefined one-dimensional vector in turn. Using list derivation, flattening can be achieved in one line of code: vector = [x for row in C for x in row]; use numpy.flatten function to flatten: vector = numpy.flatten(C).

[0082] Specifically, Numpy is the basic library for scientific computing in Python, which provides multidimensional array and matrix operation functions. hstack is a horizontal stack function in Numpy, which can realize the splicing of multiple arrays / matrices in the horizontal direction (column direction). In this application, matrix A represents the user's time preference characteristics, and vector B represents the user's basic information. Use the numpy.hstack(·) function and input (A, B). hstack will splice A and B in column order horizontally. If A has m columns and B has n columns, the output matrix C will have m+n columns. Matrix C comprehensively reflects the two aspects of the user's characteristics, Dimensions is (num_rows, m+n), and the matrix C can be flattened into a user feature vector later.

[0083] Furthermore, the pre-trained LSTM network is a bidirectional LSTM network. Specifically, in the present application, user behavior sequences are collected and divided and arranged in chronological order. One-Hot Encoding is used to convert each behavior into a vector representation. The encoded behavior sequence is input into the pre-trained bidirectional LSTM. For the behavior sequence, the bidirectional LSTM learns the hidden state representation once in the forward and reverse directions respectively. The forward and reverse hidden states at the last moment are concatenated to obtain a feature vector reflecting the full order preference. This process is performed on each behavior sequence, and the user's time preference feature matrix A is finally output. At the same time, a basic feature vector B is generated. A and B are concatenated horizontally using numpy to generate a user comprehensive feature matrix C. C is flattened to obtain the final user feature vector. This vector comprehensively learns the user's behavior order preference and basic features. Compared with one-way LSTM, bidirectional LSTM can learn users' complex behavior patterns more comprehensively, which helps to generate personalized features.

[0084] Specifically, in this application, matrix A represents the user time series features obtained based on LSTM, vector B represents the one hot encoding of the user's basic information, and the numpy.hstack(·) function is used with the input parameters (A, B). It will horizontally splice A and B in column order to generate a larger matrix C, which contains all the columns of A and B. The number of columns of matrix C is the sum of the number of columns of A and the number of columns of B. In this way, numpy provides a convenient and efficient matrix splicing function to integrate user information from different sources into one matrix.

[0085] Specifically, the homogeneity problem causes users to receive uniform recommended content. One-way LSTM can only learn the sequential features of user historical behavior. Bidirectional LSTM can learn forward and backward contextual features at the same time. It can model user behavior patterns more comprehensively, not just frequent interests. It can identify users' occasional minor interests and hobbies. It can thus tap into users' diverse interests. The generated user features can match more personalized recommendation results. Users will receive richer, more diverse and non-repetitive recommended content. It can effectively alleviate the homogeneity problem and improve recommendation satisfaction.

[0086] Figure 6This is an exemplary flowchart for calculating the matching degree between user and product ID as shown in some embodiments of this specification, and calculating the matching degree between user and product ID also includes: S553A uses the user feature vector as a query vector and inputs the nearest neighbor search index based on Annoy; S553B uses the product feature vector as input and constructs the nearest neighbor search index of the product feature vector through Annoy; S553C uses cosine similarity as a distance metric in the constructed nearest neighbor search index of the product feature vector to search for the top K1 product feature vectors that are most similar to the user feature vector; S553D calculates the cosine similarity between the searched top K1 product feature vectors and the user feature vector as the matching degree between the user and product ID.

[0087] In which, the user feature vector is regarded as the query vector. All product feature vectors are input into Annoy to construct an approximate nearest neighbor index of the product. In the Annoy index, the user feature vector is used as the query and the cosine similarity is used as the distance metric. Search for the top K1 nearest neighbor product vectors that are most similar to the user vector. Calculate the cosine similarity between these K1 product vectors and the user vector as the matching degree. The cosine similarity formula is: sim=cosθ=(A·B) / (|A||B|), where A is the user feature vector and B is the product feature vector. The larger the sim value, the more similar the two are. Return a list of products similar to the user's Top K1 as the recommendation result. Annoy index makes neighbor search more efficient.

[0088] Specifically, Annoy (Approximate Nearest Neighbors Oh Yeah) is an efficient approximate nearest neighbor search algorithm and indexing tool. In this application, the Annoy index is constructed with the product feature vector. An approximate nearest neighbor query is performed on the user feature vector. The product vector that best matches the user's interests is obtained. Its search speed is significantly faster than linear scanning. When the data volume is hundreds of millions, the results can be returned in milliseconds. The efficiency of user-product matching is greatly improved.

[0089] More specifically, in this scheme, cosine similarity is used and the first K nearest neighbors are returned. Cosine similarity can effectively measure the directional consistency of two vectors. The larger the cosine value of the product vector and the user vector, the more consistent the interest preference. Only the top K1 products most similar to the user are returned, and irrelevant products are filtered out. The value of K1 balances the recommendation recall and precision. A properly large K1 can increase recall and cover more potential user preferences. A properly small K1 can improve recommendation accuracy. By calculating the specific cosine similarity, rather than just the order, similarity priority ranking can be performed. This helps with subsequent weighted ranking and filtering based on the degree of matching. In summary, the recommendation results can be made more personalized and accurate.

[0090] Furthermore, the generated product ID set is concatenated with the first recommendation list to generate a second recommendation list as a product ID recommendation list for the user, which also includes: extracting the first K2 product IDs from the first recommendation list according to the number of clicks and purchases of the products; selecting the K3 product IDs with the highest matching degree based on the matching degree between the user and the product ID; calculating the combination of K2 product IDs and K3 product IDs through Cartesian product; sorting the generated combinations according to the sum of the matching degrees between the user and the product ID corresponding to each product ID in the combination; and selecting the W combinations with the highest ranking as the second recommendation list according to the sorting results.

[0091] Among them, the first K2 popular products with the highest number of clicks and purchases are extracted from the first recommendation list. According to the user-product matching degree, the K3 products with the highest matching degree are selected. K2 and K3 are combined by Cartesian product to generate K2xK3 product combinations. For each combination, the sum of the user-product matching degrees of each product in the combination is calculated as the matching degree of the combination. All combinations are sorted according to the sum of matching degrees. The first W combinations with the highest ranking are selected as the second recommendation list. This list takes into account both product popularity and personalized matching. Popular products can increase user acceptance, and personalized products increase satisfaction. The fusion of the two lists can balance various factors and optimize the recommendation effect.

[0092] Specifically, the ranking of the number of clicks to purchase of popular products is extracted from the first recommendation list. In this application, the number of clicks to purchase of each product by all users in the first recommendation list is counted. The products are directly sorted in descending order according to the total number of clicks to purchase. The product with the highest number of clicks has a higher purchase popularity. The click-to-purchase conversion rate of each product can also be calculated. Conversion rate = number of clicks to purchase / number of exposures. Sort by conversion rate. The higher the conversion rate, the more popular the product. Then take the K2 products with the highest ranking as popular products. The size of K2 can be adjusted according to actual conditions. In this way, popular products can be selected through the real interactive behavior of the products.

[0093] Specifically, the Cartesian product refers to the Cartesian product of two sets X and Y in mathematics, which represents the formation of a new set, in which the elements are all possible combinations of elements in X and Y. In this application, there is a set A containing K2 elements, and a set B containing K3 elements. Calculating the Cartesian product of A and B can generate a new set C. Set C contains K2*K3 elements, which are all combinations of elements in A and B. In this way, more candidate recommendation lists can be generated through combination. Then the better combination is selected according to the matching degree. The possible recommendation range is expanded, and more diverse recommendation results are generated.

[0094] Specifically, in the present application, the first recommendation list extracts the top 10 popular products A1 to A10 that are clicked and purchased. The top 5 matching products B1 to B5 are taken according to user interests. The Cartesian product of set A and set B is calculated to generate set C. Set C has 10x5=50 product combinations. For each combination, the sum of the matching degrees between each product in the combination and the user is calculated. For example, for the combination (A2, B3), the matching degree is: A2 product matching degree (0.7) + B3 product matching degree (0.8) = 1.5. All 50 combinations are sorted according to the total matching degree. The top 10 combinations with the highest ranking are taken as the second recommendation list. This list takes into account both popularity and personalized matching.

Claims

1. An online live broadcast method for e-commerce based on the Internet, comprising: Collect user behavior data on e-commerce platforms; Establish a MySQL database to store the collected user behavior data; Using supervised learning algorithms, based on the collected user behavior data and product ID data, we build and train the user's product ID preference model to generate a multi-dimensional profile of the user. Based on the TensorFlow machine learning framework, a multi-layer collaborative filtering neural network model is constructed, and the multi-dimensional portrait of the generated user is used to train the constructed multi-layer collaborative filtering neural network model; Using the trained multi-layer collaborative filtering neural network model, a product ID recommendation list for the user is generated based on the user's real-time request; Generate a list of recommended product IDs for the user, including: Using the constructed multi-layer collaborative filtering neural network model, a first recommendation list for the user is generated according to the user's real-time request; A statistical unit is set after the output layer of the constructed multi-layer collaborative filtering neural network model. The statistical unit includes multiple counters. The total number of times each product ID appears in the multi-layer collaborative filtering neural network model is counted by mapping the product ID. According to the total number of occurrences of each product ID counted by the statistical unit, the product ID distribution information entropy is calculated as the novelty index; When the novelty index is lower than the threshold, a cold start recommendation generator based on the Sklearn random forest algorithm is constructed; The cold start recommendation generator generates a set of product IDs that match the user's multi-dimensional profile and are not recommended based on the user's multi-dimensional profile; The generated product ID set is concatenated with the first recommendation list to generate a second recommendation list as a product ID recommendation list for the user; Generate a set of product IDs that match the user's multi-dimensional profile and are not recommended, including: Encode the product ID data to generate a product feature vector; Use One Hot Encoder based on Sklearn to encode user behavior data and generate user feature vectors; Calculate the matching degree between user and product ID based on user feature vector and product feature vector; A Pybloom-based Bloom filter is built in the cold start generator. The Bloom filter generates a recommended product ID set S based on the product ID recommendation list. The cold start recommendation generator randomly extracts product IDs from the MySQL database as candidate sets; The Bloom filter uses a hash function to determine whether the product ID in the candidate set is in the recommended product ID set S; The product IDs whose matching degree is higher than the threshold and are not in the recommended product ID set S are regarded as the product ID set that matches the user's multi-dimensional profile and is not recommended.

2. The method for online live broadcasting of e-commerce based on the Internet according to claim 1, characterized in that: Encode the product ID data to generate the product feature vector, which also includes: The product ID data includes the product title and product details page; Use the Text Rank algorithm to extract keywords from the text content of product titles and product detail pages; Construct the TF IDF word frequency matrix of product ID data based on the extracted keywords; Obtain the words whose frequency is greater than the threshold in the TF IDF word frequency matrix, and generate a word set representing the product ID attribute; For words in the vocabulary set, the semantic vector representation is obtained through the pre-trained BERT language model; According to the weights corresponding to the words in the TF IDF word frequency matrix, the corresponding semantic vectors are weighted averaged to generate the product feature vector.

3. The method for online live broadcasting of e-commerce based on the Internet according to claim 1, characterized in that: The Bloom filter is set up in two layers; The bit array size of the first layer Bloom filter is set to N1 bits; The bit array size of the second layer Bloom filter is set to N2 bits, where N2 is greater than N1.

4. The method for online live broadcasting of e-commerce based on the Internet according to claim 3, characterized in that: Also includes: Set M different hash functions to generate M different hash values ​​for the same product ID; Map each product ID in the product ID recommendation list to the bit arrays of the two-layer Bloom filter using M hash functions; The product ID in the input candidate set generates M corresponding hash values ​​through M different hash functions; In the first layer of Bloom filter, if the positions of the bit arrays corresponding to the M corresponding hash values ​​generated are all zero, the corresponding product ID is sent to the second layer of Bloom filter; Only when the positions of all bit arrays corresponding to the first-layer Bloom filter and the second-layer Bloom filter are both zero, it is determined that the corresponding product ID is not in the recommendation list.

5. The method for online live broadcasting of e-commerce based on the Internet according to claim 1, characterized in that: Use One Hot Encoder based on Sklearn to encode user behavior data and generate user feature vectors, which also includes: According to the timestamp, the collected user behavior data is divided into multiple session sequences; Input the acquired conversation sequence into the pre-trained LSTM network and output the feature matrix A reflecting the user's time preference; Use One Hot Encoder to encode the user's formal data and generate a vector B representing the user's basic features; Use the hstack function in numpy to horizontally concatenate matrix A and vector B by column to generate user feature matrix C; Flatten the generated user feature matrix into a user feature vector.

6. The method for online live broadcasting of e-commerce based on the Internet according to claim 5, characterized in that: The pre-trained LSTM network is a bidirectional LSTM network.

7. The method for online live broadcasting of e-commerce based on the Internet according to claim 5, characterized in that: Calculate the match between user and product IDs, including: The user feature vector is used as the query vector and input into the nearest neighbor search index based on Annoy; Take the product feature vector as input and construct the nearest neighbor search index of the product feature vector through Annoy; In the nearest neighbor search index of the constructed product feature vector, the cosine similarity is used as the distance metric to search for the first K1 product feature vectors that are most similar to the user feature vector; The cosine similarity between the first K1 searched product feature vectors and the user feature vector is calculated as the matching degree between the user and product ID.

8. The method for online live broadcasting of e-commerce based on the Internet according to claim 7, characterized in that: The generated product ID set is concatenated with the first recommendation list to generate a second recommendation list as a product ID recommendation list for the user, further comprising: From the first recommendation list, extract the first K2 product IDs according to the number of clicks and purchases of the products; Based on the matching degree between user and product IDs, select K3 product IDs with the highest matching degree; Calculate the combination of K2 product IDs and K3 product IDs through Cartesian product; The generated combinations are sorted according to the sum of the matching degrees between the user and product IDs corresponding to each product ID in the combination; According to the sorting results, the W combinations with the highest ranking are selected as the second recommendation list.