A chain commodity recommendation method and device of an e-commerce group purchase platform
By constructing a user historical interaction behavior data encoder and a 'sequence + chain' two-dimensional attention computing mechanism on the e-commerce group buying platform, the problem that the existing system cannot meet the chain-like needs of users is solved, realizing personalized, multi-category product recommendations, improving user experience and platform efficiency.
Patent Information
- Application Number
- CN202510033341.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-09
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2045-01-09
AI Technical Summary
Existing sequence recommendation systems cannot meet users' diverse and dynamic chain-like product needs, forcing users to decide on product combinations themselves, which affects the purchase experience and business traffic generation.
By constructing an encoder for user historical interaction behavior data, long-term interest features and short-term demand features are extracted. A chain-like product recommendation model is generated by using a 'sequence + chain' two-dimensional attention calculation mechanism and a comparison optimization calculation module, which is used for personalized recommendations on e-commerce group buying platforms.
It improves the accuracy and user satisfaction of recommendation systems, dynamically captures changes in user needs, provides personalized, multi-category product recommendation experiences, and enhances the sales performance and user loyalty of e-commerce platforms.
Smart Images

Figure CN119941358B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of product recommendation on e-commerce platforms, and more particularly to a chain-style product recommendation method and apparatus for e-commerce group buying platforms. Background Technology
[0002] Recommender systems arose from the demand for personalized content in an era of information overload. By analyzing user behavior and preferences, they aim to help users quickly find content of interest from massive amounts of information, thereby improving both user experience and business value. [1] With the advancement of deep learning technology, the research and application areas of recommender systems are constantly expanding, becoming an important branch of artificial intelligence. Sequence recommendation is a classic task in recommender systems. It uses users' historical interaction behaviors as a sequence to input into the model, thereby capturing user interests and predicting the next item. However, in practical applications, user needs are often dynamically evolving, presenting a chain-like distribution of needs. For example, after purchasing a "Switch game console," a user might have a need to purchase "headphones," and after purchasing "headphones," they might have a need to purchase "headphone cleaning kits." These multi-category needs are interdependent and exhibit a certain temporal order, requiring the recommender system to make multi-category chain-like recommendations. Therefore, existing sequence recommendation tasks can only make single-category recommendations based on a user's single search term, failing to meet the diverse intrinsic needs of users. In application scenarios, users need to search sequentially and decide on the purchase combination themselves, which greatly affects the user's purchasing experience and is detrimental to business customer acquisition.
[0003] Existing product combination recommendation methods can be divided into two categories:
[0004] The first type is bundled recommendations based on product relevance. [2] This type of work aims to proactively recommend predefined product combinations to users based on the complementarity or relevance of products, such as promotional packages or product bundles that meet specific needs. This approach is often used to increase sales and user engagement.
[0005] The second category is shopping basket recommendations based on users' historical data. [3] The goal is to predict a set of products a user is likely to purchase in each of their shopping trips. This type of method focuses on combinations of products that users typically buy together at specific times or in specific scenarios, without any temporal order between the products within the combination.
[0006] Therefore, a more reasonable recommendation format should be to meet the diverse needs of users that gradually develop in the short term by continuously recommending products. The recommended products should have a strict time order. This requires the recommendation system to deeply analyze the user behavior sequence and capture changes in user preferences over time, so as to provide more accurate, customized and dynamic recommendations. Summary of the Invention
[0007] This invention provides a chain-based product recommendation method and apparatus for e-commerce group-buying platforms. By extracting dynamic shopping preference features from users' historical shopping data, this invention constructs short-term and long-term product demand chains for the current user, and trains a generative recommendation model capable of recommending chain-based products in one go. This model is used by e-commerce group-buying platforms to recommend multi-category products related to food, drinks, and entertainment, improving the accuracy of the recommendation system and user satisfaction. See the description below for details:
[0008] A chain-based product recommendation method for an e-commerce group-buying platform, the method comprising:
[0009] Construct a user history interaction behavior data encoder. This encoder is used to extract both long-term interest features and short-term demand features from the user's historical shopping data, and encode the user's discrete product interaction records into data of "long-term interest sequence - short-term demand chain".
[0010] A feature extraction model is constructed to extract and process features from the encoded "long-term interest sequence - short-term demand chain" data;
[0011] A generative recommendation model is constructed using a two-dimensional attention calculation mechanism of "sequence + chain" to capture user interests from the "long-term interest sequence - short-term demand chain" and generate the next product combination that the user will buy.
[0012] Add a contrastive optimization calculation module and use the contrastive loss function to optimize the recommendation model; after completing generative training and obtaining the chained product recommendation model, deploy the chained product recommendation model to the online environment of the e-commerce group buying platform to support actual business needs.
[0013] The "sequence + chain" two-dimensional attention calculation mechanism is as follows:
[0014] The input E′ is linearly projected into four matrices Q through a learnable weight matrix. n K n V n U n The projection will be divided along the dimension H of the set attention head:
[0015] Q n =E′W q K n =E′Wk ,
[0016] V n = E′W v U n =E′W u
[0017] Among them, W q , W k , W v , W u It is a learnable projection matrix that computes attention on the sequence dimension n and the demand chain dimension m respectively to capture intra-chain and inter-chain relationships;
[0018] The final sequence-level attention score is activated by the SiLU activation function and scaled according to the sequence length n, while a mask is applied to the padding positions:
[0019]
[0020] Where R is the relative attention bias value; Mask represents the masking process;
[0021] The sequence-level attention output On is expressed as:
[0022]
[0023] in, This represents the attention score after activation;
[0024] After completing the sequence-level attention calculation, the output will be O. n For attention computation in the demand chain dimension m, the model splits the sequence-level attention output into four new matrices Q. m K m V m U m Used to capture dependencies between goods within the demand chain:
[0025] Q m =O n W q K m =O n W k ,
[0026] V m =O n W v U m =O n W u
[0027] Attention scores at the demand chain level are also processed using the SiLU activation function, scaled by the chain length m, and the padding positions are masked.
[0028]
[0029] Output By combining sequence-level and chain-level attention results, we obtain:
[0030]
[0031] Through the "sequence + chain" two-dimensional attention calculation mechanism, the first item in each chain participates in both sequence-level and chain-level attention calculations.
[0032] The comparison optimization calculation module consists of sampling a set of positive and negative samples from the product library and using a comparison loss function to optimize the chain-like product recommendation model. The comparison loss is used to enhance the model's ability to distinguish between relevant and irrelevant items.
[0033] In a second aspect, a chain-based product recommendation device for an e-commerce group-buying platform, the device comprising: a processor and a memory, the memory storing program instructions, the processor calling the program instructions stored in the memory to cause the device to execute the method described in any one of the first aspects.
[0034] Third aspect, a computer-readable storage medium storing a computer program, the computer program including program instructions that, when executed by a processor, cause the processor to perform the method described in any one of the first aspects.
[0035] The beneficial effects of the technical solution provided by this invention are:
[0036] 1. This invention innovatively designs a user's historical interaction behavior data encoder, which refines the user's historical dynamic shopping preference characteristics. This encoder enables efficient and rapid classification of user characteristics and encoding of users' long-term interests and short-term needs in the case of complex and diverse user data.
[0037] 2. This invention designs a novel feature extraction model specifically for feature extraction and processing of user "long-term interest sequence - short-term demand chain" data; it introduces the positional information between each product to help the model capture the product order within and across short-term demand chains;
[0038] 3. This invention introduces a two-dimensional attention calculation mechanism for user "sequence + chain" features. It calculates attention scores for long-term demand product features and short-term demand product features through two-layer attention calculation methods, which can reduce computational complexity while enhancing the dual learning ability of user features.
[0039] 4. This invention designs a contrastive loss function, which, by sampling the set of positive and negative samples in the product database, constrains the recommendation model to learn positive samples and stay away from negative samples, thereby enhancing the accuracy and diversity of the recommendation system;
[0040] 5. This invention improves the ability of e-commerce group-buying platforms' recommendation systems to recommend multiple product categories, enhances the accuracy of the recommendation system and user satisfaction, enabling e-commerce platforms to apply this tool to improve personalized recommendation capabilities and ensure a dual increase in platform sales performance and user loyalty. Attached Figure Description
[0041] Figure 1 A flowchart of a chain-based product recommendation method for e-commerce group-buying platforms;
[0042] Figure 2 This is a schematic diagram of a chain-like product recommendation device for an e-commerce group-buying platform. Detailed Implementation
[0043] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be described in further detail below.
[0044] In view of the above needs, this invention proposes a chain-based product recommendation method and apparatus for e-commerce group buying platforms. Based on hierarchical learning of user behavior sequences and generative recommendation technology, it improves the accuracy of the recommendation system and user satisfaction, increases user purchase conversion rate, and enables e-commerce platforms to apply this tool to enhance personalized recommendation capabilities, ensuring a dual improvement in platform sales performance and user loyalty.
[0045] Example 1
[0046] A chain-based product recommendation method for e-commerce group-buying platforms, see [link / reference]. Figure 1 The method includes the following steps:
[0047] Step 101: Deploy a new type of user historical interaction behavior data encoder. This encoder is used to extract users' long-term interest features and short-term demand features from users' historical shopping data at the same time, and encode users' discrete product interaction records into a unified data organization format that combines "long-term interest sequence - short-term demand chain".
[0048] First, given all the user's historical product interaction information, it is integrated into a product sequence with interaction timestamps and product ratings, based on a pre-set short-term demand chain size s.i The maximum allowed time difference Δt between consecutively accessed items is used to segment all items into short-term demand chains. If the time difference Δt between two adjacent accessed items exceeds a specified threshold, a new item demand chain is constructed. This data organization encodes users' discrete item interaction records into a unified data organization format combining "long-term interest sequences" and "short-term demand chains."
[0049] Step 102: Deploy a novel feature extraction model to extract and process features from the encoded "long-term interest sequence - short-term demand chain" data;
[0050] Specifically, the user's "long-term interest sequence - short-term demand chain" is mapped to its corresponding embedding vector through the model's embedding layer. After obtaining the initial embedding vector E of the input data, a learnable position embedding P is used to add position information to the initial embedding vector E. The addition of position information can help the model capture the order of goods within and across short-term demand chains.
[0051] Step 103: Deploy a novel generative recommendation model based on a "sequence + chain" two-dimensional attention computing mechanism, which can capture user interests from the user's "long-term interest sequence - short-term demand chain" after the feature extraction model has been processed, and generate the next product combination that the user may buy.
[0052] Specifically, the generative recommendation model uses a Transformer-like encoder structure with a "sequence + chain" two-dimensional attention mechanism as its main architecture. It calculates attention scores for long-term and short-term demand items through two-dimensional attention computation. Furthermore, while calculating attention hierarchically, it adds temporal and relative positional biases related to item information, enabling the recommendation model to learn the logical sequence relationships between items.
[0053] Step 104: Add a contrastive optimization calculation module and use the contrastive loss function to optimize the recommendation model;
[0054] During the training of the generative recommendation model, positive and negative samples are sampled from the product database. The Softmax sampling method is used to handle the problem of large-scale negative samples and reduce computational complexity. By calculating the scores of positive and negative samples, the model's embedding space is optimized, making positive samples closer and negative samples farther apart, thereby enhancing the model's ability to distinguish between positive and negative samples and further improving the recommendation model's ability to identify user interests.
[0055] Step 105: After completing generative training and obtaining the chain-based product recommendation model, deploy the model to the online environment of the e-commerce group-buying platform to support actual business needs.
[0056] Specifically, A / B testing was used to conduct grouped experiments, comparing and evaluating the new model with existing recommendation models. During deployment, the model was designed to support receiving real-time streaming data input from users, dynamically updating user behavior characteristics and preference information to ensure the timeliness and personalization of recommendations.
[0057] In terms of technical implementation, the model deployment employs containerization technology combined with a distributed computing framework to handle the transmission and parsing of real-time user data streams. Simultaneously, through integration with the platform's recommendation engine, the new model can utilize historical behavioral data for online inference, generating chained recommendation results for multiple product categories. To enhance user experience, the model also supports a fast response mechanism (low-latency inference), ensuring that recommendation results are returned within milliseconds.
[0058] In summary, this embodiment of the invention, through steps 101-105, implements a chain-based product recommendation method based on users' dynamic shopping preferences. While improving recommendation accuracy, it also enhances the timeliness and relevance of recommendations, meeting various needs in practical applications. This embodiment of the invention, by combining the hierarchical construction of short-term and long-term demand chains with a generative recommendation model, enables the recommendation system to more accurately capture changes in users' dynamic needs, thereby optimizing the construction of the product recommendation chain and improving the recommendation effect of e-commerce group-buying platforms. Deploying the optimized chain-based product recommendation model on e-commerce group-buying platforms allows users to obtain a more personalized, multi-category product recommendation experience, ensuring the intelligence level of the recommendation system and user satisfaction.
[0059] Example 2
[0060] The scheme in Example 1 will be further described below with specific calculation formulas and examples:
[0061] 201: First, use Represents a set of users. This represents the collection of all products. For each user... Define long-term interaction sequence for products Each of them It consists of multiple products The short-term demand chain, m i Represents the short-term demand chain C i The length of the sequence. Arranged in chronological order, C i Let represent the i-th short-term demand chain of user u. Given the interaction history... In this context, the chain-based product recommendation task is to predict the next short-term demand chain for user u. That is, a set of goods {v n_u+1,1 ,v n_u+1,2 ,…,vn_u+1,m_i A short-term demand chain consisting of}
[0062] Given a user's historical product sequence, first determine the group size based on the configurable group size m. i The maximum permissible time difference Δt between consecutive goods is used to group goods into short-term demand chains. Specifically, for a set of goods... and its corresponding timestamp C i Construct as shown in the following formula:
[0063] C i ={v i,j |t i,j -t i,j-1 ≤Δt},j=2,…,m i #(1)
[0064] Multiple short-term demand chains are arranged in chronological order to form a long-term sequence. When the number of product items is less than the pre-set sequence length, blank values are filled in.
[0065] 202: Before the constructed long-term and short-term demand chains can be used for recommendation model training, they first pass through a preprocessing module to handle irregular sequence lengths and transform them into uniform input features, denoted as E′. This is to enable the recommendation model to learn more nuanced information about both long-term and short-term product demand chains. Specifically, for each user's historical demand chain... The initial tensor E∈R is generated by mapping the embedding layer to the corresponding embedding representation. b×n×m×d Where b represents the batch size, n is the number of chains in the sequence, m is the number of items in each chain, and d is the embedding dimension.
[0066] Subsequently, to enable the model to capture the sequential relationships between items within and between chains, a learnable positional embedding P was added to the item embedding. This positional embedding generates a unique embedding representation for each item position in the sequence, helping the model better understand the temporal and sequential relationships between items in the demand chain. The initialization method for the positional embedding is as follows:
[0067]
[0068] Then, the location embedding is added to the scaled product embedding:
[0069]
[0070] Where, P∈R N×D It is a learnable positional embedding, which is expanded and broadcast to the dimensions of long-term interest sequences and short-term demand chains to match the shape of E.
[0071] To handle padded user interest sequences, tensor E undergoes computation using the `fbgemm` function. This operation ensures that the blanks introduced in the data construction module do not interfere with the model's subsequent learning process. By converting the tensor to a "zigzag format," the padded items are effectively ignored during attention calculation, allowing the model to focus solely on the actual products in each product demand chain. After this transformation, the resulting tensor E′ can be directly used for "sequence + chain" two-dimensional attention processing in generative recommendation models.
[0072] 203: The recommender system's model architecture consists of multiple layers of "sequence + chain" two-dimensional attention computation modules. In the two-dimensional attention mechanism, firstly, the input E′ is normalized through network layers and then reconstructed into a two-dimensional tensor for efficient matrix multiplication. Next, the input embedding E′ is linearly projected into four matrices Q through a learnable weight matrix. n ,K n V n U n These projections will be divided along the dimension H of the set attention head:
[0073] Q n =E′W q ,K n =E′W k ,
[0074] V n =E′W v U n =E′W u #(4)
[0075] Among them, W q ,、W k ,、W v ,、W u It is a learnable projection matrix. Attention is then computed on both the sequence dimension n and the demand chain dimension m to capture intra-chain and inter-chain relationships. Sequence-level attention focuses on the connections between different demand chains, treating the goods in each demand chain as a whole. This is achieved by reconstructing the projected Q... n and K n To match the sequence dimension n, the sequence-level attention score is calculated using the following formula:
[0076]
[0077] Where, d H The dimensional size of the configurable self-attention head.
[0078] If the product has interaction timestamp information, the attention score is adjusted using a relative attention bias R, which combines the temporal differences and positional offsets between products. The final sequence-level attention score is activated by the SiLU activation function and scaled according to the sequence length n, while a mask is applied to the padding positions.
[0079]
[0080] Where R is the relative attention bias value; Mask represents the masking process.
[0081] Finally, the sequence-level attention output O n Expressed as:
[0082]
[0083] in, This represents the attention score after activation.
[0084] After completing the sequence-level attention computation, the output On will be used for attention computation in the demand chain dimension m. The model splits the sequence-level attention output into four new matrices Q. m K m V m U m Used to capture dependencies between goods within the demand chain:
[0085] Q m =O n Wq, K m =O n W k ,
[0086] V m =O n W v U m =O n W u #(8)
[0087] Similar to formula #(5), the chain-level attention score is calculated using the following formula:
[0088]
[0089] Attention scores at the demand chain level are also processed using the SiLU activation function, scaled by the chain length m, and the padding positions are masked.
[0090]
[0091] Attention output O at the demand chain level mThe final output is calculated in a manner similar to that used at the sequence level. By combining sequence-level and chain-level attention results, we obtain:
[0092]
[0093] Through a two-dimensional attention mechanism combining sequence and chain, the first item in each chain participates in both sequence-level and chain-level attention calculations. This mechanism enhances the logical relevance required for the next chain recommendation task, as the first item in the chain serves as the basis for subsequent items, effectively capturing the relational structure of chained demand.
[0094] 204: Added a contrastive optimization calculation module to optimize the recommendation model using the contrastive loss function. It samples positive and negative samples from the product library and optimizes the recommendation model using the contrastive loss function. Used to enhance the model's ability to distinguish between relevant (positive samples) and irrelevant (negative samples);
[0095] To handle a large number of negative samples, this embodiment of the invention employs a sampling softmax method. Given the final output embedding... and supervised embedding E t ∈R n′×m×d , where n′ represents the total number of samples after aliasing, and d is the embedding dimension. The scores for positive and negative samples are defined as follows:
[0096]
[0097] in, It is the final output embedding of sample i, E ti It is supervised embedding (positive sample), E nij Let be the embedding of the j-th negative sample of sample i, and τ be the softmax temperature parameter. The formula for calculating the contrastive loss is:
[0098]
[0099] The goal of this loss function is to encourage the model to assign higher scores to positive samples and lower scores to negative samples, thereby improving the model's ability to distinguish between positive and negative samples. This mechanism effectively optimizes the embedding space, making relevant and irrelevant items clearly distinguishable in the feature space. Through this optimization term, the model is guided to prioritize learning product chains that better meet user needs during training, thus improving the accuracy and relevance of recommendations.
[0100] Furthermore, to further enhance the model's generalization ability, a regularization term can be added to the loss function to prevent overfitting. Through optimization of the contrastive loss, the recommender system can more effectively distinguish user-preferred items, ensuring that the final recommended item chain not only meets user needs but also possesses a certain degree of diversity and novelty. Through this process, the optimized recommender system can more accurately predict user demand chains, achieving dynamic matching of user demand chains and addressing the shortcomings of existing recommender systems in capturing dynamic user needs and related demand chains. This system can combine user historical behavior, comprehensively considering users' dynamic needs for related items in time series and chained recommendations, ensuring the relevance and diversity of the recommendation results.
[0101] 205: After completing generative training and obtaining the chain-like product recommendation model, deploy the model to the online environment of the e-commerce group-buying platform to support actual business needs.
[0102] Specifically, the model is first tested using A / B experiments. Assume the parameters of the generative model are θ, and the model f... θ Training is complete, and it can analyze user history. Generate chained recommendation results: in, Let G represent the product chain recommended by user u. To evaluate the performance of the new model, users are divided into experimental groups G. exp and control group G ctrl :
[0103]
[0104] Experimental group G exp Using the new model f θ control group G ctrl Using the existing model f baseline :
[0105]
[0106] The model, tested through A / B testing, can be deployed on e-commerce group-buying platforms, providing these platforms with a novel tool for predicting user demand chains. This tool enables personalized recommendations based on users' constantly evolving demand chains, accurately pushing product chains that match users' current needs, thus improving the consistency and relevance of recommendations. The system not only reduces the need for human intervention but also enhances the platform's content relevance and user stickiness, positively impacting user experience and content management efficiency. This innovative recommendation system provides platforms with a stronger competitive advantage in meeting dynamic user needs.
[0107] Example 3
[0108] The feasibility of Examples 1 and 2 is verified through specific experiments, as detailed below:
[0109] For example, in this embodiment of the invention, three datasets—Ml-1m, Ml-2m, and Taobao—are selected for training. These three datasets contain rich information on user-product interactions, including user historical interaction behavior, product ratings, timestamps, and other features, which can be effectively used to capture users' dynamic preferences and demand chains. After preprocessing, the datasets are divided into training and testing sets in an 8:2 ratio to ensure the model's generalization ability in different scenarios, and the recommendation performance is validated on the testing set.
[0110] This experiment selected BERT4Rec [4] SASRec [5] Classic recommender system models are used as the foundation to verify the applicability and superiority of the proposed method in different recommender architectures. BERT4Rec is a sequence recommender model based on bidirectional Transformer, which excels at capturing global dependencies in user sequences; SASRec is a sequence recommender model based on self-attention mechanism, which can efficiently capture local patterns and long-term preferences in user behavior sequences.
[0111] The evaluation metrics include: HR@K (hit rate, used to measure the proportion of recommended items that users genuinely like), NDCG@K (normalized depreciation cumulative gain, used to measure the ranking quality of items in the recommended list), and MRR (mean reciprocal rank, used to evaluate the overall ranking effect of the recommended list). These metrics comprehensively evaluate the performance of the recommendation model in terms of recommendation accuracy, ranking rationality, and recommendation diversity.
[0112] In implementation, the learning rate was set to 0.001, the maximum length of the long-term demand chain was set to 200, and the maximum length of the short-term demand chain was set to 3. Hyperparameters in the attention computation (e.g., number of attention heads, hidden layer dimension) were designed with 8 attention heads and a hidden layer dimension of 256 to ensure the computational accuracy and efficiency of the model in different demand chains. To ensure the reliability of the results, each experiment was performed five times, and the average value was taken to reduce the impact of random fluctuations. All experiments were executed on an NVIDIA A800-80GB GPU.
[0113] Experiments verified the effectiveness of the method proposed in this invention in capturing dynamic user demand chains, enabling the constructed recommendation model to have stronger user preference mining capabilities and dynamic recommendation effects, while improving the relevance and diversity of recommendations, thus bringing a better recommendation experience to platform users.
[0114] Example 4
[0115] A chain-based product recommendation device for an e-commerce group-buying platform includes a processor and a memory. The memory stores program instructions, and the processor calls the program instructions stored in the memory to cause the device to execute the following method steps in Embodiment 1:
[0116] Construct a user history interaction behavior data encoder. This encoder is used to extract both long-term interest features and short-term demand features from the user's historical shopping data, and encode the user's discrete product interaction records into data of "long-term interest sequence - short-term demand chain".
[0117] A feature extraction model is constructed to extract and process features from the encoded "long-term interest sequence - short-term demand chain" data;
[0118] A generative recommendation model is constructed using a two-dimensional attention calculation mechanism of "sequence + chain" to capture user interests from the "long-term interest sequence - short-term demand chain" and generate the next product combination that the user will buy.
[0119] Add a contrastive optimization calculation module and use the contrastive loss function to optimize the recommendation model; after completing generative training and obtaining the chained product recommendation model, deploy the chained product recommendation model to the online environment of the e-commerce group buying platform to support actual business needs.
[0120] The "sequence + chain" two-dimensional attention calculation mechanism is as follows:
[0121] The input E′ is linearly projected into four matrices Q through a learnable weight matrix. n K n V n U n The projection will be divided along the dimension H of the set attention head:
[0122] Q n =E′W q K n =E′W k ,
[0123] V n =E′W v U n =E′W u
[0124] Among them, W q , W k , W v , W u It is a learnable projection matrix that computes attention on the sequence dimension n and the demand chain dimension m respectively to capture intra-chain and inter-chain relationships;
[0125] The final sequence-level attention score is activated by the SiLU activation function and scaled according to the sequence length n, while a mask is applied to the padding positions:
[0126]
[0127] Where R is the relative attention bias value; Mask represents the masking process;
[0128] The sequence-level attention output On is expressed as:
[0129]
[0130] in, This represents the attention score after activation;
[0131] After completing the sequence-level attention calculation, the output will be O. n For attention computation in the demand chain dimension m, the model splits the sequence-level attention output into four new matrices Q. m K m V m U m Used to capture dependencies between goods within the demand chain:
[0132] Q m =O n W q K m =O n W k ,
[0133] V m =O n W v U m =O n W u
[0134] Attention scores at the demand chain level are also processed using the SiLU activation function, scaled by the chain length m, and the padding positions are masked.
[0135]
[0136] Output By combining sequence-level and chain-level attention results, we obtain:
[0137]
[0138] Through the "sequence + chain" two-dimensional attention calculation mechanism, the first item in each chain participates in both sequence-level and chain-level attention calculations.
[0139] The contrast optimization calculation module consists of sampling a set of positive and negative samples from the product library and using a contrast loss function to optimize the chain-like product recommendation model. The contrast loss is used to enhance the model's ability to distinguish between relevant and irrelevant items.
[0140] It should be noted that the device descriptions in the above embodiments correspond to the method descriptions in the embodiments, and the embodiments of the present invention will not be repeated here.
[0141] The execution entities of the aforementioned processor and memory can be devices with computing functions such as computers, microcontrollers, and single-chip microcomputers. In specific implementations, the embodiments of the present invention do not limit the execution entities and can select them according to the needs of actual applications.
[0142] Data signals are transmitted between the memory and the processor via a bus, which will not be elaborated upon in this embodiment of the invention.
[0143] Based on the same inventive concept, embodiments of the present invention also provide a computer-readable storage medium, the storage medium including a stored program, which, when the program is running, controls the device where the storage medium is located to execute the method steps in the above embodiments.
[0144] The computer-readable storage medium includes, but is not limited to, flash memory, hard disk, solid-state drive, etc.
[0145] It should be noted that the description of the readable storage medium in the above embodiments corresponds to the description of the method in the embodiments, and the embodiments of the present invention will not be repeated here.
[0146] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of the present invention is generated.
[0147] A computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Computer instructions can be stored in or transmitted through a computer-readable storage medium. A computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be magnetic or semiconductor, etc.
[0148] References
[0149] [1]J.Tang and K.Wang,“Personalized top-n sequential recommendationvia convolutional sequence embedding,”in Proceedings of the eleventh ACMinternational conference on web search and data mining,2018,pp.565-573.
[0150] [2]P.Wei,S.Liu,X.Yang,L.Wang,and B.Zheng,“Towards personalized bundlecreative generation with contrastive non-autoregressive decoding,”inProceedings of the 45th International ACM SIGIR Conference on Research andDevelopment in Information Retrieval,2022,pp.2634-2638.
[0151] [3]Y.Leng,L.Yu,J.Xiong,and G.Xu,“Recurrent convolution basket map fordiversity next-basket recommendation,”in International conference on databasesystems for advanced applications.Springer,2020,pp.638-653
[0152] [4]Bert4rec:Sequential recommendation with bidirectional encoderrepresentations from transformer”in Proceedings of the 28th ACM internationalconference on information and knowledge management,2019,pp.1441-1450.
[0153] [5] W.-C.Kang and J.McAuley, "Self-attentive sequential recommendation," in 2018IEEE international conference on data mining (ICDM). IEEE, 2018, pp.197–206.
[0154] Unless otherwise specified, the model numbers of the various devices in this embodiment of the invention are not limited, and any device that can perform the above functions is acceptable.
[0155] Those skilled in the art will understand that the accompanying drawings are merely schematic diagrams of a preferred embodiment, and the sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0156] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A chain-based product recommendation method for an e-commerce group-buying platform, characterized in that, The method includes: Construct a user history interaction behavior data encoder. This encoder is used to extract both long-term interest features and short-term demand features from the user's historical shopping data, and encode the user's discrete product interaction records into data of "long-term interest sequence - short-term demand chain". Construct a feature extraction model to extract and process features from the encoded "long-term interest sequence - short-term demand chain" data; A generative recommendation model with a "sequence + chain" two-dimensional attention computing mechanism is constructed to capture user interests from the "long-term interest sequence - short-term demand chain" and generate the next product combination that the user will buy. Add a contrastive optimization calculation module and use the contrastive loss function to optimize the recommendation model; after completing generative training and obtaining the chained product recommendation model, deploy the chained product recommendation model to the online environment of the e-commerce group buying platform to support actual business needs; The "sequence + chain" two-dimensional attention calculation mechanism is as follows: Input The learnable weight matrix is linearly projected into four matrices. The projection will follow the dimension of the set attention head. Divide into: ; ; in, It is a learnable projection matrix, respectively in the sequence dimension and demand chain dimension Attention is computed to capture intra-chain and inter-chain relationships; The final sequence-level attention score is activated by the SiLU activation function and adjusted according to the sequence length. Scale the area and apply a mask to the fill position: ; Where R is the relative attention bias value; This represents the masking process; Sequence-level attention output Expressed as: ; in, This represents the attention score after activation; After completing the sequence-level attention calculation, the output will be... For demand chain dimension In the attention computation, the model splits the sequence-level attention output into four new matrices. Used to capture dependencies between goods within the demand chain: ; ; Attention scores at the demand chain level are also processed using the SiLU activation function, by chain length. Scale the area and mask the fill position: ; Output By combining sequence-level and chain-level attention results, we obtain: + ; Through the "sequence + chain" two-dimensional attention calculation mechanism, the first item in each chain participates in both sequence-level and chain-level attention calculations.
2. The chain-based product recommendation method for an e-commerce group-buying platform according to claim 1, characterized in that, The contrast optimization calculation module is as follows: it samples the positive and negative sample sets of the product library and uses the contrast loss function to optimize the chain-like product recommendation model. The contrast loss is used to enhance the model's ability to distinguish between relevant and irrelevant items.
3. A chain-like product recommendation device for an e-commerce group-buying platform, characterized in that, The device includes a processor and a memory, the memory storing program instructions, the processor calling the program instructions stored in the memory to cause the device to perform the method according to any one of claims 1-2.
4. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions that, when executed by a processor, cause the processor to perform the method described in any one of claims 1-2.
Citation Information
Patent Citations
Session recommendation method based on graph attention network and bidirectional long-short-term memory network
CN112396492A
Self-attention sequence recommendation method fusing time sequence information
CN114493755A