Product recommendation method, system, device and program product
Through the product recommendation method based on knowledge graph and DQN model, the problem of insufficient product recommendation accuracy in existing technologies is solved, more accurate and novel product recommendations are achieved, and the user experience is improved.
Patent Information
- Application Number
- CN202510725763.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-09-16
AI Technical Summary
Existing product recommendation methods lack accuracy and are prone to falling into the problem of "information cocoon" and cyclically recommending similar products.
Based on the knowledge graph, we analyze the interaction data between users, products, and packages, calculate the user preference index, recommend products and packages through the DQN model, and combine it with the dynamically updated knowledge graph to capture the latest behavioral changes, breaking away from the recommendation model that relies on single user behavior.
It improves the accuracy and freshness of recommendations, avoids the "information cocoon" phenomenon, and enhances the intelligence of the recommendation system and user experience.
Smart Images

Figure CN120655374A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a product recommendation method, system, device, and program product. Background Art
[0002] Existing product recommendation methods primarily rely on historical user behavior data (such as browsing and purchase history) to generate recommendation lists through collaborative filtering or content matching algorithms. However, these methods still suffer from significant accuracy deficiencies. Collaborative filtering algorithms, overly reliant on historical user behavior data, can easily fall into an "information cocoon," repeatedly recommending similar products and narrowing user interests.
[0003] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute prior art known to ordinary technicians in the field. Summary of the Invention
[0004] The present disclosure provides a product recommendation method, system, device and program product, which at least to a certain extent overcomes the problem of insufficient accuracy of product recommendations in related technologies and the tendency to fall into the "information cocoon" problem of cyclically recommending similar products.
[0005] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by practice of the present disclosure.
[0006] According to one aspect of the present disclosure, a product recommendation method is provided, including: based on a knowledge graph at a current moment and a knowledge graph at a previous moment, determining users whose interaction data with commodities and packages has changed, and obtaining a first user set; the knowledge graph is constructed based on interaction logs between users and commodities and packages, and the knowledge graph is used to describe the relationship between users and commodities, the relationship between users and packages, and the relationship between commodities and packages; based on the preference index of each user for each commodity and the preference index for each package among multiple current users, calculating the similarity between multiple users, and determining the top M users ranked in descending order of similarity for each user to constitute a second user set associated with the user; if the second user set associated with a user is a subset of the first user set, the user is determined as a user to be recommended; based on the preference index of each user in the second user set associated with the user to be recommended for each commodity and the preference index for each package, determining the commodity and / or package recommended for the user to be recommended.
[0007] In one embodiment of the present disclosure, the knowledge graph is constructed based on the user's purchase records of goods, the user's purchase records of packages, the user's browsing records of goods, and the user's browsing records of packages.
[0008] In one embodiment of the present disclosure, the method also includes: determining the user's first product index for the product based on the user's purchase record of the product and the user's browsing record of the product, the size of the first product index is positively correlated with the number of times the user purchases the product, and the size of the first product index is positively correlated with the number of times the user browses the product; determining the user's second product index for the product based on the user's purchase record of the package containing the product and the user's browsing record of the package containing the product, the size of the second product index is positively correlated with the number of times the user purchases the package containing the product, and the size of the second product index is positively correlated with the number of times the user browses the package containing the product; based on the first product index and the second product index, determining the user's preference index for the product.
[0009] In one embodiment of the present disclosure, the method also includes: determining the user's first package index for the package based on the user's purchase record of the package and the user's browsing record of the package, the size of the first package index is positively correlated with the number of times the user purchases the package, and the size of the first package index is positively correlated with the number of times the user browses the package; determining the user's second product index for the package based on the user's purchase record of the products included in the package and the user's browsing record of the products included in the package, the size of the second product index is positively correlated with the number of times the user purchases the products included in the package, and the size of the second product index is positively correlated with the number of times the user browses the products included in the package; based on the first package index and the second package index, determining the user's preference index for the package.
[0010] In one embodiment of the present disclosure, determining the recommended product and / or package for the user to be recommended based on the preference index of each user in the second user set associated with the user to be recommended for each product and the preference index of each package includes:
[0011] For each user in the second user set associated with the user to be recommended, determine the top J products ranked from high to low in terms of user preference index for products, and the top K packages ranked from high to low in terms of user preference index for packages; concatenate the preference indexes of M×J products, M×J product vectors, the preference indexes of M×K packages, and the M×K package vectors, and input them into the DQN model as the current state to obtain the products and / or packages recommended for the user to be recommended; wherein, the product vectors and package vectors are obtained by vectorizing each product and each package in the knowledge graph.
[0012] In one embodiment of the present disclosure, the method further includes: after recommending goods and / or packages to the user to be recommended, determining a reward for the DQN model based on whether the user to be recommended browses and purchases the goods and packages after being recommended; constructing training samples based on the current state, the goods and / or packages recommended to the user to be recommended, the state and reward at the next moment; placing the training samples in a sample pool, and training and updating the DQN model based on the training samples in the sample pool.
[0013] In one embodiment of the present disclosure, if DQN recommends product j and package k to user i, the reward r t for:
[0014]
[0015] in, represents the preference index of user i for product j at time t+1, Represents the preference index of user i for package k at time t+1.
[0016] According to another aspect of the present disclosure, a product recommendation device is provided, including a data comparison module, a similarity calculation module, a set comparison module, and a product determination module.
[0017] A data comparison module is used to determine users whose interaction data with products and packages has changed based on the current knowledge graph and the previous knowledge graph, thereby obtaining a first user set. The knowledge graph is constructed based on the interaction logs between users, products, and packages, and is used to describe the relationships between users and products, users and packages, and products and packages.
[0018] A similarity calculation module is used to calculate the similarity between multiple users based on the preference index of each user for each product and the preference index of each package among the current multiple users, and determine the top M users ranked from high to low in similarity to each user to form a second user set associated with the users;
[0019] a set comparison module, configured to determine a user as a user to be recommended if the second user set associated with a user is a subset of the first user set;
[0020] The product determination module is used to determine the products and / or packages recommended to the user to be recommended based on the preference index of each user in the second user set associated with the user to be recommended to each product and the preference index of each package.
[0021] According to another aspect of the present disclosure, an electronic device is provided, including: a memory for storing instructions; and a processor for calling the instructions stored in the memory to implement the above-mentioned product recommendation method.
[0022] According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which computer instructions are stored. When the computer instructions are executed by a processor, the above-mentioned product recommendation method is implemented.
[0023] According to another aspect of the present disclosure, a computer program product is provided. The computer program product stores instructions, which, when executed by a computer, enable the computer to implement the above-mentioned product recommendation method.
[0024] According to another aspect of the present disclosure, a chip is provided, comprising at least one processor and an interface; the interface is used to provide program instructions or data to the at least one processor; and the at least one processor is used to execute program instructions to implement the above-mentioned product recommendation method.
[0025] The product recommendation method, system, device and program product provided by the embodiments of the present disclosure can simultaneously capture explicit behaviors (such as purchasing and browsing) and implicit relationships (such as the structured association between users, products and packages) to improve the accuracy of recommendations. By using a dynamically updated knowledge graph, the latest changes in user behavior can be captured. The user to be recommended is similar to the above-mentioned user with behavioral changes. The products (including products and recommendations) favorited by the above-mentioned user with behavioral changes are used to determine the products recommended for the user to be recommended. This breaks away from the mindset of recommending products to users based solely on the user's own browsing and purchasing behaviors, is not easily trapped in an "information cocoon", and can improve the freshness of recommendations.
[0026] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0028] Obviously, the drawings described below are only some embodiments of the present disclosure. A person skilled in the art can obtain other drawings based on these drawings without any creative effort.
[0029] Figure 1 A flowchart of a product recommendation method according to an embodiment of the present disclosure is shown;
[0030] Figure 2 A schematic diagram of a knowledge graph in an embodiment of the present disclosure is shown;
[0031] Figure 3 Shows a flow chart of another product recommendation method according to an embodiment of the present disclosure;
[0032] Figure 4 A flowchart of another product recommendation method according to an embodiment of the present disclosure is shown;
[0033] Figure 5 A flowchart of another product recommendation method according to an embodiment of the present disclosure is shown;
[0034] Figure 6 A schematic diagram of a product recommendation system according to an embodiment of the present disclosure is shown;
[0035] Figure 7 A structural block diagram of an electronic device in an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0036] In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. The components of the embodiments of the present disclosure generally described and shown in the drawings herein can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the disclosure for which protection is sought, but merely represents selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present disclosure.
[0037] The inventors discovered that traditional recommendation systems fail to analyze users' personalized preferences and behavior patterns by leveraging various information, such as relationships between products, relationships between users and products, and relationships between users. With the development of neural networks, although some methods have explored leveraging this correlation information to recommend products to users, these methods primarily recommend products based on the interaction history of a single user, without considering the relationships between multiple users. Furthermore, some current methods primarily analyze and recommend individual products. Operators, in addition to selling individual products to users, often package several products together and sell them to users. Existing methods do not consider recommending multiple products in a package.
[0038] The defects of the above solutions and the proposed solutions are the results obtained by the inventor after practice and careful research. Therefore, the discovery process of the above problems and the solutions proposed in the present disclosure for the above problems below should be the contributions made by the inventor to the present disclosure during the disclosure process.
[0039] It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) must comply with the requirements of relevant laws, regulations and relevant provisions. Before using the technical solutions disclosed in the various embodiments of this disclosure, the type, scope of use, and usage scenarios of the personal information involved in this disclosure should be informed to the user in an appropriate manner in accordance with relevant laws and regulations, and the user's authorization should be obtained.
[0040] This exemplary implementation is described in detail below with reference to the accompanying drawings and examples.
[0041] First, an embodiment of the present disclosure provides a product recommendation method, which can be executed by any electronic device with computing and processing capabilities.
[0042] Figure 1 A flow chart of a product recommendation method according to an embodiment of the present disclosure is shown as follows: Figure 1 As shown, the product recommendation method provided in the embodiment of the present disclosure includes S101-S104.
[0043] In S101, based on the knowledge graph at the current moment and the knowledge graph at the previous moment, the users whose interaction data with the products and packages have changed are determined to obtain a first user set; the knowledge graph is constructed based on the interaction logs between users and products and packages, and the knowledge graph is used to describe the relationship between users and products, the relationship between users and packages, and the relationship between products and packages.
[0044] In some embodiments, the knowledge graph is constructed based on a user's purchase history of products, purchase history of packages, browsing history of products, and browsing history of packages. The knowledge graph is used to describe the relationships between users and products, users and packages, products and packages, products and products, and users and users.
[0045] In some embodiments, as Figure 2 As shown in Figure 1, the knowledge graph contains three entities: users, products, and packages. Since the future cannot be predicted, the knowledge graph changes dynamically over time. For example, user 1 has no relationship with product b at time t, but user 1 may browse product b at time t+1, so the knowledge graph changes at time t+1. In subsequent steps, recommendations are only made based on the knowledge graph constructed with the current information. The knowledge graph at time t is denoted as G t .
[0046] There are two relationships between the user entity and the product: browse and buy, that is, users can browse and buy products, such as Figure 2In the example, user 1 purchases package A and browses product B at the same time. There may be multiple browsing and purchasing between the same pair of user and product nodes. Therefore, the embodiment of the present disclosure uses the attributes on the relationship (i.e., the edge of the knowledge graph) to identify the relationship between the user and the product. Describe the number of times user i browses product j at time t, using Describes the number of times user i purchases product j at time t. Each time user i browses or purchases product j, the corresponding or Just add 1.
[0047] There is also a browse and purchase relationship between users and packages, that is, users can browse and purchase packages. Similarly, using the attributes on the relationship Describes the number of times user i browses package k at time t. Describes the number of times user i purchases package k at time t. Each time user i browses or purchases package k, the corresponding or The value is increased by 1.
[0048] There is an "include" relationship between the product entity and the package entity, that is, the package includes several products, such as Figure 2 In the example, package A includes product a and product b. It should be noted that both products and packages can be called products.
[0049] In the knowledge graph, there is no direct relationship between products and users, but there is an implicit connection. For example, user 2 and user 3 both browse package B, so user 2 and user 3 have an indirect connection.
[0050] In S102, based on the preference index of each user for each product and the preference index for each package among the current multiple users, the similarity between the multiple users is calculated, and the top M users ranked from high to low in similarity to each user are determined to constitute a second user set associated with the users.
[0051] A user's preference index for a product indicates how much the user likes the product. The user's preference index for a product is positively correlated with the number of times the user browses the product, and the user's preference index for a product is positively correlated with the number of times the user purchases the product. Similarly, a user's preference index for a package indicates how much the user likes the package. The user's preference index for a package is positively correlated with the number of times the user browses the package, and the user's preference index for a package is positively correlated with the number of times the user purchases the package. In addition, the embodiments of the present disclosure also refer to the relationship between products and packages when determining the user's preference index for each product and the preference index for each package.
[0052] In S103 , if the second user set associated with a user is a subset of the first user set, the user is determined as a user to be recommended.
[0053] In S104, based on the preference index of each user in the second user set associated with the user to be recommended to each product and the preference index of each package to each user, the product and / or package recommended to the user to be recommended is determined.
[0054] The disclosed embodiments can simultaneously capture explicit behaviors (such as purchasing and browsing) and implicit relationships (such as structured associations between users, products, and packages) to improve recommendation accuracy. By using a dynamically updated knowledge graph, the latest changes in user behavior can be captured. The users to be recommended are similar to the users with behavioral changes. The products (including products and recommendations) favored by the users with behavioral changes are used to determine the products recommended for the users to be recommended. This breaks away from the mindset of recommending products to users based solely on their own browsing and purchasing behaviors, making it less likely to fall into an "information cocoon" and improving the freshness of recommendations.
[0055] In some embodiments, calculating a user's preference index for a product may include: determining the user's first product index for the product based on the user's purchase record of the product and the user's browsing record of the product, the size of the first product index being positively correlated with the number of times the user purchases the product, and the size of the first product index being positively correlated with the number of times the user browses the product; determining the user's second product index for the product based on the user's purchase record of a package containing the product and the user's browsing record of the package containing the product, the size of the second product index being positively correlated with the number of times the user purchases the package containing the product, and the size of the second product index being positively correlated with the number of times the user browses the package containing the product; determining the user's preference index for the product based on the first product index and the second product index.
[0056] Similarly, calculating a user's preference index for a product may include: determining the user's first package index for the package based on the user's purchase record of the package and the user's browsing record of the package, the size of the first package index being positively correlated with the number of times the user purchases the package, and the size of the first package index being positively correlated with the number of times the user browses the package; determining the user's second product index for the package based on the user's purchase record of the products included in the package and the user's browsing record of the products included in the package, the size of the second product index being positively correlated with the number of times the user purchases the products included in the package, and the size of the second product index being positively correlated with the number of times the user browses the products included in the package; determining the user's preference index for the package based on the first package index and the second package index.
[0057] In the above embodiment, users' ratings of products and packages are divided into "direct ratings" and "indirect ratings", namely the first product index (direct rating) and the second product index (indirect rating), the first package index (direct rating) and the second package index (indirect rating).
[0058] In some embodiments, the preference index of user i for product j at time t is recorded as From a practical point of view, if a user browses and purchases a product multiple times, the user's preference index for the product should be higher, and the user's preference for the product is higher. This part is called the first product index (direct score), recorded as Moreover, if the user browses and purchases the package containing the product multiple times, the user's preference index for the product should also be higher. This part is called the second product index (indirect score), recorded as Finally, user i’s rating of product j at time t is recorded as for:
[0059]
[0060] Similarly, user i’s rating of package k at time t is recorded as It is also divided into two parts: the first package index (direct rating) and the second package index (indirect rating). Among them, the first package index (direct rating) directly affected by the user's browsing and purchasing packages is recorded as The second package index (indirect score) indirectly affected by users browsing and purchasing products is recorded as but:
[0061]
[0062] Calculate the user's direct ratings of products and packages, namely the first product index (direct rating) and the first package index (direct rating).
[0063] The first product index (direct rating) of user i for product j at time t is directly affected by the number of times the user browses and purchases the product. The formula is as follows:
[0064]
[0065] in, Indicates the weight of converting the number of product browsing times into the number of purchases (can be manually specified in advance). represents the number of times user i browses product j, represents the number of times user i purchases product j. According to the above formula, the more a user browses and purchases a product, the higher the user's preference index for the product.
[0066] The first package index (direct score) of user i for package k at time t is directly affected by the number of times the user browses and purchases the package. Similarly, the formula is as follows:
[0067]
[0068] in, Indicates the weight of the number of package browsing converted into the number of purchases (can be manually specified in advance). Indicates the number of times user i browses package k, represents the number of times user i purchases package k. According to the above formula, the more times a user browses and purchases a package, the higher the user's preference index for that package.
[0069] Calculate the user's indirect ratings of products and packages, namely the second product index (indirect rating) and the second package index (indirect rating).
[0070] The second product index (indirect rating) of user i for product j at time t is indirectly affected by the number of times the user browses and purchases the relevant package. When a user browses or purchases a package, the user's evaluation of the package will indirectly affect all the products included in the package. Here, it is considered that the user's first package index (direct rating) of the package will evenly affect the user's second product index (indirect rating) of the products in the package, that is:
[0071]
[0072] Among them, N k represents the set of products included in package k, |N k | represents the number of items included in package k. The above formula means that the impact of a user purchasing or browsing a package k on all the items in the package is that the user's first package index (direct rating) of the package will be evenly distributed to all the items in the package as the second product index (indirect rating), that is, The second product index (indirect rating) of user i for product j at time t is the sum of the second package indexes (indirect ratings) of all packages in which the product is located, that is,
[0073] Similarly, user i's second package index (indirect rating) for package k at time t is indirectly affected by the number of times the user browses and purchases related products. When a user browses or purchases a product, the user's first product index (direct rating) for the product will indirectly affect the user's preference index for the package, that is:
[0074]
[0075] Among them, N k represents the set of products included in package k, |N k | represents the number of items included in package k. The above formula actually means that user i's second package index (indirect rating) for package k at time t is the average of the first product indexes (direct ratings) of all items in the package.
[0076] In some embodiments, when the knowledge graph Gt Updated to G t+1 When the user updates the number of browsing and purchases of the product or package at time t, the preference index of the product or package is gradually updated. Here, only the preference index of the product or package involved in the knowledge graph update is updated, and there is no need to update the preference index of all users for all products and packages.
[0077] The process of calculating the similarity between multiple users in S102 is described below.
[0078] In the embodiment of the present disclosure, the similarity between users can also be called user preference similarity, which is used to describe the similarity of users' preferences for products and packages. This method only needs to change the similarity of a small number of related user nodes when the knowledge graph is dynamically updated, avoiding large-scale updates of user preference similarity. Specifically, the products that have appeared in each knowledge graph are numbered as 1, 2, ..., j, ..., and the packages that have appeared in the knowledge graph are numbered as 1, 2, ..., k, .... According to the above description, the preference index of user i for all the products that have appeared at time t is The preference index for all packages that have appeared at time t is Therefore, the user's preference index for all products and packages can be spliced into a vector:
[0079]
[0080] The similarity between two users is measured by the following coefficient to describe the user preference similarity, that is, the similarity between user p and user q is:
[0081]
[0082] Among them, S p and S q Represent the preference index vectors of user p and user q respectively, ||·||2 represents the two-norm, that is, S p With S q In this similarity function, when S p and S q When they are completely consistent, sim(p,q)=1, and the greater the difference in the preference index of user p and user q for products and packages, the lower the similarity sim(p,q).
[0083] The above similarity function is used in the knowledge graph from G t Updated to G t+1When updating the knowledge graph, only the similarity of users who have changed at the current moment needs to be updated. Specifically, when the knowledge graph is updated, for users who have not interacted with the product or package, the preference index of these users for the existing products and packages remains unchanged. According to the calculation process of sim(p,q), the Euclidean distance between these users who have not interacted with the product or package remains unchanged. p -S q Since ||2 remains unchanged, the similarity remains unchanged, so there's no need to update sim(p,q). For users who have a new interaction with a product or package, we first update the user's preference index. Then, based on the similarity calculation formula above, we update the similarity between that user and all other users. This similarity calculation method avoids the need to update the similarity between all users on a large scale when updating the knowledge graph, reducing computational complexity.
[0084] In some embodiments, as Figure 3 As shown, based on the preference index of each user in the second user set associated with the user to be recommended to each product and the preference index of each package, the product and / or package recommended to the user to be recommended is determined, including S301-S302.
[0085] In S301, for each user in the second user set associated with the user to be recommended, determine the top J products ranked by user preference index from high to low, and the top K packages ranked by user preference index from high to low;
[0086] In S302, the preference indexes of M×J products, M×J product vectors, the preference indexes of M×K packages, and M×K package vectors are concatenated and input into the DQN (Deep Q Network) model as the current state to obtain the products and / or packages recommended to the user to be recommended; among them, the product vectors and package vectors are obtained by vectorizing each product and each package in the knowledge graph.
[0087] In some embodiments, as Figure 4 As shown, based on the preference index of each user in the second user set associated with the user to be recommended for each product and the preference index of each package, the products and / or packages recommended to the user to be recommended are determined to include S401-S406, wherein S401-S402 are similar to S301-S302 above and will not be repeated here.
[0088] In S403, recommending products and / or packages to the user to be recommended;
[0089] In S404, after recommending the product and / or package to the user to be recommended, the reward for the DQN model is determined based on the browsing and purchase of the product and package by the user to be recommended;
[0090] In S405, a training sample is constructed based on the current state, the recommended product and / or package for the user to be recommended, the state at the next moment, and the reward;
[0091] In S406 , the training samples are placed in a sample pool, and the DQN model is trained and updated based on the training samples in the sample pool.
[0092] In some embodiments, if DQN recommends product j and package k to user i, the reward r t for:
[0093]
[0094] in, represents the preference index of user i for product j at time t+1, Represents the preference index of user i for package k at time t+1.
[0095] In this embodiment, a DQN (Deep Q Network) model is trained to recommend products and packages to users. The state function, action function, and reward function are defined as follows:
[0096] When recommending products and packages for a specific user, the high preference index products and packages of users with high similarity to the user are used as state input into the DQN. Specifically, take the top M users with the highest similarity, and for each user, take the top J products with the highest preference index, and the top K packages with the highest preference index, and input the scores of these M×J products and M×K packages into the DQN. At this time, DQN cannot know which products and packages in the knowledge graph these J products and K packages specifically correspond to, so it is necessary to first vectorize each product and package in the knowledge graph, and use the vectors of products and packages as input to the DQN. In some embodiments, the position encoding method can be used here to vectorize products and packages: the vector encoding even digits of the product and package numbered i are:
[0097] PE 2ζ (i) = sin(i / 10000 2ζ / L )
[0098] The odd bits of the vector encoding of the product and package numbered i are:
[0099] PE 2ζ+1 (i) = cos(i / 10000 (2ζ+1) / L )
[0100] Where L represents the number of encoding dimensions.
[0101] The M×J product ratings, M×J product vectors, M×K package ratings and M×K package vectors are concatenated as state s t Enter DQN.
[0102] Action a t : The DQN output is the recommended product or package, and the action space is the input J products and K packages.
[0103] The reward given to the reinforcement learning model DQN is determined based on the browsing and purchase of products and packages by user i at time t. Specifically, if DQN recommends product j and package k to user i, the reward r t for:
[0104]
[0105] That is, whether user i has sufficient preference for product j and package k.
[0106] After defining the state, actions, and rewards of DQN, you can recommend products and packages to users based on the current DQN, then update the knowledge graph based on user feedback, update the DQN training sample pool, and train DQN.
[0107] Figure 5 A flow chart of a product recommendation method according to an embodiment of the present disclosure is shown as follows: Figure 5 As shown, at time t, the users who need to update the recommended products and packages at the current time are calculated. Based on the knowledge graph G t and knowledge graph G t-1 First, calculate the change in each user's preference index for products and packages, mark the users whose preference index has changed, and record it as set Y t , which is the first user set mentioned above. Then, according to the method introduced above, the top M users with the highest similarity to each user in the knowledge graph are calculated. These M users correspond to the second user set mentioned above. If user i prefers the top M users with the highest similarity in set Y t , then user i is marked as a "user to be recommended". Traverse each user in the knowledge graph and determine whether it belongs to the "user to be recommended". If it is a user to be recommended, put it into the user set to be recommended.
[0108] At time t, based on the knowledge graph G t According to the state definition above, obtain the M×J product preference indexes, M×J product vectors, M×K package preference indexes and M×K package vectors of the specified recommended user, and concatenate them as the state s t Input DQN and get DQN output action a t , and based on a t Recommend products and packages to users.
[0109] At time t+1, based on the knowledge graph G t+1 According to the state definition above, the M×J product preference indexes, M×J product vectors, M×K package preference indexes and M×K package vectors of the specified recommended user are concatenated to obtain the state s t+1 Then, based on the reward definition in the previous article, the action reward r at time t is calculated t . At this time, we get a training sample (s t ,a t ,s t+1 ,r t ) can be added to the sample pool for DQN training updates.
[0110] After recommending products and packages to all users to be recommended and obtaining training samples, use the samples in the sample pool to train and update the DQN, and then enter the next moment and repeat the previous steps.
[0111] The disclosed embodiments can improve user experience, increase product sales, and provide enterprises with more precise marketing strategies by building a more accurate, intelligent, and efficient product recommendation system.
[0112] In the embodiments of the present disclosure, the terms “first,” “second,” and “third” are used for descriptive purposes only and should not be understood as indicating or implying relative importance.
[0113] In this disclosure, the term "and / or" simply describes an association relationship between related objects, indicating that three possible relationships exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this document generally indicates that the related objects are in an "or" relationship.
[0114] Furthermore, although the steps of the methods of the present disclosure are depicted in a particular order in the drawings, this does not require or imply that the steps must be performed in this particular order, or that all illustrated steps must be performed to achieve desired results.
[0115] In some embodiments, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0116] Based on the same inventive concept, the present disclosure also provides a product recommendation system. Figure 6 As shown, the product recommendation system includes a data comparison module 601 , a similarity calculation module 602 , a set comparison module 603 and a product determination module 604 .
[0117] Data comparison module 601 is used to determine users whose interaction data with products and packages has changed based on the current knowledge graph and the previous knowledge graph, and obtain a first user set; the knowledge graph is constructed based on the interaction logs between users and products and packages, and the knowledge graph is used to describe the relationship between users and products, the relationship between users and packages, and the relationship between products and packages;
[0118] A similarity calculation module 602 is configured to calculate the similarity between multiple users based on the preference index of each user for each product and the preference index of each package among the current multiple users, and determine the top M users ranked by similarity from high to low to form a second user set associated with the users;
[0119] A set comparison module 603 is configured to determine a user as a user to be recommended if the second user set associated with the user is a subset of the first user set;
[0120] The product determination module 604 is configured to determine the product and / or package recommended to the user to be recommended based on the preference index of each user in the second user set associated with the user to be recommended to each product and the preference index of each package.
[0121] In some embodiments, the knowledge graph is constructed based on the user's purchase records of goods, the user's purchase records of packages, the user's browsing records of goods, and the user's browsing records of packages.
[0122] In some embodiments, the product recommendation system further includes a product preference calculation module. The product preference calculation module is configured to determine a first product index of a user for a product based on the user's purchase history and the user's browsing history of the product, wherein the magnitude of the first product index is positively correlated with the number of times the user purchased the product and the magnitude of the first product index is positively correlated with the number of times the user browsed the product; determine a second product index of a user for a product based on the user's purchase history and the user's browsing history of the package containing the product, wherein the magnitude of the second product index is positively correlated with the number of times the user purchased the package containing the product and the magnitude of the second product index is positively correlated with the number of times the user browsed the package containing the product; and determine the user's preference index for the product based on the first product index and the second product index.
[0123] In some embodiments, the product recommendation system further includes a package preference calculation module. The package preference calculation module is configured to determine a first package index of the user for the package based on the user's purchase records and the user's browsing records of the package, wherein the magnitude of the first package index is positively correlated with the number of times the user purchased the package and the magnitude of the first package index is positively correlated with the number of times the user browsed the package; determine a second product index of the user for the package based on the user's purchase records and the user's browsing records of the products included in the package, wherein the magnitude of the second product index is positively correlated with the number of times the user purchased the products included in the package and the magnitude of the second product index is positively correlated with the number of times the user browsed the products included in the package; and determine the user's preference index for the package based on the first package index and the second package index.
[0124] In some embodiments, the product determination module 604 is used to determine, for each user in the second user set associated with the user to be recommended, the top J products ranked from high to low in terms of user preference index for the products, and the top K packages ranked from high to low in terms of user preference index for the packages; concatenate the preference indexes of M×J products, M×J product vectors, the preference indexes of M×K packages, and the M×K package vectors, and input them into the DQN model as the current state to obtain the products and / or packages recommended for the user to be recommended; wherein the product vectors and package vectors are obtained by vectorizing each product and each package in the knowledge graph.
[0125] In some embodiments, the product determination module 604 is further used to determine the reward for the DQN model after recommending products and / or packages to the user to be recommended, based on the browsing and purchase of products and packages by the user to be recommended after being recommended; construct training samples based on the current state, the products and / or packages recommended to the user to be recommended, the state and reward at the next moment; place the training samples in the sample pool, and train and update the DQN model based on the training samples in the sample pool.
[0126] The concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0127] Regarding the product recommendation system in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the product recommendation method, and will not be elaborated here.
[0128] It should be noted that although several modules or units of the device for action execution are mentioned in the above detailed description, such division is not mandatory.
[0129] In fact, according to the embodiment of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0130] Some of the blocks shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0131] Refer to the following Figure 7 To describe the electronic device provided by the embodiment of the present disclosure. Figure 7 The electronic device 700 shown is merely an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0132] Figure 7 FIG. 1 shows a schematic diagram of the architecture of an electronic device 700 provided by an embodiment of the present disclosure. Figure 7 As shown, the electronic device 700 includes but is not limited to: at least one processor 710 and at least one memory 720.
[0133] The memory 720 is used to store instructions.
[0134] In some embodiments, the memory 720 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 7201 and / or a cache 7202 , and may further include a read-only memory unit (ROM) 7203 .
[0135] In some embodiments, the memory 720 may also include a program / utility 7204 having a set (at least one) of program modules 7205, such program modules 7205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0136] In some embodiments, the memory 720 may store an operating system, which may be a real-time operating system (RTX), LINUX, UNIX, WINDOWS, or OS X.
[0137] In some embodiments, data may also be stored in the memory 720 .
[0138] As an example, the processor 710 may read data stored in the memory 720 . The data may be stored at the same storage address as the instruction, or the data may be stored at a different storage address than the instruction.
[0139] The processor 710 is configured to call instructions stored in the memory 720 to implement the steps of various exemplary embodiments of the present disclosure described in the "Exemplary Method" section above. For example, the processor 710 may execute the steps of the aforementioned product recommendation method embodiment.
[0140] It should be noted that the processor 710 may be a general-purpose processor or a dedicated processor. The processor 710 may include one or more processing cores, and the processor 710 executes various functional applications and data processing by running instructions.
[0141] In some embodiments, the processor 710 may include a central processing unit (CPU) and / or a baseband processor.
[0142] In some embodiments, the processor 710 may determine an instruction based on the priority identifier and / or function category information carried in each control instruction.
[0143] In the present disclosure, the processor 710 and the memory 720 may be provided separately or integrated together.
[0144] As an example, the processor 710 and the memory 720 may be integrated on a single board or a system on chip (SOC).
[0145] like Figure 7 As shown, the electronic device 700 is in the form of a general-purpose computing device. The electronic device 700 may further include a bus 730 .
[0146] Bus 730 may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures.
[0147] The electronic device 700 may also communicate with one or more external devices 740 (e.g., a keyboard, a pointing device, a Bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 700, and / or any device that enables the electronic device 700 to communicate with one or more other computing devices (e.g., a router, a modem, etc.). Such communication may be performed through an input / output (I / O) interface 750.
[0148] Furthermore, the electronic device 700 can also communicate with one or more networks (eg, a local area network (LAN), a wide area network (WAN) and / or a public network, such as the Internet) through the network adapter 760 .
[0149] like Figure 7 As shown, the network adapter 760 communicates with other modules of the electronic device 700 via the bus 730 .
[0150] It should be understood that although not shown in the figures, other hardware and / or software modules may be used in conjunction with the electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0151] It is understood that the structure shown in the embodiment of the present disclosure does not constitute a specific limitation on the electronic device 700. In other embodiments of the present disclosure, the electronic device 700 may include Figure 7 More or fewer components may be shown, or some components may be combined or separated, or the components may be arranged differently. Figure 7 The components shown can be implemented in hardware, software, or a combination of software and hardware.
[0152] The present disclosure also provides a computer-readable storage medium having computer instructions stored thereon. When the computer instructions are executed by a processor, the product recommendation method described in the above method embodiment is implemented.
[0153] The computer-readable storage medium in the embodiments of the present disclosure is a computer instruction that can be sent, propagated or transmitted for use by or in conjunction with an instruction execution system, apparatus or device.
[0154] As an example, computer readable storage media are non-volatile storage media.
[0155] In some embodiments, more specific examples of computer-readable storage media in the present disclosure may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, a USB flash drive, a mobile hard disk, or any suitable combination of the foregoing.
[0156] In the embodiments of the present disclosure, the computer-readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer instructions (readable program codes).
[0157] Such a propagated data signal may take any of a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof.
[0158] In some examples, computing instructions contained on a computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0159] The embodiments of the present disclosure further provide a computer program product, which stores instructions. When the instructions are executed by a computer, the computer implements the product recommendation method described in the above method embodiment.
[0160] The above instructions may be program codes. In specific implementation, the program codes may be written in any combination of one or more programming languages.
[0161] Programming languages include object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages.
[0162] The program code may execute entirely on the user's computing device, partly on the user's computing device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device or entirely on the remote computing device or server.
[0163] Where a remote computing device is involved, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0164] An embodiment of the present disclosure also provides a chip, including at least one processor and an interface; the interface is used to provide program instructions or data to the at least one processor; and the at least one processor is used to execute program instructions to implement the product recommendation method described in the above method embodiment.
[0165] In some embodiments, the chip may further include a memory for storing program instructions and data, and the memory may be located inside or outside the processor.
[0166] Those skilled in the art will appreciate that all or part of the steps for implementing the above embodiments may be implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software, which may be collectively referred to herein as a "circuit," "module," or "system."
[0167] Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein.
[0168] This disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the appended claims.
Claims
1. A product recommendation method, characterized in that: include: Based on the knowledge graph at the current moment and the knowledge graph at the previous moment, determine the users whose interaction data with the product and package has changed, and obtain a first user set; The knowledge graph is constructed based on the interaction logs between users, products, and packages. The knowledge graph is used to describe the relationship between users and products, the relationship between users and packages, and the relationship between products and packages. Based on the preference index of each user for each product and the preference index for each package among the current multiple users, calculating the similarity between the multiple users, and determining the top M users ranked from high to low in similarity for each user to form a second user set associated with the user; If the second user set associated with a user is a subset of the first user set, the user is determined as a user to be recommended; Based on the preference index of each user in the second user set associated with the user to be recommended to each product and the preference index of each package to each product, the products and / or packages recommended to the user to be recommended are determined.
2. The method according to claim 1, characterized in that The knowledge graph is constructed based on the user's purchase records of goods, the user's purchase records of packages, the user's browsing records of goods, and the user's browsing records of packages.
3. The method according to claim 1, characterized in that The method further comprises: Determining a first product index of the user for the product based on the user's purchase record of the product and the user's browsing record of the product, wherein the magnitude of the first product index is positively correlated with the number of times the user has purchased the product, and the magnitude of the first product index is positively correlated with the number of times the user has browsed the product; Determining a second product index of the user for the product based on a purchase record of the user for a package containing the product and a browsing record of the user for the package containing the product, wherein the magnitude of the second product index is positively correlated with the number of times the user purchased the package containing the product, and the magnitude of the second product index is positively correlated with the number of times the user browsed the package containing the product; Based on the first product index and the second product index, a preference index of the user for the product is determined.
4. The method according to claim 3, characterized in that The method further comprises: Determining a first package index of the user for the package based on the user's purchase record of the package and the user's browsing record of the package, wherein the magnitude of the first package index is positively correlated with the number of times the user has purchased the package, and the magnitude of the first package index is positively correlated with the number of times the user has browsed the package; Determining a second product index of the user for the package based on the user's purchase record of the products included in the package and the user's browsing record of the products included in the package, wherein the magnitude of the second product index is positively correlated with the number of times the user purchased the products included in the package, and the magnitude of the second product index is positively correlated with the number of times the user browsed the products included in the package; Based on the first package index and the second package index, determine the user's preference index for the package.
5. The method according to claim 1, wherein The determining of the recommended product and / or package for the user to be recommended based on the preference index of each user in the second user set associated with the user to be recommended for each product and the preference index of each package includes: For each user in the second user set associated with the user to be recommended, determine the top J products ranked by the user's preference index for the product, and the top K packages ranked by the user's preference index for the package, from high to low; The preference indexes of M×J products, M×J product vectors, preference indexes of M×K packages, and M×K package vectors are concatenated and input into the DQN model as the current state to obtain the products and / or packages recommended for the user to be recommended; wherein the product vectors and the package vectors are obtained by vectorizing each product and each package in the knowledge graph.
6. The method according to claim 5, characterized in that The method further comprises: After recommending the product and / or package to the user to be recommended, determining a reward for the DQN model based on the browsing and purchase of the product and package by the user to be recommended after being recommended; Constructing a training sample based on the current state, the recommended product and / or package for the user to be recommended, the state at the next moment, and the reward; The training samples are placed in a sample pool, and the DQN model is trained and updated based on the training samples in the sample pool.
7. The method according to claim 6, characterized in that If DQN recommends product j and package k to user i, the reward is r t for: in, represents the preference index of user i for product j at time t+1, Represents the preference index of user i for package k at time t+1.
8. A product recommendation system, characterized in that: include: A data comparison module is used to determine users whose interaction data with products and packages has changed based on the knowledge graph at the current moment and the knowledge graph at the previous moment, and obtain a first user set; The knowledge graph is constructed based on the interaction logs between users, products, and packages. The knowledge graph is used to describe the relationship between users and products, the relationship between users and packages, and the relationship between products and packages. a similarity calculation module, configured to calculate the similarity between the multiple users based on the preference index of each user for each product and the preference index of each package among the multiple users, and determine the top M users ranked from high to low in similarity for each user to form a second user set associated with the user; a set comparison module, configured to determine a user as a user to be recommended if the second user set associated with a user is a subset of the first user set; The product determination module is used to determine the products and / or packages recommended to the user to be recommended based on the preference index of each user in the second user set associated with the user to be recommended to each product and the preference index of each package.
9. An electronic device, characterized in that: include: a memory for storing instructions; A processor is used to call the instructions stored in the memory to implement the product recommendation method according to any one of claims 1 to 7.
10. A computer program product, characterized in that The computer program product stores instructions, and when the instructions are executed by a computer, the computer implements the product recommendation method according to any one of claims 1 to 7.