Method and device for recommending items, storage medium, and electronic device

By constructing a heterogeneous graph from user interactions and combining item-specific embedding vectors, the method enhances the accuracy of item recommendations by accounting for item and user dependencies.

CN115358807BActive Publication Date: 2025-07-15BEIJING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110535779.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-17
Publication Date
2025-07-15
Estimated Expiration
2041-05-17

AI Technical Summary

Technical Problem

The accuracy of the item recommendation method in the prior art is low, and it is impossible to accurately recommend it based on the user's historical operation records and the dependencies between items.

Method used

By obtaining the historical operation records of the target account, a heterogeneous graph is constructed, the neighbor nodes of the item node are determined, and the neighbor nodes are classified to generate the target embedding vector, and the comprehensive embedding vector is spliced to obtain the comprehensive embedding vector, and the recommended item information is calculated using the comprehensive embedding vector.

Benefits of technology

Improve the accuracy of item recommendations, consider the dependencies between the sessions formed by the item, the user and the user's operation records, and achieve more accurate item recommendations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115358807B_ABST
    Figure CN115358807B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and apparatus, a storage medium, and an electronic device related to the recommendation of items associated with artificial intelligence and content push. Among them, the method includes: obtaining the historical operation records of a target account to which item recommendations are to be made; in a heterogeneous graph corresponding to at least one target item, determining neighbor nodes associated with each item node where each target item in the at least one target item is located; in the case of classifying the neighbor nodes associated with each target item respectively to obtain classification results, determining target embedding vectors corresponding to each target item according to the classification results; splicing the respective target embedding vectors to obtain a comprehensive embedding vector corresponding to at least one target item; and using the comprehensive embedding vector for calculation to obtain item information of a target item to be recommended to the target account. The present invention solves the technical problem of low accuracy in recommending items to users.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of big data, and in particular, to a method and device for recommending items, a storage medium, and an electronic device. Background Art

[0002] In the prior art, in the process of recommending items to a user, such as in the process of recommending shopping items or articles, similar items or articles can usually be determined according to the item information or article information in the user's historical browsing data, and then the similar items or articles are recommended. However, the method of determining similar recommendations only based on item information or article information is not accurate in the recommended content.

[0003] In view of the above problems, no effective solution has been proposed yet. Summary of the Invention

[0004] Embodiments of the present invention provide a method and device for recommending items, a storage medium, and an electronic device, so as to at least solve the technical problem of low accuracy in recommending items to a user.

[0005] According to one aspect of the embodiments of the present invention, a method for recommending items is provided, including: obtaining a historical operation record of a target account to receive item recommendations, where the historical operation record is an operation record of an interaction operation performed by a user using the target account on at least one target item; in a heterogeneous graph corresponding to the at least one target item, determining neighbor nodes associated with each item node where each of the at least one target item is located, where the neighbor nodes are nodes selected from the heterogeneous graph according to a predetermined step length, the heterogeneous graph includes a dependency relationship indicating the dependency between an item and an account that has performed an interaction operation on the item, and the items include the at least one target item; in the case of classifying the neighbor nodes associated with each target item respectively to obtain a classification result, determining a target embedding vector corresponding to each target item according to the classification result; splicing the respective target embedding vectors to obtain a comprehensive embedding vector corresponding to the at least one target item; and performing calculations using the comprehensive embedding vector to obtain item information of a target item to be recommended to the target account.

[0006] According to another aspect of the embodiments of the present invention, there is also provided a recommendation device for items, including: an acquisition unit, configured to acquire the historical operation records of a target account to which item recommendations are to be made, where the historical operation records are the operation records of the interactions that a user using the target account has performed on at least one object item; a determination unit, configured to determine, in the heterogeneous graph corresponding to the at least one object item, the neighbor nodes respectively associated with each item node where each object item in the at least one object item is located, where the neighbor nodes are the nodes selected from the heterogeneous graph according to a predetermined step length, the heterogeneous graph includes a dependency relationship indicating the dependency between an item and an account that has performed an interaction operation on the item, and the items include the at least one object item; a classification unit, configured to, in the case of classifying the neighbor nodes respectively associated with each object item to obtain a classification result, determine the target embedding vector corresponding to each object item according to the classification result; a splicing unit, configured to splice the respective target embedding vectors to obtain a comprehensive embedding vector corresponding to the at least one object item; a calculation unit, configured to perform calculations using the comprehensive embedding vector to obtain the item information of the target item to be recommended to the target account.

[0007] As an optional example, the classification unit includes: a first processing module, configured to determine each of the object items as the current item, and perform the following operations on the current item: determine the neighbor nodes of the item node where the current item is located from the heterogeneous graph; classify the neighbor nodes into multiple categories according to the types of the neighbor nodes; determine a type embedding vector for each category of the neighbor nodes; and perform a weighted sum of the type embedding vectors according to the first weight of each category of the neighbor nodes to obtain the target embedding vector.

[0008] As an optional example, the first processing module is further configured to: determine each category of the neighbor nodes as the current category of neighbor nodes, and perform the following operations on the current category of neighbor nodes: acquire the node embedding vector of each neighbor node in the current category of neighbor nodes; splice the node embedding vectors into a target node embedding vector; and determine the ratio of the target node embedding vector to the modulus of the number of nodes in the current category of neighbor nodes as the type embedding vector of the current category of neighbor nodes.

[0009] As an alternative example, the above first processing module is further configured to: determine each of the above neighbor nodes in the above current class of neighbor nodes as a current neighbor node, and perform the following operations on the above current neighbor node: obtain an attribute set of the above current neighbor node, where the above attribute set includes a plurality of attribute information of the above current neighbor node; convert each of the above attribute information into an attribute vector; splice the above attribute vectors into a target attribute vector; determine a ratio of the above target attribute vector to a norm of the above attribute set as a node embedding vector of the above current neighbor node.

[0010] As an alternative example, the above classification unit further includes: a second processing module, configured to, before weighted summing the above type embedding vectors according to the first weight of each class of the above neighbor nodes to obtain the above target embedding vector, determine each class of the above neighbor nodes as a current class of neighbor nodes, and perform the following operations on the above current class of neighbor nodes to determine the above first weight of the above current class of neighbor nodes: obtain a first splicing vector obtained by splicing a node embedding vector of the above current item and a type embedding vector of the above current class of neighbor nodes; multiply the above first splicing vector by an attention parameter to obtain a first product, and perform a correction operation on the above first product to obtain a first corrected vector; after obtaining a second splicing vector by splicing a node embedding vector of the above current item and a type embedding vector of each class of the above neighbor nodes, multiply each of the above second splicing vectors by the attention parameter to obtain a plurality of second products, and perform the above correction operation on the above plurality of second products to obtain a plurality of second corrected vectors, where each of the above second products corresponds to one of the above second corrected vectors; determine a sum of the above second corrected vectors; determine a ratio of the above first corrected vector to the above sum as the above first weight of the above current class of neighbor nodes.

[0011] According to another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium storing a computer program, where the computer program is configured to execute the above item recommendation method when running.

[0012] According to another aspect of the embodiments of the present invention, there is also provided an electronic device including a memory and a processor, where the memory stores a computer program, and the processor is configured to execute the above item recommendation method through the above computer program.

[0013] In an embodiment of the present invention, a historical operation record of a target account to which an item recommendation is to be received is obtained, where the historical operation record is an operation record of interaction operations performed by a user using the target account on at least one target item; in a heterogeneous graph corresponding to the at least one target item, neighbor nodes respectively associated with each item node where each target item in the at least one target item is located are determined, where the neighbor nodes are nodes selected from the heterogeneous graph according to a predetermined step length, and the heterogeneous graph includes a dependency relationship indicating the dependency between an item and an account that has performed an interaction operation on the item, and the items include the at least one target item; in the case of classifying the neighbor nodes respectively associated with each target item to obtain a classification result, a target embedding vector corresponding to each target item is determined according to the classification result; the respective target embedding vectors are concatenated to obtain a comprehensive embedding vector corresponding to the at least one target item; a method for obtaining item information of a target item to be recommended to the target account by calculating using the comprehensive embedding vector. Since in the above method, when recommending an item to a target account, the item information of the target item to be recommended is predicted based on the comprehensive embedding vector determined in the heterogeneous graph of the current item operated by the user, the dependency relationship between the item, the user, and the session formed by the user's operation record on the item is considered, and more accurate item recommendations can be predicted, improving the accuracy of item recommendation to the user, and thus solving the technical problem of low accuracy of item recommendation to the user. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0015] Figure 1 is a schematic diagram of an application environment of an optional item recommendation method according to an embodiment of the present invention;

[0016] Figure 2 is a schematic diagram of an application environment of another optional item recommendation method according to an embodiment of the present invention;

[0017] Figure 3 is a schematic diagram of a process of an optional item recommendation method according to an embodiment of the present invention;

[0018] Figure 4 is a heterogeneous graph of an optional item recommendation method according to an embodiment of the present invention;

[0019] Figure 5 is a schematic diagram of predicting a target item of an optional item recommendation method according to an embodiment of the present invention;

[0020] Figure 6 It is a schematic structural diagram of a target neural network model for an optional item recommendation method according to an embodiment of the present invention;

[0021] Figure 7 It is a schematic structural diagram of a heterogeneous neural network model for an optional item recommendation method according to an embodiment of the present invention;

[0022] Figure 8 It is a schematic structural diagram of an optional item recommendation device according to an embodiment of the present invention;

[0023] Figure 9 It is a schematic structural diagram of an optional electronic device according to an embodiment of the present invention. Detailed implementation manners

[0024] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention 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 inclusion. For example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0026] According to one aspect of the embodiments of the present invention, an item recommendation method is provided. Optionally, as an optional implementation manner, the above item recommendation method can be but is not limited to being applied to an environment such as Figure 1 as shown.

[0027] Such as Figure 1As shown in the figure, the terminal device 102 includes a memory 104 for storing various data generated during the operation of the terminal device 102, a processor 106 for processing and calculating the above-mentioned various data, and a display 108 for displaying the item information of the target item. The terminal device 102 can perform data interaction with the server 112 through the network 110. The server 112 includes a database 114 for storing various data and a processing engine 116 for processing the above-mentioned various data. Through steps S102 to S106, the terminal device 102 can send the historical operation records of the target account to the server 112, and then the server 112 predicts and recommends the item information of the target item based on the historical operation records, and returns the item information to the terminal device 102 so that the terminal device 102 can display the item information.

[0028] As an alternative implementation, the above item recommendation method can be applied, but is not limited to, an environment such as Figure 2 shown in the figure.

[0029] As Figure 2 shown in the figure, the terminal device 202 includes a memory 204 for storing various data generated during the operation of the terminal device 202, a processor 206 for processing and calculating the above-mentioned various data, and a display 208 for displaying the item information of the target item. The terminal device 202 can execute steps S202 to S210 to predict and recommend the item information of the target item.

[0030] Optionally, in this embodiment, the above terminal device may be a terminal device configured with a target client, and may include, but is not limited to, at least one of the following: mobile phone (such as Android mobile phone, iOS mobile phone, etc.), laptop computer, tablet computer, handheld computer, MID (Mobile Internet Devices), PAD, desktop computer, smart TV, etc. The target client may be a video client, instant messaging client, browser client, education client, etc. The above network may include, but is not limited to: wired network, wireless network, where the wired network includes: local area network, metropolitan area network and wide area network, and the wireless network includes: Bluetooth, WIFI and other networks for realizing wireless communication. The above server may be a single server, or a server cluster composed of multiple servers, or a cloud server. The above is only an example, and this embodiment does not make any limitation thereto.

[0031] The server can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto. The terminal and the server can be directly or indirectly connected through wired or wireless communication methods, and this application does not make any restrictions here.

[0032] Optionally, the above item recommendation method can be but is not limited to being applied in the shopping process, or in recommending content such as music, videos, articles, etc. For example, if it is applied in the shopping process, in the user's historical operation records, which include the items that the user has operated on, such as browsed or purchased, from the heterogeneous graph of the items browsed by the user, determine the target embedding vector of each item browsed by the user, and splice them to obtain a comprehensive embedding vector. By calculating the comprehensive embedding vector, predict the target item to be recommended, and recommend the target item to the user.

[0033] If the above item recommendation method is applied to the process of recommending music, videos or articles, then the user's historical operation records can be obtained. The historical operation records include the music, videos or articles that the user has operated on, such as browsed or liked, shared. From the heterogeneous graph of the music, videos or articles operated by the user, determine the target embedding vector of each music, video or article operated by the user, and splice them to obtain a comprehensive embedding vector. By calculating the comprehensive embedding vector, predict the information of the music, video or article to be recommended, and recommend the information of the music, video or article to the user. That is to say, the items in the above item recommendation method can be items for shopping, or content such as articles, music, videos, etc., or services, etc. For example, predict and recommend services based on the services that the user already owns or has purchased.

[0034] Since in the above process, when determining the item information of the target item to be recommended, the item information of the target item to be recommended is predicted based on the comprehensive embedding vector determined from the heterogeneous graph of the current item operated by the user, thus taking into account the dependency relationship between the item, the user, and the session formed by the user's operation records on the item, more accurate item recommendations can be predicted, and the accuracy of recommending items to the user is improved.

[0035] The recommended method for the above-mentioned items involves artificial intelligence. Artificial Intelligence (AI) uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, a theory, method, technology, and application system that can perceive the environment, acquire knowledge, and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a way similar to human intelligence. Artificial intelligence also studies the design principles and implementation methods of various intelligent machines, enabling machines to have the functions of perception, reasoning, and decision-making.

[0036] Artificial intelligence technology is an interdisciplinary subject that involves a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, and mechatronics. The software technologies of artificial intelligence mainly include several major directions such as computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0037] Computer Vision Technology (CV) Computer vision is a science that studies how to enable machines to "see". More specifically, it refers to using cameras and computers to replace human eyes to perform machine vision such as target recognition, tracking, and measurement on targets, and further perform graphic processing to make the computer-processed images more suitable for human eyes to observe or be transmitted to instruments for detection. As a scientific discipline, computer vision studies related theories and technologies and attempts to establish an artificial intelligence system that can obtain information from images or multi-dimensional data. Computer vision technology usually includes technologies such as image processing, image recognition, image semantic understanding, image retrieval, OCR, video processing, video semantic understanding, video content / behavior recognition, three-dimensional object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous localization and mapping, and also includes common biometric recognition technologies such as face recognition and fingerprint recognition.

[0038] Optionally, the nouns involved in this embodiment are as follows:

[0039] Session: A session is a collection of items. It can be an activity or transaction, or a collection of all items or transactions within a period of time.

[0040] Session-based recommendation system: A recommendation system that uses sessions as the basic data organization unit to analyze and recommend data. The goal of a session-based recommendation system is to predict the unknown parts of a session or future sessions based on the complex relationships embedded in or between sessions.

[0041] Heterogeneous Graph: A graph structure that contains multiple types of nodes and multiple types of edges.

[0042] Optionally, as an alternative implementation, such as Figure 3 shown, the recommendation method for the above items includes:

[0043] S302, Obtain the historical operation records of the target account that will receive item recommendations, where the historical operation records are the operation records of the interactions that the user using the target account has performed on at least one object item;

[0044] Optionally, taking the item in this embodiment as a shopping item as an example, the user can generate historical operation records during the shopping process. Such as operations like purchasing, browsing, adding to the shopping cart, sharing, etc. of the item. The historical operation records can be saved locally on the terminal or in the storage space corresponding to the user on the server corresponding to the client on the terminal.

[0045] S304, In the heterogeneous graph corresponding to at least one object item, determine the neighbor nodes associated with each item node where each object item in the at least one object item is located. Among them, the neighbor nodes are the nodes selected from the heterogeneous graph according to a predetermined step length. The heterogeneous graph includes the dependency relationship indicating the relationship between the item and the account that has performed an interaction operation on the item, and the item includes at least one object item;

[0046] Optionally, the heterogeneous graph in this embodiment can be the heterogeneous graph corresponding to at least one object item that the user has operated on. The heterogeneous graphs composed of different object items are different.

[0047] Optionally, different users can be included in the heterogeneous graphs composed of different object items. For example, User 1 and User 2 have respectively performed operations on different object items. User 1 has operated on Item 1, Item 2, and Item 3, while User 2 has operated on Item 1 and Item 3. The Item 1 and Item 2 operated by User 1 form a session of User 1, and the Item 3 operated by User 1 forms a session of User 1. When generating the heterogeneous graph, the relationships among Item 1, Item 2, and Item 3 can be recorded in the heterogeneous graph, as well as the relationships between the user and the item, and the sessions of the user are generated, and the relationships between the session and the item and the user are recorded in the heterogeneous graph. Different types of relationships can be distinguished by different appearances. For example, different types of relationships are represented by line segments of different colors.

[0048] Optionally, after generating the heterogeneous graph, the sequential relationship between items can be viewed in the heterogeneous graph. This sequential relationship can be determined according to the time sequence of operations of different users. For example, if the user operates on Item 1 first and then on Item 2, then Item 1 is located before Item 2.

[0049] As shown in Figure 4 the following figure Figure 4 is an optional heterogeneous graph. Figure 4 In the figure, there is a sequential relationship among Item 1, Item 2, and Item 3, which is represented by arrow directions. User 1 includes Session 1-1 and Session 1-2, while User 2 includes Session 2. Item 1 and Item 2 are included in User 1's Session 1-1, and Item 3 is included in User 1's Session 1-2. User 1 corresponds to Item 1-3. Item 1 and Item 3 are included in User 2's Session 2, and User 2 corresponds to Item 1 and Item 3.

[0050] For each item, there is a corresponding item node. An item node can have multiple neighbor nodes in the heterogeneous graph.

[0051] S306. In the case of classifying the neighbor nodes respectively associated with each target item to obtain classification results, determine the target embedding vector corresponding to each target item according to the classification results;

[0052] Optionally, in this embodiment, a target embedding vector needs to be determined for each target item. When specifically determining, the neighbor nodes of each target item can be determined, and then the neighbor nodes are classified. In the classification results, a type embedding vector is determined for each category of neighbor nodes, and the type embedding vectors are weighted and summed according to the first weights of each category of neighbor nodes to obtain the target embedding vector of a target item.

[0053] S308. Concatenate the respective target embedding vectors to obtain a comprehensive embedding vector corresponding to at least one target item;

[0054] Optionally, in this embodiment, the concatenation can be directly concatenating the target embedding vectors in the sequential order of the corresponding items into a comprehensive embedding vector. The sequential order of the items is the order of the items in the heterogeneous graph.

[0055] S310. Use the comprehensive embedding vector for calculation to obtain the item information of the target item to be recommended to the target account.

[0056] Optionally, in this embodiment, after obtaining the comprehensive embedding vector, a fully connected layer can be used to calculate the comprehensive embedding vector, so as to determine the item information of the target commodity to be recommended.

[0057] Through the above method of this embodiment, when recommending an item to a target account, the item information of the target item to be recommended is predicted according to the comprehensive embedding vector determined in the heterogeneous graph of the current item operated by the user. Thus, the dependency relationship formed among the item, the user, and the session formed by the user's operation records on the item is considered, and more accurate item recommendations can be predicted, improving the accuracy of item recommendation to the user.

[0058] As an alternative implementation, in the case of classifying the neighbor nodes respectively associated with each object item to obtain classification results, determining the target embedding vector corresponding to each object item according to the classification results includes:

[0059] Determine each object item as the current item, and perform the following operations on the current item:

[0060] Determine the neighbor nodes of the item node where the current item is located from the heterogeneous graph;

[0061] Classify the neighbor nodes into multiple categories according to the types of the neighbor nodes;

[0062] Determine a type embedding vector for each category of neighbor nodes;

[0063] Perform weighted summation on the type embedding vectors according to the first weights of each category of neighbor nodes to obtain the target embedding vector.

[0064] Optionally, in this embodiment, for each of at least one object item operated by the target account, a target embedding vector needs to be determined. When determining the target embedding vector, the neighbor nodes of the item node of the current item can be classified into multiple categories as described above. When classifying, the neighbor nodes are classified into multiple categories according to their respective types. The type of the neighbor node is the type of the node in the heterogeneous graph. For example, some neighbor nodes are of the item type, some neighbor nodes are of the session type, some neighbor nodes are of the user type, etc. After classifying the neighbor nodes into different categories, a type embedding vector is determined for each category of neighbor nodes, and weighted summation is performed to obtain the target embedding vector of the current item.

[0065] The purpose of this embodiment is to obtain an accurate target embedding vector for each current item through the above method. And the relationships between the items, users, and sessions associated with the current item are recorded in the target embedding vector. The recommended items are determined according to the comprehensive embedding vector spliced from the target embedding vectors, with higher accuracy.

[0066] As an alternative implementation, determining the neighbor nodes of the item node where the current item is located from the heterogeneous graph includes:

[0067] Taking the item node as the starting point, randomly select the associated nodes of the item node in the heterogeneous graph according to a predetermined step size;

[0068] Each time an associated node is selected according to the predetermined step size, determine the associated node as the new starting point;

[0069] After determining multiple associated nodes, determine the neighbor nodes from the multiple associated nodes.

[0070] Optionally, in this embodiment, a method for determining neighbor nodes of an item node is proposed. In the above method, according to a predetermined step size, associated nodes of the item node are selected from the heterogeneous graph, and then neighbor nodes of the item node are determined from the associated nodes. The predetermined step size can be a preset value. Then, when determining neighbor nodes through the predetermined step size, the determination efficiency of different predetermined step sizes is checked, so as to adjust the predetermined step size to obtain the optimal predetermined step size. When determining associated nodes, for example, when the predetermined step size is 2, in the heterogeneous graph, for an item node, adjacent nodes with a distance of 1 from the item node are selected, and then adjacent nodes with a distance of 1 from the adjacent node are selected. The latter adjacent node is determined as an associated node of the item node, and this associated node is used as a new starting point, and associated nodes are determined again through this method until a plurality of associated nodes are determined. Specifically, it can stop after determining a predetermined number of associated nodes, or stop when the determined associated nodes include all types in the heterogeneous graph. The determined associated nodes are classified according to types, and one or more nodes with the most occurrences are selected from each class of associated nodes as neighbor nodes.

[0071] Through this method, the accuracy of determining neighbor nodes of each item node can be guaranteed, and the accuracy of the recommended target items can be further improved.

[0072] As an alternative implementation, after determining a plurality of associated nodes, determining neighbor nodes from the plurality of associated nodes includes:

[0073] Classify the associated nodes into multiple categories according to the types of the associated nodes;

[0074] For the nodes in each category of associated nodes, sort them in descending order of the number of occurrences;

[0075] Determine the first N nodes in the sorting result of each category of associated nodes as neighbor nodes of the item node.

[0076] Optionally, the above N is a positive integer. The value of the above N can vary. For example, the initial value of N is determined to be 3, and then, for the first 3 associated nodes with the most occurrences in each category of associated nodes, they are determined as neighbor nodes of the item node. The target embedding vector is determined through the determined neighbor nodes, and finally the item information of the target item is predicted. As the accuracy of predicting the item information of the target item, the value of N can be adjusted to make the accuracy higher.

[0077] As an alternative implementation, determining a type embedding vector for each category of neighbor nodes includes:

[0078] Determine each category of neighbor nodes as the current category of neighbor nodes, and perform the following operations on the current category of neighbor nodes: Obtain the node embedding vectors of each neighbor node in the current category of neighbor nodes;

[0079] Concatenate the node embedding vectors into a target node embedding vector;

[0080] Determine the ratio of the target node embedding vector to the modulus of the number of nodes in the current class of neighbor nodes as the type embedding vector of the current class of neighbor nodes.

[0081] Optionally, in this embodiment, when determining a type embedding vector for each class of neighbor nodes, it is necessary to first determine the node embedding vector of each neighbor node in this class of neighbor nodes, and then concatenate the node embedding vectors into a target node embedding vector. When concatenating, the node embedding vectors can be concatenated in descending or ascending order according to the occurrence times of each neighbor node to obtain the target node embedding vector. Finally, determine the ratio of the target node embedding vector to the modulus of the number of nodes in the current class of neighbor nodes as the type embedding vector of the current class of neighbor nodes, thereby obtaining the type embedding vectors of each class of neighbor nodes.

[0082] As an alternative implementation, obtaining the node embedding vector of each neighbor node in the current class of neighbor nodes includes:

[0083] Determine each neighbor node in the current class of neighbor nodes as the current neighbor node, and perform the following operations on the current neighbor node:

[0084] Obtain the attribute set of the current neighbor node, where the attribute set includes multiple attribute information of the current neighbor node;

[0085] Convert each attribute information into an attribute vector;

[0086] Concatenate the attribute vectors into a target attribute vector;

[0087] Determine the ratio of the target attribute vector to the modulus of the attribute set as the node embedding vector of the current neighbor node.

[0088] Optionally, in this embodiment, the attribute value of the current neighbor node can be various attributes of the content corresponding to the current neighbor node. When the current neighbor node is a user, the attribute information can be the user information of the user, such as the unique identifier of the user, the level of the user, purchasing power, shopping cart content, etc. If the current neighbor node is a node of an item, the attribute information can be various attributes of the item, such as size, evaluation, price, weight, shelf life, brand, etc. If the current neighbor node is a session node, the attribute information can be the time period when the session is generated, the user corresponding to the session, the item corresponding to the session, etc.

[0089] Each attribute can be converted into an attribute vector, and by concatenating each attribute vector, a target attribute vector is obtained. When concatenating, the attribute information can be randomly sorted, and the vectors can be concatenated in the order of the random sorting, or an importance weight can be assigned to each piece of attribute information, and the vectors can be concatenated according to the importance weight. Finally, the ratio of the target attribute vector to the norm of the attribute set is determined as the node embedding vector of the current neighbor node, thereby obtaining the node embedding vector of the current neighbor node.

[0090] As an alternative implementation, before weighted summing the type embedding vectors according to the first weight of each type of neighbor node to obtain a target embedding vector, the method further includes:

[0091] Determine each type of neighbor node as the current type of neighbor node, and perform the following operations on the current type of neighbor node to determine the first weight of the current type of neighbor node:

[0092] Obtain a first concatenated vector obtained by concatenating the node embedding vector of the current item and the type embedding vector of the current type of neighbor node;

[0093] Multiply the first concatenated vector by the attention parameter to obtain a first product, and perform a correction operation on the first product to obtain a first corrected vector;

[0094] After a second concatenated vector is obtained by concatenating the node embedding vector of the current item and the type embedding vector of each type of neighbor node, multiply each second concatenated vector by the attention parameter to obtain a plurality of second products, and perform a correction operation on the plurality of second products to obtain a plurality of second corrected vectors, where each second product corresponds to a second corrected vector;

[0095] Determine the sum of the second corrected vectors;

[0096] Determine the ratio of the first corrected vector to the sum as the first weight of the current type of neighbor node.

[0097] Optionally, by determining the first weight through the above method, an accurate first weight can be determined for each type of neighbor node, so that an accurate target embedding vector and a comprehensive embedding vector can be determined, thereby improving the accuracy of the recommended target item.

[0098] As an alternative implementation, concatenating the respective target embedding vectors to obtain a comprehensive embedding vector corresponding to at least one target item includes:

[0099] Obtain a first target embedding vector of the last target item among at least one target item;

[0100] Assign a second weight to the target embedding vector of each item among at least one target item;

[0101] Weight-sum the target embedding vectors of each object item in at least one object item according to a second weight to obtain a second target embedding vector;

[0102] Fuse the first target embedding vector and the second target embedding vector into a comprehensive embedding vector.

[0103] Optionally, in this embodiment, when determining the comprehensive embedding vector, the second weight assigned to each target embedding vector can be adjusted. That is, the second weight is adjusted according to the accuracy of the determined target item, so as to obtain a more accurate second weight.

[0104] In this embodiment, when splicing to obtain the comprehensive embedding vector, the short-term preference and long-term preference of the user need to be considered. The first target embedding vector determined by the last object item in the above at least one object item is the short-term preference of the user. And a second weight is assigned to the target embedding vector of each item in at least one object item; Weight-sum the target embedding vectors of each object item in at least one object item according to the second weight to obtain the second target embedding vector, which is the long-term preference of the user. The short-term preference and the long-term preference are fused to obtain the comprehensive embedding vector, and the comprehensive embedding vector includes the short-term preference and the long-term preference of the user. This embodiment improves the accuracy of determining the target item.

[0105] The following explains the above item recommendation method in combination with a specific example. For example, apply the above item recommendation method to the process of recommending shopping items. When a user purchases an item, the user can browse the item and perform operations such as purchasing, adding to the shopping cart, and sharing the item. Obtain the records of the items operated by the user within a predetermined time period to form a session. For example, User 1 clicks on Item 1, adds Item 2 to the shopping cart, and purchases Item 3 within 10 minutes. Then Items 1 to 3 form the session sequence of User 1. Different sessions of different users can form a heterogeneous graph. The three dependence relationships (i.e., the dependence between different items in the same session, the dependence between different sessions, and the dependence between different items in different sessions) recorded in the heterogeneous graph fully consider the conversion relationship between items to achieve better recommendation results. The above item recommendation method can be implemented using a target neural network model. The target neural network model can obtain the comprehensive embedding vector and calculate the recommended target item. The target neural network model is divided into two stages: training and use. And in either stage, the role of the target neural network model is to predict the next item of a certain item in the case of obtaining the items in the user's historical operation records. For example, as Figure 5 shown Figure 5Among them, the historical operation record S1 of user u includes four items V1 to V4 that the user has operated on. During the training process of the target neural network model, it can predict the next item of each item. For example, it predicts the next item V3 of item V2, and then compares it with V3 in the historical operation record to check whether the prediction result is correct. If the prediction result is incorrect, the model parameters of the target neural network model need to be adjusted to make the prediction of the target neural network model more accurate. When using the target neural network model to determine the target item, the historical operation record of the user can be obtained. Then, predicting the next item of the last item in the historical operation record is to predict the item that the user may operate on next, so as to predict the target item.

[0106] The model structure diagram of the target neural network model in this embodiment is as Figure 6 shown, which mainly includes three parts, namely the construction of the heterogeneous graph, learning the item node embedding, and generating the session embedding. First, the session sequence is constructed into a heterogeneous graph, and the heterogeneous graph contains three types of nodes, namely session, item, and user nodes; in this step, the different session sequences of different users can be constructed into a heterogeneous graph. Such as Figure 6 the construction of the heterogeneous graph in, where the order relationship of the items is V1 to V2 to V3 to V5 to V4. Among them, due to the different operation sequences of different users, V2 can directly go to V5. Moreover, the heterogeneous graph also records the users u1 and u2 corresponding to each item, as well as the relationship between the user and sessions S1 to S3, and the relationship between the session and the item. Then, the item embedding vector containing item conversion information and user session dependency relationship is learned through the heterogeneous graph neural network; then a powerful comprehensive embedding vector is generated; finally, the scores of each candidate item are calculated through the softmax layer, and the item with the highest score is used as the recommendation for the next item.

[0107] For the construction of the heterogeneous graph, the session set S is constructed into the heterogeneous graph G n =(V, S, U, E V , E). Where V is the set of item nodes, S is the set of session nodes, U is the set of user nodes, and E v represents the set of edges between two items, and E v =(v s,i , v s,i+1 ) is a set of directed edges, which means that after purchasing item v s,i , the next item purchased is item v s,i+1 . E is a set of undirected edges, and E = {(v s,i , s), (v s,i, (u), (s, u)} can represent the relationships between items and conversations, items and users, and users and conversations. After the heterogeneous graph is created, the DeepWalk algorithm is used to embed all the nodes in the heterogeneous graph into a unified vector space, that is, starting from each node, a random walk with a fixed step length L is performed to obtain a certain number of word vectors, and then the Word2vec model is used to identify these word vectors, and finally the pre-embedded node embedding vectors of each node are generated.

[0108] After obtaining the node embedding vectors of each node, the target embedding vectors of each item node need to be obtained. After generating the node embedding vectors, each node in the heterogeneous graph can be represented by node embedding vectors of the same dimension. Next, the Heterogeneous Graph Neural Network (HetGNN) is used to learn the comprehensive embedding vectors containing rich information and rich item transformation relationships. The core step of HetGNN is aggregation, which is mainly divided into four steps: a heterogeneous neighbor sampling; b heterogeneous neighbor node content aggregation; c homogeneous type heterogeneous neighbor aggregation; d different type aggregation. The model structure of HetGNN is as Figure 7 shown.

[0109] a. Heterogeneous neighbor sampling

[0110] The most important problem in learning item embedding vectors is how to aggregate heterogeneous neighbors with different contents. The types and quantities of these heterogeneous neighbors are different, and different feature transformations may be required for processing. For example, a certain user purchased three items in 2 conversations, and another user purchased 4 items in 3 conversations. At this time, the number of neighbors of these two users is different, so how to select the heterogeneous neighbors of the nodes so that they can be aggregated using the same model is an important problem. To solve this problem, the embodiment uses the method of random walk with restart (RWR) to sample heterogeneous neighbors. The main steps of RWR are as follows:

[0111] (1) For all item nodes V = {v1, v2, v3, ……, vn}, start a random walk from each item node vi. During the random walk, there is a probability P of returning to the node vi. In order to obtain all types of nodes during the walk, RWR controls the number of walks of each type of node and stores all the walked nodes in the RWR(v) list. When performing the random walk, a predetermined step length is used. The predetermined step length can be initialized to a value and adjusted through the training process of the target neural network model.

[0112] (2) Classify all nodes in RWR(v). For each type t, select one or more nodes with the most occurrences as the heterogeneous neighbor nodes of the item node vi. By sampling heterogeneous neighbors in this way, all types and the same number of heterogeneous neighbor nodes can be selected for each item node.

[0113] b. Aggregation of heterogeneous neighbor node content

[0114] For heterogeneous neighbor nodes of different types, the content of the nodes is different. For example, user nodes may contain attributes such as age and gender, and item nodes contain attributes such as item name and type. In order to encode the different attribute contents of the nodes into an embedded representation of a fixed dimension through a neural network, this embodiment provides an architecture based on bidirectional LSTM (BiLSTM) to obtain the interaction between features. It aggregates all the attributes of the node into the node embedded representation, making it have greater expressive power. The specific steps are as follows:

[0115] First, for the heterogeneous neighbor v of the node vi, its attribute set is Arr = {arr1, arr2…arrn}. Use different models to convert the attribute arri into an embedded vector of the same dimension to get Arr = {arr1, arr2...arr n}. HetGNN gives different solutions for different types of attributes. For example, one-hot model is used for text attributes and CNN model is used for pictures, etc. After obtaining the embedded vectors of each attribute of the neighbor node, the following formula is used to calculate the node embedded vector f1(v) after content aggregation:

[0116]

[0117] where f1(v) ∈ R d×1 , d is the dimension of the node embedding; FC is the vector conversion layer, which is a fully connected layer; is the concatenation operation. is the bidirectional LSTM model. arr refers to the vector in the embedded vector Arr = {arr1, arr2...arr n}.

[0118] The encoding method of content aggregation in this embodiment can aggregate heterogeneous content to make the node embedded vector more expressive, and at the same time facilitate adding the content attributes of the node.

[0119] c. Aggregation of homogeneous type heterogeneous neighbors

[0120] After aggregating the node content to obtain the node embedding vector, the embedding vector representations of each heterogeneous neighbor node are obtained. There are multiple types of heterogeneous neighbor nodes for each item node, and there are multiple heterogeneous neighbor nodes of t types. This embodiment provides a neural network structure to aggregate nodes of the same type into a type embedding vector. BiLSTM is used to aggregate nodes of the same type to learn the complex relationships between nodes of the same type, so that the learned type embedding has stronger expressive power. The calculation of the type embedding vector f2(t) can be seen in the following formula.

[0121]

[0122] So far, this article aggregates the neighbor nodes of the same type t of the item node vi into a type embedding vector.

[0123] d. Aggregation of different types

[0124] After obtaining the type embedding vectors, all type embedding vectors need to be aggregated into a target embedding vector, that is, finally obtain the target embedding vector of the item node vi. However, for different nodes, the influence of their different types of heterogeneous neighbors is different. Therefore, this embodiment introduces an attention mechanism to solve this problem. The importance calculation formula of different types of the item node vi is as follows:

[0125]

[0126] Among them, LeakyReLU is a leaky rectified linear unit, U ∈ R 1×2d is the attention parameter, T is the set of heterogeneous node types, and t is a certain heterogeneous node type. f j represents f1 or except f2. After calculating the importance of each type to the node vi, the following formula is used to calculate the final target embedding vector representation of the item node vi.

[0127]

[0128] So far, this embodiment aggregates each item node and its heterogeneous neighbor nodes into a target embedding vector, as the final vector representation v of the item node i = f3(v i ), v i not only contains the conversion relationship between items, but also learns the information of other types of nodes, making it more expressive.

[0129] After obtaining the target embedding vector of each item node, the comprehensive embedding vector can be generated. For the session s = {vs,1, vs,2, vs,3, ……, vs,i}, its comprehensive embedding vector representation is calculated as shown in the following formula:

[0130]

[0131] where v s,i is the embedding vector of item vs,i, and v0 is the zero vector. is the concatenation operation. Since the number of items in a session may vary, zero vectors need to be concatenated to make all pre-session vector dimensions the same.

[0132] The obtained S is the comprehensive embedding vector. When training the target neural network model, the item information of the target commodity is predicted through S and compared with the sample data to check the recognition accuracy of the target neural network model. If the recognition accuracy is low, the parameters in the target neural network model need to be adjusted. If the recognition accuracy of the target neural network model is high, it can be put into use. S is determined by the above method, and then S is calculated to predict the item information of the target item and recommend the target item to the target account.

[0133] In addition, considering the different impacts of the user's long-term preferences and short-term preferences on the recommendation results, this embodiment also provides a method for determining the above S. An attention mechanism is added to the model to obtain the comprehensive embedding vector S that can represent long-term preferences and short-term preferences.

[0134] First, consider the local embedding vector s of the session l , s l It should be noted that the short-term preferences of the user are concerned. The local session embedding vector can be calculated using the following formula:

[0135] s l = v s,n

[0136] where v s,n is the embedding vector of the last item in the current session.

[0137] For the user's long-term preferences, the conversion relationship between all items needs to be considered. In this embodiment, a soft attention mechanism is used to learn the global embedding vector s of the session g , and the following formula is used:

[0138] α i = W T σ(W1v s,n + W2v s,i + c)

[0139]

[0140] where the matrix W T ∈ R d , W1, W2 ∈ R d×2d are the weights for controlling the item embedding vectors.

[0141] After obtaining the global embedding and local embedding of the session, the mixed embedding of the session is calculated according to the following formula.

[0142] s h = W3[s l ; s g

[0143] where the matrix W3 ∈ R d×2 d is used to fuse s l , s g into the same embedding vector.

[0144] After generating the comprehensive embedding vector s h , the scores of each candidate item are calculated through the softmax layer, and then the model is trained by the backpropagation algorithm. After the model converges, it is tested on the test set.

[0145] The objective of this embodiment is to make the next recommendation for the user according to the dependency relationship between the existing session information. This embodiment constructs the session sequence into a heterogeneous graph structure, in which the rich dependency relationships among items, sessions, and users can be fully considered, and all nodes are embedded into a unified vector space through the Deepwalk algorithm; the item vectors containing user information, session, and item dependency relationships are learned through the heterogeneous graph neural network; through the soft attention mechanism, considering the local embedding and global embedding of the session, the short-term and long-term preferences of the user are learned, and a session vector containing rich information and complex transformation relationships is generated; the scores of each item are calculated through the softmax layer, and the Top-N recommendation is made for the user according to the scores, improving the accuracy of the recommended target item.

[0146] It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.

[0147] According to another aspect of the embodiments of the present invention, there is also provided an item recommendation device for implementing the above item recommendation method. As Figure 8 shown, the device includes:

[0148] An acquisition unit 802, configured to acquire the historical operation records of the target account to which item recommendations are to be made, where the historical operation records are the operation records of the interactions performed by the user of the target account on at least one target item;

[0149] ​A determination unit 804, configured to determine, in a heterogeneous graph corresponding to at least one target item, neighbor nodes respectively associated with each item node where each target item in the at least one target item is located, where the neighbor nodes are nodes selected from the heterogeneous graph according to a predetermined step length, and the heterogeneous graph includes a dependency relationship indicating a dependency between an item and an account that has performed an interaction operation on the item, and the item includes at least one target item;

[0150] A classification unit 806, configured to, in a case of classifying the neighbor nodes respectively associated with each target item to obtain a classification result, determine a target embedding vector corresponding to each target item according to the classification result;

[0151] A splicing unit 808, configured to splice the respective target embedding vectors to obtain a comprehensive embedding vector corresponding to at least one target item;

[0152] A calculation unit 810, configured to perform calculations using the comprehensive embedding vector to obtain item information of a target item to be recommended to a target account.

[0153] Through the above device of this embodiment, when recommending an item to a target account, the item information of the target item to be recommended is predicted according to the comprehensive embedding vector determined in the heterogeneous graph of the current item operated by the user, thereby taking into account the dependency relationship between the item, the user, and the session formed by the user's operation records on the item, and more accurate item recommendations can be predicted, improving the accuracy of item recommendation to the user.

[0154] For other examples of this embodiment, please refer to the above examples and will not be elaborated here.

[0155] According to another aspect of an embodiment of the present invention, there is also provided an electronic device for implementing the above item recommendation method, and the electronic device may be Figure 9 the terminal device or server shown. This embodiment takes the electronic device as the terminal as an example for illustration. As Figure 9 shown, the electronic device includes a memory 902 and a processor 904, the memory 902 stores a computer program, and the processor 904 is configured to execute the steps in any one of the above method embodiments through the computer program.

[0156] Optionally, in this embodiment, the above electronic device may be at least one network device among multiple network devices in a computer network.

[0157] Optionally, in this embodiment, the above processor may be configured to execute the following steps through the computer program:

[0158] Obtain the historical operation records of the target account that will receive item recommendations, where the historical operation records are the operation records of the interactions that the user using the target account has performed on at least one target item;

[0159] In the heterogeneous graph corresponding to at least one target item, determine the neighbor nodes respectively associated with each item node where each target item in the at least one target item is located. The neighbor nodes are the nodes selected from the heterogeneous graph according to a predetermined step length. The heterogeneous graph includes a dependency relationship indicating the dependency between an item and the accounts that have performed interaction operations on the item, and the items include at least one target item;

[0160] In the case of classifying the neighbor nodes respectively associated with each target item to obtain a classification result, determine the target embedding vector corresponding to each target item according to the classification result;

[0161] Concatenate the respective target embedding vectors to obtain a comprehensive embedding vector corresponding to at least one target item;

[0162] Use the comprehensive embedding vector for calculation to obtain the item information of the target item to be recommended to the target account.

[0163] Optionally, those of ordinary skill in the art can understand that Figure 9 The structure shown is only for illustration. The electronic device can also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a handheld computer, and terminal devices such as Mobile Internet Devices (MID), PAD, etc. Figure 9 It does not limit the structure of the above-mentioned electronic device. For example, the electronic device may further include more or fewer components (such as a network interface, etc.) than those shown in Figure 9 or have a different configuration from that shown in Figure 9 shown.

[0164] Among them, the memory 902 can be used to store software programs and modules, such as the program instructions / modules corresponding to the item recommendation method and device in the embodiments of the present invention. The processor 904 executes various functional applications and data processing by running the software programs and modules stored in the memory 902, that is, implements the above-mentioned item recommendation method. The memory 902 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some instances, the memory 902 may further include a memory remotely disposed relative to the processor 904, and these remote memories can be connected to the terminal through a network. Examples of the above network include but are not limited to the Internet, enterprise intranets, local area networks, mobile communication networks, and combinations thereof. Among them, the memory 902 can specifically but not limitedly be used to store information such as the historical operation records of the target account. As an example, as Figure 9 shown, the above memory 902 may include but are not limited to the acquisition unit 802, determination unit 804, classification unit 806, splicing unit 808, and calculation unit 810 in the above item recommendation device. In addition, it may also include but are not limited to other module units in the above item recommendation device, which will not be elaborated in this example.

[0165] Optionally, the above transmission device 906 is used to receive or send data via a network. Specific examples of the above network may include a wired network and a wireless network. In one instance, the transmission device 906 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers through a network cable so as to communicate with the Internet or a local area network. In one instance, the transmission device 906 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0166] In addition, the above electronic device further includes: a display 908, which is used to display the item information of the target item; and a connection bus 910, which is used to connect each module component in the above electronic device.

[0167] In other embodiments, the above terminal device or server can be a node in a distributed system. Among them, the distributed system can be a blockchain system, and the blockchain system can be a distributed system formed by connecting the multiple nodes through network communication. Among them, the nodes can form a peer-to-peer (P2P, Peer To Peer) network, and any form of computing device, such as servers, terminals and other electronic devices, can become a node in the blockchain system by joining the peer-to-peer network.

[0168] According to another aspect of an embodiment of the present invention, there is also provided a computer-readable storage medium storing a computer program, where the computer program is configured to execute the steps in any one of the above method embodiments when running.

[0169] Optionally, in this embodiment, the above computer-readable storage medium may be configured to store a computer program for executing the following steps:

[0170] Obtain the historical operation records of the target account to which item recommendations are to be made, where the historical operation records are the operation records of the interactions that the user using the target account has performed on at least one target item;

[0171] In the heterogeneous graph corresponding to at least one target item, determine the neighbor nodes respectively associated with each item node where each target item in the at least one target item is located. The neighbor nodes are the nodes selected from the heterogeneous graph according to a predetermined step length. The heterogeneous graph includes a dependency relationship indicating the dependency between an item and the accounts that have performed interaction operations on the item, and the items include at least one target item;

[0172] In the case of classifying the neighbor nodes respectively associated with each target item to obtain a classification result, determine the target embedding vector corresponding to each target item according to the classification result;

[0173] Concatenate the respective target embedding vectors to obtain a comprehensive embedding vector corresponding to at least one target item;

[0174] Use the comprehensive embedding vector for calculation to obtain the item information of the target item to be recommended to the target account.

[0175] Optionally, in this embodiment, those of ordinary skill in the art can understand that all or part of the steps in the above various methods can be completed by instructing the relevant hardware of the terminal device through a program. The program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc, etc.

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

[0177] If the integrated unit in the above embodiments is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in the above computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing one or more computer devices (which can be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods in the various embodiments of the present invention.

[0178] In the above embodiments of the present invention, the descriptions of the various embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0179] In the several embodiments provided by the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, 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 displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of the units or modules can be in electrical or other forms.

[0180] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place, or they can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0181] In addition, the functional units in the various embodiments of the present invention can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.

[0182] The above is only the preferred embodiment of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can still be made, and these improvements and refinements should also be regarded as the protection scope of the present invention.

Claims

1. A method for recommending an item, characterized in that, Including: Obtaining the historical operation records of a target account that will receive item recommendations, where the historical operation records are the operation records of the interactions that a user using the target account has performed on at least one object item; In the heterogeneous graph corresponding to the at least one object item, determining the neighbor nodes respectively associated with each item node where each object item in the at least one object item is located, where the neighbor nodes are the nodes selected from the heterogeneous graph according to a predetermined step size, and the heterogeneous graph includes a dependency relationship indicating the dependency between an item and an account that has performed an interaction operation on the item, and the items include the at least one object item; In the case of classifying the neighbor nodes respectively associated with each object item to obtain a classification result, determining the target embedding vector corresponding to each object item according to the classification result; Concatenating the respective target embedding vectors to obtain a comprehensive embedding vector corresponding to the at least one object item; Using the comprehensive embedding vector for calculation to obtain the item information of the target item to be recommended to the target account.

2. The method according to claim 1, wherein The determining the target embedding vector corresponding to each object item according to the classification result in the case of classifying the neighbor nodes respectively associated with each object item to obtain a classification result includes: Determining each of the object items as the current item, and performing the following operations on the current item: Determining the neighbor nodes of the item node where the current item is located from the heterogeneous graph; Classifying the neighbor nodes into multiple categories according to the types of the neighbor nodes; Determining a type embedding vector for each category of the neighbor nodes; Performing a weighted sum on the type embedding vectors according to the first weight of each category of the neighbor nodes to obtain the target embedding vector.

3. The method according to claim 2, wherein The determining the neighbor nodes of the item node where the current item is located from the heterogeneous graph includes: Taking the item node as the starting point, randomly selecting the associated nodes of the item node in the heterogeneous graph according to a predetermined step size; Each time an associated node is selected according to the predetermined step size, determining the associated node as the new starting point; After determining multiple associated nodes, determining the neighbor nodes from the multiple associated nodes.

4. The method according to claim 3, wherein The determining the neighbor nodes from the multiple associated nodes after determining multiple associated nodes includes: Classifying the associated nodes into multiple categories according to the types of the associated nodes; Sorting the nodes in each category of the associated nodes in descending order of the number of occurrences; Determining the first N nodes in the sorting result of each category of the associated nodes as the neighbor nodes of the item node.

5. The method according to claim 2, wherein The determining a type embedding vector for each category of the neighbor nodes includes: Determining each category of the neighbor nodes as the current category of neighbor nodes, and performing the following operations on the current category of neighbor nodes: obtaining the node embedding vector of each neighbor node in the current category of neighbor nodes; Concatenating the node embedding vectors into a target node embedding vector; Determine the type embedding vector of the current class of neighbor nodes as the ratio of the target node embedding vector to the modulus of the number of nodes in the current class of neighbor nodes.

6. The method according to claim 5, characterized in that, The obtaining the node embedding vector of each neighbor node in the current class of neighbor nodes includes: Determine each of the neighbor nodes in the current class of neighbor nodes as the current neighbor node, and perform the following operations on the current neighbor node: Obtain the attribute set of the current neighbor node, where the attribute set includes multiple attribute information of the current neighbor node; Convert each of the attribute information into an attribute vector; Concatenate the attribute vectors into a target attribute vector; Determine the node embedding vector of the current neighbor node as the ratio of the target attribute vector to the modulus of the attribute set.

7. The method according to claim 2, characterized in that, Before weighted summing the type embedding vectors according to the first weight of each class of neighbor nodes to obtain the target embedding vector, the method further includes: Determine each class of neighbor nodes as the current class of neighbor nodes, and perform the following operations on the current class of neighbor nodes to determine the first weight of the current class of neighbor nodes: Obtain a first concatenated vector obtained by concatenating the node embedding vector of the current item and the type embedding vector of the current class of neighbor nodes; Multiply the first concatenated vector by the attention parameter to obtain a first product, and perform a correction operation on the first product to obtain a first corrected vector; After obtaining a second concatenated vector by concatenating the node embedding vector of the current item and the type embedding vector of each class of neighbor nodes, multiply each of the second concatenated vectors by the attention parameter to obtain a plurality of second products, and perform the correction operation on the plurality of second products to obtain a plurality of second corrected vectors, where each of the second products corresponds to one of the second corrected vectors; Determine the sum of the second corrected vectors; Determine the first weight of the current class of neighbor nodes as the ratio of the first corrected vector to the sum.

8. The method according to any one of claims 1 to 7, characterized in that The concatenating the respective target embedding vectors to obtain the comprehensive embedding vector corresponding to the at least one target item includes: Obtain a first target embedding vector of the last target item among the at least one target item; Assign a second weight to the target embedding vector of each item among the at least one target item; Perform weighted summation on the target embedding vectors of each target item among the at least one target item according to the second weight to obtain a second target embedding vector; Fuse the first target embedding vector and the second target embedding vector into the comprehensive embedding vector.

9. A recommendation device for an item, characterized in that, Includes: An obtaining unit, configured to obtain a historical operation record of a target account that will receive item recommendations, where the historical operation record is an operation record of interaction operations that a user using the target account has performed on at least one target item; A determination unit, configured to determine, in the heterogeneous graph corresponding to the at least one object item, neighbor nodes respectively associated with each item node where each object item in the at least one object item is located, where the neighbor nodes are nodes selected from the heterogeneous graph according to a predetermined step length, the heterogeneous graph includes a dependency relationship indicating the dependency between an item and an account that has performed an interaction operation on the item, and the items include the at least one object item; A classification unit, configured to, when classifying the neighbor nodes respectively associated with each object item to obtain a classification result, determine a target embedding vector corresponding to each object item according to the classification result; A splicing unit, configured to splice the respective target embedding vectors to obtain a comprehensive embedding vector corresponding to the at least one object item; A calculation unit, configured to perform calculations using the comprehensive embedding vector to obtain item information of a target item to be recommended to the target account.

10. The device according to claim 9, characterized in that, The classification unit includes: A first processing module, configured to determine each of the object items as the current item, and perform the following operations on the current item: Determine neighbor nodes of the item node where the current item is located from the heterogeneous graph; Classify the neighbor nodes into multiple categories according to the types of the neighbor nodes; Determine a type embedding vector for each category of the neighbor nodes; Perform weighted summation on the type embedding vectors according to the first weights of each category of the neighbor nodes to obtain the target embedding vector.

11. The device according to claim 10, characterized in that, The first processing module is further configured to: Starting from the item node, randomly select associated nodes of the item node in the heterogeneous graph according to a predetermined step length; Each time an associated node is selected according to the predetermined step length, determine the associated node as the new starting point; After determining multiple associated nodes, determine the neighbor nodes from the multiple associated nodes.

12. The device according to claim 11, characterized in that, The first processing module is further configured to: Classify the associated nodes into multiple categories according to the types of the associated nodes; Sort the nodes in each category of the associated nodes in descending order of the number of occurrences; Determine the first N nodes in the sorting result of each category of the associated nodes as the neighbor nodes of the item node.

13. The device according to any one of claims 9 to 12, characterized in that The splicing unit includes: An acquisition module, configured to acquire a first target embedding vector of the last object item in the at least one object item; An allocation module, configured to allocate a second weight to the target embedding vector of each item in the at least one object item; A calculation module, configured to perform weighted summation on the target embedding vectors of each object item in the at least one object item according to the second weights to obtain a second target embedding vector; A fusion module, configured to fuse the first target embedding vector and the second target embedding vector into the comprehensive embedding vector.

14. A computer-readable storage medium storing a computer program, characterized in that, The computer program, when running, executes the method according to any one of claims 1 to 8.

15. An electronic device, comprising a memory and a processor, characterized in that, A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 8 through the computer program.