A friend recommendation method and device based on Truss model

By analyzing user similarities and common historical behaviors, personalized recommendations for Why-not friends solve the problem of users not appearing in query results in social networks, and improve user experience and social network activity.

CN118503551BActive Publication Date: 2024-10-11ZHEJIANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410974020.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-19
Publication Date
2024-10-11
Estimated Expiration
2044-07-19

AI Technical Summary

Technical Problem

When performing k-Truss community queries in social networks, users may find that some specific users do not appear in the query results, resulting in a poor user experience and the inability to interact with desired friends or interested users.

Method used

By analyzing the similarities or common historical behaviors between users and other users, we provide personalized friend recommendation methods, establish friend relationships between Why-not points and k-Truss community users, update the social network structure, and traverse friends The relationship collection calculates followers, deletes unnecessary relationships and recommends the minimum number of friends.

Benefits of technology

It improves the personalization and transparency of user experience and recommendation systems, enhances the activity and user loyalty of social networks, and promotes interconnection between users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118503551B_ABST
    Figure CN118503551B_ABST
Patent Text Reader

Abstract

The present invention discloses a friend recommendation method and device based on the Truss model. The friend recommendation method includes: k‑Truss Establish friendship among all users in the community so Why‑not click to join k‑Truss community and update the social network structure; traverse each friend relationship in the newly added friend relationship set B and calculate its followers; select a friend relationship with the most followers from the newly added friend relationship set B; delete the selected friend relationship and its followers and update the social network structure and the remaining newly added friend relationship set B; repeat the above traversal calculation, selection deletion and update operations. If deleting a selected friend relationship causes the Why‑not point to no longer be k‑Truss If there is a point in the community, the deletion is cancelled and the duplication is stopped; the remaining new friend relationships are returned, and based on the remaining new friend relationships, the minimum number of friends are recommended to the Why‑not point user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of social network, and in particular to a friend recommendation method and device based on a Truss model. Background Art

[0002] With the rapid development of information technology, various large-scale graph structures have become increasingly common in many practical application scenarios, such as social media, e-commerce, and knowledge bases. A key component of these graphs is the network community, which is essentially a group of tightly connected vertices with high connectivity between members. Community detection and query techniques are widely used in practical problems, including but not limited to event organization, friend recommendation, market analysis, and social behavior research.

[0003] A variety of community models have been studied in depth, including k-Truss ( k- truss), k-Core ( k- core) and k- Clique ( k- However, k-Core The model lacks structural cohesion. k-Clique The computational problem of is NP-hard (non-deterministic polynomial time problem). k-Truss The structure is based on triangles and can be computed in polynomial time. Therefore, k-Truss The model is widely used in community search due to its high cohesion and computational efficiency, especially on various types of graphs such as undirected graphs, directed graphs and attribute graphs.

[0004] k-Truss The model is a network subgraph structure in which each edge must participate in at least k -2 triangles ( k ≥2). This feature makes k-Truss The model can effectively identify stable structural groups in the network, namely k-Truss Communities. This model is particularly useful in community detection because it can reveal groups of social relationships with strong coherence and stability.

[0005] k-Truss The core task of community query is to input a network G and a query node and find the nodes that contain the query node. k-Truss community. k-Truss Analyzing the community can effectively explore the social relationships and potential friend networks among users. Specifically, k-TrussThe community can identify users who are closely related to the query node and have multiple common friends, which means that these users usually have stronger social connections and interaction frequencies.

[0006] In executing social networks k-Truss When searching in a community, users may be confused about certain specific users (i.e., Why-not users) not appearing in the query results. For example, a user may want a friend or a user of interest to appear in the result list, but this is not the case. These users who were expected to appear in the result list but did not appear in reality can be called Why-not users. In order to meet this demand of users, Why-not users can be included by recommending a minimum number of friend relationships. k-Truss Community.

[0007] This personalized friend recommendation not only improves user experience and satisfaction, but also stimulates more social interaction. As users interact with more users who match their interests and behavior patterns on the platform, the activity and diversity of the social network will increase significantly. Users stay on the platform longer and participate in more social activities, such as content sharing, commenting and liking, thus forming a more active social ecosystem.

[0008] In this way, not only can the expectations of users be met, but the overall structure and connectivity of the social network community can also be enhanced. Personalized recommendation mechanisms can not only enhance users' loyalty and dependence on the platform, but also promote interconnection between users to a great extent. Summary of the invention

[0009] In a first aspect, the present invention provides a friend recommendation method based on the Truss model, which provides modification suggestions for the Why-not problem by analyzing the similarities or common historical behaviors between a user and other users. For example, if a friend is not recommended, the system can suggest that the user interact with more similar users.

[0010] A friend recommendation method based on the Truss model comprises the following steps:

[0011] S11. Obtain user social information and build a social network;

[0012] S12. Find out the k-Truss Community, and Why-not Points;

[0013] S13, at the Why-not point and k-Truss Establish friendships among all community users, so that Why-not can join k-Truss community, and updating the social network structure;

[0014] S14, traverse each friend relationship in the newly added friend relationship set B, and calculate its followers F(e,B); F(e,B) refers to the friend relationships in the newly added friend relationship set B that are gradually collapsed after a friend relationship e in the newly added friend relationship set B is revoked;

[0015] S15, selecting a friend relationship with the most followers from the newly added friend relationship set B;

[0016] S16, deleting the selected friend relationship and its followers, and updating the social network structure and the remaining newly added friend relationship set B;

[0017] S17, repeat steps S14, S15, S16, if deleting a selected friend relationship causes the Why-not point to no longer be k- Truss If a point in the community is found, the deletion of the friendship relationship will be cancelled and the duplication will stop;

[0018] S18. Return the remaining newly added friend relationships, and based on the remaining newly added friend relationships, recommend a minimum number of friends to the Why-not point user.

[0019] In step S11, user social information may include following behaviors, liking behaviors, commenting behaviors, etc. among users.

[0020] In step S11, users in social media can be modeled as a set of points, and the relationship between users can be modeled as a set of edges. Each edge connects two different users, indicating that there is a close connection between the two users, thereby building a social network.

[0021] In step S12, k-Truss The community query algorithm calculates the Truss value of each edge to find the k-Truss Community.

[0022] In some embodiments, in step S13, after each friendship relationship is established, the Truss value of each friendship relationship in the social network structure is updated according to the following steps:

[0023] S31, preset the upper and lower bounds of the Truss value of the established friend relationship, that is, ,and , Indicates the friendship relationship established Truss value, Indicates that it contains friend relationships And the Truss values ​​of the other two adjacent relations are greater than or equal to The number of triangles, Indicates that it contains friend relationships And the Truss values ​​of the other two adjacent relations are greater than or equal to The number of triangles, the lower bound is to make Greater than or equal to The largest positive integer, that is , upper bound is to make Greater than or equal to The largest positive integer, that is ;

[0024] S32, traverse the triangle structure containing the established friend relationship, and for each triangle structure, calculate the smaller Truss value of two adjacent relationships ,if , then the Truss value is equal to The adjacent relationship is put into the queue ;

[0025] S33, through breadth-first traversal, for For each relationship in the , count the Truss values ​​of the two adjacent relationships that contain the relationship and satisfy the remaining two adjacent relationships The number of triangle structures , and the Truss value is The neighbor relationship is added , these new additions Continue the above breadth-first traversal based on the adjacent relationship;

[0026] S34, if The number of triangle structures in The relationship between Delete the relationship and update the same The number of triangle structures of all adjacent relations in , the updated relationship continues to step S34;

[0027] S35, The Truss values ​​of all friend relationships in the social network increase by 1, and the Truss values ​​of the remaining friend relationships in the social network structure remain unchanged.

[0028] In some embodiments, in step S14, for any newly added friend relationship e, its followers F(e, B) are calculated according to the following steps:

[0029] S41, traverse the triangle structure containing the newly added friend relationship e, and for each triangle structure, calculate the smaller Truss value of two adjacent relationships ,if , for k-Truss In , then the Truss value is equal to The adjacent relationship is put into the queue ;

[0030] S42, through breadth-first traversal, for For the relations that are not marked in the list, the average Truss value of the relations that contain the relations and satisfy the remaining two adjacent relations is counted. The number of triangular structures S;

[0031] S43. If the number of triangle structures S of a relationship is less than , mark the relationship and change its Truss value to Finally, the Truss values ​​of all triangles containing this relationship are And untagged relations are added , these new additions The unmarked relations continue to perform the breadth-first traversal in step S42;

[0032] S44, Final All the friend relationships that have been marked in and appear in the newly added friend relationship set B are considered followers F(e,B).

[0033] In some embodiments, in step S16, after each friend relationship is deleted, the Truss value of each friend relationship in the social network structure is updated according to the following steps:

[0034] S61. Traverse the triangle structure containing the deleted friend relationship, and for each triangle structure, calculate the smaller Truss value of the two adjacent relationships. ,if , Indicates the Truss value of the deleted friend relationship, then the Truss value is equal to The adjacent relationship is put into the queue ;

[0035] S62, through breadth-first traversal, for There are no tagged relationships in , respectively count the Truss values ​​of the two adjacent relationships that contain this relationship and satisfy the remaining two adjacent relationships The number of triangle structures , Representing relationships Truss value;

[0036] S63. If there is a relationship between the number of triangle structures Less than , mark the relationship and change its Truss value to Finally, all triangles containing this relationship have Truss values ​​less than or equal to And untagged relations are added , these new additions The unmarked relations continue to perform the breadth-first traversal in step S62;

[0037] S64. The Truss values ​​of other friend relationships in the social network structure remain unchanged.

[0038] In a second aspect, the present invention provides a computer device, comprising a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, and when the computer program is run, the processor executes the friend recommendation method based on the Truss model described in the first aspect.

[0039] In a third aspect, the present invention provides a computer-readable storage medium storing a program or instruction. When the program or instruction is executed by a computer device, the computer device executes the friend recommendation method based on the Truss model described in the first aspect.

[0040] In a fourth aspect, the present invention provides a computer program product, including a computer program, which, when executed by a computer device, enables the computer device to execute the friend recommendation method based on the Truss model described in the first aspect.

[0041] In a fifth aspect, the present invention provides a friend recommendation device based on the Truss model, comprising:

[0042] The acquisition module is used to obtain user social information, build social networks, and find k-Truss Community, and Why-not Points;

[0043] Preprocessing module for Why-not points and k-Truss Establish friendships among all community users, so that Why-not can join k-Truss community, and updating the social network structure;

[0044] The calculation module is used to: I) traverse each friend relationship in the newly added friend relationship set B and calculate its followers F(e, B); F(e, B) refers to the friend relationships in the newly added friend relationship set B that collapse one after another after a friend relationship e in the newly added friend relationship set B is revoked; II) select a friend relationship with the most followers from the newly added friend relationship set B; III) delete the selected friend relationship and its followers, and update the social network structure and the remaining newly added friend relationship set B; IV) repeat I), II), and III). If deleting a selected friend relationship causes the Why-not point to no longer be k-Truss If a point in the community is found, the deletion of the friendship relationship will be cancelled and the duplication will stop;

[0045] The output module is used to return the remaining new friend relationships, and based on the remaining new friend relationships, recommend the minimum number of friends to the Why-not point user.

[0046] The friend recommendation device described in the fifth aspect can execute the friend recommendation method described in the first aspect when running.

[0047] Compared with the prior art, the present invention has the following beneficial effects:

[0048] The present invention analyzes the similarities or common historical behaviors between a user and other users, provides modification suggestions for Why-not questions, thereby improving user understanding and acceptance, enhancing the personalization and transparency of the recommendation system, and recommending a minimum number of friends to users of Why-not points, thereby improving the quality of friend recommendations and user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 A flowchart of a friend recommendation method based on the Truss model.

[0050] Figure 2 for Figure 1 A specific flow chart of step S13 in the friend recommendation method is shown.

[0051] Figure 3 for Figure 1 A specific flow chart of step S14 in the friend recommendation method is shown.

[0052] Figure 4 for Figure 1 A specific flow chart of step S16 in the friend recommendation method is shown. DETAILED DESCRIPTION

[0053] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments. It should be understood that these embodiments are only used to illustrate the present invention and are not used to limit the scope of the present invention.

[0054] See alsoFigure 1 , a friend recommendation method based on the Truss model, comprising the steps of:

[0055] S11. Obtain user social information and build a social network;

[0056] S12. Find out the k-Truss Community, and Why-not Points;

[0057] S13, at the Why-not point and k-Truss Establish friendships among all community users, so that Why-not can join k-Truss community, and updating the social network structure;

[0058] S14, traverse each friend relationship in the newly added friend relationship set B, and calculate its followers F(e,B); F(e,B) refers to the friend relationships in the newly added friend relationship set B that are gradually collapsed after a friend relationship e in the newly added friend relationship set B is revoked;

[0059] S15, selecting a friend relationship with the most followers from the newly added friend relationship set B;

[0060] S16, deleting the selected friend relationship and its followers, and updating the social network structure and the remaining newly added friend relationship set B;

[0061] S17, repeat steps S14, S15, S16, if deleting a selected friend relationship causes the Why-not point to no longer be k- Truss If a point in the community is found, the deletion of the friendship relationship will be cancelled and the duplication will stop;

[0062] S18. Return the remaining newly added friend relationships, and based on the remaining newly added friend relationships, recommend a minimum number of friends to the Why-not point user.

[0063] The present invention can be applied to multiple practical fields such as social networks, personalized friend recommendation systems, etc. Without loss of generality, the present invention can represent a social network as , is a set of nodes, representing the set of users in a social network. is a set of relations and , represents the social relationship between users. Specifically, in a social network, there are behaviors such as following, liking and commenting between users. The present invention can model users in social media as a set of points, and model the relationship between users as a set of edges, where each edge connects two different users, indicating that there is a close connection between the two users, thereby constructing a social network.

[0064] In step S12,k-Truss The community query algorithm calculates the Truss value of each edge to find the k-Truss Community: Any pair of friends has at least k -2 common friends, that is, for any friendship relationship e(u,v) ,satisfy ,in Indicates the node user The set of connected friend nodes, Indicates the node user v The set of connected friend nodes. At the same time, determine the Why-not point, that is, not k-Truss In the community but hoping to join by building some friendships k-Truss Users of the community.

[0065] In step S13, after establishing the friendship, the Truss value of the relevant edge needs to be updated to ensure that the Truss structure of the graph remains accurate and complete. For details, see Figure 2 After each friendship is established, the Truss value of each friendship in the social network structure is updated according to the following steps:

[0066] S31, preset the upper and lower bounds of the Truss value of the established friend relationship, that is, ,and , Indicates the friendship relationship established Truss value, Indicates that it contains friend relationships And the Truss values ​​of the other two adjacent relations are greater than or equal to The number of triangles, Indicates that it contains friend relationships And the Truss values ​​of the other two adjacent relations are greater than or equal to The number of triangles, the lower bound is to make Greater than or equal to The largest positive integer, that is , upper bound is to make Greater than or equal to The largest positive integer, that is .

[0067] The purpose of estimating the Truss upper and lower bounds of the established friendship is to reduce the range of the affected edges. After that, only if the Truss value is less than The Truss value of the relationship may change. Moreover, due to And other relationships can only form a triangle, so after establishing the relationship After that, the Truss values ​​of other relations in the network either remain unchanged or increase by one.

[0068] S32, traverse the triangle structure containing the established friend relationship, and for each triangle structure, calculate the smaller Truss value of two adjacent relationships ,if , then the Truss value is equal to The adjacent relationship is put into the queue .

[0069] For satisfying of Value, Queue The relationship in is established by friendship e Directly affected and Truss value is , so the Truss values ​​of these relations may change in subsequent operations. We put these relations into the queue , so that they can be processed and updated in subsequent steps. Doing so ensures that we only process those relationships that are directly affected and whose Truss values ​​may change, thereby improving the efficiency of the algorithm and reducing unnecessary calculations.

[0070] S33, through breadth-first traversal, for For each relationship in the , count the Truss values ​​of the two adjacent relationships that contain the relationship and satisfy the remaining two adjacent relationships The number of triangle structures , and the Truss value is The neighbor relationship is added , these new additions Continue the above breadth-first traversal based on the adjacent relationship.

[0071] we will Each relationship in the queue is put into a queue. Then, each time a relationship is taken out of the queue for processing, we mark the relationship and calculate the adjacent relationships that meet the above conditions and are not marked. Add the adjacent relationship to the queue. In this way, we can gradually process the established friend relationships by breadth-first traversal. e The indirect influence relationship is calculated, and the number of triangle structures that meet the conditions is calculated. Repeat the above steps until the queue is empty.

[0072] S34, if The number of triangle structures in The relationship between Delete the relationship and update the same The number of triangle structures of all adjacent relations in , the updated relationship proceeds to step S34.

[0073] For each Value, we use a large root heap to store The relationship in the heap and the number of triangle structures corresponding to the relationship. The element in the big root heap is a pair<int,int> Data structure, the first value in the pair stores the number of triangle structures of the relationship, and the second value stores the relationship. Specifically, when processing the big root heap, we sort by the number of triangle structures of the relationship to ensure that the top element of the heap is the relationship with the largest number of triangle structures. If the relationship corresponding to the top element of the heap has been marked, it means that it has been processed, and we delete the relationship from the heap. If the relationship corresponding to the top element of the heap is not marked and the number of triangle structures is , we delete the relation from the heap and mark it as processed. At the same time, we update the number of triangle structures of the relations adjacent to this relation, and add the updated relation and its corresponding number of triangle structures to the big root heap. Repeat the above steps until the relation corresponding to the top element of the heap is not marked and the number of triangle structures is This ensures that the relations corresponding to the remaining elements in the big root heap are the relations whose Truss values ​​are affected.

[0074] S35, The Truss values ​​of all friend relationships in the social network increase by 1, and the Truss values ​​of the remaining friend relationships in the social network structure remain unchanged.

[0075] For each Value, take out the relationship corresponding to the remaining elements from the big root heap, and increase its Truss value by 1.

[0076] In step S14, the initial size of the newly added friend relationship set B is the Why-not points and k-Truss The number of newly added relationship edges between all points in the community. Collapse refers to the Truss value of a relationship in the newly added friend relationship set B from Reduced to , causing it to exit k-Truss Community, see Figure 3 , for any newly added friend relationship e, calculate its followers F(e,B) according to the following steps:

[0077] S41, traverse the triangle structure containing the newly added friend relationship e, and for each triangle structure, calculate the smaller Truss value of two adjacent relationships ,if , for k-Truss In , then the Truss value is equal to The adjacent relationship is put into the queue .

[0078] Since the newly added friend relationship e and other relationships can only form a triangle, after e is deleted, the Truss values ​​of other relationships in the network will either remain unchanged or decrease by one. Q The elements in are e Relationships that directly affect the Truss value. After e is deleted, their Truss values ​​may change from Reduced to , causing them to exit k-Truss Community.

[0079] S42, through breadth-first traversal, for For the relations that are not marked in the list, the average Truss value of the relations that contain the relations and satisfy the remaining two adjacent relations is counted. The number of triangular structures S.

[0080] For the queue For each relationship in the queue, if it has been marked, its Truss value is definitely reduced by 1, and it is popped out of the queue without any operation, and the next relationship is processed. Otherwise, the variable S is initialized to 0, and the triangle structure where the relationship is located is traversed. If the condition is met, the value of S is increased by 1.

[0081] S43. If the number of triangle structures S of a relationship is less than , mark the relationship and change its Truss value to Finally, the Truss values ​​of all triangles containing this relationship are And untagged relations are added , these new additions The unmarked relations continue to be traversed in step S42.

[0082] For the queue For each relation in , if S is greater than or equal to , pop it from the queue, do nothing, and continue to process the next relation. Otherwise, mark the relation and modify its Truss value to Finally, the Truss values ​​of all triangles containing this relationship are And untagged relations are added .

[0083] S44, Final All the friend relationships that have been marked in and appear in the newly added friend relationship set B are considered followers F(e,B).

[0084] In step S16, the selected new friend relationship and its followers are deleted from the social network. Similarly, the deleted new friend relationship is deleted from the remaining new friend relationship set B. This ensures that these deleted relationships are no longer considered in subsequent processing. After deleting friend relationships and followers from the social network, the Truss values ​​of some relationships in the social network may be affected. See Figure 4 In step S16, after each friend relationship is deleted, the Truss value of each friend relationship in the social network structure is updated according to the following steps:

[0085] S61. Traverse the triangle structure containing the deleted friend relationship, and for each triangle structure, calculate the smaller Truss value of the two adjacent relationships. ,if , Indicates the Truss value of the deleted friend relationship, then the Truss value is equal to The adjacent relationship is put into the queue .

[0086] S62, through breadth-first traversal, for There are no tagged relationships in , respectively count the Truss values ​​of the two adjacent relationships that contain this relationship and satisfy the remaining two adjacent relationships The number of triangle structures , Representing relationships Truss value.

[0087] For the queue For each relation in the queue, if it has been marked, its Truss value is definitely reduced by 1, and it is popped out of the queue without any operation, and the next relation is processed. Otherwise, the variable is initialized is 0, traverse the triangle structure where the relationship is located, and if the conditions are met, The value of is increased by 1.

[0088] S63. If there is a relationship between the number of triangle structures Less than , mark the relationship and change its Truss value to Finally, all triangles containing this relationship have Truss values ​​less than or equal to And untagged relations are added , these new additions The unmarked relations continue to perform breadth-first traversal in step S62.

[0089] For the queue For each relationship in Greater than or equal to , pop it from the queue, do nothing, and continue to process the next relation. Otherwise, mark the relation and modify its Truss value to Finally, all triangles containing this relationship have Truss values ​​less than or equal to And untagged relations are added .

[0090] S64. The Truss values ​​of other friend relationships in the social network structure remain unchanged.

[0091] The present invention also provides a computer device, including a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, and when the computer program is run, the processor executes the friend recommendation method based on the Truss model.

[0092] The present invention also provides a computer-readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a computer device, the computer device executes the friend recommendation method based on the Truss model.

[0093] The present invention also provides a computer program product, including a computer program, which enables the computer device to execute the friend recommendation method based on the Truss model when the computer program is executed by the computer device.

[0094] The present invention also provides a friend recommendation device based on the Truss model, comprising:

[0095] The acquisition module is used to obtain user social information, build social networks, and find k-Truss Community, and Why-not Points;

[0096] Preprocessing module for Why-not points and k-Truss Establish friendships among all community users, so that Why-not can join k-Truss community, and updating the social network structure;

[0097] The calculation module is used to: I) traverse each friend relationship in the newly added friend relationship set B and calculate its followers F(e, B); F(e, B) refers to the friend relationships in the newly added friend relationship set B that collapse one after another after a friend relationship e in the newly added friend relationship set B is revoked; II) select a friend relationship with the most followers from the newly added friend relationship set B; III) delete the selected friend relationship and its followers, and update the social network structure and the remaining newly added friend relationship set B; IV) repeat I), II), and III). If deleting a selected friend relationship causes the Why-not point to no longer be k-Truss If a point in the community is found, the deletion of the friendship relationship will be cancelled and the duplication will stop;

[0098] The output module is used to return the remaining new friend relationships, and based on the remaining new friend relationships, recommend the minimum number of friends to the Why-not point user.

[0099] The friend recommendation device can execute the friend recommendation method when running.

[0100] The friend recommendation device provided in the above specific implementation manner and the method flow embodiment executed by it belong to the same concept. The specific implementation process is detailed in the above method and flow introduction, which will not be repeated here.

[0101] In addition, it should be understood that after reading the above description of the present invention, those skilled in the art may make various changes or modifications to the present invention, and these equivalent forms also fall within the scope defined by the claims attached to this application.

Claims

1. A friend recommendation method based on the Truss model, characterized in that: Includes steps: S11. Obtain user social information and build a social network; S12. Find out the social network k-Truss Community, and Why-not Points; S13, at the Why-not point and k-Truss Establish friendships among all community users, so that Why-not can join k- Truss community, and updating the social network structure; S14, traverse each friend relationship in the newly added friend relationship set B, and calculate its followers F(e,B); F(e,B) refers to the friend relationships in the newly added friend relationship set B that are gradually collapsed after a friend relationship e in the newly added friend relationship set B is revoked; S15, selecting a friend relationship with the most followers from the newly added friend relationship set B; S16, deleting the selected friend relationship and its followers, and updating the social network structure and the remaining newly added friend relationship set B; S17, repeat steps S14, S15, S16, if deleting a selected friend relationship causes the Why-not point to no longer be k- Truss If a point in the community is found, the deletion of the friendship relationship will be cancelled and the duplication will stop; S18. Return the remaining newly added friend relationships, and based on the remaining newly added friend relationships, recommend a minimum number of friends to the Why-not point user.

2. The friend recommendation method based on the Truss model according to claim 1, characterized in that: In step S11: User social information includes following behaviors, liking behaviors, and commenting behaviors among users; Users in social media are modeled as a set of points, and the relationships between users are modeled as a set of edges. Each edge connects two different users, indicating that there is a close connection between the two users, thereby constructing a social network.

3. The friend recommendation method based on the Truss model according to claim 1 or 2, characterized in that: In step S12, by k-Truss The community query algorithm calculates the Truss value of each edge to find the k-Truss Community.

4. The friend recommendation method based on the Truss model according to claim 1, characterized in that: In step S13, after each friendship relationship is established, the Truss value of each friendship relationship in the social network structure is updated according to the following steps: S31, preset the upper and lower bounds of the Truss value of the established friend relationship, that is, ,and , Indicates the friendship relationship established Truss value, Indicates that it contains friend relationships And the Truss values ​​of the other two adjacent relations are greater than or equal to The number of triangles, Indicates that it contains friend relationships And the Truss values ​​of the other two adjacent relations are greater than or equal to The number of triangles, the lower bound is to make Greater than or equal to The largest positive integer, that is , upper bound is to make Greater than or equal to The largest positive integer, that is ; S32, traverse the triangle structure containing the established friend relationship, and for each triangle structure, calculate the smaller Truss value of two adjacent relationships ,if , then the Truss value is equal to The adjacent relationship is put into the queue ; S33, through breadth-first traversal, for For each relationship in the , count the Truss values ​​of the two adjacent relationships that contain the relationship and satisfy the remaining two adjacent relationships The number of triangle structures , and the Truss value is The neighbor relationship is added , these new additions Continue the above breadth-first traversal based on the adjacent relationship; S34, if The number of triangle structures in The relationship between Delete the relationship and update the same The number of triangle structures of all adjacent relations in , the updated relationship continues to step S34; S35, The Truss values ​​of all friend relationships in the social network increase by 1, and the Truss values ​​of the remaining friend relationships in the social network structure remain unchanged.

5. The friend recommendation method based on the Truss model according to claim 1, characterized in that: In step S14, for any newly added friend relationship e, its followers F(e, B) are calculated according to the following steps: S41, traverse the triangle structure containing the newly added friend relationship e, and for each triangle structure, calculate the smaller Truss value of two adjacent relationships ,if , for k-Truss In , then the Truss value is equal to The adjacent relationship is put into the queue ; S42, through breadth-first traversal, for For the relations that are not marked in the list, the average Truss value of the relations that contain the relations and satisfy the remaining two adjacent relations is counted. The number of triangular structures S; S43. If the number of triangle structures S of a relationship is less than , mark the relationship and change its Truss value to Finally, the Truss values ​​of all triangles containing this relationship are And untagged relations are added , these new additions The unmarked relations continue to perform the breadth-first traversal in step S42; S44, Final All the friend relationships that have been marked in and appear in the newly added friend relationship set B are considered followers F(e,B).

6. The friend recommendation method based on the Truss model according to claim 1, characterized in that: In step S16, after each friend relationship is deleted, the Truss value of each friend relationship in the social network structure is updated according to the following steps: S61. Traverse the triangle structure containing the deleted friend relationship, and for each triangle structure, calculate the smaller Truss value of the two adjacent relationships. ,if , Indicates the Truss value of the deleted friend relationship, then the Truss value is equal to The adjacent relationship is put into the queue ; S62, through breadth-first traversal, for There are no tagged relationships in , respectively count the Truss values ​​of the two adjacent relationships that contain this relationship and satisfy the remaining two adjacent relationships The number of triangle structures , Representing relationships Truss value; S63. If there is a relationship between the number of triangle structures Less than , mark the relationship and change its Truss value to Finally, all triangles containing this relationship have Truss values ​​less than or equal to And untagged relations are added , these new additions The unmarked relations continue to perform the breadth-first traversal in step S62; S64. The Truss values ​​of other friend relationships in the social network structure remain unchanged.

7. A computer device comprising a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, wherein: When the computer program is executed, the processor is enabled to execute the friend recommendation method based on the Truss model according to any one of claims 1 to 6.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program or instruction, and when the program or instruction is executed by a computer device, the computer device executes the friend recommendation method based on the Truss model as described in any one of claims 1 to 6.

9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a computer device, the computer device executes the friend recommendation method based on the Truss model as described in any one of claims 1 to 6.

10. A friend recommendation device based on the Truss model, characterized in that: include: The acquisition module is used to obtain user social information, build social networks, and find k-Truss Community, and Why-not Points; Preprocessing module for Why-not points and k-Truss Establish friendships among all community users, so that Why-not can join k-Truss community, and updating the social network structure; The calculation module is used to: I) traverse each friend relationship in the newly added friend relationship set B and calculate its followers F(e,B); F(e,B) refers to the friend relationships in the newly added friend relationship set B that are gradually collapsed after a friend relationship e in the newly added friend relationship set B is revoked; II) Select a friend relationship with the most followers from the newly added friend relationship set B; III) Delete the selected friend relationship and its followers, and update the social network structure and the remaining new friend relationship set B; IV) Repeat I), II), and III). If deleting a selected friend relationship causes the Why-not point to no longer be k-Truss If a point in the community is found, the deletion of the friendship relationship will be cancelled and the duplication will stop; The output module is used to return the remaining new friend relationships, and based on the remaining new friend relationships, recommend the minimum number of friends to the Why-not point user.