Friend recommendation method based on importance score

By converting the social network into a graph structure and calculating the importance scores of neighbor nodes at each level, the problem of lack of versatility in existing friend recommendation methods is solved, and unified maintenance and efficient recommendation in different social software scenarios are achieved.

CN114265988BActive Publication Date: 2024-09-10GUANGDONG ARTIFICIAL INTELLIGENCE & DIGITAL ECONOMY LAB (GUANGZHOU)
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111560166.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-20
Publication Date
2024-09-10
Estimated Expiration
2041-12-20

AI Technical Summary

Technical Problem

The existing friend recommendation methods lack versatility, resulting in the loss of resources and revenue in the maintenance and resource allocation of the friend recommendation function of various social software, making it difficult to maintain uniformly in different scenarios.

Method used

The friend recommendation method based on importance score is adopted to convert the relationship between the target user and the user into a graph structure, calculate the user importance score through the importance score parameters of neighbor nodes at each order, and recommend users based on the score to implement a universal friend recommendation method.

Benefits of technology

Through the selection of importance score parameters, the versatility and unified maintenance in various recommendation scenarios are achieved, the efficiency and quality of friend recommendation are improved, and the loss of resources and revenue is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114265988B
    Figure CN114265988B
Patent Text Reader

Abstract

The present invention discloses a friend recommendation method based on importance score, including: converting a target user, a user, and the relationship between users into a graph structure; calculating an estimate of the importance score of all i+1th order neighbor nodes of node s according to the importance score parameter of the ith order neighbor node; obtaining an estimate of the importance score of the first Lth order neighbors of the target node s; obtaining an estimate of the importance score of all nodes on the graph structure G relative to the target node s according to the estimate of the importance score of the first Lth order neighbors of the target node s#imgabs0#finding the highest k user nodes among the estimates of the importance scores of all user nodes on the graph structure G#imgabs1#, and recommending the social users corresponding to the k user nodes as the results to the target user. The friend recommendation method based on importance score provided in this embodiment realizes a universal and uniformly maintainable friend recommendation method based on various recommendation scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to friend recommendation, and in particular to a friend recommendation method based on importance score. Background Art

[0002] With the rapid development of my country's Internet industry, the scale of social media has expanded rapidly.

[0003] Based on the core business of social software, my country's mainstream social software can be roughly divided into communication social software represented by WeChat, DingTalk, etc.; media social software represented by Weibo and Zhihu; and dating social software represented by Tantan and Soul. Various types of social software have diverse businesses and different functions, but they all generally have the function of friend recommendation, that is, based on the relationship between users, find users who are of high importance to the target users, and recommend these high-importance users to the target users. High-quality friend recommendations can optimize the user experience, expand the social scope, enhance user interaction in social networks, and thus improve user stickiness. Therefore, the efficiency and quality of friend recommendations are crucial to the vigorous development of the social industry.

[0004] At present, different social software will select different user importance measurement indicators according to their own functional positioning. The same social software will also select specific user importance measurement indicators for friend recommendations in various types of friend recommendations based on specific functions. The friend recommendation method based on different user importance measurement indicators is not universal.

[0005] Based on this, the inventors of this application discovered that the non-universality of existing friend recommendation methods makes the friend recommendation methods in various scenarios unable to be interoperable and difficult to maintain in a unified manner, which brings additional burdens to the process of maintaining the friend recommendation function of various social software and causes potential loss of resources and revenue.

[0006] The information disclosed in this background technology section is only intended to enhance the understanding of the overall background of the invention and should not be regarded as an acknowledgment or any form of suggestion that the information constitutes the prior art already known to a person skilled in the art. Summary of the invention

[0007] The object of the present invention is to provide a friend recommendation method based on importance score, which can be applicable to a variety of friend recommendation methods.

[0008] To achieve the above object, the present invention provides a friend recommendation method based on importance score, comprising:

[0009] Convert the target user, the users, and the relationships between the users into a graph structure, wherein the graph structure includes a plurality of nodes corresponding to the users and a plurality of edges corresponding to the relationships between the users, the graph structure G includes n nodes u, and the target user corresponds to the target node s in the graph structure;

[0010] Obtain importance score parameters corresponding to neighbor nodes of each order of the target user corresponding to the application scenario, wherein each application scenario has a plurality of preset recommendation algorithms, and different preset algorithms correspond to different parameters;

[0011] According to the importance score parameter of the i-th order neighbor node, calculate the estimated importance score of an i-th order neighbor node u of the target node s, repeat the above steps to obtain the estimated importance scores of all i-th order neighbor nodes of the target node s;

[0012] According to the importance score parameter of the i+1th order neighbor node and the estimated importance score of an i-th order neighbor node u of the target node s, calculate the estimated importance score of the neighbor node v of the node u as the i+1th order neighbor node of the target node s, repeat the above steps to obtain the estimated importance scores of all i+1th order neighbor nodes of the node s;

[0013] Repeat the step of obtaining an estimate of the importance scores of all i+1th-order neighbor nodes of node s until an estimate of the importance scores of the first Lth-order neighbors of target node s is obtained, where i is an integer from 0 to L;

[0014] According to the estimation of the importance scores of the first L order neighbors of the target node s, the estimation of the importance scores of all nodes on the graph structure G relative to the target node s is obtained. in, The u-th dimension The stored value is an estimate of the importance score of node u on the graph relative to the target node s;

[0015] Find an estimate of the importance scores of all user nodes on the graph structure G The highest k nodes in , and the users corresponding to these k nodes are recommended to the target users as the results.

[0016] In a preferred embodiment, according to the importance score parameter of the i-th order neighbor node, an estimate of the importance score of an i-th order neighbor node u of the target node s is calculated, and the above steps are repeated to obtain an estimate of the importance scores of all i-th order neighbor nodes of the target node s, including:

[0017] Obtain an i-th order neighbor node u of the target node s, wherein the i-th order neighbor node of the target node s belongs to the first L order neighbor nodes of the target node s;

[0018] Set the residual value for the i-th order neighbor node u of the target node s and reserved values Among them, the residual value is the residual value of the i-th order neighbor node u of the target node s, indicating the importance score that the i-th order neighbor node u of the target node s may obtain but has not yet obtained, and the retention value is the reserved value of the i-th order neighbor node u of the target node s, indicating the importance score of the i-th order neighbor node u of the target node s;

[0019] Using Formula 3, we can calculate the residual value of node u as the i-th order neighbor of target node s. Get the retention value of node u as the i-th order neighbor of target node s Among them, node u is the reserved value of the i-th order neighbor of the target node s The initial value of is 0 (i=0,1,2,…,L), and node u is the residual value of the i-th order neighbor of the target node s. The initial value of is 0 (i=0,1,2,…,L), and the target node s is the residual value of the i-th order neighbor of the target node s. The initial value of is 0 (i=1,2,…,L), and the target node s is the residual value of the 0th-order neighbor of the target node s. The initial value of is 1;

[0020] The formula three is:

[0021] Get the next i-th order neighbor node u of the target node s, and repeat the above steps until the importance scores of all i-th order neighbor nodes of the target node s are estimated.

[0022] In a preferred embodiment, according to the importance score parameter of the i+1th order neighbor node and the estimate of the importance score of an i-th order neighbor node u of the target node s, the neighbor node v of the node u is calculated as the estimate of the importance score of the i+1th order neighbor node of the target node s, and the above steps are repeated to obtain the estimate of the importance scores of all i+1th order neighbor nodes of the node s, including:

[0023] Get a neighbor node v of node u;

[0024] According to the residual value of node u as the i-th order neighbor node of target node s The degree d of nodes u and v u ,d v and the neighbor node v of node u as the residual value of the i+1th order neighbor node of the target node s Get the updated node v as the residual value of the i+1th order neighbor node of the target node s Repeat the above steps until the residual values ​​of all i+1 order neighbors of the target node s are obtained;

[0025] According to the residual value updated by the i+1th order neighbor node of the target node s And formula 3, calculate the retention value of node v as the updated i+1th order neighbor of target node s

[0026] Get the next i+1th order neighbor node v of the target node s, and repeat the above steps until the importance scores of all i+1th order neighbor nodes of the target node s are estimated.

[0027] In a preferred embodiment, converting the target user, the user, and the relationship between the users into a graph structure includes:

[0028] For each user node u on the graph structure G, the neighbor nodes v are arranged in increasing order of the degree of the neighbor nodes v of node u, where the neighbor nodes v of node u are the nodes directly connected to node u on the graph by an edge;

[0029] Acquiring the neighbor node v of the node u includes: acquiring the neighbor node v according to the order of the neighbor nodes after the node u is arranged.

[0030] In a preferred embodiment, the arranging the neighbor nodes v of each user node u on the graph structure G in increasing order of the degree of the neighbor nodes v of node u comprises:

[0031] Form an adjacency list for each node u respectively, wherein the adjacency list of the node u stores all neighbor nodes v of the node u, and the neighbor nodes v are arranged in increasing order of their degrees, and the degree of the node v is equal to the number of neighbor nodes that the node v has;

[0032] The step of obtaining the neighbor node v according to the order of the neighbor nodes after the node u is arranged includes:

[0033] In the adjacency list of node u, obtain the neighbor nodes v of node u in ascending order of the degree of neighbor nodes v.

[0034] In a preferred embodiment, the importance score parameter of the i-th order neighbor node includes a weight parameter w i and the Laplace coefficients a, b,

[0035] The residual value of node u as the i-th order neighbor node of target node s The degree d of nodes u and v u ,d vand the neighbor node v of node u as the residual value of the i+1th order neighbor node of the target node s Get the updated node v as the residual value of the i+1th order neighbor node of the target node s include:

[0036] When the degree of the acquired node u meets the first preset condition, the residual value after the node v is updated as the i+1th order neighbor of the target node s is calculated by formula 1

[0037] Among them, the first preset condition is that when the degree of node u

[0038] The formula 1:

[0039] Among them, node u is an i-th order neighbor node of node s, and Node v is a neighbor node of node u.

[0040] In a preferred embodiment, the residual value of node u as the i-th order neighbor node of target node s is The degree d of nodes u and v u d v and the neighbor node v of node u as the residual value of the i+1th order neighbor node of the target node s Get the updated node v as the residual value of the i+1th order neighbor node of the target node s Also includes:

[0041] If the degree of node u does not meet the first preset condition, subset sampling is performed on some neighbor nodes v, where the residual value of some neighbor nodes v is not updated according to formula 1. For the sampled nodes, the following formula is used to calculate

[0042] Formula 2:

[0043] Among them, ε is the error parameter.

[0044] In a preferred embodiment, the subset sampling process includes:

[0045] For the i-th order neighbor node u of the target node, the sampling probability p of some neighbor nodes v of node u is calculated according to Formula 5. v , the part of neighbor nodes v is the neighbor nodes v whose residual values ​​are not updated according to formula 1,

[0046] Formula 5 is:

[0047] Part of the neighbor nodes v are divided intov Divide into logn sets, where the degree of the nodes in the tth set satisfies 2 t ≤d v ≤2 t+1 -1;

[0048] For the nodes in the tth set, the maximum sampling probability corresponding to all nodes in the set is calculated. Perform Bernoulli sampling;

[0049] For the node v sampled by Bernoulli, The probability of giving up sampling the node;

[0050] The nodes that have not given up sampling are regarded as the sampled nodes.

[0051] Compared with the prior art, the friend recommendation method based on importance measurement indicators provided by this embodiment can correspond the importance score parameters of neighbor nodes of each order to the mainstream user importance measurement indicators, use the current mainstream user importance measurement indicators as importance score parameters, and through the selection of importance score parameters, realize a universal and uniformly maintainable friend recommendation method based on various recommendation scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 4 is a flowchart of a friend recommendation method based on importance score according to an embodiment of the present invention.

[0053] Figure 2 is a schematic diagram of a node according to an embodiment of the present invention. DETAILED DESCRIPTION

[0054] The specific implementation modes of the present invention are described in detail below in conjunction with the accompanying drawings, but it should be understood that the protection scope of the present invention is not limited by the specific implementation modes.

[0055] Unless explicitly stated otherwise, throughout the specification and claims, the term “comprise” or variations such as “include” or “comprising”, etc., will be understood to include the stated elements or components but not to exclude other elements or components.

[0056] In social networks, the measurement criteria of user importance scores will be affected by the recommendation scenario. In different recommendation scenarios, friend recommendation methods will choose different user importance measurement indicators to calculate user importance scores. Existing user importance measurement indicators mainly include: personalized Page ranking, hot core ranking, K-step transition probability, Katz index, etc. However, existing friend recommendation methods generally only target a single user importance measurement indicator and cannot perform a universal calculation of user importance scores based on multiple user importance measurement indicators. Once the user importance measurement indicator is changed, for example, from personalized Page ranking indicator to hot core ranking indicator, the existing friend recommendation method will become invalid, that is, the user importance score calculation method based on personalized Page ranking cannot be directly used to calculate the user importance score based on hot core ranking.

[0057] The specific choice of user importance measurement indicators needs to be based on the actual scenario. Here we need to first clarify the concept of "order", which is used to measure the closeness of the friendship between users. If user A and user B have a friendship on the social network, then users A and B are first-order neighbors. If there is no direct friendship between users A and B, but users A and user C are first-order neighbors, and users C and user B are first-order neighbors, that is, if user A needs to contact user B, he needs to find user C first, and then find B from user C. We call users A and B second-order neighbors. Different user importance measurement indicators have different importance measurements for neighbors of each order. For example, personalized Page ranking pays more attention to the importance of low-order neighbors, while hot core ranking tends to despise low-order neighbors, pay attention to mid-order neighbors, and ignore high-order neighbors. Therefore, a specific social network will select appropriate user importance measurement indicators based on its own attributes, calculate the relative importance scores between users, and finally complete friend recommendations suitable for its own social platform. For example, the WeChat network focuses more on daily communication and pays attention to neighbor relationships, so it is suitable to use the user importance score calculation method based on personalized Page ranking. The Weibo network focuses more on obtaining fresh information, pays less attention to neighbor friends, and pays more attention to relationships with friends who are a little further away. It is more suitable to use the user importance score calculation method based on hot core ranking.

[0058] like Figure 1 As shown, a flowchart of a friend recommendation method based on importance score according to a preferred embodiment of the present invention includes steps S1-S6.

[0059] Step S1, converting the target user, users and the relationships between users into a graph structure, wherein the graph structure includes multiple nodes corresponding to the users and multiple edges corresponding to the relationships between the users, the graph structure G includes n nodes v, and the target user corresponds to the target node s in the graph structure.

[0060] The social network is converted into a graph structure G = (V, E) in graph theory, where V and E represent the set of all nodes and edges on the graph structure, respectively, corresponding to the user groups and friend relationships between users in the actual social network.

[0061] The users in this embodiment refer to all registered users on the social platform, and the relationship between users may be a friend relationship between users.

[0062] Specifically, we correspond the users of the social network to the nodes on the graph structure, and the friendships between users to the edges on the graph structure. For example, in social networks with friendships such as WeChat and QQ, if there is a friendship between user A and user B, an edge between user A's node and user B's node needs to be established on the graph structure. In this way, the friendships on the social network are converted into edge relationships between nodes on the graph structure.

[0063] Step S2, obtaining importance score parameters corresponding to neighbor nodes of each order of the target user corresponding to the specific application scenario, wherein each application scenario has a plurality of preset recommendation algorithms, and different preset algorithms correspond to different parameters.

[0064] Step S3, calculate an estimate of the importance score of an i-th order neighbor node u of the target node s according to the importance score parameter of the i-th order neighbor node, repeat the above steps to obtain an estimate of the importance scores of all i-th order neighbor nodes of the target node s.

[0065] Step S4, based on the importance score parameters of the i+1th order neighbor nodes and the estimated importance score of an i-order neighbor node u of the target node s, calculate the estimated importance score of the neighbor node v of the node u as the i+1th order neighbor node of the target node s, repeat the above steps to obtain the estimated importance scores of all i+1th order neighbor nodes of the node s.

[0066] Step S5, repeat the step of obtaining the estimated importance scores of all i+1th order neighbor nodes of node s until the estimated importance scores of the first L order neighbors of target node s are obtained, where i is an integer from 0 to L. That is, repeat steps S3 and S4 for a total of L times.

[0067] It should be noted that steps S3-S5 are to update the retained values ​​of all i-order neighbors (according to formula three), then update the residual values ​​of all i+1-order neighbors (those that meet the first preset condition are updated according to formula one, and the others are subset sampled, the sampled ones are updated according to formula two, and the unsampled ones are not updated), then update the retained values ​​of all i+1-order neighbors, and then update the residual values ​​of all i+2-order neighbors, and so on until the L-order neighbors are updated.

[0068] Step S6, based on the estimated importance scores of the first L order neighbors of the target node s, obtain the estimated importance scores of all nodes on the graph structure G relative to the target node s in, The u-th dimension The stored value is an estimate of the importance score of node u on the graph relative to the target node s.

[0069] Step S7, find the estimation of the importance scores of all nodes on the graph structure G The highest k nodes in , and the users corresponding to these k nodes are recommended to the target users as the results.

[0070] Therefore, through the friend recommendation method based on importance measurement indicators provided by this embodiment, the importance score parameters of neighbor nodes of each order can be matched with the mainstream user importance measurement indicators, and the current mainstream user importance measurement indicators can be used as importance score parameters. Through the selection of importance score parameters, a universal and uniformly maintainable friend recommendation method based on various recommendation scenarios can be implemented.

[0071] Among them, different user importance measurement indicators can be reflected as different importance score parameters of neighbor nodes.

[0072] In one implementation, Figure 1 Steps S3-S5 in may include:

[0073] Step S301, obtaining an i-th order neighbor node u of the target node s.

[0074] The i-th order neighbor node of the target node s belongs to the first L order neighbor nodes of the target node s.

[0075] It should be noted that although node u is limited to user nodes other than the target node, it is not limited to this method in specific implementation. For example, node u is the i-th order neighbor node of s, when i=0, it can be node s itself.

[0076] Step S302: Set the residual value for the i-th order neighbor node u of the target node s and reserved values Among them, the residual value is the residual value of the i-th order neighbor node u of the target node s, indicating the importance score that the i-th order neighbor node u of the target node s may obtain but has not yet obtained, and the retention value is the reserved value of the i-th order neighbor node u of the target node s, indicating the importance score of the i-th order neighbor node u of the target node s. The importance score of node u when it is the i-th order neighbor of target node s.

[0077] Step S303, using Formula 3, according to the importance score parameter of the i-th order neighbor node and the residual value of node u as the i-th order neighbor of the target node s Get the retention value of node u as the i-th order neighbor of target node s

[0078] Among them, node u is the reserved value of the i-th order neighbor of the target node s The initial value of is 0 (i=0,1,2,…,L), and node u is the residual value of the i-th order neighbor of the target node s. The initial value of is 0 (i=1,2,…,L), and the target node s is the residual value of the i-th order neighbor of the target node s. The initial value is 0 (i=1, 2, ..., L), and the target node s is the residual value of the 0th-order neighbor of the target node s. The initial value is 1.

[0079] Formula 3:

[0080] Among them, w i is the weight parameter in the importance score parameter of the i-th order neighbor node, Y i is the cumulative weight parameter,

[0081] It should be noted that, in the initial state, given the target node s, for all user nodes u on the graph structure, their neighbors of each order as the target node The initial values ​​of (i=0,1,2,…,L) are all set to 0, except This means that in the initial state, only the target node may obtain the importance score, and other nodes have no possibility of obtaining the importance score. After that, the reserved value and residual value of each node on the graph are repeatedly updated. In each update, a part of the residual value is allocated to the reserved value, that is, a part of the importance score that node u may obtain but has not yet obtained is allocated. (Corresponding to steps S303, S402, S403)

[0082] Formula 3 indicates that in the calculation of an importance score, the importance score that node u has obtained is updated according to the importance score that it may obtain but has not yet obtained as the i-th order neighbor of the target node s. Specifically, the importance score that node u may obtain but has not yet obtained as the i-th order neighbor of the target node s (recorded in Some is definitely assigned to Right now In an importance score calculation, the importance scores that can be assigned are:

[0083] In one implementation, step S1 may further include: arranging the neighbor nodes v of each user node u on the graph structure G in increasing order of the degree of the neighbor nodes v of node u, wherein the neighbor nodes v of node u are nodes on the graph that are directly connected to the node u by an edge.

[0084] Step S4 may include:

[0085] Step S401, obtaining a neighbor node v of node u. Node v is a neighbor node of node u, because node u is an i-th order neighbor node of the target node, and thus, the neighbor node v of node u is an i+1-th order neighbor node of the target node s.

[0086] In one implementation, obtaining the neighbor node v of the node u means obtaining the neighbor node v according to the order of the sorted neighbor nodes of the node u.

[0087] In one implementation, the arranging the neighbor nodes v of each user node u on the graph structure G in increasing order of the degrees of the neighbor nodes v of node u includes: forming an adjacency list for each node u respectively, wherein the adjacency list of node u stores all the neighbor nodes v of node u, and the neighbor nodes v are arranged in increasing order of their degrees.

[0088] Specifically, when converting the actual social network structure into a graph structure, the neighbor nodes of all nodes on the graph are sorted in ascending order of degree. For example, for node u on the graph, the nodes that have direct edge relationships with it are called neighbor nodes v of node u, and the number of neighbor nodes of node u is called the degree of node u, expressed as d u Represents. All neighbor nodes of node u are recorded in a table structure, which is called the adjacency table N of node u. u , adjacency list N u The CCP recorded u nodes, sorting the neighbor nodes in ascending order of degree ensures that u The nodes are arranged in increasing order of their degrees.

[0089] Correspondingly, acquiring the node v in the order of the neighbor nodes after the node u is arranged may include: acquiring the neighbor nodes v of the node u in the order of increasing degrees of the neighbor nodes v in the adjacency list of the node u.

[0090] Step S402: based on the residual value of node u as the i-th order neighbor node of target node s The degree d of nodes u and v u d v and the neighbor node v of node u as the residual value of the i+1th order neighbor node of the target node s Get the updated node v as the residual value of the i+1th order neighbor node of the target node s Repeat the above steps until the residual values ​​of all i+1 order neighbors of the target node s are obtained;

[0091] Step S403: Update the residual value of the target node s according to the i+1th order neighbor node And formula 3, calculate the retention value of node v as the updated i+1th order neighbor of target node s

[0092] Specifically, we can use an i+1th order neighbor node v of the target node s as the node u in formula 3, and use the residual value of node v as the i+1th order neighbor of the target node s Get the reserved value of node v as the i+1th order neighbor of target node s

[0093] Step S404, obtaining the next (i+1)th order neighbor node v of the target node s, and repeating the above steps until the importance scores of all (i+1)th order neighbor nodes of the target node s are estimated.

[0094] It should be noted that steps S301 and 302 are only performed during the initial calculation, and S303 to S404 are repeated subsequently to obtain the residual values ​​and retained values ​​of the first L-order neighbor nodes of the target node s.

[0095] Specifically, step 402 may include:

[0096] Step 4021: When the neighbor node v of the acquired node u satisfies the first preset condition, the residual value after the node v is updated as the i+1th order neighbor of the target node s is calculated by formula 1:

[0097] Among them, the first preset condition is that when the degree of node u

[0098] The formula 1:

[0099] Among them, node u is an i-th order neighbor node of node s, and Node v is a neighbor node of node u. The importance score parameters of the i-th order neighbor node include the weight parameter w i And the Laplace coefficients a and b.

[0100] Among them, Y i is the cumulative weight parameter, ε is an error parameter, δ is the error parameter threshold of the importance score selected by the user according to actual conditions in this embodiment.

[0101] Step 4022: If the first preset condition is not met, subset sampling is performed on some neighbor nodes v, where the residual values ​​of some neighbor nodes v are not updated according to Formula 1. For the sampled nodes, the residual values ​​of

[0102] Formula 2: ε is the error parameter.

[0103] The subset sampling process includes:

[0104] For the i-th order neighbor node u of the target node, the sampling probability p of some neighbor nodes v of node u is calculated according to Formula 5. v , the calculation formula is formula five, and the said part of neighbor nodes v are neighbor nodes v whose residual values ​​are not updated according to formula one.

[0105] Formula 5:

[0106] Part of the neighbor nodes v are divided into v Divide into logn sets, where the nodes in the tth set satisfy 2 t ≤d v ≤2 t+1 -1;

[0107] For the nodes in the tth set, the maximum sampling probability corresponding to all nodes in the set is calculated. Perform Bernoulli sampling;

[0108] For the node v sampled by Bernoulli, The probability of giving up sampling the node;

[0109] The nodes that have not given up sampling are regarded as the sampled nodes.

[0110] An example of updating the residual value and the retained value is given below.

[0111] See also Figure 2 , which is a node schematic diagram of an embodiment of the present invention. Nodes u1, u2, and u3 are first-order neighbors of node s, and nodes v1, v2, and v3 are second-order neighbors of node s.

[0112] Round 1 Updates:

[0113] (initial value setting), calculated according to formula 3 If the degrees of nodes u1 and u2 meet the first preset condition, but node u3 does not, then update according to formula 1 And perform subset sampling on node u3, and then determine whether u3 is sampled. If it is sampled, update according to formula 2 Otherwise do not update

[0114] Round 2 Updates:

[0115] According to formula 3, calculate like Update the residual value of the neighbor v of node u1 that meets the first preset condition according to formula 1 Otherwise, update the residual value of the sampled neighbor v according to formula 2 like Update the residual value of the neighbor v of node u2 that meets the first preset condition according to formula 1 Otherwise, update the residual value of the sampled neighbor v according to formula 2 like Update the residual value of the neighbor v of node u3 that meets the first preset condition according to formula 1 Otherwise, update the residual value of the sampled neighbor v according to formula 2

[0116] Round 3 Updates:

[0117] According to formula 3, calculate For all nodes v, if the residual value Update the residual value of the neighbor z of node v that meets the first preset condition according to formula 1 Otherwise, update the residual value of the sampled neighbor z according to formula 2

[0118] Step S6 can be implemented by formula 4, which is:

[0119]

[0120] in is an n-dimensional vector, where n is the number of nodes on the graph (i.e. the number of users in the social network). The u-th dimension The recorded value is an estimate of the importance score of node u on the graph relative to the target node s. is also an n-dimensional vector, The value of the u-th dimension record is the reserved value of node u as the i-th order neighbor of target node s on the graph, is an estimate of the importance score of node u when it is considered as the i-th order neighbor of target node s.

[0121] i is an increasing variable that takes values ​​from 0 to L. is known, we will Calculate Then calculate Finally calculated Finally, according to the first L+1 (i=0,1,…,L) Calculated

[0122] δ is an error threshold, and the user of this embodiment needs to select a specific value of δ according to the actual situation. The present invention can ensure that for any user u on the social network (i.e., any node u on the corresponding graph), according to the calculation steps provided by the present invention, the estimated importance score of node u with respect to the target node s is calculated. The exact value of the importance score of node u with respect to the target node s is π u The following relationship is satisfied:

[0123] when hour, The probability of occurrence is no more than 1%. That is, under a 99% probability, the estimated importance score of node u with respect to target node s calculated by the present invention is and the true value π u The relative error between

[0124] L is the maximum allowed order of recommended friends, and the value of L is completely determined by the error parameter δ. Specifically, ε is an intermediate error parameter set to simplify the calculation process in the present invention, which can be completely determined by the error threshold δ. Specifically,

[0125] The following is a method for setting the importance score parameters corresponding to the current mainstream user importance measurement indicators:

[0126] When calculating the importance score based on the personalized Page Ranking metric, the importance score parameter is set as follows: i =α(1-α) i ,a=0,b=1, where α is a parameter with a value range of α∈(0,1). Personalized Page ranking considers that the higher the order of neighbor nodes of the target node s, the lower the importance score of the target node s. When calculating the importance score based on the hot core ranking indicator, the setting method of the importance score parameter is as follows: a=0, b=1, where e is the natural logarithm and t is a parameter. The heat kernel ranking considers the t-th order neighbor to be the most important. When calculating the importance score based on the l-step transition probability, the importance score parameter is set as w l =1,w i=0(i=0,1,…,l-1), a=0, b=1, where l is a parameter, i is an increasing variable, and its value is all integers between 0 and l-1. The l-step transition probability considers that only the l-th order neighbor is important, and the neighbors of other orders are not important. When calculating the importance score based on the Katz index, the setting method of the importance score parameter is: w i =β i , a=0, b=0, where β is a parameter that ensures that the final importance score is unique and finite.

[0127] Users need to determine the parameter w in the general importance score calculation paradigm based on the actual friend recommendation scenario. i For example, if the importance of low-order neighbor users in the friend recommendation scenario is higher, it is more appropriate to choose the importance score calculation formula based on the personalized Page ranking index, that is, set the importance score parameter in the general importance measurement paradigm to w i =α(1-α) i ,a=0,b=1.

[0128] Therefore, the method provided in this embodiment can obtain the importance score corresponding to any error parameter threshold, and the time required is Where D is the degree matrix of the graph structure obtained after transformation from the actual network. The diagonal of D records the degree of each node on the graph structure, and the value on the off-diagonal of D is 0. Specifically, the u-th value on the diagonal of matrix D corresponds to the degree d of node u on the graph. u A is the adjacency matrix of the graph structure obtained after transformation from the actual network. If the value of the u-th row and the v-th column of A is 1, it means that there is an edge connecting nodes u and v. Otherwise, the value of the u-th row and the v-th column of A is 0. is a one-hot vector corresponding to the target user s, the value of the sth dimension of the vector is 1, and the values ​​of other dimensions are 0.

[0129] This time is at the same level as the output result size of the user importance score calculation, so the calculation time of the friend recommendation method of this embodiment is approximately optimal.

[0130] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0131] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0132] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0133] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0134] The foregoing description of specific exemplary embodiments of the present invention is for the purpose of illustration and demonstration. These descriptions are not intended to limit the present invention to the precise form disclosed, and it is clear that many changes and variations can be made based on the above teachings. The purpose of selecting and describing the exemplary embodiments is to explain the specific principles of the present invention and its practical application, so that those skilled in the art can realize and utilize various different exemplary embodiments of the present invention and various different selections and changes. The scope of the present invention is intended to be limited by the claims and their equivalents.

Claims

1. A friend recommendation method based on importance score, It is characterized in that include: Converting the target user, the users, and the relationships between the users into a graph structure, wherein the graph structure includes a plurality of nodes corresponding to the users and a plurality of edges corresponding to the relationships between the users, the graph structure includes n nodes u, and the target user corresponds to the target node s in the graph structure; Obtain importance score parameters corresponding to neighbor nodes of each order of the target user corresponding to the application scenario, wherein each application scenario has a plurality of preset recommendation algorithms, and different preset algorithms correspond to different parameters; According to the importance score parameter of the i-th order neighbor node, calculate the estimated importance score of an i-th order neighbor node u of the target node s, repeat the above steps to obtain the estimated importance scores of all i-th order neighbor nodes of the target node s; According to the importance score parameter of the i+1th order neighbor node and the estimated importance score of an i-th order neighbor node u of the target node s, calculate the estimated importance score of the neighbor node v of the node u as the i+1th order neighbor node of the target node s, repeat the above steps to obtain the estimated importance scores of all i+1th order neighbor nodes of the node s; Repeat the step of obtaining an estimate of the importance scores of all i+1th-order neighbor nodes of node s until an estimate of the importance scores of the first Lth-order neighbors of target node s is obtained, where i is an integer from 0 to L; According to the estimation of the importance scores of the first L order neighbors of the target node s, the estimation of the importance scores of all nodes on the graph structure relative to the target node s is obtained. in, The u-th dimension The stored value is an estimate of the importance score of node u on the graph relative to the target node s; Find an estimate of the importance scores of all user nodes on the graph The highest k nodes in , and the users corresponding to these k nodes are recommended to the target users as the results.

2. The friend recommendation method according to claim 1, It is characterized in that According to the importance score parameter of the i-th order neighbor node, the importance score estimate of an i-th order neighbor node u of the target node s is calculated, and the above steps are repeated to obtain the importance score estimates of all i-th order neighbor nodes of the target node s, including: Obtain an i-th order neighbor node u of the target node s, wherein the i-th order neighbor node of the target node s belongs to the first L order neighbor nodes of the target node s; Set the residual value for the i-th order neighbor node u of the target node s and reserved values Among them, the residual value is the residual value of the i-th order neighbor node u of the target node s, indicating the importance score that the i-th order neighbor node u of the target node s may obtain but has not yet obtained, and the retention value is the reserved value of the i-th order neighbor node u of the target node s, indicating the importance score of the i-th order neighbor node u of the target node s; Using Formula 3, we can calculate the residual value of node u as the i-th order neighbor of target node s. Get the retention value of node u as the i-th order neighbor of target node s Among them, node u is the reserved value of the i-th order neighbor of the target node s The initial value of is 0, i = 0, 1, 2, ..., L, and the node u is the residual value of the i-th order neighbor of the target node s. The initial value of is 0, i = 0, 1, 2, ..., L, and the target node s is the residual value of the i-th order neighbor of the target node s. The initial value of is 0, i = 1, 2, ..., L, and the target node s is the residual value of the 0th-order neighbor of the target node s. The initial value of is 1; The formula three is: Among them, w i is the weight parameter in the importance score parameter of the i-th order neighbor node, Y i is the cumulative weight parameter of the i-th order neighbor node, Get the next i-th order neighbor node u of the target node s, and repeat the above steps until the importance scores of all i-th order neighbor nodes of the target node s are estimated.

3. The friend recommendation method according to claim 2, It is characterized in that According to the importance score parameter of the i+1th order neighbor node and the estimated importance score of an i-th order neighbor node u of the target node s, the neighbor node v of the node u is calculated as the estimated importance score of the i+1th order neighbor node of the target node s, and the above steps are repeated to obtain the estimated importance scores of all i+1th order neighbor nodes of the node s, including: Get a neighbor node v of node u; According to the residual value of node u as the i-th order neighbor node of target node s The degree d of nodes u and v u d v and the neighbor node v of node u as the residual value of the i+1th order neighbor node of the target node s Get the updated node v as the residual value of the i+1th order neighbor node of the target node s Repeat the above steps until the residual values ​​of all i+1 order neighbors of the target node s are obtained; According to the residual value updated by the i+1th order neighbor node of the target node s And formula 3, calculate the retention value of node v as the updated i+1th order neighbor of target node s Get the next i+1th order neighbor node v of the target node s, and repeat the above steps until the importance scores of all i+1th order neighbor nodes of the target node s are estimated.

4. The friend recommendation method according to claim 3, It is characterized in that The converting of the target user, the user and the relationship between the users into a graph structure comprises: For each user node u on the graph structure, the neighbor nodes v are arranged in increasing order of the degree of the neighbor nodes v of node u, where the neighbor nodes v of node u are the nodes directly connected to node u on the graph by an edge; Acquiring the neighbor node v of the node u includes: acquiring the neighbor node v according to the order of the neighbor nodes after the node u is arranged.

5. The friend recommendation method according to claim 4, It is characterized in that The step of arranging the neighbor nodes v of each user node u on the graph structure in increasing order of the degree of the neighbor nodes v of node u comprises: Form an adjacency list for each node u respectively, wherein the adjacency list of the node u stores all neighbor nodes v of the node u, and the neighbor nodes v are arranged in increasing order of their degrees, and the degree of the node v is equal to the number of neighbor nodes that the node v has; The step of obtaining the neighbor node v according to the order of the neighbor nodes after the node u is arranged includes: In the adjacency list of node u, obtain the neighbor nodes v of node u in ascending order of the degree of neighbor nodes v.

6. The friend recommendation method according to claim 3, It is characterized in that The importance score parameter of the i-th order neighbor node includes a weight parameter w i and the Laplace coefficients a, b, The residual value of node u as the i-th order neighbor node of target node s The degree d of nodes u and v u d v and the neighbor node v of node u as the residual value of the i+1th order neighbor node of the target node s Get the updated node v as the residual value of the i+1th order neighbor node of the target node s include: When the degree of the acquired node u meets the first preset condition, the residual value after the node v is updated as the i+1th order neighbor of the target node s is calculated by formula 1 Among them, the first preset condition is that when the degree of node u The formula 1: Among them, node u is an i-th order neighbor node of node s, and Node v is the neighbor node of node u, and ε is the error parameter.

7. The friend recommendation method according to claim 6, It is characterized in that The residual value of node u as the i-th order neighbor node of target node s The degree d of nodes u and v u d v and the neighbor node v of node u as the residual value of the i+1th order neighbor node of the target node s Get the updated node v as the residual value of the i+1th order neighbor node of the target node s Also includes: If the degree of node u does not meet the first preset condition, subset sampling is performed on some neighbor nodes v, where the residual value of some neighbor nodes v is not updated according to formula 1. For the sampled nodes, the formula 2 is used to calculate Formula 2: Among them, ε is the error parameter.

8. The friend recommendation method according to claim 7, It is characterized in that The subset sampling process includes: For the i-th order neighbor node u of the target node, the sampling probability p of some neighbor nodes v of node u is calculated according to Formula 5. v , the part of neighbor nodes v is the neighbor nodes v whose residual values ​​are not updated according to formula 1, Formula 5 is: Part of the neighbor nodes v are divided into v Divide into logn sets, where the degree of the nodes in the tth set satisfies 2 t ≤d v ≤2 t+1 -1; For the nodes in the tth set, the maximum sampling probability corresponding to all nodes in the set is calculated. Perform Bernoulli sampling; For the node v sampled by Bernoulli, The probability of giving up sampling the node; The nodes that have not given up sampling are regarded as the sampled nodes.

Citation Information

Patent Citations

  • Friend recommendation method based on personalized fortune ranking

    CN111984832A

  • Social network friend recommendation method based on graph neural network

    CN112507245A

  • Node classification method, model training method, device, apparatus, and storage medium

    WO2020098606A1