Sequence recommendation method and device based on time feature perception and storage medium
Through a sequence recommendation method based on time feature perception, combined with Gaussian hybrid model and attention mechanism, the problem of deviation between user preferences and current actual preferences is solved, and a more accurate and dynamic recommendation effect is achieved.
Patent Information
- Application Number
- CN202411686678.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-11-22
AI Technical Summary
In the prior art, there is a deviation between user preferences and current actual preferences, resulting in low recommendation reliability.
A sequence recommendation method based on time feature perception is proposed. By obtaining the historical interactive data of users and projects, multi-dimensional time feature analysis and feature embedding, combining Gaussian mixed model and attention mechanism, short-term and long-term preference scores are generated, and weighted fusion is performed to generate comprehensive preference scores.
It has achieved a comprehensive integration of short-term and long-term preferences, making recommendations more accurate and dynamic, and improving the personalization and timeliness of recommendations.
Smart Images

Figure CN119598039A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a sequence recommendation method, device and storage medium based on time feature perception. Background Art
[0002] In an era of rapidly increasing information volume, recommendation systems have become a vital personalized information filtering tool. Sequential recommendation has emerged due to the rapid growth of user behavior data, the improvement of personalized needs, and the advancement of deep learning technology. It is an important branch of the recommendation system field, which mainly predicts the user's possible future behavior based on the historical behavior sequence. Sequential recommendation takes into account the temporal and sequential information of user behavior, which helps to reveal the user's dynamic interests and achieve more accurate and personalized recommendations. This method has shown its importance and effectiveness in e-commerce, music, news, and social networks. It can provide users with a rich and expected online experience and help improve the user activity and commercial benefits of the platform. Unlike traditional recommendation systems based on user static preferences and item static features, sequential recommendation pays more attention to the interaction sequence between users and items, emphasizes the order of time, and can better reflect the dynamic changes of user behavior and interests. However, since user interests are constantly changing, this may lead to a deviation between the user preferences captured by the model and the current actual preferences.
[0003] The existing technology has the technical problem that the captured user preferences deviate from the current actual preferences and the recommendation reliability is low. Summary of the invention
[0004] The purpose of the present invention is to propose a sequence recommendation method, device and storage medium based on time feature perception, which is used to solve the technical problem that the user preferences captured in the prior art are deviated from the current actual preferences and the recommendation reliability is low.
[0005] To achieve the above purpose, the present invention proposes a sequence recommendation method based on time feature perception, and the specific steps are as follows:
[0006] S1. Obtain historical interaction data between a user and a group of projects within a preset historical period, perform context analysis on the historical interaction data, and obtain a historical interaction sequence and a timestamp sequence;
[0007] S2, traversing the historical interaction sequence and the timestamp sequence to perform multidimensional time feature analysis, and dividing the multidimensional time features into three groups according to the learning purpose, to obtain a first group of time features, a second group of time features, and a third group of time features;
[0008] S3, traversing the first group of time features, the second group of time features and the third group of time features to perform feature embedding and encoding, obtaining a first group of feature vectors, a second group of feature vectors and a third group of feature vectors, combining the timestamp sequence, using a Gaussian mixture model to analyze and capture the first group of time features, the second group of time features and the third group of time features, and obtaining a short-term preference score;
[0009] S4, constructing an embedding matrix, filling the historical interaction sequence into the embedding matrix to obtain a project embedding matrix, and analyzing the project embedding matrix using a linear attention mechanism to obtain a long-term preference score;
[0010] S5. Perform weighted fusion of the short-term preference score and the long-term preference score using a fusion formula to generate a comprehensive preference score;
[0011] S6. determining a plurality of interaction probabilities of the set of items based on the comprehensive preference scores;
[0012] S7. Sort the multiple interaction probabilities in descending order, and use the item corresponding to the interaction probability at the front as the recommendation result.
[0013] Preferably, in S1, the historical interaction sequence is used to describe the items and context information interacted by the user at different time points in the historical time, and the timestamp sequence is used to describe the time points when the user interacted with the items in the historical time, and the historical interaction sequence corresponds one-to-one to the timestamp sequence.
[0014] Preferably, in S2, the first group of time features includes timestamp sequence and week features, which are used to identify the periodicity of user behavior; the second group of time features includes sliding window standard deviation and first-order difference features, which are used to identify the degree of user interaction and behavior change; the third group of time features includes personalized time interval features, which are used to perceive the relative positions of all interactions.
[0015] Preferably, the timestamp sequence and the historical interaction sequence are traversed to determine the Sunday on which each historical interaction occurs, and to obtain the weekly feature.
[0016] Preferably, the timestamp sequence is analyzed using the sliding window standard deviation calculation formula to obtain the sliding window standard deviation; the sliding window standard deviation calculation formula is as follows:
[0017]
[0018] Where σ(t) is the sliding window standard deviation, t i is the i-th timestamp in the timestamp sequence, μ is the timestamp mean of the timestamp sequence, n u is the length of the timestamp sequence.
[0019] Preferably, the time difference between two items is determined based on the historical interaction sequence, the minimum non-zero time difference is determined according to the timestamp sequence, and the personalized interval feature is obtained using a feature recognition formula; the feature recognition formula is as follows:
[0020]
[0021]
[0022] in, is the scale interval for the user to interact with the i-th item and the j-th item respectively, t i is the time that the user interacts with the i-th item, t j is the time that the user interacts with the jth item, is the minimum non-zero time difference when the user interacts with the item, M u It is a personalized time interval feature.
[0023] Preferably, in S5, the fusion formula is:
[0024]
[0025] Among them, rel N+1 (v) is the comprehensive preference score of the item, λ is a learnable parameter, is the short-term preference score, is the long-term preference score, and v is the interaction item.
[0026] Preferably, in S6, based on the comprehensive preference score, a ratio of the corresponding comprehensive preference score of each item to the sum of the comprehensive preference scores of the group of items is calculated to obtain the multiple interaction probabilities.
[0027] The present invention also provides an electronic device, comprising: a processor and a memory; the memory stores a computer program; the processor executes the computer program to execute a sequence recommendation method based on time feature perception provided by the present invention.
[0028] The present invention also provides a computer-readable storage medium on which a computer program is stored; the computer program is used to execute a sequence recommendation method based on time feature perception provided by the present invention.
[0029] Therefore, the present invention proposes a sequence recommendation method, device and storage medium based on time feature perception, which have the following beneficial effects:
[0030] (1) The present invention realizes the comprehensive integration of short-term and long-term preferences through multi-level analysis of time characteristics and project characteristics, making the recommendation more accurate and dynamic.
[0031] (2) The present invention integrates short-term and long-term temporal features, analyzes and captures user behavior changes through multi-head self-attention mechanism and linear attention mechanism, and realizes time-aware personalized recommendation.
[0032] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 A schematic diagram of a sequence recommendation method based on time feature perception provided by the present invention;
[0034] Figure 2 A schematic diagram of a process of obtaining a first group of time features, a second group of time features and a third group of time features in a sequence recommendation method based on time feature perception provided by the present invention;
[0035] Figure 3 The present invention provides a schematic structural diagram of an electronic device. DETAILED DESCRIPTION
[0036] In order to make the technical solutions, advantages and purposes of the present invention clearer, the technical solutions of the embodiments of the present invention are clearly and completely described below. The described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the described embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work belong to the protection scope of this application.
[0037] Unless otherwise defined, technical or scientific terms used in the present invention shall have the common meanings understood by one having ordinary skills in the field to which the present invention belongs.
[0038] like Figure 1 As shown, the present invention provides a sequence recommendation method based on time feature perception, and the specific steps are as follows:
[0039] Step S100: Obtain historical interaction data between a user and a group of projects within a preset historical time, perform context analysis on the historical interaction data, and obtain a historical interaction sequence and a timestamp sequence, wherein the historical interaction sequence is used to describe the projects and context information interacted by the user at different time points in the historical time, and the timestamp sequence is used to describe the time points when the user interacted with the project in the historical time, and the historical interaction sequence corresponds to the timestamp sequence one-to-one.
[0040] In a possible embodiment, the preset historical time is a time period for analyzing the user's project interaction, which may be half a month, a month, etc. The user is any user who needs to be recommended in sequence, and a group of projects are projects that the user interacted with within the preset historical time, such as music, news, social network, etc.
[0041] The historical interaction data contains detailed information about each user interaction, such as the timestamp of the interaction (recording the time when it occurred) and the project ID (recording the project visited by the user). With each interaction, we observe a context sequence, that is, the interaction information before and after the interaction occurs. Each element c t (t∈{1,…,n u}) is a tuple-associated interaction SuiC∈N * Different types of time-related context information, such as month (from January to December), day of the month (from 1 to 31), or day of the week (from Monday to Sunday) interactions. Formally, we set c t =(c t1 , c t2 , ..., c tC ), where c tj ∈C j , Using C j represents the possible value set of the jth context type. For each set C j The values in are sorted to account for temporal proximity, for example, capturing January closer to February than to July.
[0042] Then, the context sequence is mixed with the obtained historical interaction data, that is, each element of each context sequence is fused with the corresponding historical interaction data to obtain a historical interaction sequence containing the user's actual interaction information and context information, which is expressed as:
[0043]
[0044] Among them, S u is the historical interaction sequence of the u-th user in a group of users, is the item that the u-th user interacted with at the t-th time node, n u represents the length of the historical interaction sequence of the u-th user. When u is 1, the historical interaction sequence is the interaction data of the user in the preset historical period.
[0045] The timestamp sequence is:
[0046]
[0047] Among them, Tu is the timestamp sequence of the u-th user in a group of users, t t is the timestamp of the tth interaction of the uth user, n u The length of the timestamp sequence of the uth user. When u is 1, the timestamp sequence is the sequence of time nodes that the user interacted with within the preset historical time.
[0048] By combining the context sequence with the historical interaction data, a rich historical interaction sequence is formed, which contains the context information of each interaction, thereby providing the interaction background of users in different time periods and between different projects, so that we can subsequently deeply understand user behavior habits from the time dimension, and provide support for the multi-dimensional time feature extraction and model analysis in the subsequent steps.
[0049] Step S200: traverse the historical interaction sequence and the timestamp sequence to perform multidimensional time feature analysis, and divide the multidimensional time features into three groups according to the learning purpose to obtain a first group of time features, a second group of time features and a third group of time features.
[0050] like Figure 2 As shown, the first group of time features includes timestamp sequence and week features, which are used to identify the periodicity of user behavior; the second group of time features includes sliding window standard deviation and first-order difference features, which are used to identify the degree of user interaction and behavior change; the third group of time features includes personalized time interval features, which are used to perceive the relative positions of all interactions.
[0051] In one possible embodiment, the time information of each interaction is extracted from the user's historical interaction sequence and timestamp sequence to analyze the multi-dimensional time features. Each interaction record is traversed, and its timestamp and interaction items are read in sequence to gradually construct different time features.
[0052] The obtained multidimensional time features are divided according to different learning purposes (that is, the purpose of feature extraction) to obtain the first group of time features, the second group of time features and the third group of time features. Among them, the first group of time features includes timestamp sequences and week features, which are used to identify the periodicity of user behavior. The timestamp and week features help the model identify the periodicity of user behavior and observe whether the user has consistent behavior preferences in certain specific times or periods. The second group of time features includes sliding window standard deviation and first-order difference features, which are used to identify the degree of user interaction and behavior change. By obtaining the sliding window standard deviation and first-order difference features, the volatility and change amplitude of user behavior are analyzed to help the model identify the rhythm and fluctuation degree of user behavior. The third group of time features includes personalized time interval features, which perceive the relative positions of all interactions, enable the model to understand the relative time distribution between user interaction events, capture the interval pattern of interaction events, and enhance the personalized understanding of the time dimension.
[0053] In the embodiment of the present application, step S200 further includes:
[0054] The timestamp sequence and the historical interaction sequence are traversed to determine the Sunday on which each historical interaction occurs, and the week feature is obtained; the week feature and the timestamp sequence are used as the first set of time features.
[0055] In one embodiment, for each timestamp in the timestamp sequence, the day of the week (such as Monday to Sunday) on which the interaction occurs is extracted. This information indicates whether the user has a behavioral preference at a specific time of the week. The timestamp is converted into the corresponding week information through a system function or algorithm to generate a week feature sequence. For example, if the time of an interaction is "November 8, 2024", the week feature will record the Friday corresponding to that date. Arrange the week information of all interactions in chronological order to form a week feature sequence. This sequence corresponds one-to-one to the user's timestamp sequence. This sequence helps capture the user's periodic behavioral preferences and can reflect whether the user tends to perform certain interactions on specific Sundays (such as weekends or weekdays). Then, the week feature and the timestamp sequence are combined into a first set of time features.
[0056] The generated week feature sequence is combined with the original timestamp sequence to form the first set of time features. This combination retains the specific time information of the user interaction and its periodic characteristics. This first set of time features helps the model understand the periodicity of user behavior. By combining the week features and timestamps, it can be identified whether the user has a fixed time preference (such as usage habits on a specific day of the week).
[0057] In the embodiment of the present application, step S200 further includes:
[0058] The timestamp series is analyzed using sliding window standard deviation.
[0059] In a possible embodiment, the sliding window standard deviation is calculated based on the timestamp sequence, and the sliding window standard deviation is the standard deviation of the user interaction timestamps within a fixed interaction window. This feature reflects the stability and volatility of user behavior, and the calculation method is:
[0060]
[0061] Where σ(t) is the sliding window standard deviation, t i is the i-th timestamp in the timestamp sequence, μ is the timestamp mean of the timestamp sequence, n u is the length of the timestamp sequence, that is, the sliding window.
[0062] A low sliding window standard deviation indicates that the corresponding user has a stable interaction time, indicating fixed usage habits. A high standard deviation indicates that the interaction time fluctuates more, indicating random behavior or significant external influences.
[0063] The first-order difference features are calculated based on the timestamp sequence, which is obtained by calculating the difference between two adjacent timestamp nodes. Frequent short time intervals may indicate high interest or urgent need, while significant changes in short time intervals may indicate sudden changes in behavior.
[0064] By using the sliding window standard deviation and first-order difference features as the second set of time features, data support is provided for the subsequent identification of the volatility and rhythm changes of user behavior, achieving the technical effect of providing a deep understanding of user stability or sudden behavior.
[0065] In the embodiment of the present application, step S200 further includes:
[0066] The interval feature recognition of the historical interaction sequence is performed using the scale interval calculation to obtain the personalized time interval feature. The scale interval calculation formula is as follows:
[0067]
[0068] in, is the scale interval for the user to interact with the i-th item and the j-th item respectively, t i is the time that the user interacts with the i-th item, t j is the time that the user interacts with the jth item, The minimum non-zero time difference when a user interacts with an item;
[0069] In a possible embodiment, the timestamp sequence is traversed to calculate the time difference between each pair of adjacent interaction events. i -t j |, find the minimum value among all non-zero time differences, defined as This value represents the minimum interaction interval of the user and is the basis for the personalized interval feature. For each pair of interaction items of the user, the scale interval calculation formula is used to identify the interval feature to form a personalized time interval feature, that is, the interval feature matrix, which is:
[0070]
[0071] Among them, M u is a personalized time interval feature that fully describes the personalized time interval pattern between all interactions of the user. The personalized time interval feature matrix M uAs the third set of time feature outputs, it provides personalized information about user interaction behaviors in the time dimension. Personalized time interval features can effectively reflect the relative time distribution characteristics of users' project interactions, provide unique personalized information in the time dimension, and support the recommendation model to understand users' behavioral habits more accurately.
[0072] The first set of time features are timestamp and day of the week features, which help the model identify the periodicity and consistency of user behavior. The second set of time features are sliding window standard deviation and first-order difference features, which help the model identify the rhythm of user interaction and behavior changes. The third set of time features are personalized time interval features, which enable the model to perceive the relative position of all interactions and enrich the background information of time features. These three sets of embedded data are used for attention calculations of three different attention heads. The first two sets are processed and merged through the linear layer to obtain fixed-dimensional embeddings, and then the three sets are encoded for item position and the absolute position information is merged. The technical effect of obtaining multi-dimensional time features and providing data support for subsequent analysis is achieved.
[0073] Step S300: Traverse the first group of time features, the second group of time features, and the third group of time features to perform feature embedding and encoding, obtain the first group of feature vectors, the second group of feature vectors, and the third group of feature vectors, combine the timestamp sequence, and use the Gaussian mixture model to analyze and capture the first group of time features, the second group of time features, and the third group of time features to obtain a short-term preference score;
[0074] In one possible embodiment, item features and time features are combined so that the model can consider both "item content" and "time information" during analysis. By processing item-time sequences through a multi-head self-attention mechanism, the model can focus on different interaction features and capture local preference changes of users in a short period of time. This mechanism is particularly good at identifying significant behavioral features of users in a short period of time, such as sudden interests of users in certain time periods.
[0075] The multi-head self-attention mechanism is designed to capture the complex relationships in user-item interaction sequences and temporal patterns. This module adopts three different attention heads, each of which processes different temporal features to effectively learn users' behavior patterns.
[0076] The first attention head is used for relative time interval feature embedding to capture the relative time changes between interactions. The second attention head is used for week feature embedding to help the model identify the periodicity of user behavior. The third attention head is used for sliding window standard deviation and first-order difference feature embedding to focus on the fluctuation and changing rhythm of user behavior.
[0077] The relative time interval embedding vector (E I&R ), for timestamp sequence and week feature Embed it, and then combine it using a linear activation function to get the embedding Add position embedding before inputting into the model. Sliding window standard deviation and first-order difference features Similarly, the sliding window standard deviation and first-order difference features are embedded and combined using a linear activation function to obtain the embedding Position embedding is also added here. I&R , Analyze and obtain
[0078] Then, the mixed formula of the mixed Gaussian model is used to respectively Perform analysis to obtain short-term preference scores The formula is as follows:
[0079]
[0080]
[0081] The mixed short-term preference score is used as the user's interest evaluation of the project in a short period of time, and then provides the recommendation system with the user's short-term preference information. Through this step, the model not only captures the short-term behavior changes of users, but also identifies different dimensions in the time features through three different attention heads, making the recommendation more accurate and timely.
[0082] Step S400: construct an embedding matrix, fill the historical interaction sequence into the embedding matrix, obtain a project embedding matrix, and then use a linear attention mechanism to analyze the project embedding matrix to obtain a long-term preference score;
[0083] The model also needs to focus on the user's long-term preferences, not just short-term behavior. This step extracts features that reflect the user's long-term preferences in the interaction data and processes them using a linear attention model. Unlike the multi-head self-attention mechanism, linear attention is more suitable for capturing users' persistent interests and habits and generating vectors that reflect users' long-term preferences.
[0084] Create an embedding matrix MI∈R|I|×d, where d is the potential dimension. Use a constant zero vector 0 as the embedding of the filler item. Fill the historical interaction sequence into the embedding matrix to obtain the item embedding (E1). Use the linear attention mechanism to analyze and identify the item embedding (E1) to determine the long-term preference score
[0085] Exemplarily, an embedding matrix MI∈R|I|×d is constructed based on the user's historical interaction sequence, where |I| is the number of items in the user's historical interaction and d is the dimension of the embedding vector. The features of each item are mapped to MI, and each row represents the embedding vector of an item. Zero vector 0 is used as a padding item to ensure that the embedding matrix dimensions of all users are consistent.
[0086] Fill the project features in the historical interaction sequence into the embedding matrix to form the project embedding matrix E1. This matrix records the historical information of the user's interaction with the project and represents the user's project preference in the long term. Then, the linear attention mechanism is used to process the project embedding E1 to capture the user's long-term interest pattern. Calculate the attention weight αi, which is used to measure the user's long-term preference for each project. The linear attention mechanism is mainly based on content alignment here to avoid multi-head interference in the short-term attention mechanism and focus more on persistent interests. The embedding vectors of each project are weighted and summed according to the weights to generate a vector representation that reflects the user's long-term interests. This weighted result forms a long-term preference vector that characterizes the overall long-term interest distribution of the user.
[0087] The weighted sum of long-term preference vectors is used as input, and the user's long-term preference score is obtained through linear transformation or nonlinear activation. This score reflects the user's interest in different items in the long term and is used to further balance the importance of long-term preferences in recommendations.
[0088] Through this step, the model can accurately obtain users' long-term interest trends and help identify users' persistent preferences, thereby providing stable long-term preference support for the recommendation system.
[0089] Step S500: Use a fusion formula to perform weighted fusion on the short-term preference score and the long-term preference score to generate a comprehensive preference score. The fusion formula is as follows:
[0090]
[0091] Among them, rel N+1 (v) is the comprehensive preference score of the item, λ is a learnable parameter, is the short-term preference score, is the long-term preference score, v is the interaction item;
[0092] In one embodiment, short-term and long-term preferences are combined to generate a balanced comprehensive preference. The Gaussian mixture model plays a role of "weighted fusion" in this step, helping the model find the appropriate weight between short-term and long-term preferences. This weighted fusion allows the model to more flexibly adapt to the behavioral characteristics of different users and generate a comprehensive preference vector.
[0093] Step S600: Determine multiple interaction probabilities of the group of items based on the comprehensive preference scores.
[0094] According to the comprehensive preference score, obtaining a corresponding comprehensive preference score for each item in the group of items;
[0095] The ratio of the corresponding comprehensive preference score of each item to the sum of the comprehensive preference scores of the group of items is calculated to obtain the multiple interaction probabilities.
[0096] In one possible embodiment, for each item in the candidate items, the ratio of its comprehensive preference score to the total is calculated to determine the interaction probability of the item, and the interaction probability indicates the possibility of the user performing the next step of interaction with the item, and a higher value indicates that the user is more interested in the item.
[0097] The interaction probability of each candidate item is stored in a list to form an interaction probability set containing all candidate items. The candidate item list is sorted from large to small according to the interaction probability, with the item with the highest probability at the top. This sorting process will help the model determine the items with which the user is most likely to interact. Then, the first item in the sorted candidate item list (the item with the highest interaction probability) is used as the final recommendation result. The model selects the item with the highest probability to maximize the match with the user's current interest. The top-ranked items or the best items are provided as recommendation results to users to meet their interest needs.
[0098] By ensuring that recommendations of different items are based on relative interest, we can better match user preferences. This recommendation method can effectively improve the accuracy and personalization of recommendations, ensuring that users receive the content that best matches their needs.
[0099] Step S700: sorting the multiple interaction probabilities in descending order, and taking the item corresponding to the interaction probability at the front as the recommendation result.
[0100] like Figure 3 , which is a schematic diagram of the structure of the electronic device provided by the present invention, and shows a block diagram of an exemplary electronic device suitable for implementing the embodiments of the present invention. The electronic device includes a processor 21, a memory 22, an input device 23, and an output device 24; the number of processors 21 in the electronic device can be one or more, Figure 3 A processor 21 is taken as an example; the processor 21, memory 22, input device 23 and output device 24 in the electronic device can be connected by a bus or other means. Figure 3 The example of connecting through bus is taken in the following.
[0101] The memory 22, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to a sequence recommendation method based on time feature perception in an embodiment of the present application. The processor 21 executes various functional applications and data processing of the computer device by running the software programs, instructions and modules stored in the memory 22, that is, realizing the above-mentioned sequence recommendation method based on time feature perception.
[0102] Figure 3 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0103] Therefore, the present invention proposes a sequence recommendation method, device and storage medium based on time feature perception, which realizes the comprehensive integration of short-term and long-term preferences through multi-level analysis of time features and project features, making recommendations more accurate and dynamic; it integrates short-term and long-term time features, analyzes and captures user behavior changes through multi-head self-attention mechanism and linear attention mechanism, and realizes time-aware personalized recommendation.
[0104] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical solution of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solution to deviate from the spirit and scope of the technical solution of the present invention.
Claims
1. A sequence recommendation method based on time feature perception, characterized in that: The specific steps are as follows: S1. Obtain historical interaction data between a user and a group of projects within a preset historical period, perform context analysis on the historical interaction data, and obtain a historical interaction sequence and a timestamp sequence; S2, traversing the historical interaction sequence and the timestamp sequence to perform multidimensional time feature analysis, and dividing the multidimensional time features into three groups according to the learning purpose, to obtain a first group of time features, a second group of time features, and a third group of time features; S3, traversing the first group of time features, the second group of time features and the third group of time features to perform feature embedding and encoding, obtaining a first group of feature vectors, a second group of feature vectors and a third group of feature vectors, combining the timestamp sequence, using a Gaussian mixture model to analyze and capture the first group of time features, the second group of time features and the third group of time features, and obtaining a short-term preference score; S4, constructing an embedding matrix, filling the historical interaction sequence into the embedding matrix to obtain a project embedding matrix, and analyzing the project embedding matrix using a linear attention mechanism to obtain a long-term preference score; S5. Perform weighted fusion of the short-term preference score and the long-term preference score using a fusion formula to generate a comprehensive preference score; S6. determining a plurality of interaction probabilities of the set of items based on the comprehensive preference scores; S7. Sort the multiple interaction probabilities in descending order, and use the item corresponding to the interaction probability at the front as the recommendation result.
2. The method for sequence recommendation based on time feature perception according to claim 1, characterized in that: In S1, the historical interaction sequence is used to describe the items and context information interacted by the user at different time points in the historical time, and the timestamp sequence is used to describe the time points when the user interacted with the items in the historical time. The historical interaction sequence corresponds to the timestamp sequence one by one.
3. The method for sequence recommendation based on time feature perception according to claim 1, characterized in that: In S2, the first group of time features includes timestamp sequence and week features, which are used to identify the periodicity of user behavior; the second group of time features includes sliding window standard deviation and first-order difference features, which are used to identify the degree of user interaction and behavior change; the third group of time features includes personalized time interval features, which are used to perceive the relative positions of all interactions.
4. The method for sequence recommendation based on time feature perception according to claim 3, characterized in that: The timestamp sequence and the historical interaction sequence are traversed to determine the day of the week on which each historical interaction occurs, and the day of the week feature is obtained.
5. The method for sequence recommendation based on time feature perception according to claim 3, characterized in that: The timestamp sequence is analyzed using the sliding window standard deviation calculation formula to obtain the sliding window standard deviation; the sliding window standard deviation calculation formula is as follows: Where σ(t) is the sliding window standard deviation, t i is the i-th timestamp in the timestamp sequence, μ is the timestamp mean of the timestamp sequence, n u is the length of the timestamp sequence.
6. The method for sequence recommendation based on time feature perception according to claim 3, characterized in that: Determine the time difference between two items based on the historical interaction sequence, determine the minimum non-zero time difference according to the timestamp sequence, and obtain the personalized interval feature using a feature recognition formula; The feature recognition formula is as follows: in, is the scale interval for the user to interact with the i-th item and the j-th item respectively, t i is the time that the user interacts with the i-th item, t j is the time that the user interacts with the jth item, is the minimum non-zero time difference when the user interacts with the item, M u It is a personalized time interval feature.
7. The sequence recommendation method based on time feature perception according to claim 1, characterized in that: In S5, the fusion formula is: Among them, rel N+1 (v) is the comprehensive preference score of the item, λ is a learnable parameter, is the short-term preference score, is the long-term preference score, and v is the interaction item.
8. The method for sequence recommendation based on time feature perception according to claim 1, characterized in that: In S6, based on the comprehensive preference score, a ratio of the comprehensive preference score corresponding to each item to the sum of the comprehensive preference scores of the group of items is calculated to obtain the multiple interaction probabilities.
9. An electronic device, comprising: Processor, memory; The memory stores a computer program, wherein the processor implements a sequence recommendation method based on time feature perception as described in any one of claims 1 to 8 when executing the computer program.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: The computer program is used to execute the sequence recommendation method based on time feature perception as described in any one of claims 1 to 8.
Citation Information
Patent Citations
User behavior sequence recommendation method based on attention mechanism and convolutional neural network
CN110060097A
Destination recommendation method and system based on multi-source heterogeneous information network
CN114398462A
Layered attention network sequence recommendation method based on long-term and short-term preferences of user
CN116484092A
Multi-interest sequence recommendation method, system and equipment
CN116776004A
Method for constructing sequence recommendation model through project relation attention mechanism and convolution mode
CN118797154A