A method of user recommendation and related apparatus
By using a graph neural network model to process user features and obtain friend probabilities, the problem of insufficient targeting of user recommendations in existing technologies is solved, thereby improving the accuracy of recommendations and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2022-02-28
- Publication Date
- 2026-07-07
AI Technical Summary
Existing neural network models trained solely on user features are poorly targeted in user recommendations, resulting in ineffective recommendations and negatively impacting user experience.
The training samples are trained using a graph neural network model, including user features with friend relationships. The graph neural network model processes user features to obtain friend probabilities, and recommends target users based on these probabilities.
It improves the accuracy of friend probability and the targeting of user recommendations, thus enhancing the user experience.
Smart Images

Figure CN116712736B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of Internet technology, and in particular to a user recommendation method and related apparatus. Background Technology
[0002] With the continuous development of the Internet, more and more users are communicating or interacting in game software, and different players (i.e., users) connect with each other by adding game friends.
[0003] Currently, neural network models are typically trained based on the user characteristics of each game player, and then the trained neural network model is used to recommend game friends to the target user.
[0004] Because it only considers the user characteristics of game players, it may recommend some game players who are less likely to become friends to the target user, resulting in poor user recommendation targeting and affecting user experience. Summary of the Invention
[0005] In view of this, this application provides a user recommendation method, including:
[0006] The graph neural network model is trained using training samples. The training samples include: user features of the user corresponding to the first set of neighbor nodes, the first set of neighbor nodes includes one or more neighbor nodes, and the user corresponding to the neighbor node in the first set of neighbor nodes has a friend relationship with the user corresponding to the target node.
[0007] Obtain the user characteristics of the first user and the second user. The user characteristics include one or more of the following: user activity characteristics, user gaming characteristics, user payment characteristics, and user social characteristics.
[0008] A graph neural network model is used to process the user characteristics of the first user and the user characteristics of the second user to obtain the friend probability, which indicates the probability that the second user and the first user will form a friend relationship.
[0009] Based on the probability of one or more friends, the target user recommended to the first user is determined, and the target user belongs to the second user.
[0010] In this embodiment, a graph neural network model is used to process the user features of a first user and a second user to obtain a friend probability. This friend probability indicates the probability that the second user and the first user will form a friend relationship. Then, based on this friend probability, a target user is determined to be recommended to the first user; this target user belongs to the second user. Since the training samples used in training the graph neural network model include the user features of multiple users with friend relationships, using this graph neural network model can effectively improve the accuracy of obtaining the friend probability. This enhances the user experience and improves the targeting of user recommendations.
[0011] This application also provides a user recommendation device, comprising:
[0012] The send / receive module is used to obtain the user characteristics of the first user and the second user. The user characteristics include one or more of the following: user activity characteristics, user gaming characteristics, user payment characteristics, and user social characteristics.
[0013] The processing module is used to process the user features of the first user and the user features of the second user using a graph neural network model to obtain the friend probability. The friend probability indicates the probability that the second user and the first user form a friend relationship. The training samples of the graph neural network model include: the user features of the user corresponding to the first neighbor node set, the first neighbor node set including one or more neighbor nodes, and the user corresponding to the neighbor node in the first neighbor node set has a friend relationship with the user corresponding to the target node.
[0014] The processing module is also used to determine the second user to recommend to the first user based on the probability of multiple friends.
[0015] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0016] The training samples for the graph neural network model also include: user features corresponding to the second set of neighbor nodes, the second set of neighbor nodes includes one or more neighbor nodes, and the users corresponding to the neighbor nodes in the second set of neighbor nodes have a friend relationship with the users corresponding to the first neighbor nodes.
[0017] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0018] The second set of neighbor nodes includes a subset of the first set of neighbor nodes. The users corresponding to the neighbor nodes in the first set of neighbor nodes do not have a friend relationship with the user corresponding to the target node. The user features of the users corresponding to the neighbor nodes in the first set of neighbor nodes are used as negative training samples for the graph neural network.
[0019] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0020] The second neighbor node set includes a second neighbor node subset, where the users corresponding to the neighbor nodes in the second neighbor node subset have a friend relationship with the user corresponding to the target node;
[0021] The positive training samples of the graph neural network include: the user features of the neighboring nodes corresponding to the users included in the second neighboring node subset, and the user features of the neighboring nodes corresponding to the users included in the second neighboring node set.
[0022] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0023] The processing module is also used to determine the user features of the first target node and the user features of the neighboring nodes corresponding to the first target node in the training samples of the graph neural network model.
[0024] The processing module is also used to aggregate the user features of the first target node and the user features of the neighboring nodes corresponding to the first target node to obtain a first aggregate vector;
[0025] The processing module is also used to determine the user features of the second target node and the user features of the neighboring nodes corresponding to the second target node in the training samples of the graph neural network model.
[0026] The processing module is also used to aggregate the user features of the second target node and the user features of the neighboring nodes corresponding to the second target node to obtain a second aggregate vector;
[0027] The processing module is also used to merge the first aggregated vector and the second aggregated vector to obtain the first merged vector;
[0028] The processing module is also used to determine the target loss function based on the first merged vector;
[0029] The processing module is also used to optimize the parameters of the graph neural network to be trained until the target loss function converges, thus obtaining the trained graph neural network.
[0030] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0031] The processing module is also used to normalize the user features of the first target node and the user features of the neighboring nodes corresponding to the first target node, so as to obtain the normalized user features of the first target node and the normalized user features of the neighboring nodes corresponding to the first target node.
[0032] The processing module is also used to aggregate the user features of the normalized first target node and the user features of the neighboring nodes corresponding to the normalized first target node to obtain the first aggregate vector.
[0033] The processing module is also used to normalize the user features of the second target node and the user features of the neighboring nodes corresponding to the second target node, so as to obtain the normalized user features of the second target node and the normalized user features of the neighboring nodes corresponding to the second target node.
[0034] The processing module is also used to aggregate the user features of the normalized second target node and the user features of the neighboring nodes corresponding to the normalized second target node to obtain a second aggregate vector.
[0035] In one possible design, in another implementation of another aspect of the embodiments of this application, the user features further include:
[0036] User game characteristics include one or more of the following: game level, game rank, number of game matches, game win rate, and game scene preference.
[0037] In one possible design, in another implementation of another aspect of the embodiments of this application, user activity characteristics include one or more of the following: number of logins, login duration, number of check-ins, and online duration.
[0038] In one possible design, in another implementation of another aspect of the embodiments of this application, the user payment features include one or more of the following: number of payments, total payment amount, payment amount within a period of time, and maximum payment amount.
[0039] In one possible design, in another implementation of another aspect of the embodiments of this application, the user's social characteristics include one or more of the following: number of chats, chat duration, number of likes, number of team-ups, team-up duration, number of gifts sent, and gift amount.
[0040] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0041] The training samples for the graph neural network model also include: user features corresponding to the third neighbor node set, the third neighbor node set includes one or more neighbor nodes, and the users corresponding to the neighbor nodes in the third neighbor node set have a friend relationship with the users corresponding to the second neighbor nodes.
[0042] This application also provides a computer device, including: a memory, a processor, and a bus system;
[0043] The memory is used to store programs;
[0044] The processor is used to execute programs in memory, and the processor is used to execute the methods mentioned above according to the instructions in the program code;
[0045] Bus systems are used to connect memory and processor to enable communication between them.
[0046] Another aspect of this application provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the methods described above.
[0047] Another aspect of this application provides a computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the above aspects.
[0048] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:
[0049] A graph neural network model is used to process the user features of the first user and the second user to obtain the friend probability. This friend probability indicates the probability that the second user and the first user will form a friend relationship. Then, based on this friend probability, a target user that belongs to the second user is determined to be recommended to the first user. Since the training samples used in training the graph neural network model include the user features of multiple users with friend relationships, using this graph neural network model can effectively improve the accuracy of obtaining the friend probability. This enhances the user experience and improves the targeting of user recommendations. Attached Figure Description
[0050] Figure 1 This is a schematic diagram illustrating an application scenario of the user recommendation method provided in the embodiments of this application;
[0051] Figure 2 This is a schematic diagram illustrating the acquisition of the graph neural network involved in an embodiment of this application;
[0052] Figure 3 This is a schematic flowchart of an embodiment of a user recommendation method in this application.
[0053] Figure 4 This is a schematic diagram of the nodes corresponding to the friend relationship in the embodiments of this application;
[0054] Figure 5 This is a schematic diagram of an operation interface in an embodiment of this application;
[0055] Figure 6 This is a schematic diagram of another user interface in the embodiments of this application;
[0056] Figure 7 This is a schematic diagram illustrating the training of a graph neural network according to an embodiment of this application;
[0057] Figure 8 This is a schematic diagram of the user recommendation device in the embodiments of this application;
[0058] Figure 9 This is a schematic diagram of a server structure provided in an embodiment of this application;
[0059] Figure 10 This is a schematic diagram of a terminal device structure provided in an embodiment of this application. Detailed Implementation
[0060] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “corresponding to,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0061] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application. The step numbers in the following embodiments are set only for ease of explanation, and there is no limitation on the order between the steps. The execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.
[0062] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0063] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained first. The nouns and terms involved in the embodiments of this application are subject to the following interpretations.
[0064] A graph is a data form composed of many nodes (also called vertices) connected to each other. Nodes can be entities such as people and organizations, and the connections between nodes (called edges) represent certain relationships (such as friendships, hierarchical relationships, etc.). A graph can have only one type of node and one type of edge (called a single graph), or it can have multiple types of nodes or multiple types of edges (called a heterogeneous graph). The edges in a graph can be directed edges (called a directed graph) or undirected edges (called an undirected graph).
[0065] Graph Neural Networks (GNNs) are graph-based machine learning methods. Their input can be defined as graph structure data or node feature data, and their output is a representation vector for each node or the entire graph.
[0066] Generalization ability refers to a machine learning algorithm's ability to recognize input samples that it has never seen before.
[0067] Source domain: The knowledge domain in which the knowledge being transferred resides during the transfer learning process. It contains a large amount of general knowledge that can be transferred for learning.
[0068] Target domain: The knowledge domain to which the transferred knowledge is to be transferred during the transfer learning process, that is, the domain in which the task is located in machine learning applications.
[0069] The graph neural network pre-training method provided in this application embodiment can be applied to artificial intelligence (AI) technology. AI is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results. AI technology is a comprehensive discipline involving a wide range of fields, including both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly include computer vision, speech processing, natural language processing, and machine learning / deep learning.
[0070] This application's embodiments can be applied to various scenarios such as cloud technology, artificial intelligence, smart transportation, and assisted driving. The user recommendation method can be used in a user recommendation device. This user recommendation device can be integrated into a computer device, which can be a server or a terminal. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms. The server can be a node in a blockchain. The terminal can be a mobile phone, tablet, laptop, smart TV, wearable smart device, personal computer (PC), smart voice interaction device, smart home appliance, or in-vehicle terminal, etc.
[0071] Intelligent Traffic Systems (ITS), also known as Intelligent Transportation Systems, effectively integrate advanced technologies (information technology, computer technology, data communication technology, sensor technology, electronic control technology, automatic control theory, operations research, artificial intelligence, etc.) into transportation, service control, and vehicle manufacturing. This strengthens the connection between vehicles, roads, and users, thereby forming a comprehensive transportation system that ensures safety, improves efficiency, enhances the environment, and conserves energy.
[0072] Intelligent Vehicle Infrastructure Cooperative Systems (IVICS) are a development direction of Intelligent Transportation Systems (ITS). IVICS utilizes advanced wireless communication and next-generation Internet technologies to implement comprehensive, real-time dynamic information exchange between vehicles and infrastructure. Based on the collection and fusion of dynamic traffic information across all times and spaces, it conducts active vehicle safety control and cooperative road management, fully realizing effective collaboration between people, vehicles, and roads. This ensures traffic safety, improves traffic efficiency, and ultimately forms a safe, efficient, and environmentally friendly road traffic system.
[0073] Specifically, the user recommendation method provided in this application embodiment can be applied to various application scenarios in the field of artificial intelligence. For example, in a social network application scenario, it is necessary to recommend other users that a user may know. A prediction model for interpersonal relationships can be established using the graph neural network obtained in this application embodiment. This prediction model then predicts the interpersonal relationships between the user and other users and provides relevant information about other users the user may know. In a medical research application scenario, it is necessary to analyze the properties of chemical molecules with different structures. A prediction model for molecular properties can be established using the graph neural network obtained in this application embodiment. This prediction model then predicts the chemical properties of the molecules, thereby facilitating drug screening. It is understood that the above application scenarios are merely illustrative and do not imply any limitation on the implementation of the user recommendation method in this application embodiment. In these application scenarios, the artificial intelligence system can use the graph neural network trained by this user recommendation method to fine-tune the graph neural network using a small amount of training data in a specified task scenario to obtain the required prediction model for performing the specified task. Based on the graph neural network obtained by the pre-training method provided in this application embodiment, a few parameter updates in these application scenarios can achieve a relatively ideal effect.
[0074] In this application embodiment, the main artificial intelligence technology involved is machine learning.
[0075] Machine Learning (ML) is a multidisciplinary field involving probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory. It specifically studies how computers can simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to endow computers with intelligence. Its applications span all areas of artificial intelligence, and there are many types of algorithms. Machine learning can be categorized based on learning methods: supervised learning, unsupervised learning, semi-supervised learning, and reinforcement learning. Based on algorithm function, it can be divided into: regression algorithms, classification algorithms, clustering algorithms, dimensionality reduction algorithms, and ensemble algorithms, among others.
[0076] With the development of artificial intelligence technology, neural networks have gradually emerged and been applied in various industries. Traditional machine learning commonly uses data in Euclidean space. In Euclidean space, the most prominent feature of data is its regular spatial structure; for example, images are regular square grids, and speech data is a one-dimensional sequence. This data can be represented by one-dimensional or two-dimensional matrices, making data processing relatively simple. Furthermore, these data share a typical characteristic: the data are independent of each other. However, in some practical applications, the data may take the form of an irregular spatial structure, i.e., non-Euclidean space data. Examples include graphs abstracted from electronic transactions, recommendation systems, and social networks. In these graphs, the connections between nodes are not regular or fixed, and there may be interrelated information between nodes. Graph Neural Networks (GNNs) are models specifically designed to process graph-type data. GNNs can model non-Euclidean space data, capture the internal dependencies between data, and thus better generate representation vectors for nodes or graphs.
[0077] Blockchain is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and cryptographic algorithms. Essentially, a blockchain is a decentralized database, a chain of data blocks linked together using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. A blockchain can include an underlying platform, a platform product and service layer, and an application service layer.
[0078] The underlying blockchain platform can include modules for user management, basic services, smart contracts, and operational monitoring. The user management module is responsible for managing the identity information of all blockchain participants, including maintaining public and private key generation (account management), key management, and maintaining the correspondence between user identities and blockchain addresses (access management). Under authorization, it also monitors and audits transactions of certain real identities and provides risk control rule configuration (risk control audit). The basic services module is deployed on all blockchain node devices to verify the validity of business requests. After consensus is reached on valid requests, they are recorded in storage. For a new business request, the basic services first perform interface adaptation parsing and authentication (interface adaptation), and then encrypt the business information using a consensus algorithm (consensus management). The encryption process involves transmitting the encrypted data to the shared ledger (network communication) and storing it in a consistent manner. The smart contract module is responsible for contract registration, issuance, triggering, and execution. Developers can define contract logic using a programming language and publish it to the blockchain (contract registration). Based on the contract terms, the module calls keys or other events to trigger execution and complete the contract logic. It also provides functions for contract upgrades and cancellations. The operation and monitoring module is mainly responsible for deployment, configuration modification, contract settings, cloud adaptation, and real-time status visualization during product launch, such as alarms, network status monitoring, and node device health status monitoring.
[0079] The platform's product service layer provides the basic capabilities and implementation frameworks for typical applications. Developers can leverage these basic capabilities, along with the specific characteristics of their business needs, to implement blockchain-based business logic. The application service layer provides blockchain-based application services to business stakeholders.
[0080] To facilitate understanding of the technical solutions provided in the embodiments of this application, the following example illustrates the application scenario of the AI-based user recommendation method in the scenario of interaction between terminal devices and servers.
[0081] See Figure 1 , Figure 1 This is a schematic diagram illustrating an application scenario for the user recommendation method provided in the embodiments of this application. For example... Figure 1As shown, this application scenario includes a terminal device 110 and a server 120, which communicate via a network. The terminal device 110 provides the server 120 with basic information required for user recommendations, such as user characteristics (including but not limited to user activity characteristics, user gaming characteristics, user payment characteristics, or user social characteristics). The server 120 executes the user recommendation method provided in this embodiment, recommending target users to a first user based on the user characteristics provided by the terminal device 110, where the target user has a high probability of forming a friend relationship with the first user.
[0082] In specific implementation, after the terminal device 110 transmits user features to the server 120 via the network, the server 120 can first call a pre-trained graph neural network model 121 to process the user features of the first user and the second user, obtaining the friend probability between the first user and the second user. This friend probability indicates the probability between the second user and the second user. Then, based on the multiple friend probabilities obtained by the graph neural network model, the server 120 can determine the target user to recommend to the first user. Furthermore, the server 120 can transmit the friend link of the target user to the terminal device 110 via the network.
[0083] It should be noted that, in practical applications, when the graph neural network model 121 obtains the probability of obtaining friends, in addition to user activity features, user game features, user payment features, or user social features, it can also use user registration address information, user login address information, user gender information, or user age information features, etc. This application does not impose any restrictions on the information used by the graph neural network model 121 when obtaining the probability of obtaining friends.
[0084] It should be understood that the user features provided by the terminal device 110 to the server 120 are merely examples. In practical applications, the terminal device 110 may provide fewer or more user features to the server 120. For example, the terminal device 110 may only provide the server 120 with user activity features and user game features, and then the server 120 itself may use these user activity features and user game features to determine other information required in the process of obtaining the probability of friends. No limitation is made here on the user features provided by the terminal device 110 to the server 120.
[0085] It should be understood that Figure 1The application scenarios shown are merely examples. In practical applications, the user recommendation method provided in the embodiments of this application can be executed independently by the terminal device, independently by the server, or jointly by the terminal device and the server. No limitations are made here on the application scenarios of the user recommendation method provided in the embodiments of this application.
[0086] The terminal device 110 can be referred to as a user terminal, which includes, but is not limited to, mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle terminals, aircraft, etc.
[0087] Graph Neural Networks (GNNs) are neural networks that consist of multiple embedding updating layers and a prediction layer.
[0088] Typically, an embedding update layer performs two operations to update the embedding vector of a node in a partite graph. These two operations can include aggregation and combination.
[0089] The aggregation operation uses an aggregation function to aggregate the embedding vectors of the current node's neighboring nodes to obtain the aggregated embedding vectors of the neighboring nodes. Common aggregation methods include mean, max pooling, long short-term memory (LSTM) networks, and attention networks.
[0090] The combine operation combines the neighbor embedding vectors obtained from aggregation with the current embedding vector of the current node to generate an updated embedding vector for the current node. Common combiners include concatenation.
[0091] An embedding update layer can update the embedding vectors of all nodes in a ternary graph simultaneously. When applying the model, the number of embedding update layers in a graph neural network usually needs to be predetermined. As an example, the number of embedding update layers can be set based on the required accuracy of the prediction rating. For instance, if high accuracy is required for the prediction rating, different numbers of embedding update layers can be tested, and the layer with the highest accuracy can be selected. Alternatively, the number of embedding update layers can be set empirically.
[0092] Please see Figure 2 , Figure 2This is a schematic diagram illustrating the acquisition of the graph neural network involved in this application embodiment. This application uses a graph neural network model to process user features and obtain the probability of friendship. Each user is treated as a node, and the user's features serve as the node's initial feature vector. Then, message propagation is performed through a social relationship network structure to update the node's feature vector; this step is also called user model representation. Finally, based on the user model representation, nearest neighbor search is used to determine the target users to be recommended.
[0093] The method for user recommendation based on artificial intelligence provided in this application will be described in detail below through embodiments. Please refer to... Figure 3 , Figure 3 This is a schematic flowchart illustrating an embodiment of a user recommendation method according to this application. The user recommendation method proposed in this application includes:
[0094] 301. Obtain the user characteristics of the first user and the user characteristics of the second user.
[0095] In this embodiment, when the user recommendation device needs to recommend friends to the first user, the user recommendation device obtains the user characteristics of the first user and the user characteristics of the second user. The second user is other users who may form a friend relationship with the first user, and the second user includes one or more users.
[0096] In this embodiment, the user's user characteristics can also be understood as a user feature vector. The user in this embodiment can also be understood as a game player. These user characteristics include one or more of the following: user activity characteristics, user payment characteristics, and user social characteristics. When this embodiment is applied to friend recommendation in a game, the user characteristics may also include user game characteristics. It is understood that the user recommendation method proposed in this embodiment can also be applied to friend recommendation in social software, and this embodiment does not limit this application.
[0097] Examples are given below:
[0098] A. User activity characteristics refer to a user's login status or online status information over a period of time. Examples of user activity characteristics include, but are not limited to: the number of times a user logs in, the duration of their login session (e.g., the number of days they log in), the number of times they check in, or the duration of their online time.
[0099] B. User game characteristics refer to user-related game-related feature information. For example, these user game characteristics include, but are not limited to: user's game level, user's game rank, user's number of game matches, user's game win rate, user's game scenario preferences, etc.
[0100] C. User payment characteristics refer to user payment-related features in the game. For example, these user payment characteristics include, but are not limited to: the number of times a user has made a payment, the total amount a user has paid, the amount a user has paid within a certain period of time, and the maximum amount a user has paid.
[0101] D. User social characteristics refer to the social interaction characteristics of a user with other users in the game. For example, these user social characteristics include, but are not limited to: the number of times a user chats, the duration of a user's chats, the number of times a user likes a message, the number of times a user teams up with other users, the duration of a user team up with other users, the number of times a user sends gifts, and the amount of money a user sends gifts.
[0102] One possible implementation scenario is: Please refer to Figure 5 , Figure 5 This is a schematic diagram of an operation interface in an embodiment of this application. A first user clicks the "Add Friend" control in the game application interface. Then, in response to this click, the user recommendation device acquires the user characteristics of the first user. The user recommendation device identifies a second user from among the users other than the first user and then acquires the user characteristics of the second user. For example, it filters users who are geographically close to the first user upon login as the second user. Then, in step 302, the user recommendation device uses a graph neural network model to process the user characteristics of the first user and the second user to obtain the friend probability. Next, in step 303, the user recommendation device determines a target user to recommend to the first user based on one or more friend probabilities. The relevant information of the target user and the "Add Friend" link are displayed in the "People You May Be Interested In" window of the game application interface. For example... Figure 6 Indication, Figure 6 This is another schematic diagram of an operation interface in the embodiments of this application. The target users displayed in the "People Who May Be Interested" window include: User B, User D, User G, and User H.
[0103] For example, a first user clicks the "Add Friend" control on the game interface to enter the "Add Friend" interface. The user recommendation device obtains the first user's user characteristics, such as: "Gender: Male", "Frequently active time: 22:00~24:00", "Rank: 500", "Location: Shenzhen", and "Preference mode: Ranked Match". Based on these first user characteristics, the user recommendation device uses a graph neural network model to determine target users to recommend to the first user from among the second users. Specifically, in the "Add Friend" interface, the target users recommended to the first user are displayed in the "People You May Be Interested In" sub-window. For example: User B, User D, User G, and User H. Among them, User B's user characteristics include: "Gender: Male", "Frequently active time: 22:00~24:00", "Rank: 400", "Location: Shenzhen", and "Preference mode: Ranked Match". User D's user characteristics include: "Gender: Female", "Frequent online time: 23:00~01:00", "Rank: 540", "Location: Shenzhen", and "Preference mode: Ranked matches". User G's user characteristics include: "Gender: Male", "Frequent online time: 23:00~01:00", "Rank: 520", "Location: Guangzhou", and "Preference mode: Ranked matches". User H's user characteristics include: "Gender: Male", "Frequent online time: 22:00~01:00", "Rank: 520", "Location: Huizhou", and "Preference mode: Ranked matches". Based on the user characteristics of users B, D, G, and H, it can be seen that users B, D, G, and H have similar preference modes, ranks, and locations to the first user, or their frequent online times are similar. Therefore, it is highly likely that users B, D, G, and H will become friends with the first user.
[0104] 302. A graph neural network model is used to process the user characteristics of the first user and the user characteristics of the second user to obtain the probability of friendship.
[0105] In this embodiment, the user recommendation device uses a graph neural network model to process the user characteristics of the first user and the user characteristics of the second user to obtain the probability of friendship.
[0106] One possible implementation is: let the node corresponding to the first user be... Let the node corresponding to the second user be The probability of the first user and the second user being friends is obtained using the following method:
[0107] ;
[0108] in, The probability of the first user and the second user being friends. This is the paranoia parameter in the logistic regression model. For example, the Sigmoid function: .
[0109] node For nodes Corresponding neighbor nodes, nodes Corresponding users and nodes The corresponding users have a friend relationship. Including nodes One or more nodes that have a neighbor relationship. Can be regarded as a node The set of neighboring nodes, nodes belong . For nodes The user characteristics of the corresponding user (i.e., the user characteristics of the first user). For nodes Corresponding user characteristics is the first parameter in the graph neural network. For the first user (node) User characteristics and other users (nodes) who are friends with the first user. The aggregate vector is obtained by aggregating user features.
[0110] in, For the second user, For nodes Corresponding neighbor nodes, nodes Corresponding users and nodes The corresponding users have a friend relationship. Including nodes One or more nodes that have a neighbor relationship. Can be regarded as a node The set of neighboring nodes, nodes belong .
[0111] For nodes The user characteristics of the corresponding user (i.e., the user characteristics of the second user). For nodes Corresponding user characteristics This is the second parameter in the graph neural network. For the second user (node) User characteristics and other users (nodes) who are friends with the second user. The aggregate vector is obtained by aggregating user features. and Consistency is the first parameter in the graph neural network, which is obtained during the training process of the graph neural network.
[0112] 303. Based on the probability of one or more friends, determine the target user to recommend to the first user.
[0113] In this embodiment, the user recommendation device obtains one or more friend probabilities based on the user characteristics of the first user and the user characteristics of the second user (each friend probability corresponds to one second user). The user recommendation device then sorts these one or more friend probabilities and selects the top H users (where H is a positive integer) as target users. The user recommendation device then recommends these target users to the first user. For example, the user recommendation device displays the relevant information of the target user and a link to add them as a friend in the "People You May Be Interested In" window of the game application interface. For example, as shown in Table 1, Table 1 illustrates the probability of a second user forming a friend relationship with the first user. The user recommendation device selects the five second users (user a to user e) with the highest probabilities as target users to recommend to the first user.
[0114] Table 1
[0115]
[0116] In this embodiment, the user recommendation device uses a graph neural network model to process the user features of a first user and a second user to obtain a friend probability. This friend probability indicates the probability that the second user and the first user will become friends. Then, based on this friend probability, a target user is determined to be recommended to the first user; this target user belongs to the second user. Since the training samples used in training the graph neural network model include the user features of multiple users with friend relationships, using this graph neural network model can effectively improve the accuracy of obtaining friend probabilities. In a possible simulation scenario, compared to the traditional XGBoost algorithm, the graph neural network model using this scheme improves the hit rate for obtaining friend probabilities and recommending friends by 2.98%. This hit rate refers to the probability that the recommended target user and the first user will eventually become friends.
[0117] In conjunction with the foregoing embodiments, the training samples for the graph neural network model further include: user features corresponding to the second set of neighbor nodes, wherein the second set of neighbor nodes includes one or more neighbor nodes, and the users corresponding to the neighbor nodes in the second set of neighbor nodes have a friend relationship with the users corresponding to the first neighbor nodes. Specifically, for example... Figure 4For example, if the target node is node A, then the first set of neighboring nodes is nodes B, C, D and E, and the second set of neighboring nodes is nodes E and F.
[0118] In one possible implementation, the first set of neighboring nodes can be the set of first-order neighboring nodes of the target node. For example, let the target node be a node. ,node The set of neighbor nodes is ,sampling In 1 nodes, as the set of first neighbor nodes: ,in, , A custom hyperparameter. For example: .
[0119] for Each node in , ,node The set of neighboring nodes , Remove Nodes and nodes Then sample Each node From the neighboring nodes, we finally get a result from... The set of second-order neighbor nodes is denoted as , As a subset of the first neighbor nodes included in the second set of neighbor nodes.
[0120] The above methods can effectively expand the training samples of the graph neural network model and improve the accuracy of the graph neural network model in obtaining the probability of friends.
[0121] In conjunction with the foregoing embodiments, the user recommendation device trains the graph neural network model using training samples from the graph neural network model, specifically including:
[0122] In this embodiment, the user recommendation device trains the graph neural network model using training samples. Specifically, the training samples of the graph neural network model include: user features corresponding to a first set of neighboring nodes, wherein the first set of neighboring nodes includes one or more neighboring nodes, and the users corresponding to the neighboring nodes in the first set of neighboring nodes have a friend relationship with the user corresponding to the target node.
[0123] It should be noted that in the embodiments of this application, the neighbor relationship between two nodes, or the neighbor node of one node, refers to the fact that the users corresponding to the two nodes have a friend relationship (or have formed a friend relationship).
[0124] For easier understanding, please refer to Figure 4 , Figure 4 This is a schematic diagram of the nodes corresponding to the friend relationship in the embodiments of this application. Figure 4 This includes nodes A, B, C, D, E, and F. Each node corresponds to a user (or a player). A connection between two nodes indicates that the users corresponding to those two nodes are friends. For example... Figure 4 The user corresponding to node A is a friend of the user corresponding to node B; the user corresponding to node A is a friend of the user corresponding to node D; the user corresponding to node A is a friend of the user corresponding to node C; and the user corresponding to node A is a friend of the user corresponding to node E. The user corresponding to node B is a friend of the users corresponding to nodes E and F. The user corresponding to node D is a friend of the user corresponding to node F.
[0125] If node A is taken as the target node, then the set of its first neighbor nodes includes nodes B, D, and C. When training the graph neural network model, the training samples used include: user features corresponding to the user at node A, user features corresponding to the user at node B, user features corresponding to the user at node C, and user features corresponding to the user at node D.
[0126] Based on the aforementioned multiple features, the user recommendation device concatenates these features to form the user's user characteristics. Then, the graph neural network model normalizes these user characteristics, and the normalized user characteristics serve as training samples for the graph neural network model.
[0127] Specifically, because user characteristics have different value ranges across multiple dimensions, it is necessary to normalize the data across these different dimensions. For example, for data... This data can be obtained. The maximum and minimum values in a certain dimension. The maximum value is represented as... The minimum value is expressed as Then let the normalized data... For data ,in, .
[0128] Optionally, if the data is in a certain dimension... If the maximum and minimum values are equal, then remove the data. The reason is that data in this dimension lacks discriminative power and is not helpful for model training.
[0129] It is understood that the user recommendation device can train the graph neural network model online and use it to obtain the friend probability. The user recommendation device can also use the graph neural network model trained offline to obtain the friend probability; this application embodiment does not impose any limitations on this.
[0130] In conjunction with the foregoing embodiments, the training samples for the graph neural network model further include: user features corresponding to the third neighbor node set, the third neighbor node set including one or more neighbor nodes, and the user corresponding to the neighbor node in the third neighbor node set having a friend relationship with the user corresponding to the second neighbor node.
[0131] In one possible implementation, for Each node in , ,node The set of neighboring nodes , Remove Nodes and nodes Then sample Each node From the neighboring nodes, we finally get a result from... The set of third-order neighbor nodes is denoted as , As the set of third neighbor nodes.
[0132] It is understood that the training of the graph neural network model in this application embodiment may use user features of a higher-order set of neighbor nodes, and this application embodiment does not limit this.
[0133] The above methods can effectively expand the training samples of the graph neural network model and improve the accuracy of the graph neural network model in obtaining the probability of friends.
[0134] In conjunction with the foregoing embodiments, the second set of neighbor nodes includes a subset of the first set of neighbor nodes. The users corresponding to the neighbor nodes in the first set of neighbor nodes do not have a friend relationship with the user corresponding to the target node. The user features of the users corresponding to the neighbor nodes in the first set of neighbor nodes are used as negative training samples for the graph neural network.
[0135] For better understanding, please refer to... Figure 4 , Figure 4 In the given information, since the second set of neighboring nodes includes nodes E and F, and the user corresponding to node E is a friend of the user corresponding to node A, while the user corresponding to node F is not a friend of the user corresponding to node A, the first set of neighboring nodes corresponding to the target node includes node F.
[0136] By using the user characteristics of users who are not friends with the target user as negative samples in the training samples, the discriminative power of the graph neural network model can be effectively improved.
[0137] In conjunction with the foregoing embodiments, the second neighbor node set includes a second neighbor node subset, wherein the users corresponding to the neighbor nodes included in the second neighbor node subset have a friend relationship with the user corresponding to the target node; the positive training samples of the graph neural network include: user features of the users corresponding to the neighbor nodes included in the second neighbor node subset, and user features of the users corresponding to the neighbor nodes included in the second neighbor node set.
[0138] For better understanding, please refer to... Figure 4 , Figure 4 In the given information, since the second neighbor node set includes nodes E and F, and the user corresponding to node E is a friend of the user corresponding to node A, while the user corresponding to node F is not a friend of the user corresponding to node A, the second neighbor node subset corresponding to the target node includes node E.
[0139] By using user features of users who are friends with the target user as positive samples in the training samples, the discriminative power of the graph neural network model can be effectively improved.
[0140] Based on the foregoing embodiments, the following provides a detailed explanation of how to train this graph neural network. For easier understanding, please refer to [link to relevant documentation]. Figure 7 , Figure 7 This is a schematic diagram of the training of a graph neural network according to an embodiment of this application.
[0141] Specifically, the user recommendation device trains the graph neural network model using training samples from the graph neural network model, including:
[0142] The user recommendation device determines the user features of the first target node (i.e., the user features of the user corresponding to the first target node) and the user features of the neighboring nodes corresponding to the first target node in the training samples of the graph neural network model. Specifically, the target node includes the first target node, and the neighboring nodes corresponding to the first target node belong to the first neighboring node set, the second neighboring node set, or the third neighboring node set corresponding to the first target node.
[0143] The user recommendation device aggregates the user features of the first target node and the user features of the neighboring nodes corresponding to the first target node to obtain a first aggregated vector. The neighboring nodes corresponding to the first target node can be all the neighboring nodes corresponding to the first target node, or they can be some of the neighboring nodes corresponding to the first target node. This application embodiment does not limit this.
[0144] One possible implementation is to sum the user features of the neighboring nodes corresponding to the first target node and then perform an average processing, and then sum the result with the user features of the first target node and then perform an average processing to obtain the first aggregate vector;
[0145] The user recommendation device determines the user features of the second target node and the user features of the neighboring nodes corresponding to the second target node in the training samples of the graph neural network model. Specifically, the target node includes the second target node, and the neighboring nodes corresponding to the second target node belong to the first neighboring node set, the second neighboring node set, or the third neighboring node set corresponding to the second target node. The neighboring nodes corresponding to the second target node can be all the neighboring nodes corresponding to the second target node, or they can be some of the neighboring nodes corresponding to the second target node. This application embodiment does not limit this.
[0146] The user recommendation device aggregates the user features of the second target node and the user features of the neighboring nodes corresponding to the second target node to obtain a second aggregated vector.
[0147] One possible implementation is to sum the user features of the neighboring nodes corresponding to the second target node and then perform an average processing, and then sum the result with the user features of the second target node and then perform an average processing to obtain the second aggregate vector;
[0148] The user recommendation device merges the first aggregated vector and the second aggregated vector to obtain the first merged vector;
[0149] The user recommendation device determines the target loss function based on the first merged vector. One possible implementation is to use a logistic regression algorithm to obtain and determine the target loss function;
[0150] The user recommendation device optimizes the parameters of the graph neural network to be trained until the target loss function converges, thus obtaining the trained graph neural network.
[0151] In one possible implementation, the user features of the first target node and the user features of its neighboring nodes are aggregated to obtain a first aggregate vector, including:
[0152] ;
[0153] in, As the first target node, The neighboring nodes of the first target node. This includes one or more nodes that are neighbors of the first target node. belong , User characteristics for the first target node, The user characteristics of the neighboring nodes corresponding to the first target node. The first parameter to be learned in the graph neural network model. This is the first aggregation vector.
[0154] In one possible implementation, the user features of the second target node and the user features of its neighboring nodes are aggregated to obtain a second aggregated vector, including:
[0155] ;
[0156] in, For the second target node, The neighboring nodes of the second target node. This includes one or more nodes that are neighbors of the second target node. belong , User characteristics for the second target node. The user characteristics of the neighboring nodes corresponding to the second target node. The first parameter to be learned in the graph neural network model. This is the second aggregation vector.
[0157] In one possible implementation, the first aggregated vector and the second aggregated vector are merged to obtain a first merged vector, including:
[0158] ;
[0159] in, This is the first merged vector. This is the first aggregation vector. This is the second aggregation vector.
[0160] In one possible implementation, the target loss function is determined based on the first merge vector, including:
[0161] ;
[0162] in, Let be the target loss function. The second parameter to be learned. This is the first merged vector. The paranoia parameter in the logistic regression model. For the Sigmoid function, Indicates whether the user corresponding to the first target node and the user corresponding to the second target node have a friend relationship.
[0163] In this embodiment of the application, the graph neural network model is trained using the above method. During the training process, a variety of training samples are fully referenced. For training samples with high learning costs and training samples that are difficult to distinguish, the above method can effectively distinguish them, thus effectively improving the discriminativeness of the graph neural network model and reducing the training cost of the graph neural network model.
[0164] The foregoing primarily describes the solutions provided in the embodiments of this application from a methodological perspective. It is understood that, in order to achieve the aforementioned functions, the user recommendation device includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, based on the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0165] This application embodiment can divide the user recommendation device into functional modules based on the above method example. For example, each function can be divided into its own functional module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. It should be noted that the module division in this application embodiment is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.
[0166] The user recommendation device in this application is described in detail below. Please refer to [link / reference]. Figure 8 , Figure 8 This is a schematic diagram of the user recommendation device in an embodiment of this application. The user recommendation device 800 proposed in this embodiment includes: a processing module 801 and a transceiver module 802;
[0167] The transceiver module 802 is used to obtain the user characteristics of the first user and the user characteristics of the second user. The user characteristics include one or more of the following: user activity characteristics, user game characteristics, user payment characteristics, and user social characteristics.
[0168] The processing module 801 is used to process the user features of the first user and the user features of the second user using a graph neural network model to obtain the friend probability. The friend probability indicates the probability that the second user and the first user form a friend relationship. The training samples of the graph neural network model include: the user features of the user corresponding to the first neighbor node set, the first neighbor node set including one or more neighbor nodes, and the user corresponding to the neighbor node in the first neighbor node set has a friend relationship with the user corresponding to the target node.
[0169] The processing module 801 is also used to determine the second user to recommend to the first user based on the probability of multiple friends.
[0170] In one possible implementation,
[0171] The training samples for the graph neural network model also include: user features corresponding to the second set of neighbor nodes, the second set of neighbor nodes includes one or more neighbor nodes, and the users corresponding to the neighbor nodes in the second set of neighbor nodes have a friend relationship with the users corresponding to the first neighbor nodes.
[0172] In one possible implementation,
[0173] The second set of neighbor nodes includes a subset of the first set of neighbor nodes. The users corresponding to the neighbor nodes in the first set of neighbor nodes do not have a friend relationship with the user corresponding to the target node. The user features of the users corresponding to the neighbor nodes in the first set of neighbor nodes are used as negative training samples for the graph neural network.
[0174] In one possible implementation,
[0175] The second neighbor node set includes a second neighbor node subset, where the users corresponding to the neighbor nodes in the second neighbor node subset have a friend relationship with the user corresponding to the target node;
[0176] The positive training samples of the graph neural network include: the user features of the neighboring nodes corresponding to the users included in the second neighboring node subset, and the user features of the neighboring nodes corresponding to the users included in the second neighboring node set.
[0177] In one possible implementation,
[0178] The processing module 801 is also used to determine the user features of the first target node and the user features of the neighboring nodes corresponding to the first target node in the training samples of the graph neural network model.
[0179] The processing module 801 is also used to aggregate the user features of the first target node and the user features of the neighboring nodes corresponding to the first target node to obtain a first aggregate vector;
[0180] The processing module 801 is also used to determine the user features of the second target node in the training samples of the graph neural network model, and the user features of the neighboring nodes corresponding to the second target node.
[0181] The processing module 801 is also used to aggregate the user features of the second target node and the user features of the neighboring nodes corresponding to the second target node to obtain a second aggregate vector.
[0182] Processing module 801 is also used to merge the first aggregated vector and the second aggregated vector to obtain the first merged vector;
[0183] The processing module 801 is also used to determine the target loss function based on the first merged vector;
[0184] The processing module 801 is also used to optimize the parameters of the graph neural network to be trained until the target loss function converges, thus obtaining the trained graph neural network.
[0185] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0186] The processing module 801 is also used to normalize the user features of the first target node and the user features of the neighboring nodes corresponding to the first target node, so as to obtain the normalized user features of the first target node and the normalized user features of the neighboring nodes corresponding to the first target node.
[0187] The processing module 801 is also used to aggregate the user features of the normalized first target node and the user features of the neighboring nodes corresponding to the normalized first target node to obtain a first aggregate vector.
[0188] The processing module 801 is also used to normalize the user features of the second target node and the user features of the neighboring nodes corresponding to the second target node, so as to obtain the normalized user features of the second target node and the normalized user features of the neighboring nodes corresponding to the second target node.
[0189] The processing module 801 is also used to aggregate the user features of the normalized second target node and the user features of the neighboring nodes corresponding to the normalized second target node to obtain a second aggregate vector.
[0190] In one possible design, in another implementation of another aspect of the embodiments of this application, the user features further include:
[0191] User game characteristics include one or more of the following: game level, game rank, number of game matches, game win rate, and game scene preference.
[0192] In one possible design, in another implementation of another aspect of the embodiments of this application, user activity characteristics include one or more of the following: number of logins, login duration, number of check-ins, and online duration.
[0193] In one possible design, in another implementation of another aspect of the embodiments of this application, the user payment features include one or more of the following: number of payments, total payment amount, payment amount within a period of time, and maximum payment amount.
[0194] In one possible design, in another implementation of another aspect of the embodiments of this application, the user's social characteristics include one or more of the following: number of chats, chat duration, number of likes, number of team-ups, team-up duration, number of gifts sent, and gift amount.
[0195] In one possible implementation,
[0196] Processing module 801 is further configured to aggregate the user features of the first target node and the user features of the neighboring nodes corresponding to the first target node to obtain a first aggregate vector, including:
[0197] ;
[0198] in, As the first target node, The neighboring nodes of the first target node. This includes one or more nodes that are neighbors of the first target node. belong , User characteristics for the first target node, The user characteristics of the neighboring nodes corresponding to the first target node. The first parameter to be learned in the graph neural network model. This is the first aggregation vector.
[0199] In one possible implementation,
[0200] Processing module 801 is further configured to aggregate the user features of the second target node and the user features of the neighboring nodes corresponding to the second target node to obtain a second aggregate vector, including:
[0201] ;
[0202] in, For the second target node, The neighboring nodes of the second target node. This includes one or more nodes that are neighbors of the second target node. belong , User characteristics for the second target node. The user characteristics of the neighboring nodes corresponding to the second target node. The first parameter to be learned in the graph neural network model. This is the second aggregation vector.
[0203] In one possible implementation,
[0204] Processing module 801 is further configured to merge the first aggregated vector and the second aggregated vector to obtain a first merged vector, including:
[0205] ;
[0206] in, This is the first merged vector. This is the first aggregation vector. This is the second aggregation vector.
[0207] In one possible implementation,
[0208] Processing module 801 is further configured to determine the target loss function based on the first merged vector, including:
[0209] ;
[0210] in, Let be the target loss function. The second parameter to be learned. This is the first merged vector. The paranoia parameter in the logistic regression model. For the Sigmoid function, Indicates whether the user corresponding to the first target node and the user corresponding to the second target node have a friend relationship.
[0211] In one possible implementation,
[0212] Processing module 801 is further configured to process the user features of the first user and the user features of the second user using a graph neural network model to obtain the probability of friendship, including:
[0213] Let the node corresponding to the first user be Let the node corresponding to the second user be Then, the processing module 801 uses the following method to obtain the probability of the first user and the second user being friends:
[0214] ;
[0215] in, The probability of the first user and the second user being friends.
[0216] In one possible implementation,
[0217] The training samples for the graph neural network model also include: user features corresponding to the third neighbor node set, the third neighbor node set includes one or more neighbor nodes, and the users corresponding to the neighbor nodes in the third neighbor node set have a friend relationship with the users corresponding to the second neighbor nodes.
[0218] Figure 9 This is a schematic diagram of a server structure provided in an embodiment of this application. The server 700 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 722 (e.g., one or more processors) and memory 732, and one or more storage media 730 (e.g., one or more mass storage devices) for storing application programs 742 or data 744. The memory 732 and storage media 730 can be temporary or persistent storage. The program stored in the storage media 730 may include one or more modules (not shown in the diagram), each module may include a series of instruction operations on the server. Furthermore, the CPU 722 may be configured to communicate with the storage media 730 and execute the series of instruction operations in the storage media 730 on the server 700.
[0219] Server 700 may also include one or more power supplies 726, one or more wired or wireless network interfaces 750, one or more input / output interfaces 758, and / or one or more operating systems 741, such as Windows Server. TM Mac OS X TM Unix TM Linux TM FreeBSD TM etc.
[0220] The steps performed by the server in the above embodiments can be based on this Figure 9 The server structure shown.
[0221] Figure 10 This is a schematic diagram of a terminal device structure provided in an embodiment of this application, such as... Figure 10As shown, for ease of explanation, only the parts related to the embodiments of this application are shown. For specific technical details not disclosed, please refer to the method section of the embodiments of this application. This terminal device is also called a user terminal, which can be any terminal device including mobile phones, tablets, personal digital assistants (PDAs), point-of-sale (POS) terminals, in-vehicle computers, etc. User terminals include, but are not limited to, mobile phones, computers, intelligent voice interaction devices, smart home appliances, in-vehicle terminals, and aircraft. Taking a mobile phone as an example:
[0222] Figure 10 This diagram illustrates a partial structural representation of a mobile phone related to the terminal device provided in this embodiment. (Reference) Figure 10 The mobile phone includes components such as a radio frequency (RF) circuit 810, a memory 820, an input unit 830, a display unit 840, a sensor 850, an audio circuit 860, a wireless fidelity (WiFi) module 870, a processor 880, and a power supply 890. Those skilled in the art will understand that... Figure 10 The mobile phone structure shown does not constitute a limitation on the mobile phone and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0223] The following is combined with Figure 10 A detailed introduction to each component of a mobile phone:
[0224] RF circuit 810 can be used for receiving and transmitting signals during information transmission or calls. Specifically, it receives downlink information from the base station and processes it with processor 880; additionally, it transmits uplink data to the base station. Typically, RF circuit 810 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier (LNA), a duplexer, etc. Furthermore, RF circuit 810 can also communicate wirelessly with networks and other devices. The aforementioned wireless communication can use any communication standard or protocol, including but not limited to Global System for Mobile Communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.
[0225] The memory 820 can be used to store software programs and modules. The processor 880 executes various functions and data processing of the mobile phone by running the software programs and modules stored in the memory 820. The memory 820 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory 820 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0226] The input unit 830 can be used to receive input numerical or character information, and to generate key signal inputs related to user settings and function control of the mobile phone. Specifically, the input unit 830 may include a touch panel 831 and other input devices 832. The touch panel 831, also known as a touch screen, can collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel 831), and drive the corresponding connected devices according to a pre-set program. Optionally, the touch panel 831 may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch position and the signal generated by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 880, and can also receive and execute commands sent by the processor 880. In addition, the touch panel 831 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 831, the input unit 830 may also include other input devices 832. Specifically, other input devices 832 may include, but are not limited to, one or more of the following: physical keyboard, function keys (such as volume control buttons, power buttons, etc.), trackball, mouse, joystick, etc.
[0227] The display unit 840 can be used to display information input by the user or information provided to the user, as well as various menus of the mobile phone. The display unit 840 may include a display panel 841, which may optionally be configured as a liquid crystal display (LCD), organic light-emitting diode (OLED), or similar display. Further, a touch panel 831 may cover the display panel 841. When the touch panel 831 detects a touch operation on or near it, it transmits the information to the processor 880 to determine the type of touch event. Subsequently, the processor 880 provides corresponding visual output on the display panel 841 based on the type of touch event. Although in Figure 10 In this embodiment, the touch panel 831 and the display panel 841 are two separate components to realize the input and output functions of the mobile phone. However, in some embodiments, the touch panel 831 and the display panel 841 can be integrated to realize the input and output functions of the mobile phone.
[0228] The mobile phone may also include at least one sensor 850, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor. The ambient light sensor can adjust the brightness of the display panel 841 according to the ambient light level, and the proximity sensor can turn off the display panel 841 and / or backlight when the phone is moved to the ear. As a type of motion sensor, an accelerometer sensor can detect the magnitude of acceleration in various directions (generally three axes). When stationary, it can detect the magnitude and direction of gravity, and can be used for applications that recognize the phone's posture (such as landscape / portrait switching, related games, magnetometer posture calibration), vibration recognition-related functions (such as pedometer, taps), etc. Other sensors that may be configured in the mobile phone, such as gyroscopes, barometers, hygrometers, thermometers, and infrared sensors, will not be described in detail here.
[0229] Audio circuit 860, speaker 861, and microphone 862 provide an audio interface between the user and the mobile phone. Audio circuit 860 converts received audio data into electrical signals and transmits them to speaker 861, where speaker 861 converts them into sound signals for output. On the other hand, microphone 862 converts collected sound signals into electrical signals, which are received by audio circuit 860, converted into audio data, and then output to processor 880 for processing. The audio data is then transmitted via RF circuit 810 to, for example, another mobile phone, or output to memory 820 for further processing.
[0230] WiFi is a short-range wireless transmission technology. Through the WiFi module 870, mobile phones can help users send and receive emails, browse web pages, and access streaming media, providing users with wireless broadband internet access. Although Figure 10 The WiFi module 870 is shown, but it is understood that it is not an essential component of a mobile phone and can be omitted as needed without changing the essence of the invention.
[0231] The processor 880 is the control center of the mobile phone, connecting various parts of the phone through various interfaces and lines. It performs various functions and processes data by running or executing software programs and / or modules stored in the memory 820, and by calling data stored in the memory 820, thereby performing an overall check of the phone. Optionally, the processor 880 may include one or more processing units; optionally, the processor 880 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the aforementioned modem processor may also not be integrated into the processor 880.
[0232] The phone also includes a power supply 890 (such as a battery) that supplies power to various components. Optionally, the power supply can be logically connected to the processor 880 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system.
[0233] Although not shown, mobile phones may also include a camera, Bluetooth module, etc., which will not be described in detail here.
[0234] The steps performed by the terminal device in the above embodiments can be based on this Figure 10 The terminal device structure is shown.
[0235] This application also provides a computer-readable storage medium storing a computer program that, when run on a computer, causes the computer to perform the methods described in the foregoing embodiments.
[0236] This application also provides a computer program product including a program, which, when run on a computer, causes the computer to perform the methods described in the foregoing embodiments.
[0237] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0238] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.
[0239] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0240] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0241] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0242] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
[0243] It should be noted that the user information (including but not limited to user characteristics, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
Claims
1. A user recommendation method, characterized in that, include: Obtain user characteristics of the first user and user characteristics of the second user, wherein the user characteristics include one or more of the following: user activity characteristics, user payment characteristics, and user social characteristics; A graph neural network model is used to process the user features of the first user and the second user to obtain the friend probability. The friend probability indicates the probability that the second user and the first user will form a friend relationship. The training samples of the graph neural network model include: user features of users corresponding to the first set of neighbor nodes and user features of users corresponding to the second set of neighbor nodes. Both the first set of neighbor nodes and the second set of neighbor nodes include one or more neighbor nodes. Users corresponding to neighbor nodes in the first set of neighbor nodes have a friend relationship with users corresponding to target nodes. Users corresponding to neighbor nodes in the second set of neighbor nodes have a friend relationship with users corresponding to the first neighbor nodes. The second set of neighbor nodes includes a subset of the first set of neighbor nodes, which is obtained by sampling after removing nodes from the first set of neighbor nodes and the target node from the second set of neighbor nodes. Users corresponding to neighbor nodes included in the first set of neighbor nodes do not have a friend relationship with users corresponding to the target node. The user features of users corresponding to neighbor nodes in the first set of neighbor nodes serve as negative training samples for the graph neural network. Based on one or more of the friend probabilities, a target user is determined to be recommended to the first user, and the target user belongs to the second user.
2. The method according to claim 1, characterized in that, The second set of neighbor nodes includes a second subset of neighbor nodes, wherein the users corresponding to the neighbor nodes in the second subset of neighbor nodes have a friend relationship with the user corresponding to the target node; The positive training samples of the graph neural network include: user features of the users corresponding to the neighbor nodes included in the second neighbor node subset, and user features of the users corresponding to the neighbor nodes included in the second neighbor node set.
3. The method according to claim 1, characterized in that, The method further includes: Determine the user features of the first target node and the user features of the neighboring nodes corresponding to the first target node in the training samples of the graph neural network model; The user features of the first target node and the user features of the neighboring nodes corresponding to the first target node are aggregated to obtain a first aggregate vector; Determine the user features of the second target node and the user features of the neighboring nodes corresponding to the second target node in the training samples of the graph neural network model; The user features of the second target node and the user features of the neighboring nodes corresponding to the second target node are aggregated to obtain a second aggregate vector; The first aggregated vector and the second aggregated vector are merged to obtain the first merged vector; Based on the first merged vector, determine the target loss function; The parameters of the graph neural network to be trained are optimized until the target loss function converges, thus obtaining the trained graph neural network.
4. The method according to claim 3, characterized in that, The aggregation process of the user features of the first target node and the user features of the neighboring nodes corresponding to the first target node to obtain a first aggregation vector includes: The user features of the first target node and the user features of the neighboring nodes corresponding to the first target node are normalized to obtain the normalized user features of the first target node and the normalized user features of the neighboring nodes corresponding to the first target node. The user features of the first target node after normalization and the user features of the neighboring nodes corresponding to the first target node after normalization are aggregated to obtain the first aggregated vector; The aggregation process of the user features of the second target node and the user features of the neighboring nodes corresponding to the second target node to obtain the second aggregation vector includes: The user features of the second target node and the user features of the neighboring nodes corresponding to the second target node are normalized to obtain the normalized user features of the second target node and the normalized user features of the neighboring nodes corresponding to the second target node. The user features of the normalized second target node and the user features of the neighboring nodes corresponding to the normalized second target node are aggregated to obtain the second aggregate vector.
5. The method according to any one of claims 1-4, characterized in that, The user characteristics also include: User game characteristics, which include one or more of the following: game level, game rank, number of game matches, game win rate, and game scene preference.
6. The method according to any one of claims 1-4, characterized in that, The user activity characteristics include one or more of the following: number of logins, login duration, number of check-ins, and online duration.
7. The method according to any one of claims 1-4, characterized in that, The user payment characteristics include one or more of the following: number of payments, total payment amount, payment amount within a certain period, and maximum payment amount.
8. The method according to any one of claims 1-4, characterized in that, The user's social characteristics include one or more of the following: number of chats, chat duration, number of likes, number of team-ups, team-up duration, number of gifts sent, and gift amount.
9. The method according to any one of claims 1-4, characterized in that, The training samples of the graph neural network model also include: user features of users corresponding to the third neighbor node set, wherein the third neighbor node set includes one or more neighbor nodes, and the users corresponding to the neighbor nodes in the third neighbor node set have a friend relationship with the users corresponding to the second neighbor nodes.
10. A user recommendation device, characterized in that, include: The transceiver module is used to acquire user characteristics of the first user and user characteristics of the second user. The user characteristics include one or more of the following: user activity characteristics, user game characteristics, user payment characteristics, and user social characteristics. The processing module is used to process the user features of the first user and the user features of the second user using a graph neural network model to obtain the friend probability. The friend probability indicates the probability that the second user and the first user form a friend relationship. The training samples of the graph neural network model include: user features of users corresponding to the first set of neighbor nodes and user features of users corresponding to the second set of neighbor nodes. The first set of neighbor nodes and the second set of neighbor nodes each include one or more neighbor nodes. The user corresponding to the neighbor node in the first set of neighbor nodes has a friend relationship with the user corresponding to the target node. The user corresponding to the neighbor node in the second set of neighbor nodes has a friend relationship with the user corresponding to the first neighbor node. The second set of neighbor nodes includes a subset of the first set of neighbor nodes. The first subset of neighbor nodes is obtained by sampling the second set of neighbor nodes after removing the nodes in the first set of neighbor nodes and the target node. The users corresponding to the neighbor nodes in the first neighbor node subset do not have a friend relationship with the user corresponding to the target node, and the user features of the users corresponding to the neighbor nodes in the first neighbor node subset are used as negative training samples of the graph neural network. The processing module is further configured to determine the second user to be recommended to the first user based on the probabilities of multiple friends.
11. The apparatus according to claim 10, characterized in that, The second set of neighbor nodes includes a second subset of neighbor nodes, wherein the users corresponding to the neighbor nodes in the second subset of neighbor nodes have a friend relationship with the user corresponding to the target node; The positive training samples of the graph neural network include: user features of the users corresponding to the neighbor nodes included in the second neighbor node subset, and user features of the users corresponding to the neighbor nodes included in the second neighbor node set.
12. The apparatus according to claim 10, characterized in that, The processing module is also used for: Determine the user features of the first target node and the user features of the neighboring nodes corresponding to the first target node in the training samples of the graph neural network model; The user features of the first target node and the user features of the neighboring nodes corresponding to the first target node are aggregated to obtain a first aggregate vector; Determine the user features of the second target node and the user features of the neighboring nodes corresponding to the second target node in the training samples of the graph neural network model; The user features of the second target node and the user features of the neighboring nodes corresponding to the second target node are aggregated to obtain a second aggregate vector; The first aggregated vector and the second aggregated vector are merged to obtain the first merged vector; Based on the first merged vector, determine the target loss function; The parameters of the graph neural network to be trained are optimized until the target loss function converges, thus obtaining the trained graph neural network.
13. The apparatus according to claim 12, characterized in that, The process by which the processing module aggregates the user features of the first target node and the user features of the neighboring nodes corresponding to the first target node to obtain a first aggregated vector includes: The user features of the first target node and the user features of the neighboring nodes corresponding to the first target node are normalized to obtain the normalized user features of the first target node and the normalized user features of the neighboring nodes corresponding to the first target node. The user features of the first target node after normalization and the user features of the neighboring nodes corresponding to the first target node after normalization are aggregated to obtain the first aggregated vector; The aggregation process of the user features of the second target node and the user features of the neighboring nodes corresponding to the second target node to obtain the second aggregation vector includes: The user features of the second target node and the user features of the neighboring nodes corresponding to the second target node are normalized to obtain the normalized user features of the second target node and the normalized user features of the neighboring nodes corresponding to the second target node. The user features of the normalized second target node and the user features of the neighboring nodes corresponding to the normalized second target node are aggregated to obtain the second aggregate vector.
14. A computer device, characterized in that, include: Memory, processor, and bus system; The memory is used to store programs; The processor is configured to execute a program in the memory, and the processor is configured to execute the method of any one of claims 1 to 9 according to instructions in the program code; The bus system is used to connect the memory and the processor to enable communication between the memory and the processor.
15. A computer-readable storage medium comprising instructions that, when executed on a computer, cause the computer to perform the method as claimed in any one of claims 1 to 9.
16. A computer program product, comprising a computer program and instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the method as described in any one of claims 1 to 9.