CN111984832A - A friend recommendation method based on personalized page ranking - Google Patents
A friend recommendation method based on personalized page ranking Download PDFInfo
- Publication number
- CN111984832A CN111984832A CN202010850777.2A CN202010850777A CN111984832A CN 111984832 A CN111984832 A CN 111984832A CN 202010850777 A CN202010850777 A CN 202010850777A CN 111984832 A CN111984832 A CN 111984832A
- Authority
- CN
- China
- Prior art keywords
- node
- personalized
- ranking
- user
- graph structure
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/953—Querying, e.g. by the use of web search engines
- G06F16/9536—Search customisation based on social or collaborative filtering
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/901—Indexing; Data structures therefor; Storage structures
- G06F16/9024—Graphs; Linked lists
-
- G06Q10/40—
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本发明提供一种基于个性化佩奇排名的好友推荐方法,该方法包括:将目标用户、用户及用户间的关系转换为图结构,重复执行l‑层个性化佩奇排名的计算过程共L轮,得到图结构上宿节点相对于所有其它节点在各层的个性化佩奇排名,将宿节点相对每一其它节点的各层个性化佩奇排名分数值相加,得到宿节点相对每一其它节点的个性化佩奇排名,根据宿节点相对于每一其它节点的个性化佩奇排名,获取排名在前的预设数值个其它节点对应的用户作为目标用户,根据待推荐用户和目标用户相互之间的重要性衡量标准,进行好友推荐。本发明能够摆脱单宿个性化佩奇排名的计算时间与社交网络稠密度的依赖关系,达到最优的计算时间,从而提高好友推荐速度。The present invention provides a method for recommending friends based on personalized page ranking. The method includes: converting target users, users and the relationship between users into a graph structure, and repeating the calculation process of L-layer personalized page ranking for a total of L round to obtain the personalized page ranking of the sink node relative to all other nodes in each layer on the graph structure, and add the personalized page ranking scores of the sink node relative to each other node at each layer to obtain the relative value of the sink node relative to each layer. The personalized page ranking of other nodes, according to the personalized page ranking of the sink node relative to each other node, obtain the users corresponding to the top preset value and other nodes as target users, according to the user to be recommended and the target user Mutual importance measure, friend recommendation. The invention can get rid of the dependence between the calculation time of the single-home personalized page ranking and the density of the social network, and achieve the optimal calculation time, thereby improving the friend recommendation speed.
Description
技术领域technical field
本发明涉及计算机技术领域,尤其涉及一种基于个性化佩奇排名的好友推荐方法。The invention relates to the field of computer technology, in particular to a friend recommendation method based on personalized Page ranking.
背景技术Background technique
随着互联网建设的高速发展,社交网络整合了沟通交流、商务合作、生活娱乐等多项功能,在国民用户中快速流行,成为了互联网应用中的重要组成部分。根据前瞻产业研究院发布的社交网络行业深度调研报告,我国社交网络行业的市场规模有望在2022年达到500亿元,并保持快速增长的趋势持续发展,呈现出巨大的商业价值。With the rapid development of Internet construction, social networks have integrated a number of functions such as communication, business cooperation, life entertainment, etc., which are rapidly popular among national users and become an important part of Internet applications. According to the in-depth research report on the social network industry released by the Prospective Industry Research Institute, the market size of my country's social network industry is expected to reach 50 billion yuan in 2022, and it will maintain a rapid growth trend and continue to develop, showing huge commercial value.
在社交网络的管理与发展中,内容、平台与用户是社交应用重点关注的三个维度,优质的内容输出、高质量的平台搭建和大规模的用户绑定是社交应用持续发展的关键因素。如何吸引更多的用户加入特定的社交软件,如何圈定目标用户进行内容推广和价值传播,如何衡量用户间的亲密程度,都是社交应用会重点关注的问题。其中,社交应用中用户的重要性评估被广泛应用于好友推荐、广告投放、用户相似度计算等核心领域,用户重要性的评估结果直接影响到诸多具体应用的操作效果,如好友推荐的质量、广告投放的实际收益、用户相似度计算的结果准确性等。因此,如何得到社交用户重要性的精准评估结果,是绝大多数社交应用普遍关心的问题。In the management and development of social networks, content, platform and users are the three dimensions that social applications focus on. High-quality content output, high-quality platform construction and large-scale user binding are the key factors for the sustainable development of social applications. How to attract more users to join a specific social software, how to delineate target users for content promotion and value dissemination, and how to measure the degree of intimacy between users are all issues that social applications will focus on. Among them, user importance evaluation in social applications is widely used in core fields such as friend recommendation, advertisement placement, user similarity calculation, etc. The evaluation results of user importance directly affect the operation effect of many specific applications, such as the quality of friend recommendation, The actual revenue of advertising, the accuracy of user similarity calculation results, etc. Therefore, how to obtain accurate evaluation results of the importance of social users is a common concern of most social applications.
在用户重要性的评估过程中,为了取得更好的评估结果,人们倾向于将社交网络转换成抽象的图结构,通过计算图节点相对重要性的方法,完成社交网络上的用户重要性评估。在众多的图节点重要性衡量指标中,个性化佩奇排名(PersonalizedPageRank)以其直观的设计思想、符合实际的迭代定义方式和高质量的用户重要性评估结果而得到了广泛地研究和应用。根据用户重要性的评估方向,可以将个性化佩奇排名的计算方式划分为两种类型,即单源个性化佩奇排名和单宿个性化佩奇排名。对于某给定的用户,单源个性化排名站在该指定用户的角度,计算所有用户相对该指定用户的重要性;单宿个性化佩奇排名则希望计算出该指定用户相对其他用户的重要性排名。例如:在好友推荐中(如Facebook上的好友推荐功能),给定待推荐用户,既需要站在待推荐用户的视角,寻找对其具有较高重要性的用户,还需要进行重要性的反向评估,判断待推荐用户对哪些用户是重要的。双向的重要性评估保证了好友推荐的实际作用和使用效果,既找到了对待推荐用户而言,具有高重要性的用户,也保证了待推荐用户对于这些高重要性的用户也具有关注价值。只有这样,双方才都能从待建立的好友关系中获益,并同意本次好友推荐,建立好友关系,例如:比尔盖茨对计算机行业的用户重要性普遍较高,如果只考虑单向的重要性,则比尔盖茨的Facebook上可能每天都要收到众多的好友推荐消息,这些只考虑了单向重要性的好友推荐对比尔盖茨是无意义的,因为这些用户对比尔盖茨的重要性普遍不高,造成了好友推荐的低效。In the evaluation process of user importance, in order to obtain better evaluation results, people tend to convert social networks into abstract graph structures, and complete the user importance evaluation on social networks by calculating the relative importance of graph nodes. Among many graph node importance measures, Personalized PageRank has been widely studied and applied for its intuitive design idea, realistic iterative definition and high-quality user importance evaluation results. According to the evaluation direction of user importance, the calculation method of personalized page ranking can be divided into two types, namely single-source personalized page ranking and single-homed personalized page ranking. For a given user, the single-source personalized ranking calculates the importance of all users relative to the specified user from the perspective of the specified user; the single-homed personalized page ranking hopes to calculate the importance of the specified user relative to other users. Sex rankings. For example: in friend recommendation (such as the friend recommendation function on Facebook), given a user to be recommended, it is necessary to stand in the perspective of the user to be recommended, look for users with high importance to it, and also need to carry out an important response. To evaluate, determine to which users the user to be recommended is important. The two-way importance evaluation ensures the actual function and use effect of friend recommendation. It not only finds users who are highly important to the recommended users, but also ensures that the users to be recommended also have attention value for these highly important users. Only in this way can both parties benefit from the friend relationship to be established, and agree to this friend recommendation to establish a friend relationship. For example, Bill Gates is generally more important to users in the computer industry. If only one-way importance, then Bill Gates' Facebook may receive numerous friend recommendation messages every day. These friend recommendations that only consider the one-way importance are meaningless to Bill Gates, because these users have a lot of respect for Bill Gates. The importance is generally not high, resulting in the inefficiency of friend recommendation.
目前,对于单源个性化佩奇排名的计算,已有能使其时间消耗达到理论最优的方法出现,但是单宿个性化佩奇排名的计算过程还存在提升空间。At present, for the calculation of single-source personalized page ranking, there are methods that can make the time consumption reach the theoretical optimum, but there is still room for improvement in the calculation process of single-homed personalized page ranking.
发明内容SUMMARY OF THE INVENTION
本发明实施例提供一种基于个性化佩奇排名的好友推荐方法,用以解决现有技术中好友推荐时间消耗长的缺陷,实现快速的好友推荐。The embodiment of the present invention provides a method for recommending friends based on personalized page ranking, so as to solve the problem of long time consumption of friend recommendation in the prior art, and realize fast friend recommendation.
本发明实施例提供一种基于个性化佩奇排名的好友推荐方法,包括:An embodiment of the present invention provides a method for recommending friends based on personalized page ranking, including:
S1,对于任一社交网络平台上的目标用户,将所述目标用户、用户及用户间的关系转换为图结构G,其中,所述图结构G中包括与所述用户对应的节点以及与所述用户间的关系对应的边,所述目标用户为所述图结构的宿节点;S1, for a target user on any social network platform, convert the target user, the user and the relationship between the users into a graph structure G, wherein the graph structure G includes a node corresponding to the user and a node corresponding to the user. The edge corresponding to the relationship between the users, the target user is the sink node of the graph structure;
S2,对于所述图结构中的每一节点,将每一节点的入邻居节点按照出度递增的顺序排序;S2, for each node in the graph structure, sort the incoming neighbor nodes of each node according to the order of increasing out-degree;
S3,重复执行l-层个性化佩奇排名的计算过程共L轮,得到所述图结构上宿节点相对于所有其它节点在各层的个性化佩奇排名,每一其它用户对应所述图结构上的每一其它节点;S3, repeating the calculation process of the l-layer personalized page ranking for a total of L rounds, to obtain the personalized page ranking of the sink node at each layer relative to all other nodes on the graph structure, and each other user corresponds to the graph every other node on the structure;
S4,对于所述图结构上的每一其它节点,将所述宿节点相对每一其它节点的各层个性化佩奇排名分数值相加,得到所述宿节点相对每一其它节点的个性化佩奇排名;S4, for each other node on the graph structure, add up the personalized page ranking scores of each layer of the sink node relative to each other node to obtain the personalization of the sink node relative to each other node Page ranking;
S5,根据所述宿节点相对于每一其它节点的个性化佩奇排名,获取排名在前的预设数值个其它节点;S5, according to the personalized page ranking of the sink node relative to each other node, obtain a preset number of other nodes that are ranked first;
S6,获取所述预设数值个其它节点对应的用户信息,作为所述目标用户对于待推荐用户的重要性衡量标准,结合所述待推荐用户对于所述目标用户的重要性排名,进行好友推荐。S6: Obtain the user information corresponding to the preset number of other nodes, as a measure of the importance of the target user to the user to be recommended, and make friend recommendation in combination with the importance ranking of the user to be recommended to the target user .
根据本发明一个实施例的基于个性化佩奇排名的好友推荐方法,所述步骤S3具体包括:According to an embodiment of the present invention, the method for recommending friends based on personalized page rankings, the step S3 specifically includes:
S31,对于所述图结构,重复执行更新过程,直至该更新过程遍历所述图结构上所有在当前层的个性化佩奇排名分数值大于0的节点;S31, for the graph structure, repeat the update process until the update process traverses all nodes on the graph structure with a personalized page ranking score value greater than 0 at the current layer;
S32,将所述图结构上各节点在当前层的个性化佩奇排名分数值进行存储,用于后续计算。S32: Store the personalized page ranking score values of each node on the graph structure at the current layer for subsequent calculation.
根据本发明一个实施例的基于个性化佩奇排名的好友推荐方法,所述更新过程具体为:According to the method for recommending friends based on personalized page ranking according to an embodiment of the present invention, the update process is specifically:
对于所述图结构,按照当前节点v的入邻接表中的节点存储顺序,逐个判断所述入邻接表中每一入邻居节点u∈Nin(v)是否满足预设条件,如果满足,更新满足预设条件的入邻居节点在下一层的个性化佩奇排名分数值,Nin(v)为所述当前节点v的所有入邻居节点组成的集合,所述当前节点为在当前层的个性化佩奇排名分数值大于0的节点。For the graph structure, according to the storage order of the nodes in the incoming adjacency list of the current node v, judge one by one whether each incoming neighbor node u∈N in (v) in the incoming adjacency list satisfies the preset condition, and if so, update The personalized page ranking score value of the incoming neighbor nodes that meet the preset conditions in the next layer, N in (v) is the set composed of all incoming neighbor nodes of the current node v, and the current node is the personality in the current layer. Converts nodes with a Page rank score greater than 0.
根据本发明一个实施例的基于个性化佩奇排名的好友推荐方法,所述步骤S31具体包括:According to the method for recommending friends based on personalized page ranking according to an embodiment of the present invention, the step S31 specifically includes:
如果所述当前节点的入邻居节点u满足第一预设条件,利用第一更新公式对该入邻居节点u在下一层的个性化佩奇排名分数值πl+1(u,t)进行更新;If the incoming neighbor node u of the current node satisfies the first preset condition, use the first update formula to update the personalized page ranking score π l+1 (u, t) of the incoming neighbor node u in the next layer ;
所述第一预设条件为:The first preset condition is:
所述第一更新公式为:The first update formula is:
其中,πl+1(u,t)′表示更新后的个性化佩奇排名分数值,v为当前节点,πl(v,t)为当前节点v在当前层l的个性化佩奇排名分数值,πl+1(u,t)为入邻居节点u在下一层l+1的个性化佩奇排名分数值,θ为用户根据实际情况确定的误差参数,α为α-衰减随机游走中每一步的停止概率,由用户根据实际情况确定参数α的具体取值,λ(u)是一个与节点u相关的数值,当λ(u)=1时,对于个性化佩奇排名的真实分数值大于θ的节点,最后得到的个性化佩奇排名的估计分数值和真实分数值之间不超过常数相对误差,当时,最后得到的各节点个性化佩奇排名的估计分数值与真实分数值之间的绝对误差不超过θ,用户根据实际情况选择λ(u)的取值;Among them, π l+1 (u, t)' represents the updated personalized page ranking score value, v is the current node, and π l (v, t) is the personalized page ranking of the current node v in the current layer l Score value, π l+1 (u, t) is the personalized page ranking score value of incoming neighbor node u in the next layer l+1, θ is the error parameter determined by the user according to the actual situation, α is the α-decay random walk The stopping probability of each step is determined by the user according to the actual situation. The specific value of the parameter α is determined by the user. λ(u) is a value related to the node u. For nodes whose true score value is greater than θ, the estimated score value of the final personalized Page ranking and the true score value do not exceed a constant relative error, when When , the absolute error between the estimated score value of each node's personalized Page ranking and the real score value does not exceed θ, and the user chooses the value of λ(u) according to the actual situation;
如果该入邻居u不满足所述第一预设条件,但满足第二预设条件,则独立随机地产生一个介于0、1之间的随机数r∈[0,1),利用第二更新公式对所述当前节点的入邻居节点u在下一层的个性化佩奇排名分数值πl+1(u,t)进行更新;If the incoming neighbor u does not meet the first preset condition, but meets the second preset condition, a random number r∈[0,1) between 0 and 1 is independently and randomly generated, using the second The update formula updates the personalized Page rank score π l+1 (u, t) of the incoming neighbor node u of the current node in the next layer;
所述第二预设条件如下:The second preset condition is as follows:
所述第二更新公式如下:The second update formula is as follows:
如果所述当前节点的入邻居节点u不满足所述第一预设条件,也不满足所述第二预设条件,则结束节点v的更新过程。If the incoming neighbor node u of the current node does not satisfy the first preset condition nor the second preset condition, the update process of the node v is ended.
根据本发明一个实施例的基于个性化佩奇排名的好友推荐方法,L为所述l-层个性化佩奇排名计算需要重复的轮数,且L=log1-αθ,θ为用户根据实际情况确定的误差参数,α为α-衰减随机游走中每一步的停止概率,由用户根据实际情况确定参数α的具体取值。According to the method for recommending friends based on personalized page ranking according to an embodiment of the present invention, L is the number of rounds that need to be repeated for the calculation of the l-layer personalized page ranking, and L=log 1-α θ, θ is the user's The error parameter determined by the actual situation, α is the stopping probability of each step in the α-decay random walk, and the specific value of the parameter α is determined by the user according to the actual situation.
本发明实施例还提供一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现如上述任一种所述基于个性化佩奇排名的好友推荐方法的步骤。An embodiment of the present invention further provides an electronic device, including a memory, a processor, and a computer program stored in the memory and running on the processor, when the processor executes the program, the processor implements any of the above based Steps of a friend recommendation method for personalized Page Ranking.
本发明实施例还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如上述任一种所述基于个性化佩奇排名的好友推荐方法的步骤。Embodiments of the present invention also provide a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, implements the method for recommending friends based on any of the above-mentioned personalized page rankings A step of.
本发明实施例提供的一种基于个性化佩奇排名的好友推荐方法,其能够摆脱单宿个性化佩奇排名的计算时间与社交网络稠密度的依赖关系,在使用相对误差约束单宿个性化佩奇排名分数值的估计质量时,达到了最优的计算时间,提高社交用户重要性评估的效率,从而提高好友推荐速度。The embodiment of the present invention provides a method for recommending friends based on personalized page ranking, which can get rid of the dependence between the calculation time of single-homed personalized page ranking and the density of social networks, and use relative error to constrain single-homed personalized When estimating the quality of Page's ranking score value, it achieves the optimal calculation time, improves the efficiency of social user importance evaluation, and thus improves the speed of friend recommendation.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description These are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained according to these drawings without creative efforts.
图1为本发明实施例提供的一种基于个性化佩奇排名的好友推荐方法的流程图;FIG. 1 is a flowchart of a method for recommending friends based on personalized page ranking provided by an embodiment of the present invention;
图2为本发明实施例中步骤S3的具体流程图;Fig. 2 is the specific flow chart of step S3 in the embodiment of the present invention;
图3为本发明实施例提供的一种电子设备的结构示意图。FIG. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
具体实施方式Detailed ways
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purposes, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments These are some embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
目前,对于单源个性化佩奇排名的计算,已有能使其时间消耗达到理论最优的方法,但是单宿个性化佩奇排名的计算过程还存在提升空间。但是现有的计算单宿个性化佩奇排名的方法,其时间消耗普遍依赖于社交网络的稠密度。对于用户之间平均关联度较大的社交网络,单宿个性化佩奇排名的计算速度较慢,且没有达到理论分析上的最优时间消耗,在一定程度上限制了用户重要性评估的效率,从而影响了好友推荐的速度。At present, for the calculation of single-source personalized page ranking, there are methods that can make the time consumption reach the theoretical optimum, but there is still room for improvement in the calculation process of single-homed personalized page ranking. However, the time consumption of existing methods for calculating single-homed personalized page ranking generally depends on the density of social networks. For social networks with a large average correlation between users, the calculation speed of the single-home personalized page ranking is slow, and it does not reach the optimal time consumption in theoretical analysis, which limits the efficiency of user importance evaluation to a certain extent. , thus affecting the speed of friend recommendation.
针对上述问题,本发明实施例提供的一种基于个性化佩奇排名的好友推荐方法,该方法能够摆脱单宿个性化佩奇排名的计算时间与社交网络稠密度的依赖关系,在使用相对误差约束单宿个性化佩奇排名分数值的估计质量时,达到了最优的计算时间,提高社交用户重要性评估的效率,从而提高好友推荐速度。In order to solve the above problems, the embodiment of the present invention provides a method for recommending friends based on personalized page ranking, which can get rid of the dependence between the calculation time of single-home personalized page ranking and the density of social networks, and when using relative error When constraining the estimated quality of the single-homed personalized page ranking score value, the optimal calculation time is achieved, the efficiency of social user importance evaluation is improved, and the friend recommendation speed is improved.
图1为本发明实施例提供的一种基于个性化佩奇排名的好友推荐方法的流程图,如图1所示,该方法包括:FIG. 1 is a flowchart of a method for recommending friends based on personalized page ranking provided by an embodiment of the present invention. As shown in FIG. 1 , the method includes:
S1,对于任一社交网络平台上的目标用户,将所述目标用户、用户及用户间的关系转换为图结构G,其中,所述图结构G中包括与所述用户对应的节点以及与所述用户间的关系对应的边,所述目标用户为所述图结构的宿节点;S1, for a target user on any social network platform, convert the target user, the user and the relationship between the users into a graph structure G, wherein the graph structure G includes a node corresponding to the user and a node corresponding to the user. The edge corresponding to the relationship between the users, the target user is the sink node of the graph structure;
首先将目标用户、用户及用户之间的关系转换为图结构G,图结构G中包括所有的社交用户,即目标用户和其它用户,社交用户对应图结构上的节点,社交用户之间的关注关系对应图结构上的边,目标用户为图结构的宿节点t,图结构G包括n个节点。First, the relationship between target users, users and users is converted into a graph structure G. The graph structure G includes all social users, namely target users and other users, social users correspond to nodes on the graph structure, and concerns between social users The relationship corresponds to the edge on the graph structure, the target user is the sink node t of the graph structure, and the graph structure G includes n nodes.
本发明实施例中用户指的是社交平台上所有的注册用户,用户间的关系具体可以是用户间的关注关系。例如,Facebook上所有的注册好友以及好友关系网。In the embodiment of the present invention, users refer to all registered users on the social platform, and the relationship between users may specifically be a follow relationship between users. For example, all registered friends on Facebook and the network of friends.
具体的,对于微博、Facebook、Instagram这类有关注关系的社交网络,将社交网络的用户对应到图结构上的节点,用户之间的关注关系对应到图结构上的边。Specifically, for social networks with following relationships such as Weibo, Facebook, and Instagram, the users of the social network are mapped to nodes on the graph structure, and the attention relationships between users correspond to the edges on the graph structure.
具体来说,如果A用户关注了B用户,则在图结构上建立一条由B用户节点到A用户节点的有向边。例如B—>A,这里,B是A的入邻居节点,A是B的出邻居节点,这条边是节点B的出边,是节点A的入边。将一个节点所拥有的出边的个数称为“出度”,将其所拥有的入边的个数称为“入度”。Specifically, if user A follows user B, a directed edge from user B to user A is established on the graph structure. For example, B—>A, where B is the incoming neighbor node of A, and A is the outgoing neighbor node of B. This edge is the outgoing edge of node B and the incoming edge of node A. The number of out-edges owned by a node is called "out-degree", and the number of in-edges owned by a node is called "in-degree".
对于微信、QQ这类有好友关系的社交网络,将社交网络上的用户对应到图节点,将好友关系对应到图结构上的边。具体来说,如果A用户和B用户之间存在好友关系(即A、B互为好友),则在图结构上建立一条由A用户节点到B用户节点的有向边和一条B用户节点到A用户节点的有向边。For social networks such as WeChat and QQ with friend relationships, users on the social network are mapped to graph nodes, and friend relationships are mapped to edges on the graph structure. Specifically, if there is a friend relationship between user A and user B (that is, A and B are friends with each other), a directed edge from user A to user B and a directed edge from user B to user B are established on the graph structure. A directed edge of user node.
在存储上述图结构时,对图上每个节点都构建一个入邻接表,用来存储该节点的所有入邻居。对于图上任意节点v,其对应的入邻接表长度为din(v),din(v)表示节点v的出度。When storing the above graph structure, an incoming adjacency table is constructed for each node on the graph to store all incoming neighbors of the node. For any node v on the graph, the length of its corresponding in-adjacency list is d in (v), and d in (v) represents the out-degree of node v.
S2,对于所述图结构中的每一节点,将每一节点的入邻居节点按照出度递增的顺序排序;S2, for each node in the graph structure, sort the incoming neighbor nodes of each node according to the order of increasing out-degree;
将图结构上所有节点的入邻接表里存储的节点,按照出度递增的顺序排序。假设图上任意节点v的入邻居为其对应的入邻接表里存储的节点即为 Sort the nodes stored in the in-adjacency list of all nodes in the graph structure in the order of increasing out-degree. Suppose the incoming neighbor of any node v on the graph is The corresponding node stored in the adjacency list is
将按照其出度递增顺序进行重排,并重构节点v的入邻接表为其中表示节点v所有入邻居的一种排列顺序,且保证 Will Rearrange in ascending order of its out-degree, and reconstruct the in-adjacency list of node v as in represents all incoming neighbors of node v a sort order of , and guarantees
需要说明的是,本发明实施例使用计数排序的方法完成上述排序,使得整个排序过程的时间消耗与图结构构建过程的时间消耗相同。It should be noted that, in the embodiment of the present invention, the above-mentioned sorting is completed by using the counting sorting method, so that the time consumption of the entire sorting process is the same as the time consumption of the graph structure construction process.
S3,重复执行l-层个性化佩奇排名的计算过程共L轮,得到所述图结构上宿节点相对于所有其它节点在各层的个性化佩奇排名,每一其它用户对应所述图结构上的每一其它节点;S3, repeating the calculation process of the l-layer personalized page ranking for a total of L rounds, to obtain the personalized page ranking of the sink node at each layer relative to all other nodes on the graph structure, and each other user corresponds to the graph every other node on the structure;
重复执行l-层个性化佩奇排名的计算过程,根据如下公式对l进行更新,直至l大于预设值。Repeat the calculation process of the l-layer personalized page ranking, and update l according to the following formula until l is greater than the preset value.
l更新公式为:l=l+1。l The update formula is: l=l+1.
其中,所述预设值为L=log1-αθ,θ为用户根据实际情况确定的误差参数,L为l-层个性化佩奇排名计算需要重复的轮数。Wherein, the preset value is L=log 1-α θ, θ is an error parameter determined by the user according to the actual situation, and L is the number of rounds that need to be repeated for the calculation of the l-layer personalized page ranking.
在执行步骤S3之前,图结构上的所有节点都各自维护(L+1)个变量,对应该节点在各层的个性化佩奇排名分数值。例如,对于图上任意节点v,其需要维护(L+1)个变量:π0(v,t)、π1(v,t)、…、πL(v,t),对应节点v在第0、1、…、L层的个性化佩奇排名的得分。除π0(t,t)被初始化为α外,所有节点v在各层的个性化佩奇排名分数值均被初始化为0。α是一个用户指定的参数,来自于α-衰减随机游走。Before step S3 is executed, all nodes on the graph structure maintain (L+1) variables respectively, corresponding to the personalized page ranking score values of the node at each layer. For example, for any node v on the graph, it needs to maintain (L+1) variables: π 0 (v,t), π 1 (v,t), ..., π L (v,t), the corresponding node v is in The score of the personalized page ranking for tiers 0, 1, ..., L. Except that π 0 (t, t) is initialized to α, the personalized Page rank scores of all nodes v at each layer are initialized to 0. α is a user-specified parameter derived from the α-decay random walk.
在l-层个性化佩奇排名的计算过程中,各节点在l-层的个性化佩奇排名分数值被对应更新。l是一个中间变量,用来标记当前个性化佩奇排名的更新层数,并决定整个计算过程的停止时间。In the calculation process of the l-layer personalized page ranking, the personalized page ranking score value of each node in the l-layer is correspondingly updated. l is an intermediate variable, which is used to mark the update layer number of the current personalized page ranking, and determine the stop time of the whole calculation process.
需要说明的是,“L层”的概念来自于随机游走的步数,给定宿节点t,图结构上任意节点v在第l层的个性化佩奇排名分数值π1(v,t)等于从节点v出发的α-衰减随机游走在第l步停止在宿节点t的概率。其中,α-衰减随机游走是一种特殊的随机游走方式,在每步游走时,α-衰减随机游走都以α的概率停止,以1-α的概率随机走向当前节点的任意出邻居节点。α是一个介于0、1之间的参数,由用户根据实际情况确定参数α的具体取值,α取值越大,α-衰减随机游走在每步停止的概率越大,随机游走的步长就越短。It should be noted that the concept of "L layer" comes from the number of steps of random walks. Given a sink node t, the personalized Page rank score of any node v in the lth layer in the graph structure is π 1 (v,t) is equal to the probability that an α-decaying random walk from node v stops at destination node t at step l. Among them, the α-decay random walk is a special random walk method. At each step of the walk, the α-decay random walk stops with the probability of α, and randomly walks to the current node with the probability of 1-α. out neighbor nodes. α is a parameter between 0 and 1. The specific value of parameter α is determined by the user according to the actual situation. The step size is shorter.
S4,对于所述图结构上的每一其它节点,将所述宿节点相对每一其它节点的各层个性化佩奇排名分数值相加,得到所述宿节点相对每一其它节点的个性化佩奇排名;S4, for each other node on the graph structure, add up the personalized page ranking scores of each layer of the sink node relative to each other node to obtain the personalization of the sink node relative to each other node Page ranking;
对图结构上的所有节点,将其自身相对宿节点t的各层个性化佩奇排名分数值相加,得到各节点相对宿节点t的个性化佩奇排名。For all nodes in the graph structure, add up the personalized page ranking scores of each layer relative to the sink node t to obtain the personalized page ranking of each node relative to the sink node t.
例如,对于图上任意节点v,将其维护的(L+1)个变量π0(v,t)、π1(v,t)、…、πL(v,t)的变量值相加,作为节点v的个性化佩奇排名分数值π(v,t)的估计值即 For example, for any node v on the graph, add up the variable values of the (L+1) variables π 0 (v,t), π 1 (v,t), ..., π L (v,t) it maintains , as an estimate of the personalized Page rank score π(v,t) for node v which is
需要说明的是,给定宿节点t,图上任意节点v的个性化佩奇排名分数值π(v,t)等于从节点v出发的α-衰减随机游走最终停止在宿节点t的概率。节点v的个性化佩奇排名分数值π(v,t)等于各层的个性化佩奇排名分数值之和,即 It should be noted that, given the sink node t, the personalized Page rank score π(v, t) of any node v on the graph is equal to the probability that the α-decay random walk starting from the node v finally stops at the sink node t. The personalized page ranking score value π(v,t) of node v is equal to the sum of the personalized page ranking score values of each layer, namely
在步骤S4中,将前L层的个性化佩奇排名分数值之和作为节点v个性化佩奇排名分数值π(v,t)的估计值可以证明的是,与π(v,t)之间的误差不超过θ,其中θ为用户根据实际情况确定的误差参数。In step S4, the sum of the personalized page ranking scores of the first L layers is used as the estimated value of the node v personalized page ranking score π(v, t) It can be proved that, The error with π(v,t) does not exceed θ, where θ is the error parameter determined by the user according to the actual situation.
S5,根据所述宿节点相对于每一其它节点的个性化佩奇排名,获取排名在前的预设数值个其它节点;S5, according to the personalized page ranking of the sink node relative to each other node, obtain a preset number of other nodes that are ranked first;
从图结构上的所有节点中,找到相对宿节点的个性化佩奇排名最高的前t个节点,t为预设数值,可以由用户指定,是指给目标用户进行推荐的用户数量。From all the nodes in the graph structure, find the top t nodes with the highest personalized page ranking relative to the sink node, where t is a preset value, which can be specified by the user, and refers to the number of users recommended to the target user.
S6,获取所述预设数值个其它节点对应的用户信息,作为所述目标用户对于待推荐用户的重要性衡量标准,结合所述待推荐用户对于所述目标用户的重要性排名,进行好友推荐。S6: Obtain the user information corresponding to the preset number of other nodes, as a measure of the importance of the target user to the user to be recommended, and make friend recommendation in combination with the importance ranking of the user to be recommended to the target user .
找到前述t个节点对应的用户信息,作为目标用户相对待推荐用户的重要性衡量标准,结合其他待推荐用户相对该目标用户的重要性排名,进行好友推荐。Find the user information corresponding to the aforementioned t nodes, and use it as a measure of the importance of the target user relative to the user to be recommended, and make friend recommendation in combination with the importance ranking of other users to be recommended relative to the target user.
其中,待推荐用户对于目标用户的重要性排名的计算方法为单源个性化排名计算方法,常用的实现单源个性化佩奇排名的方法有蒙特卡罗采样和前向搜索。Among them, the calculation method of the importance ranking of the user to be recommended to the target user is the single-source personalized ranking calculation method, and the commonly used methods for realizing the single-source personalized page ranking include Monte Carlo sampling and forward search.
综上,本发明实施例提供了一种基于个性化佩奇排名的好友推荐方法,摆脱了以往计算单宿个性化佩奇排名时,计算时间与社交网络稠密度的依赖关系,在使用相对误差约束单宿个性化佩奇排名分数值的估计质量时,达到了最优的计算时间,提高社交用户重要性评估的效率,从而提高好友推荐速度。To sum up, the embodiment of the present invention provides a method for recommending friends based on personalized page ranking, which gets rid of the dependence of calculation time and social network density when calculating single-home personalized page ranking in the past, and uses relative error When constraining the estimated quality of the single-homed personalized page ranking score value, the optimal calculation time is achieved, the efficiency of social user importance evaluation is improved, and the friend recommendation speed is improved.
另外,对于随机选取的宿节点,本发明实施例可以在的时间复杂度内完成单宿个性化佩奇排名在常数相对误差、δ相对误差约束阈值下的计算,达到了理论证明的最优计算时间;对于绝对误差ε,本发明实施例可以在的时间复杂度内完成单宿个性化佩奇排名的计算,为该社交网络对应的图结构上的节点平均度。In addition, for a randomly selected sink node, the embodiment of the present invention may The calculation of the single-homed personalized page ranking under the constant relative error and the δ relative error constraint threshold is completed within the time complexity of ε, which achieves the optimal calculation time of the theoretical proof; for the absolute error ε, the embodiment of the present invention can be The calculation of the single-homed personalized page ranking is completed within the time complexity of , is the average degree of nodes on the graph structure corresponding to the social network.
而现有的计算单宿个性化佩奇排名的方法只能在的时间内得到常数相对误差、δ相对误差约束阈值下的计算结果,或者在的时间内得到绝对误差ε的计算结果。However, the existing methods for calculating the single-homed personalized page ranking can only be used in The calculation results under the constant relative error, the delta relative error constraint threshold, or the The calculation result of the absolute error ε is obtained within the time.
图2为本发明实施例中步骤S3的具体流程图,如图2所示,在上述实施例的基础上,优选地,所述步骤S3具体包括:Fig. 2 is a specific flowchart of step S3 in the embodiment of the present invention. As shown in Fig. 2, on the basis of the above-mentioned embodiment, preferably, the step S3 specifically includes:
S31,对于所述图结构,重复执行更新过程,直至该更新过程遍历所述图结构上所有在当前层的个性化佩奇排名分数值大于0的节点;S31, for the graph structure, repeat the update process until the update process traverses all nodes on the graph structure with a personalized page ranking score value greater than 0 at the current layer;
重复执行更新过程,直至该更新过程遍历图结构上所有在当前层的个性化佩奇排名分数值大于0的节点。The update process is repeated until the update process traverses all nodes in the graph structure whose personalized Page rank score value is greater than 0 at the current layer.
具体地,该更新过程为:Specifically, the update process is:
对于所述图结构,按照当前节点v的入邻接表中的节点存储顺序,逐个判断所述入邻接表中每一入邻居节点u∈Nin(v)是否满足预设条件,如果满足,更新满足预设条件的入邻居节点在下一层的个性化佩奇排名分数值,Nin(v)为所述当前节点v的所有入邻居节点组成的集合,所述当前节点为在当前层的个性化佩奇排名分数值大于0的节点。For the graph structure, according to the storage order of the nodes in the incoming adjacency list of the current node v, judge one by one whether each incoming neighbor node u∈N in (v) in the incoming adjacency list satisfies the preset condition, and if so, update The personalized page ranking score value of the incoming neighbor nodes that meet the preset conditions in the next layer, N in (v) is the set composed of all incoming neighbor nodes of the current node v, and the current node is the personality in the current layer. Converts nodes with a Page rank score greater than 0.
S32,将所述图结构上各节点在当前层的个性化佩奇排名分数值进行存储,用于后续计算。S32: Store the personalized page ranking score values of each node on the graph structure at the current layer for subsequent calculation.
在上述实施例的基础上,优选地,所述步骤S31具体包括:On the basis of the above embodiment, preferably, the step S31 specifically includes:
S311,如果所述当前节点的入邻居节点u满足第一预设条件,利用第一更新公式对该入邻居节点u在下一层的个性化佩奇排名分数值πl+1(u,t)进行更新;S311, if the incoming neighbor node u of the current node satisfies the first preset condition, use the first update formula for the personalized page ranking score of the incoming neighbor node u in the next layer π l+1 (u, t) to update;
所述第一预设条件为:The first preset condition is:
所述第一更新公式为:The first update formula is:
其中,πl+1(u,t)′表示更新后的个性化佩奇排名分数值,v为当前节点,πl(v,t)为当前节点v在当前层l的个性化佩奇排名分数值,πl+1(u,t)为入邻居节点u在下一层l+1的个性化佩奇排名分数值,θ为用户根据实际情况确定的误差参数,α为α-衰减随机游走中每一步的停止概率,由用户根据实际情况确定参数α的具体取值,λ(u)是一个与节点u相关的数值,当λ(u)=1时,对于个性化佩奇排名的真实分数值大于θ的节点,最后得到的个性化佩奇排名的估计分数值和真实分数值之间不超过常数相对误差,当时,最后得到的各节点个性化佩奇排名的估计分数值与真实分数值之间的绝对误差不超过θ,用户根据实际情况选择λ(u)的取值;Among them, π l+1 (u, t)' represents the updated personalized page ranking score value, v is the current node, and π l (v, t) is the personalized page ranking of the current node v in the current layer l Score value, π l+1 (u, t) is the personalized page ranking score value of incoming neighbor node u in the next layer l+1, θ is the error parameter determined by the user according to the actual situation, α is the α-decay random walk The stopping probability of each step is determined by the user according to the actual situation. The specific value of the parameter α is determined by the user. λ(u) is a value related to the node u. For nodes whose true score value is greater than θ, the estimated score value of the final personalized Page ranking and the true score value do not exceed a constant relative error, when When , the absolute error between the estimated score value of each node's personalized Page ranking and the real score value does not exceed θ, and the user chooses the value of λ(u) according to the actual situation;
S312,如果该入邻居u不满足所述第一预设条件,但满足第二预设条件,则独立随机地产生一个介于0、1之间的随机数r∈[0,1),利用第二更新公式对所述当前节点的入邻居节点u在下一层的个性化佩奇排名分数值πl+1(u,t)进行更新;S312, if the incoming neighbor u does not meet the first preset condition but meets the second preset condition, independently and randomly generate a random number r∈[0,1) between 0 and 1, using The second update formula updates the personalized Page rank score π l+1 (u, t) of the incoming neighbor node u of the current node in the next layer;
所述第二预设条件如下:The second preset condition is as follows:
所述第二更新公式如下:The second update formula is as follows:
S313,如果所述当前节点的入邻居节点u不满足所述第一预设条件,也不满足所述第二预设条件,则结束节点v的更新过程。S313, if the incoming neighbor node u of the current node does not satisfy the first preset condition nor the second preset condition, end the updating process of the node v.
需要说明的是,对于入邻居节点u,只有当其不满足第一预设条件时,其才可能满足第二预设条件。并且,在步骤S2中,各节点的入邻居已经按照其出度递增顺序进行了排序。因此,如果入邻接表中的前一入邻居节点不满足第一预设条件但满足第二预设条件时,下一入邻居节点不需要再进行步骤S311的判断,直接执行步骤S312即可;如果从某一入邻居节点开始不满足第二预设条件,该入邻居节点直接执行步骤S313,结束对节点v入邻居在下一层个性化佩奇排名的更新,后续节点无需再执行步骤S311-S313。It should be noted that, for the incoming neighbor node u, only when it does not meet the first preset condition, it may satisfy the second preset condition. In addition, in step S2, the in-neighbors of each node have been sorted in an increasing order of their out-degrees. Therefore, if the previous incoming neighbor node in the incoming adjacency table does not meet the first preset condition but meets the second preset condition, the next incoming neighbor node does not need to perform the judgment of step S311 again, and directly executes step S312; If the second preset condition is not satisfied from an incoming neighbor node, the incoming neighbor node directly executes step S313, and ends the update of the personalized page ranking of node v incoming neighbors in the next layer, and subsequent nodes do not need to perform step S311- S313.
图3为本发明实施例提供的一种电子设备的实体结构示意图,如图3所示,该电子设备可以包括:处理器(processor)310、通信接口(Communications Interface)320、存储器(memory)330和通信总线340,其中,处理器310,通信接口320,存储器330通过通信总线340完成相互间的通信。处理器310可以调用存储器330中的逻辑指令,以执行一种基于个性化佩奇排名的好友推荐方法,该方法包括:FIG. 3 is a schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention. As shown in FIG. 3 , the electronic device may include: a processor (processor) 310, a communications interface (Communications Interface) 320, and a memory (memory) 330 and a
S1,对于任一社交网络平台上的目标用户,将所述目标用户、用户及用户间的关系转换为图结构G,其中,所述图结构G中包括与所述用户对应的节点以及与所述用户间的关系对应的边,所述目标用户为所述图结构的宿节点;S1, for a target user on any social network platform, convert the target user, the user and the relationship between the users into a graph structure G, wherein the graph structure G includes a node corresponding to the user and a node corresponding to the user. The edge corresponding to the relationship between the users, the target user is the sink node of the graph structure;
S2,对于所述图结构中的每一节点,将每一节点的入邻居节点按照出度递增的顺序排序;S2, for each node in the graph structure, sort the incoming neighbor nodes of each node according to the order of increasing out-degree;
S3,重复执行l-层个性化佩奇排名的计算过程共L轮,得到所述图结构上宿节点相对于所有其它节点在各层的个性化佩奇排名,每一其它用户对应所述图结构上的每一其它节点;S3, repeating the calculation process of the l-layer personalized page ranking for a total of L rounds, to obtain the personalized page ranking of the sink node at each layer relative to all other nodes on the graph structure, and each other user corresponds to the graph every other node on the structure;
S4,对于所述图结构上的每一其它节点,将所述宿节点相对每一其它节点的各层个性化佩奇排名分数值相加,得到所述宿节点相对每一其它节点的个性化佩奇排名;S4, for each other node on the graph structure, add up the personalized page ranking scores of each layer of the sink node relative to each other node to obtain the personalization of the sink node relative to each other node Page ranking;
S5,根据所述宿节点相对于每一其它节点的个性化佩奇排名,获取排名在前的预设数值个其它节点;S5, according to the personalized page ranking of the sink node relative to each other node, obtain a preset number of other nodes that are ranked first;
S6,获取所述预设数值个其它节点对应的用户信息,作为所述目标用户对于待推荐用户的重要性衡量标准,结合所述待推荐用户对于所述目标用户的重要性排名,进行好友推荐。S6: Obtain the user information corresponding to the preset number of other nodes, as a measure of the importance of the target user to the user to be recommended, and make friend recommendation in combination with the importance ranking of the user to be recommended to the target user .
此外,上述的存储器330中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。In addition, the above-mentioned logic instructions in the
另一方面,本发明实施例还提供一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,计算机能够执行上述各方法实施例所提供的一种基于个性化佩奇排名的好友推荐方法,该方法包括:On the other hand, an embodiment of the present invention also provides a computer program product, the computer program product includes a computer program stored on a non-transitory computer-readable storage medium, the computer program includes program instructions, when the program instructions When executed by a computer, the computer can execute a method for recommending friends based on personalized Page rank provided by the above method embodiments, the method includes:
S1,对于任一社交网络平台上的目标用户,将所述目标用户、用户及用户间的关系转换为图结构G,其中,所述图结构G中包括与所述用户对应的节点以及与所述用户间的关系对应的边,所述目标用户为所述图结构的宿节点;S1, for a target user on any social network platform, convert the target user, the user and the relationship between the users into a graph structure G, wherein the graph structure G includes a node corresponding to the user and a node corresponding to the user. The edge corresponding to the relationship between the users, the target user is the sink node of the graph structure;
S2,对于所述图结构中的每一节点,将每一节点的入邻居节点按照出度递增的顺序排序;S2, for each node in the graph structure, sort the incoming neighbor nodes of each node according to the order of increasing out-degree;
S3,重复执行l-层个性化佩奇排名的计算过程共L轮,得到所述图结构上宿节点相对于所有其它节点在各层的个性化佩奇排名,每一其它用户对应所述图结构上的每一其它节点;S3, repeating the calculation process of the l-layer personalized page ranking for a total of L rounds, to obtain the personalized page ranking of the sink node at each layer relative to all other nodes on the graph structure, and each other user corresponds to the graph every other node on the structure;
S4,对于所述图结构上的每一其它节点,将所述宿节点相对每一其它节点的各层个性化佩奇排名分数值相加,得到所述宿节点相对每一其它节点的个性化佩奇排名;S4, for each other node on the graph structure, add up the personalized page ranking scores of each layer of the sink node relative to each other node to obtain the personalization of the sink node relative to each other node Page ranking;
S5,根据所述宿节点相对于每一其它节点的个性化佩奇排名,获取排名在前的预设数值个其它节点;S5, according to the personalized page ranking of the sink node relative to each other node, obtain a preset number of other nodes that are ranked first;
S6,获取所述预设数值个其它节点对应的用户信息,作为所述目标用户对于待推荐用户的重要性衡量标准,结合所述待推荐用户对于所述目标用户的重要性排名,进行好友推荐。S6: Obtain the user information corresponding to the preset number of other nodes, as a measure of the importance of the target user to the user to be recommended, and make friend recommendation in combination with the importance ranking of the user to be recommended to the target user .
又一方面,本发明实施例还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现以执行上述各实施例提供的一种基于个性化佩奇排名的好友推荐方法,该方法包括:In yet another aspect, embodiments of the present invention further provide a non-transitory computer-readable storage medium on which a computer program is stored, and the computer program is implemented when executed by a processor to execute a personalization-based storage medium provided by the foregoing embodiments. Page Rank's friend recommendation method, which includes:
S1,对于任一社交网络平台上的目标用户,将所述目标用户、用户及用户间的关系转换为图结构G,其中,所述图结构G中包括与所述用户对应的节点以及与所述用户间的关系对应的边,所述目标用户为所述图结构的宿节点;S1, for a target user on any social network platform, convert the target user, the user and the relationship between the users into a graph structure G, wherein the graph structure G includes a node corresponding to the user and a node corresponding to the user. The edge corresponding to the relationship between the users, and the target user is the sink node of the graph structure;
S2,对于所述图结构中的每一节点,将每一节点的入邻居节点按照出度递增的顺序排序;S2, for each node in the graph structure, sort the incoming neighbor nodes of each node according to the order of increasing out-degree;
S3,重复执行l-层个性化佩奇排名的计算过程共L轮,得到所述图结构上宿节点相对于所有其它节点在各层的个性化佩奇排名,每一其它用户对应所述图结构上的每一其它节点;S3, repeating the calculation process of the l-layer personalized page ranking for a total of L rounds, to obtain the personalized page ranking of the sink node at each layer relative to all other nodes on the graph structure, and each other user corresponds to the graph every other node on the structure;
S4,对于所述图结构上的每一其它节点,将所述宿节点相对每一其它节点的各层个性化佩奇排名分数值相加,得到所述宿节点相对每一其它节点的个性化佩奇排名;S4, for each other node on the graph structure, add up the personalized page ranking scores of each layer of the sink node relative to each other node to obtain the personalization of the sink node relative to each other node Page ranking;
S5,根据所述宿节点相对于每一其它节点的个性化佩奇排名,获取排名在前的预设数值个其它节点;S5, according to the personalized page ranking of the sink node relative to each other node, obtain a preset number of other nodes that are ranked first;
S6,获取所述预设数值个其它节点对应的用户信息,作为所述目标用户对于待推荐用户的重要性衡量标准,结合所述待推荐用户对于所述目标用户的重要性排名,进行好友推荐。S6: Obtain the user information corresponding to the preset number of other nodes, as a measure of the importance of the target user to the user to be recommended, and make friend recommendation in combination with the importance ranking of the user to be recommended to the target user .
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The device embodiments described above are only illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in One place, or it can be distributed over multiple network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment. Those of ordinary skill in the art can understand and implement it without creative effort.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and certainly can also be implemented by hardware. Based on this understanding, the above-mentioned technical solutions can be embodied in the form of software products in essence or the parts that make contributions to the prior art, and the computer software products can be stored in computer-readable storage media, such as ROM/RAM, magnetic A disc, an optical disc, etc., includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the methods described in various embodiments or some parts of the embodiments.
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, but not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that it can still be The technical solutions described in the foregoing embodiments are modified, or some technical features thereof are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims (7)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010850777.2A CN111984832B (en) | 2020-08-21 | 2020-08-21 | Friend recommendation method based on personalized petty ranking |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010850777.2A CN111984832B (en) | 2020-08-21 | 2020-08-21 | Friend recommendation method based on personalized petty ranking |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN111984832A true CN111984832A (en) | 2020-11-24 |
| CN111984832B CN111984832B (en) | 2023-07-07 |
Family
ID=73443232
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202010850777.2A Active CN111984832B (en) | 2020-08-21 | 2020-08-21 | Friend recommendation method based on personalized petty ranking |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN111984832B (en) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114265988A (en) * | 2021-12-20 | 2022-04-01 | 人工智能与数字经济广东省实验室(广州) | Friend recommendation method based on importance score |
| CN116776007A (en) * | 2022-03-10 | 2023-09-19 | 中国移动通信集团江苏有限公司 | Information recommendation methods, devices, electronic equipment and computer program products |
| CN116992153A (en) * | 2023-08-28 | 2023-11-03 | 中国人民大学 | How to determine the importance of a web page |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20090307344A1 (en) * | 2008-06-04 | 2009-12-10 | Kaplan Yuval | Web page ranking method and system based on user referrals |
| CN108460158A (en) * | 2018-03-28 | 2018-08-28 | 天津大学 | Differentiation Web page sequencing method based on PageRank |
| CN110287424A (en) * | 2019-06-28 | 2019-09-27 | 中国人民大学 | Collaborative filtering recommendation method based on single-source SimRank |
| CN110659394A (en) * | 2019-08-02 | 2020-01-07 | 中国人民大学 | Recommendation method based on two-way proximity |
| CN111506833A (en) * | 2020-06-12 | 2020-08-07 | 中国人民大学 | A friend recommendation method based on the exact solution of single-source SimRank |
-
2020
- 2020-08-21 CN CN202010850777.2A patent/CN111984832B/en active Active
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20090307344A1 (en) * | 2008-06-04 | 2009-12-10 | Kaplan Yuval | Web page ranking method and system based on user referrals |
| CN108460158A (en) * | 2018-03-28 | 2018-08-28 | 天津大学 | Differentiation Web page sequencing method based on PageRank |
| CN110287424A (en) * | 2019-06-28 | 2019-09-27 | 中国人民大学 | Collaborative filtering recommendation method based on single-source SimRank |
| CN110659394A (en) * | 2019-08-02 | 2020-01-07 | 中国人民大学 | Recommendation method based on two-way proximity |
| CN111506833A (en) * | 2020-06-12 | 2020-08-07 | 中国人民大学 | A friend recommendation method based on the exact solution of single-source SimRank |
Non-Patent Citations (2)
| Title |
|---|
| FUYUN HE 等: "User Mining Algorithm Based On PageRank Modeling Improvement and Comprehensive Influence Evaluation", 《2018 IEEE 4TH INFORMATION TECHNOLOGY AND MECHATRONICS ENGINEERING CONFERENCE (ITOEC)》 * |
| 杨红果 等: "基于强连通分量的个性化的网页排名高效算法", 《计算机学报》 * |
Cited By (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114265988A (en) * | 2021-12-20 | 2022-04-01 | 人工智能与数字经济广东省实验室(广州) | Friend recommendation method based on importance score |
| CN114265988B (en) * | 2021-12-20 | 2024-09-10 | 人工智能与数字经济广东省实验室(广州) | Friend recommendation method based on importance score |
| CN116776007A (en) * | 2022-03-10 | 2023-09-19 | 中国移动通信集团江苏有限公司 | Information recommendation methods, devices, electronic equipment and computer program products |
| CN116992153A (en) * | 2023-08-28 | 2023-11-03 | 中国人民大学 | How to determine the importance of a web page |
Also Published As
| Publication number | Publication date |
|---|---|
| CN111984832B (en) | 2023-07-07 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| Narayanam et al. | A shapley value-based approach to discover influential nodes in social networks | |
| CN103024017B (en) | A kind of social networks important goal and Community Group recognition methods | |
| Chaoji et al. | Recommendations to boost content spread in social networks | |
| Pham et al. | S3g2: A scalable structure-correlated social graph generator | |
| CN104281882B (en) | The method and system of prediction social network information stream row degree based on user characteristics | |
| Hangal et al. | All friends are not equal: Using weights in social graphs to improve search | |
| CN105809554B (en) | Prediction method for user participating in hot topics in social network | |
| CN108763314A (en) | A kind of interest recommends method, apparatus, server and storage medium | |
| CN108399189A (en) | Friend recommendation system based on community discovery and its method | |
| CN107330020B (en) | A User Entity Resolution Method Based on Structural and Attribute Similarity | |
| CN108399191B (en) | A Personalized Recommendation Method for Bidding Information | |
| CN107330798A (en) | Method for identifying ID between a kind of social networks propagated based on seed node | |
| CN111984832A (en) | A friend recommendation method based on personalized page ranking | |
| CN110008999B (en) | Method, device, storage medium and electronic device for determining target account | |
| CN106991614A (en) | The parallel overlapping community discovery method propagated under Spark based on label | |
| CN111475724A (en) | A random walk social network event recommendation method based on user similarity | |
| CN107657043A (en) | A kind of combination chart model image based on content recommends method | |
| CN104850647A (en) | Microblog group discovering method and microblog group discovering device | |
| Bródka | A method for group extraction and analysis in multilayer social networks | |
| US20180150864A1 (en) | Method and System for creating and comparing virtual firms | |
| CN104484365B (en) | In a kind of multi-source heterogeneous online community network between network principal social relationships Forecasting Methodology and system | |
| CN109120431A (en) | The method, apparatus and terminal device that propagating source selects in complex network | |
| CN114154076A (en) | Social user influence measuring method based on multi-angle analysis | |
| CN112508725B (en) | Community structure-based location awareness influence maximization method | |
| CN103279484A (en) | Creating method and creating system facing future opinion leaders in micro-blog system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |