Sequence recommendation method and device

By analyzing user historical interaction behavior, combining matrix decomposition and Markov chain model, the problem of poor recommendation effect of collaborative filtering algorithm under missing data is solved, and the recommendation of similar items in the same category is achieved during stationary distribution, which improves the accuracy of the recommendation system.

CN115687777BActive Publication Date: 2025-08-29CHINA TELECOM CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211413135.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-11
Publication Date
2025-08-29
Estimated Expiration
2042-11-11

AI Technical Summary

Technical Problem

When the existing collaborative filtering algorithm lacks the user's feedback data for some items, it cannot recommend items matching the user's personalized preferences, resulting in poor recommendation results.

Method used

By obtaining the historical interaction sequence of the target object, using matrix decomposition and Markov chain model to predict user preferences, combined with the approximate item preference prediction model, the same category of similar items is recommended when the preferred recommendation model is stationary, solving the problem of poor recommendation results caused by missing data.

Benefits of technology

It improves the effectiveness of the recommendation system in the multi-layer recommendation index system, ensuring that personalized items can still be accurately recommended in the absence of data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115687777B_ABST
    Figure CN115687777B_ABST
Patent Text Reader

Abstract

The present application discloses a sequence recommendation method and device. The method includes: obtaining the historical interaction sequence of the target object, and predicting the target object's preference score for each first item to be recommended in the set of recommended items based on the historical interaction sequence; determining multiple groups of first random numbers based on the preference information; analyzing the first random numbers using an item preference recommendation model, and when the item preference recommendation model does not undergo a stationary distribution, determining the first target recommended item based on the first random number, and recommending the first target recommended item to the target object; when the item preference recommendation model undergoes a stationary distribution, using an approximate item preference prediction model to determine the target object's preference for similar items of the same category as the second item to be recommended, obtaining the second target recommended item, and recommending the second target recommended item to the target object. The present application solves the technical problem that related recommendation technologies lack non-bottom-level indicator data in a multi-layer recommendation indicator system, resulting in poor recommendation effects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of sequence recommendation, and in particular to a sequence recommendation method and device. Background Art

[0002] With the rapid development of network technology, the amount of information consumers collect is exploding. In order for businesses to understand consumers and conduct effective marketing campaigns in the digital economy, they need to analyze consumer behavior. Because user interactions with items are naturally sequential, recommendation algorithms have emerged to leverage this sequential information.

[0003] Usually when studying consumer usage behavior, relevant technical personnel often use the Collaborative Filtering (CF) algorithm. Since this algorithm is based on observed user feedback on some items, it filters out items that match each user's personalized preferences. Therefore, once the algorithm lacks user feedback data on some items, it cannot recommend items that match the user's personalized preferences, resulting in poor recommendation effect.

[0004] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention

[0005] The embodiments of the present application provide a sequence recommendation method and apparatus to at least solve the technical problem that related recommendation technologies lack non-bottom-level indicator data in a multi-layer recommendation indicator system, resulting in poor recommendation effects.

[0006] According to one aspect of an embodiment of the present application, a sequence recommendation method is provided, comprising: obtaining a historical interaction sequence of a target object, and predicting preference information of the target object based on the historical interaction sequence, wherein the historical interaction sequence comprises: target object information, item information, and a sequence data set of the target object's interaction behavior with respect to items at each time step, and the preference information comprises the target object's preference score for each first item to be recommended in a set of recommended items; determining multiple groups of first random numbers based on the preference information, wherein each group of first random numbers in the multiple groups of first random numbers comprises: a first number of second items to be recommended that are ranked first in terms of the target object's preference score at a target time step; analyzing the first random numbers using an item preference recommendation model, and when the item preference recommendation model does not undergo a stationary distribution, determining a first target recommended item based on the first random number, and recommending the first target recommended item to the target object; when the item preference recommendation model undergoes a stationary distribution, using an approximate item preference prediction model to determine the target object's preference for similar items of the same category as the second item to be recommended, obtaining a second target recommended item, and recommending the second target recommended item to the target object.

[0007] Optionally, the interactive behavior sequence dataset includes a long-term sequence dataset and a short-term sequence dataset, and predicts the target object's preference information based on the historical interaction sequence, including: based on the long-term sequence dataset, using a matrix decomposition method to determine the target object's long-term preference score for each first item to be recommended; based on the short-term sequence dataset, determining the correlation between the first item to be recommended recommended to the target object at the target time step and the item with which the target object has interacted before the target time step, and calculating the target object's short-term preference score for each first item to be recommended based on the correlation; based on the long-term preference score and the short-term preference score, calculating the target object's preference score for each first item to be recommended.

[0008] Optionally, multiple groups of first random numbers are determined based on the preference information, including: sorting the target object's preference scores for the first items to be recommended at each time step in descending order, and determining a first number of second items to be recommended that are ranked first; and combining the target object with the corresponding second items to be recommended at each time step to obtain multiple groups of first random numbers.

[0009] Optionally, before adopting the item preference recommendation model to analyze the first random number, it also includes: determining the target load of the target thread pool at the target collection time based on the saturation of the working thread, the task saturation at the target collection time and the growth rate of the task buffer queue; when the target load is greater than a preset load threshold, adjusting the working parameters of the target thread pool; when the target load is not greater than the load threshold, determining that the target thread pool is the thread pool with the most empty threads, and determining that the empty threads in the target thread pool transmit multiple groups of first random numbers to the item preference prediction model.

[0010] Optionally, an item preference recommendation model is used to analyze the first random number, and when the item preference recommendation model does not undergo a stationary distribution, a first target recommended item is determined based on the first random number, including: constructing an item preference recommendation model based on a Markov chain; inputting the first random number into the item preference recommendation model using a target thread; determining whether the item preference recommendation model undergoes a stationary distribution; and when the item preference recommendation model does not undergo a stationary distribution, determining the first target recommended item based on the first random number.

[0011] Optionally, the item preference recommendation model is trained in the following manner: constructing an item preference recommendation model to be trained; dividing the second item to be recommended into multiple positive sample data sets and multiple negative sample data sets at each time step, wherein the positive sample data is the item data with which the target object has an interaction behavior, and the negative sample data is the item data with which the target object has not an interaction behavior; using a stochastic gradient descent algorithm to input the multiple positive sample data sets and the multiple negative sample data sets into the item preference recommendation model to be trained one by one, updating the model parameters of the item preference recommendation model, and obtaining a trained item preference recommendation model.

[0012] Optionally, when the item preference recommendation model undergoes a stationary distribution, an approximate item preference prediction model is used to determine the target object's preference for similar items of the same category as the second item to be recommended, and obtain the second target recommended item, including: when the item preference recommendation model undergoes a stationary distribution, an approximate item preference prediction model is used to determine whether the first random data is normal before the target collection time, wherein, when the first random data is normal before the target collection time, the target object's preference for similar items of the same category as the second item to be recommended is determined, and the second target recommended item is obtained; when the first random data is abnormal before the target collection time, it is determined to re-obtain the second random number from the preference information.

[0013] Optionally, when the first random data is normal before the target collection moment, the target object's preference for similar items of the same category as the second item to be recommended is determined to obtain the second target recommended item, including: obtaining the target object's preference characteristic value for similar items of the same category as the second item to be recommended; calculating, based on a conditional probability formula, a first probability that the target object prefers similar items of the same category as the second item to be recommended when the preference characteristic value is met, and a second probability that the target object does not prefer similar items of the same category as the second item to be recommended; when the first probability is greater than the second probability, determining that the target object prefers similar items of the same category as the second item to be recommended to obtain the second target recommended item; when the first probability is not greater than the second probability, determining that the target object does not prefer similar items of the same category as the second item to be recommended.

[0014] According to another aspect of an embodiment of the present application, a sequence recommendation device is also provided, including: an acquisition module, configured to acquire a historical interaction sequence of a target object, and predict preference information of the target object based on the historical interaction sequence, wherein the historical interaction sequence includes: target object information, item information, and a sequence data set of the target object's interaction behavior with respect to items at each time step, and the preference information includes the target object's preference score for each first item to be recommended in a set of recommended items; a determination module, configured to determine multiple groups of first random numbers based on the preference information, wherein each group of first random numbers in the multiple groups of first random numbers includes: a first number of second items to be recommended that are ranked first in terms of the target object's preference score at a target time step; a first recommendation module, configured to analyze the first random numbers using an item preference recommendation model, and when the item preference recommendation model does not undergo a stationary distribution, determine a first target recommended item based on the first random number, and recommend the first target recommended item to the target object; a second recommendation module, configured to determine the target object's preference for similar items of the same category as the second item to be recommended using an approximate item preference prediction model when the item preference recommendation model undergoes a stationary distribution, obtain a second target recommended item, and recommend the second target recommended item to the target object.

[0015] According to another aspect of an embodiment of the present application, an electronic device is further provided, comprising: a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to execute the above-mentioned sequence recommendation method through the computer program.

[0016] In an embodiment of the present application, the long-term and short-term preferences of the target object are learned through the target object's interactive behavior sequence, so as to find items with which the target object may interact in the future; through the item preference recommendation model, the target object's preference probability for the recommended item is obtained, so as to determine the first target recommended item to be recommended to the target object; and when the item preference recommendation model undergoes a stationary distribution, that is, when the target object's preference probability for all recommended items is consistent and loses its analytical value, an approximate item preference prediction model is used to determine the second target recommended item to be recommended to the target object, thereby solving the technical problem that the relevant recommendation technology lacks non-bottom-level indicator data in the multi-layer recommendation indicator system, resulting in poor recommendation effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0018] Figure 1 is a flowchart of an optional sequence recommendation method according to an embodiment of the present application;

[0019] Figure 2 It is a structural diagram of an optional sequence recommendation device according to an embodiment of the present application. DETAILED DESCRIPTION

[0020] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.

[0021] It should be noted that the terms "first", "second", etc. in the specification, claims, and drawings of the present application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.

[0022] In order to better understand the embodiments of the present application, some nouns or terms that appear in the description of the embodiments of the present application are first translated and explained as follows:

[0023] Factorizing Personalized Markov Chains for Next-Basket Recommendation (FPMC) algorithm: This algorithm includes two recommendation algorithms: MF (Matrix Factorization) and MC (Markov Chain). MF is used to model the preferences of target objects and items, that is, given the interactions between known target objects and items, to predict the preferences of target objects at other positions in the matrix. MC is used to model the sequential information of the interactions between target objects and items. Based on the transition matrix, MC predicts the target object interactions at the next moment through the interactions at the previous moment.

[0024] Social Bayesian Personalized Ranking (S-BPR) algorithm: This algorithm is a personalized ranking algorithm with implicit feedback and multi-faceted trust relationships, proposed based on Bayesian personalized ranking. This algorithm assumes that users like to recommend better items to other friends, thereby improving the accuracy of recommendations.

[0025] Markov Chain: Also known as a discrete-time Markov chain, it reflects a random process that transitions from one state to another in state space. This process requires a "memoryless" property, meaning that the probability distribution of the next state is determined solely by the current state and is unrelated to previous events in the time series. This specific type of "memorylessness" is called the Markov property. At each step in the Markov chain, the system changes from one state to another according to the probability distribution, or it can remain in the current state. This change in state is called a transition, and the probabilities associated with different state changes are called transition probabilities.

[0026] Bayesian prediction model: Bayesian prediction is an event sequence prediction method based on dynamic models. The Bayesian prediction model uses Bayesian statistics for prediction. It not only uses model information and data information, but also makes full use of prior information. Specifically, when making statistical inferences, the posterior distribution information is obtained through prior information, overall distribution information and sample information. Therefore, the Bayesian prediction model not only uses previous data information, but also incorporates information such as the decision maker's experience and judgment, and combines objective factors with subjective factors, which has more flexibility in dealing with the occurrence of abnormal situations.

[0027] Example 1

[0028] In recent years, with the rise of big data, research on consumer behavior analysis is booming. Consumer behavior analysis is regarded as one of the effective means for companies in digital economic forms such as e-commerce and social networks to understand their consumers and carry out marketing activities.

[0029] Because user interactions with items are naturally sequential, researchers often use collaborative filtering algorithms to analyze this sequential information and learn user preferences. However, this approach suffers from inaccurate learning of user preferences if there are gaps in the sequential information, leading to poor item recommendations.

[0030] In order to solve the above technical problems, an embodiment of the present application provides a sequential recommendation method, which learns the long-term and short-term preferences of a target object through the target object's interaction behavior sequence, thereby finding items with which the target object may interact in the future; through an item preference recommendation model, the target object's preference probability for the recommended items is obtained, thereby determining the first target recommended item to be recommended to the target object; and when the item preference recommendation model undergoes a stationary distribution, that is, when the target object's preference probability for all items to be recommended is consistent and loses its analytical value, an approximate item preference prediction model is used to determine the second target recommended item to be recommended to the target object.

[0031] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0032] Figure 1 is a flow chart of an optional sequence recommendation method according to an embodiment of the present application, such as Figure 1 As shown, the method includes at least steps S102-S108, wherein:

[0033] Step S102: Obtain the historical interaction sequence of the target object and predict the target object's preference information based on the historical interaction sequence, wherein the historical interaction sequence includes: target object information, item information, and a data set of the target object's interaction behavior sequence for the items at each time step; the preference information includes the target object's preference score for each first item to be recommended in the set of recommended items.

[0034] Specifically, the historical interaction sequence of the target object can be obtained by accessing the database. For example, the browsing history of user A on an e-commerce platform can be obtained by accessing the database, along with the chronological order of occurrence. User A's historical behavior includes various interactive behaviors such as "browsing," "searching," and "purchasing," and the items they interacted with include: "mobile phones," "earphones," "chargers," and other items.

[0035] In an embodiment of the present application, a sequence recommendation model can be constructed to analyze user behavior and item information in a time series to accurately recommend relevant items to users.

[0036] Because users and items interact several times over time, and in real life, user interests change over time, it is necessary to arrange user interactions with items in chronological order to obtain a dataset of user interaction behaviors with items in each historical time period (i.e., at each time step) in order to determine one or more items recommended to the user at the next time step. The interaction behavior sequence dataset can be divided into long-term and short-term sequence datasets based on time series.

[0037] As an optional embodiment of the present application, based on the long-term sequence data set, the matrix decomposition method is used to determine the long-term preference score of the target object for each first item to be recommended; based on the short-term sequence data set, the correlation between the first item to be recommended recommended to the target object at the target time step and the items that the target object has interacted with before the target time step is determined, and the short-term preference score of the target object for each first item to be recommended is calculated based on the correlation; based on the long-term preference score and the short-term preference score, the preference score of the target object for each first item to be recommended is calculated.

[0038] Therefore, based on the above embodiment, the preference score of user u for item i at the tth time step can be obtained, and the calculation formula is as follows:

[0039]

[0040] Among them, U u represents the potential feature vector of user u, Indicates items The latent feature vector of represents the potential feature vector of the item that user u interacted with at the previous time step t-1, represents the potential feature vector of the item to be recommended at the current time step t; and The traditional matrix decomposition method is used to determine the long-term preference score of user u for item i. The Markov chain is used to determine the short-term preference score of user u for item i based on the correlation between the item that user u interacted with in the previous time step t-1 and the item to be recommended in the current time step t. It can be understood that there is often a front-to-back dependency between user u's purchase of "mobile phone" in the previous time step and his search for "mobile phone film" in the next time step.

[0041] In addition, it is necessary to determine the objective function of the sequence recommendation model based on social Bayesian personalized ranking to control the user's preference for real items. Rating Higher preference score than negative sample item j Among them, negative sample items j can be defined as items that user u has not interacted with or items that user u has interacted with very few times. Negative sample items j cannot receive clear feedback from user u, which does not mean that the user does not prefer negative sample items j. Therefore, the objective function of the sequential recommendation model is expressed as follows:

[0042]

[0043] Step S104 : determining a plurality of groups of first random numbers based on the preference information, wherein each group of the plurality of groups of first random numbers includes: a first number of second items to be recommended that are ranked first in the preference score of the target object at the target time step.

[0044] Specifically, after obtaining the target object's preference score for the first item to be recommended at each time step through the sequential recommendation model, the preference scores of all the first items to be recommended at each time step can be sorted in descending order to determine the first number of second items to be recommended that are ranked first; the target object is combined with the corresponding second items to be recommended at each time step to obtain multiple groups of first random numbers, where the first number can be set according to actual conditions and is not limited here.

[0045] As another optional embodiment of the present application, a preference probability scheduling model for unpurchased items can be constructed, and the obtained multiple groups of first random numbers can be scheduled through the preference probability scheduling model and transmitted to the item preference recommendation model to complete the item recommendation.

[0046] Specifically, first, based on the saturation of the worker threads, the task saturation at the target collection time, and the task buffer queue growth rate, the target load of the target thread pool at the target collection time is calculated. The calculation formula is as follows:

[0047]

[0048] Where N is the number of worker threads in the thread pool at runtime, N max is the preset maximum number of threads, Describes the saturation of the worker thread; T cur is the number of tasks in the target acquisition time window, T pre is the number of tasks in the last acquisition window, Q is the size of the task buffer queue, Describe the current task saturation, Describes the growth rate of the task buffer queue. ξ is the weight coefficient of each parameter. ξ can be set according to actual conditions and is not restricted here.

[0049] When the load degree ω is greater than the preset load degree threshold w, the working parameters of the target thread pool are adjusted; when the load degree ω is not greater than the load degree threshold w, the target thread pool is determined to be the thread pool with the most empty threads, and the empty threads in the target thread pool are determined to transmit multiple groups of first random numbers to the item preference prediction model.

[0050] Step S106: Analyze the first random number using the item preference recommendation model. When the item preference recommendation model does not have a stable distribution, determine a first target recommended item based on the first random number, and recommend the first target recommended item to the target object.

[0051] As an optional implementation, the first target recommended item may be determined through steps S1061-S1062, where:

[0052] Step S1061, constructing an item preference recommendation model based on the Markov chain;

[0053] Step S1062: Use the target thread to input the first random number into the item preference recommendation model; determine whether the item preference recommendation model has a stable distribution; when the item preference recommendation model has not a stable distribution, determine the first target recommended item based on the first random number.

[0054] Since the core idea of ​​the Markov chain is to model the interaction behavior of user u at the current moment to determine the probability of interaction behavior at the next moment, the Markov transition probability matrix model is defined by the following formula:

[0055] x k+1 =x k +P

[0056] Among them, xk represents the interaction behavior vector of user u at time t = k, P represents the probability transfer matrix, x k+1 Represents the interaction behavior vector of user u at time t=k+1.

[0057] After a long period of time, the Markov process gradually reaches a stable state, independent of the initial state. At this point, the Markov chain reaches a stable state and outputs a stable state probability, also known as a stable probability. If the item preference recommendation model constructed based on the Markov chain does not achieve a stationary distribution, that is, it does not reach a stable state, the output item preference probability is valuable for analysis. The first random number can be input into the item preference recommendation model to obtain the user's preference probability for the second recommended item, thereby determining the first target recommended item to the user.

[0058] For example, assuming that the initial threshold for item preference recommendation and the initial probability of historical preference recommendation are [0.3, 0.7] respectively, and the current item preference recommendation threshold and the probability of preference recommendation shifting from high to low are [0.6, 0.4] respectively, and the current item preference recommendation threshold and the probability of preference recommendation shifting from low to high are [0.3, 0.7] respectively, then the Markov transition probability matrix can be used to calculate that the probability of the next item preference recommendation threshold shifting from high to low is: 0.3x0.6+0.3x0.7=0.39; the probability of the next item preference recommendation threshold shifting from low to high is: 0.3x0.4+0.7x0.7=0.61. Therefore, the probability of preference recommendation shifting from low to high for the next item preference recommendation threshold is [0.39, 0.61]. Since the initial probability of item preference recommendation from the historical preference recommendation is [0.3, 0.7], which is different from the probability of preference recommendation shifting from the item preference recommendation threshold to the next threshold [0.39, 0.61], it means that the item preference recommendation model has not achieved a stationary distribution.

[0059] Optionally, the item preference recommendation model can be trained through steps S1-S3:

[0060] Step S1, constructing an item preference recommendation model to be trained;

[0061] Step S2: Divide the second item to be recommended into multiple positive sample data sets and multiple negative sample data sets at each time step, wherein the positive sample data is the item data with which the target object has interacted, and the negative sample data is the item data with which the target object has not interacted;

[0062] In step S3, a stochastic gradient descent algorithm is used to input multiple positive sample data sets and multiple negative sample data sets into the item preference recommendation model to be trained one by one, and the model parameters of the item preference recommendation model are updated to obtain a trained item preference recommendation model.

[0063] Specifically, an item preference recommendation model to be trained is constructed, and multiple positive sample data sets and multiple negative sample data sets are determined from multiple groups (u, i), that is, the first random numbers, wherein the positive sample data set includes item data with which user u has interacted before the current time step t, and the negative sample data set includes item data with which user u has not interacted before the current time step t.

[0064] Then initialize the model parameters of the item preference recommendation model, wherein the model parameters obtained in step S102 are and The corresponding gradient of the model parameters of the item preference recommendation model is determined by the following formula, where:

[0065]

[0066]

[0067]

[0068]

[0069]

[0070]

[0071] in, represents the gradient corresponding to the potential feature vector of user u, Indicates items The gradient corresponding to the potential feature vector of represents the gradient corresponding to the potential feature vector of the negative sample item j, Indicates the items to be recommended at the current time step t The gradient corresponding to the potential feature vector of represents the gradient corresponding to the potential feature vector of the negative sample item j at the current time step t, Represents the gradient corresponding to the latent feature vector of the item that user u interacted with at the previous time step t-1.

[0072] For the gradient corresponding to each of the above model parameters, the stochastic gradient descent algorithm is used to update the model parameters of the item preference recommendation model. The update formulas are all referenced as follows:

[0073]

[0074] Among them, γ represents the learning rate, and γ is greater than 0. The larger γ is, the better the learning effect is.

[0075] Step S108: When the item preference recommendation model is in a stationary distribution, the similar item preference prediction model is used to determine the target object's preference for similar items of the same category as the second item to be recommended, obtain the second target recommended item, and recommend the second target recommended item to the target object.

[0076] Optionally, when the item preference recommendation model has a stationary distribution, that is, the preference probability obtained by the item preference recommendation model has no analytical value, an approximate item preference prediction model can be used to determine whether the first random data is normal before the target collection time, wherein,

[0077] When the first random data is abnormal before the target collection time, for example, the negative sample data in the first random number is missing, it is necessary to re-obtain the second random number from the preference information;

[0078] When the first random data is normal before the target collection time, the target object's preference for similar items of the same category as the second item to be recommended is determined to obtain the second target recommended item.

[0079] As an optional implementation, if negative sample item data is missing in the first random number, it is impossible to accurately recommend personalized items to the target object through the item preference recommendation model. In this case, the negative sample item data can be replaced by similar items of the same category as the item to be recommended. Specifically, the second target recommended item can be determined through steps S1081-S1084, where:

[0080] Step S1081: Obtain the preference feature value of user u for similar item j of the same category as the second item to be recommended, which is expressed as follows:

[0081] T={t1,t2,t3,...,t n}

[0082] Step S1082: Calculate, based on the conditional probability formula, the first probability that user u prefers similar items of the same category as the second item to be recommended, and the second probability that user u does not prefer similar items of the same category as the second item to be recommended, when the preference characteristic value is satisfied. The preference state is denoted as R1, and the non-preference state is denoted as R2.

[0083] When the preference characteristic value is satisfied, the first probability that user u prefers similar items of the same category as the second recommended item is:

[0084]

[0085] Wherein, P(T|R1) represents the probability that the characteristic value T appears in the preference subset in the multiple groups of first random numbers, and P(R1) represents the proportion of the preference subset in the multiple groups of first random numbers.

[0086] Similarly, according to the above calculation formula, when the preference characteristic value is satisfied, the second probability that user u does not prefer similar items of the same category as the second recommended item is obtained as follows:

[0087]

[0088] Wherein, P(T|R2) represents the probability that the characteristic value T appears in the non-preferred subset in the multiple sets of first random numbers, and P(R2) represents the proportion of the non-preferred subset in the multiple sets of first random numbers.

[0089] Step S1083: When the first probability P(R1|T) is greater than the second probability P(R2|T), it is determined that the user u prefers similar items of the same category as the second item to be recommended, and a second target recommended item is obtained.

[0090] Step S1084: When the first probability P(R1|T) is not greater than the second probability P(R2|T), it is determined that the user u does not prefer similar items of the same category as the second item to be recommended.

[0091] Since each eigenvalue t in Bayesian thinking i If they are independent of each other, then the first probability P(R1|T) of the preference state R1 and the second probability P(R2|T) of the non-preference state R2 are calculated according to the probability of relatively independent events, and then the two probabilities are compared. If P(R1|T)>P(R2|T), it is considered that user U prefers the similar item j; otherwise, it is considered that user U has no preference.

[0092] In an embodiment of the present application, the long-term and short-term preferences of the target object are learned through the target object's interactive behavior sequence, so as to find items with which the target object may interact in the future; through the item preference recommendation model, the target object's preference probability for the recommended item is obtained, so as to determine the first target recommended item to be recommended to the target object; and when the item preference recommendation model undergoes a stationary distribution, that is, when the target object's preference probability for all recommended items is consistent and loses its analytical value, an approximate item preference prediction model is used to determine the second target recommended item to be recommended to the target object, thereby solving the technical problem that the relevant recommendation technology lacks non-bottom-level indicator data in the multi-layer recommendation indicator system, resulting in poor recommendation effect.

[0093] Example 2

[0094] According to an embodiment of the present application, a sequence recommendation device for implementing the above sequence recommendation method is also provided. Figure 2 As shown, the sequence recommendation device at least includes an acquisition module 21, a determination module 22, a first recommendation module 23 and a second recommendation module 24, wherein:

[0095] The acquisition module 21 is used to obtain the historical interaction sequence of the target object and predict the target object's preference information based on the historical interaction sequence, wherein the historical interaction sequence includes: target object information, item information, and a data set of the target object's interaction behavior sequence for the item at each time step, and the preference information includes the target object's preference score for each first item to be recommended in the set of recommended items.

[0096] Specifically, the acquisition module 21 obtains the historical interaction sequence of the target object by accessing the database. For example, the browsing history of user A on the e-commerce platform is obtained by accessing the database and arranged in chronological order. User A's historical behavior includes various different interaction behaviors such as "browsing", "searching", and "purchasing", and the items interacted with include "mobile phone", "earphones", "charger", etc.

[0097] In the embodiment of the present application, a sequential recommendation model is constructed to analyze user behavior and item information in a time series to accurately recommend relevant items to users. Since users and items interact several times over time, and in real life, users' interests change over time, it is necessary to arrange the user's interaction behaviors with items in chronological order to obtain a sequence dataset of the user's interaction behaviors with items in each time period (i.e., each time step), so as to obtain one or more items recommended to the user in the next time step. The interaction behavior sequence dataset includes a long-term sequence dataset and a short-term sequence dataset.

[0098] As an optional embodiment of the present application, based on the long-term sequence data set, the matrix decomposition method is used to determine the long-term preference score of the target object for each first item to be recommended; based on the short-term sequence data set, the correlation between the first item to be recommended recommended to the target object at the target time step and the items that the target object has interacted with before the target time step is determined, and the short-term preference score of the target object for each first item to be recommended is calculated based on the correlation; based on the long-term preference score and the short-term preference score, the preference score of the target object for each first item to be recommended is calculated.

[0099] The determination module 22 is configured to determine multiple groups of first random numbers based on the preference information, wherein each group of the multiple groups of first random numbers includes: a first number of second items to be recommended that have a higher preference score ranking than the target object at the target time step.

[0100] Specifically, after obtaining the preference score of the target object for the first items to be recommended at each time step through the sequential recommendation model, the determination module 22 can sort the preference scores of all the first items to be recommended at each time step in order from high to low, and determine the first number of second items to be recommended that are sorted first; and combine the target object with the corresponding second items to be recommended at each time step to obtain multiple groups of first random numbers, where the first number can be set according to actual conditions and is not limited here.

[0101] As another optional embodiment of the present application, a preference probability scheduling model for unpurchased items can be constructed, and the obtained multiple groups of first random numbers can be scheduled through the preference probability scheduling model and transmitted to the item preference recommendation model to complete the item recommendation.

[0102] Specifically, first, based on the saturation of the worker threads, the task saturation at the target collection time, and the task buffer queue growth rate, the target load of the target thread pool at the target collection time is calculated. The calculation formula is as follows:

[0103]

[0104] Where N is the number of worker threads in the thread pool at runtime, N max is the preset maximum number of threads, Describes the saturation of the worker thread; T cur is the number of tasks in the target acquisition time window, T pre is the number of tasks in the last acquisition window, Q is the size of the task buffer queue, Describe the current task saturation, Describes the growth rate of the task buffer queue. ξ is the weight coefficient of each parameter. ξ can be set according to actual conditions and is not restricted here.

[0105] When the load degree ω is greater than the preset load degree threshold w, the working parameters of the target thread pool are adjusted; when the load degree ω is not greater than the load degree threshold w, the target thread pool is determined to be the thread pool with the most empty threads, and the empty threads in the target thread pool are determined to transmit multiple groups of first random numbers to the item preference prediction model.

[0106] The first recommendation module 23 is configured to analyze the first random number using an item preference recommendation model, determine a first target recommended item based on the first random number when the item preference recommendation model does not have a stable distribution, and recommend the first target recommended item to the target object.

[0107] As an optional implementation, the first recommendation module 23 may determine the first target recommended item in the following manner: constructing an item preference recommendation model based on a Markov chain; using a target thread to input a first random number into the item preference recommendation model; determining whether the item preference recommendation model undergoes a stationary distribution; and when the item preference recommendation model does not undergo a stationary distribution, determining the first target recommended item based on the first random number.

[0108] Optionally, the item preference recommendation model can be trained through steps S1-S3:

[0109] Step S1, constructing an item preference recommendation model to be trained;

[0110] Step S2: Divide the second item to be recommended into multiple positive sample data sets and multiple negative sample data sets at each time step, wherein the positive sample data is the item data with which the target object has interacted, and the negative sample data is the item data with which the target object has not interacted;

[0111] In step S3, a stochastic gradient descent algorithm is used to input multiple positive sample data sets and multiple negative sample data sets into the item preference recommendation model to be trained one by one, and the model parameters of the item preference recommendation model are updated to obtain a trained item preference recommendation model.

[0112] The second recommendation module 24 is used to determine the target object's preference for similar items of the same category as the second recommended item using the approximate item preference prediction model when the item preference recommendation model undergoes a stationary distribution, obtain a second target recommended item, and recommend the second target recommended item to the target object.

[0113] Optionally, when the item preference recommendation model is in a stationary distribution, that is, the preference probability obtained by the item preference recommendation model has no analytical value, the second recommendation module 24 may use an approximate item preference prediction model to determine whether the first random data is normal before the target collection time, wherein:

[0114] When the first random data is abnormal before the target collection time, for example, the negative sample data in the first random number is missing, it is necessary to re-obtain the second random number from the preference information;

[0115] When the first random data is normal before the target collection time, the target object's preference for similar items of the same category as the second item to be recommended is determined to obtain the second target recommended item.

[0116] As an optional implementation, if negative sample item data is missing in the first random number, it is impossible to accurately recommend personalized items to the target object through the item preference recommendation model. In this case, the negative sample item data can be replaced by similar items of the same category as the item to be recommended. Specifically, the second target recommended item can be determined in the following manner, wherein:

[0117] First, obtain the preference feature value of user u for the similar item j of the same category as the second recommended item, and its expression is as follows:

[0118] T={t1,t2,t3,...,t n}

[0119] Then, based on the conditional probability formula, calculate the first probability that user u prefers similar items in the same category as the second recommended item when the preference feature value is met, and the second probability that user u does not prefer similar items in the same category as the second recommended item. Here, the preference state is recorded as R1, and the non-preference state is recorded as R2.

[0120] When the preference characteristic value is satisfied, the first probability that user u prefers similar items of the same category as the second recommended item is:

[0121]

[0122] Wherein, P(T|R1) represents the probability that the characteristic value T appears in the preference subset in the multiple groups of first random numbers, and P(R1) represents the proportion of the preference subset in the multiple groups of first random numbers.

[0123] Similarly, according to the above calculation formula, when the preference characteristic value is satisfied, the second probability that user u does not prefer similar items of the same category as the second recommended item is obtained as follows:

[0124]

[0125] Wherein, P(T|R2) represents the probability that the characteristic value T appears in the non-preferred subset in the multiple sets of first random numbers, and P(R2) represents the proportion of the non-preferred subset in the multiple sets of first random numbers.

[0126] When the first probability P(R1|T) is greater than the second probability P(R2|T), it is determined that the user u prefers similar items of the same category as the second item to be recommended, and a second target recommended item is obtained.

[0127] When the first probability P(R1|T) is not greater than the second probability P(R2|T), it is determined that the user u does not prefer similar items of the same category as the second item to be recommended.

[0128] It should be noted that each module in the sequence recommendation device in the embodiment of the present application corresponds one-to-one to each implementation step of the sequence recommendation method in Example 1. Since a detailed description has been given in Example 1, some details not reflected in this embodiment can be referred to Example 1 and will not be repeated here.

[0129] Example 3

[0130] According to an embodiment of the present application, an electronic device is further provided, comprising: a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to execute the sequence recommendation method in Example 1 through the computer program.

[0131] Specifically, the processor is configured to execute the following steps through a computer program: obtaining a historical interaction sequence of the target object, and predicting the preference information of the target object based on the historical interaction sequence, wherein the historical interaction sequence includes: target object information, item information, and a data set of interaction behavior sequences of the target object for items at each time step, and the preference information includes the target object's preference score for each first item to be recommended in the set of recommended items; determining multiple groups of first random numbers based on the preference information, wherein each group of first random numbers in the multiple groups of first random numbers includes: a first number of second items to be recommended that are ranked first in terms of the target object's preference score at the target time step; analyzing the first random numbers using an item preference recommendation model, and when the item preference recommendation model does not undergo a stationary distribution, determining a first target recommended item based on the first random number, and recommending the first target recommended item to the target object; when the item preference recommendation model undergoes a stationary distribution, using an approximate item preference prediction model to determine the target object's preference for similar items of the same category as the second item to be recommended, obtaining a second target recommended item, and recommending the second target recommended item to the target object.

[0132] Optionally, the interactive behavior sequence dataset includes a long-term sequence dataset and a short-term sequence dataset, and predicts the target object's preference information based on the historical interaction sequence, including: based on the long-term sequence dataset, using a matrix decomposition method to determine the target object's long-term preference score for each first item to be recommended; based on the short-term sequence dataset, determining the correlation between the first item to be recommended recommended to the target object at the target time step and the item with which the target object has interacted before the target time step, and calculating the target object's short-term preference score for each first item to be recommended based on the correlation; based on the long-term preference score and the short-term preference score, calculating the target object's preference score for each first item to be recommended.

[0133] Optionally, before adopting the item preference recommendation model to analyze the first random number, it also includes: determining the target load of the target thread pool at the target collection time based on the saturation of the working thread, the task saturation at the target collection time and the growth rate of the task buffer queue; when the target load is greater than a preset load threshold, adjusting the working parameters of the target thread pool; when the target load is not greater than the load threshold, determining that the target thread pool is the thread pool with the most empty threads, and determining that the empty threads in the target thread pool transmit multiple groups of first random numbers to the item preference prediction model.

[0134] Optionally, an item preference recommendation model is used to analyze the first random number, and when the item preference recommendation model does not undergo a stationary distribution, a first target recommended item is determined based on the first random number, including: constructing an item preference recommendation model based on a Markov chain; inputting the first random number into the item preference recommendation model using a target thread; determining whether the item preference recommendation model undergoes a stationary distribution; and when the item preference recommendation model does not undergo a stationary distribution, determining the first target recommended item based on the first random number.

[0135] Optionally, when the item preference recommendation model undergoes a stationary distribution, an approximate item preference prediction model is used to determine the target object's preference for similar items of the same category as the second item to be recommended, and obtain the second target recommended item, including: when the item preference recommendation model undergoes a stationary distribution, an approximate item preference prediction model is used to determine whether the first random data is normal before the target collection time, wherein, when the first random data is normal before the target collection time, the target object's preference for similar items of the same category as the second item to be recommended is determined, and the second target recommended item is obtained; when the first random data is abnormal before the target collection time, it is determined to re-obtain the second random number from the preference information.

[0136] Optionally, when the first random data is normal before the target collection moment, the target object's preference for similar items of the same category as the second item to be recommended is determined to obtain the second target recommended item, including: obtaining the target object's preference characteristic value for similar items of the same category as the second item to be recommended; calculating, based on a conditional probability formula, a first probability that the target object prefers similar items of the same category as the second item to be recommended when the preference characteristic value is met, and a second probability that the target object does not prefer similar items of the same category as the second item to be recommended; when the first probability is greater than the second probability, determining that the target object prefers similar items of the same category as the second item to be recommended to obtain the second target recommended item; when the first probability is not greater than the second probability, determining that the target object does not prefer similar items of the same category.

[0137] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0138] In the above embodiments of the present application, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0139] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0140] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected to achieve the purpose of the present embodiment according to actual needs.

[0141] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0142] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program code.

[0143] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A sequence recommendation method, characterized in that: include: Obtain a historical interaction sequence of a target object, and predict preference information of the target object based on the historical interaction sequence, wherein the historical interaction sequence includes: target object information, item information, and a dataset of target object's interaction behavior sequences with respect to items at each time step, and the preference information includes the target object's preference score for each first item to be recommended in a set of items to be recommended; Determining a plurality of groups of first random numbers based on the preference information, wherein each group of the plurality of groups of first random numbers includes: a first number of second items to be recommended that are ranked first in the preference score of the target object at the target time step; Analyzing the first random number using an item preference recommendation model, and when the item preference recommendation model does not exhibit a stationary distribution, determining a first target recommended item based on the first random number, and recommending the first target recommended item to the target object; When the item preference recommendation model undergoes a stationary distribution, an approximate item preference prediction model is used to determine the target object's preference for similar items of the same category as the second item to be recommended, obtain a second target recommended item, and recommend the second target recommended item to the target object.

2. The method according to claim 1, characterized in that The interaction behavior sequence dataset includes a long-term sequence dataset and a short-term sequence dataset. Predicting the preference information of the target object based on the historical interaction sequence includes: Determining, based on the long-term sequence data set, the target subject's long-term preference score for each of the first items to be recommended using a matrix decomposition method; Determining, based on the short-term sequence dataset, a correlation between a first item to be recommended to the target subject at the target time step and items with which the target subject has interacted before the target time step, and calculating, based on the correlation, a short-term preference score of the target subject for each first item to be recommended; Based on the long-term preference score and the short-term preference score, the preference score of the target object for each of the first items to be recommended is calculated.

3. The method according to claim 1, characterized in that Determining multiple sets of first random numbers according to the preference information includes: sorting the preference scores of the target subjects for the first items to be recommended at each time step in descending order, and determining a first number of second items to be recommended that are ranked first; The target object is combined with the second recommended item corresponding to each time step to obtain the multiple groups of first random numbers.

4. The method according to claim 1, wherein Before analyzing the first random number using the item preference recommendation model, the method further includes: Determine the target load of the target thread pool at the target collection time based on the saturation of the working thread, the task saturation at the target collection time, and the growth rate of the task buffer queue; When the target load degree is greater than a preset load degree threshold, adjusting the working parameters of the target thread pool; When the target load degree is not greater than the load degree threshold, the target thread pool is determined to be the thread pool with the most empty threads, and the empty threads in the target thread pool are determined to transmit the multiple groups of first random numbers to the item preference prediction model.

5. The method according to claim 4, characterized in that Analyzing the first random number using an item preference recommendation model, and determining a first target recommended item based on the first random number when the item preference recommendation model does not exhibit a stationary distribution, including: Constructing the item preference recommendation model based on the Markov chain; Using the target thread to input the first random number into the item preference recommendation model; Determining whether the item preference recommendation model has a stationary distribution; When the item preference recommendation model does not have a stable distribution, a first target recommended item is determined according to the first random number.

6. The method according to claim 5, characterized in that The item preference recommendation model is trained in the following way: Build an item preference recommendation model to be trained; Dividing the second to-be-recommended items into multiple positive sample data sets and multiple negative sample data sets at each time step, wherein the positive sample data is the item data with which the target object has interacted, and the negative sample data is the item data with which the target object has not interacted; The multiple positive sample data sets and the multiple negative sample data sets are input into the item preference recommendation model to be trained one by one using a stochastic gradient descent algorithm, and the model parameters of the item preference recommendation model are updated to obtain the trained item preference recommendation model.

7. The method according to claim 1, characterized in that When the item preference recommendation model is in a stationary distribution, a similar item preference prediction model is used to determine the target subject's preference for similar items of the same category as the second item to be recommended, thereby obtaining a second target recommended item, including: When the item preference recommendation model is in a stationary distribution, an approximate item preference prediction model is used to determine whether the first random data is normal before the target collection time, wherein: When the first random data is normal before the target collection time, determining the target subject's preference for similar items of the same category as the second to-be-recommended item, and obtaining the second target recommended item; When the first random data is abnormal before the target collection time, it is determined to re-acquire a second random number from the preference information.

8. The method according to claim 7, characterized in that When the first random data is normal before the target collection time, determining the target subject's preference for similar items of the same category as the second to-be-recommended item to obtain the second target recommended item includes: Obtaining a preference characteristic value of the target subject for similar items of the same category as the second item to be recommended; Calculating, based on a conditional probability formula, a first probability that the target subject prefers similar items of the same category as the second item to be recommended, and a second probability that the target subject does not prefer similar items of the same category as the second item to be recommended, when the preference characteristic value is satisfied; When the first probability is greater than the second probability, determining that the target object prefers similar items of the same category as the second item to be recommended, and obtaining the second target recommended item; When the first probability is not greater than the second probability, it is determined that the target object does not prefer similar items of the same category as the second item to be recommended.

9. A sequence recommendation device, characterized in that: include: an acquisition module, configured to acquire a historical interaction sequence of a target object and predict preference information of the target object based on the historical interaction sequence, wherein the historical interaction sequence includes target object information, item information, and a dataset of interaction behavior sequences of the target object with respect to items at each time step, and the preference information includes a preference score of the target object for each first item to be recommended in a set of items to be recommended; a determination module, configured to determine a plurality of groups of first random numbers based on the preference information, wherein each group of the plurality of groups of first random numbers includes: a first number of second items to be recommended that are ranked first in the preference score of the target object at the target time step; a first recommendation module, configured to analyze the first random number using an item preference recommendation model, determine a first target recommended item based on the first random number when the item preference recommendation model does not exhibit a stationary distribution, and recommend the first target recommended item to the target object; The second recommendation module is used to use an approximate item preference prediction model to determine the target object's preference for similar items of the same category as the second item to be recommended when the item preference recommendation model undergoes a stationary distribution, obtain a second target recommended item, and recommend the second target recommended item to the target object.

10. An electronic device, characterized in that: include: A memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the sequence recommendation method according to any one of claims 1 to 8 through the computer program.

Citation Information

Patent Citations

  • Content-based mixed graph model image recommendation method

    CN107657043A

  • Product recommendation method and device

    WO2019223379A1