A session establishment method and device, computer device and storage medium
By constructing a bipartite graph for interest-based user matching, this method solves the problem of low friend conversion rates in stranger-based social networking, achieving efficient user matching and resource conservation.
Patent Information
- Application Number
- CN202111305340.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-05
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2041-11-05
AI Technical Summary
Current technologies for stranger-based social networking have low friend conversion rates, leading users to repeatedly search for strangers and wasting server resources.
By constructing a bipartite graph and using the degree of interest matching between users as edges, user matching is performed, and some user information is masked in the session to improve the accuracy and real-time performance of the matching.
It improved the conversion rate of stranger social networking to friends, reduced users' repeated searches for strangers, reduced the computing burden on the server, and saved resources.
Smart Images

Figure CN114117249B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of instant messaging, and more particularly to a method, apparatus, computer device, and storage medium for establishing a session. Background Technology
[0002] In some social applications, users can not only chat with friends, but also search for strangers and chat with them.
[0003] The core of social applications is improving communication efficiency between people. Compared to social networking among acquaintances, social networking among strangers places even greater emphasis on efficiency. Unlike social networking among acquaintances, which focuses on maintaining existing relationships, social networking products among strangers primarily aim to expand social connections. Before a stable social network is established, a prolonged lack of feedback can severely impact user experience. Therefore, one of the key focuses of social networking among strangers is matching users with suitable strangers as quickly as possible and providing feedback to satisfy users' desire to expand their social networks.
[0004] Currently, to ensure the real-time matching of strangers, the system usually randomly selects other users who are not friends with the current user for matching. However, the purpose of stranger social networking is to establish a social relationship chain. The conversion rate of friends is low when using random matching, that is, the probability of establishing a social relationship chain is low. This causes users to repeatedly search for strangers, which causes the server to perform repeated calculations, resulting in a waste of resources. Summary of the Invention
[0005] This invention proposes a method, apparatus, computer device, and storage medium for establishing a session, in order to address the problem of how to improve the conversion rate of strangers into friends in social networking, thereby reducing the waste of server resources.
[0006] In a first aspect, embodiments of the present invention provide a method for establishing a session, comprising:
[0007] Determine a first user pool, which records online users who are participating in the matching process;
[0008] The user is retrieved from the first user pool at preset time intervals;
[0009] Construct a bipartite graph using the users as nodes and the degree of interest matching between the users as edges;
[0010] In the bipartite graph, independent users are matched based on their interest matching degree to obtain user pairs;
[0011] Establish a session for the user in the user pair and mask at least some of the user's information in the session.
[0012] Secondly, embodiments of the present invention also provide a session establishment apparatus, comprising:
[0013] The first user pool determination module is used to determine the first user pool, which records the online users who participate in the matching.
[0014] The user extraction module is used to extract the user from the first user pool at preset time intervals.
[0015] The bipartite graph construction module is used to construct a bipartite graph with the user as a node and the degree of interest matching between the users as an edge.
[0016] The user matching module is used to match independent users in the bipartite graph according to the degree of interest matching to obtain user pairs;
[0017] A session establishment module is used to establish a session for the user in the user pair and to mask at least some of the user's user information in the session.
[0018] Thirdly, embodiments of the present invention also provide a computer device, the computer device comprising:
[0019] One or more processors;
[0020] Memory, used to store one or more programs.
[0021] When the one or more programs are executed by the one or more processors, the one or more processors implement the session establishment method as described in the first aspect.
[0022] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the session establishment method as described in the first aspect.
[0023] In this embodiment, a first user pool is determined, which records online users who participate in matching. Users are extracted from the first user pool at preset time intervals. A bipartite graph is constructed with users as nodes and the degree of interest matching between users as edges. In the bipartite graph, independent users are matched according to the degree of interest matching to obtain user pairs. If a user participates in the matching, a session is established for the users in the user pair, and at least some of the user information is hidden in the session. The structure of the bipartite graph is relatively simple, so the amount of computation for matching users in the bipartite graph is small, which can ensure real-time performance and meet the business needs of stranger social networking. Matching users by the degree of interest matching can enrich the topics that users can communicate with each other, increase the probability of establishing social relationship chains between users, that is, increase the conversion rate of friends between users, avoid users repeatedly searching for strangers, thereby avoiding repeated calculations on the server side and reducing waste of resources. Attached Figure Description
[0024] Figure 1 A flowchart illustrating a session establishment method provided in Embodiment 1 of the present invention;
[0025] Figures 2A to 2C This is an example diagram of user matching in a bipartite graph provided in Embodiment 1 of the present invention;
[0026] Figure 3 This is a flowchart of a session establishment method provided in Embodiment 2 of the present invention;
[0027] Figure 4 This is a schematic diagram of the structure of a session establishment device provided in Embodiment 3 of the present invention;
[0028] Figure 5 This is a schematic diagram of the structure of a computer device provided in Embodiment 4 of the present invention. Detailed Implementation
[0029] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present invention, and not all of the structures.
[0030] Example 1
[0031] Figure 1This is a flowchart of a session establishment method provided in Embodiment 1 of the present invention. This embodiment is applicable to situations where matching is based on the degree of interest in stranger social networking. The method can be executed by a session establishment device, which can be implemented by software and / or hardware and can be configured in a computer device, such as a server, workstation, personal computer, etc., and can serve as the server of an instant messaging system. The method specifically includes the following steps:
[0032] Step 101: Determine the first user pool.
[0033] In general, the server in an instant messaging system is a cluster of multiple machines, with different machines responsible for different functions.
[0034] Users log in to the instant messaging system in the client using their user account and password. Some machines connect to the client to provide access to users and maintain a long connection. The client and server communicate mainly based on TCP / IP (Transmission Control Protocol / Internet Protocol) and UDP (User Datagram Protocol).
[0035] For different products, the client can take many forms. The client can be a standalone application or a browser. The browser can load pages with instant messaging functions or other applications with instant messaging functions, such as payment applications, short video applications, live streaming applications, etc. This embodiment does not limit this.
[0036] Some machines are responsible for processing business logic, such as verifying the legitimacy of user identities, verifying the legitimacy of message content, and querying group member lists.
[0037] Some machines are responsible for storing messages, such as Redis.
[0038] In this embodiment, a region for stranger social networking can be set up in the server-side cache or database, denoted as the first user pool. The first user pool records online users who participate in matching (represented by user accounts or other identifiers).
[0039] In one scenario, a control for social networking with strangers is loaded on the client's UI (User Interface) for users to browse. When a confirmation action is received from this control, it confirms that the user logged into the client is participating in social networking with strangers, and the user can be added to the first user pool.
[0040] In another scenario, you can proactively send users notification messages about social networking with strangers, prompting or inviting them to participate.
[0041] Considering that users may not be perfectly balanced when the bipartite graph is divided, in order to ensure that users are as balanced as possible when the bipartite graph is divided, improve the accuracy of matching, and thus improve the friend conversion rate, targeted prompt messages about stranger social networking can be sent to users to remind or invite them to participate in stranger social networking.
[0042] In the specific implementation, the attributes of online users who are to be matched and are recorded in the first user pool can be queried. The attributes are used to divide the bipartite graph, including the first value and the second value.
[0043] This attribute can be gender, region, age, etc. Taking gender as an example, the first and second values are male and female, respectively.
[0044] In the first user pool, count the first number of users belonging to the first value and the second number of users belonging to the second value.
[0045] With the aim of balancing the first and second quantities, the number of prompt messages sent to users with different attributes is adjusted, thereby sending prompt messages to users who have not participated in matching. That is, prompt messages are sent to the clients logged into by users who have not participated in matching, so that users can browse relevant information about stranger social networking.
[0046] Furthermore, some users may be online, in which case the notification message is considered an online system message; other users may be offline, in which case the notification message is considered an offline system message. These offline users will receive the notification message when they come online.
[0047] If a confirmation message is received from a user in response to the prompt message, the user will be added to the first user pool.
[0048] In a method for adjusting the number of notification messages sent to users with different attributes, a third quantity and a fourth quantity can be determined separately. The sum of the first quantity and the third quantity is balanced with the sum of the second quantity and the fourth quantity. The so-called balance can mean that the sum of the first quantity and the third quantity is equal to the sum of the second quantity and the fourth quantity, or it can mean that the difference between the sum of the first quantity and the third quantity and the sum of the second quantity and the fourth quantity is within a preset error range.
[0049] By analyzing the log files recorded during the historical matching process, the first click rate of users belonging to the first value and the second click rate of users belonging to the second value for the prompt message are calculated. The first click rate and the second click rate are both click rates, which are the ratios between the number of times the prompt message is clicked and the number of times the prompt message is displayed.
[0050] In this approach, considering that users' actual willingness to participate in matching is not a linear relationship like click-through rate, a mapping relationship between click-through rate and quantity can be established in advance based on business feedback from stranger social networking. For the third and fourth quantities, the third quantity can be mapped (amplified) to a new quantity according to the first click-through rate, and recorded as the fifth quantity, and the fourth quantity can be mapped (amplified) to a new quantity according to the second click-through rate, and recorded as the sixth quantity.
[0051] Then, we can send notification messages to users who belong to the first value but have not participated in the matching according to the fifth number, and send notification messages to users who belong to the second value but have not participated in the matching according to the sixth number. It is expected that the first number of users who belong to the first value and the second number of users who belong to the second value will participate in the matching, so that the number of users who belong to the first value and the number of users who belong to the second value in the first user pool are balanced.
[0052] Step 102: Extract users from the first user pool at preset time intervals.
[0053] During the operation of the instant messaging system's server, if it provides users with a social networking service with strangers, it can extract some or all users from the first user pool for matching at preset intervals (such as 3 seconds).
[0054] Generally, this time (e.g., 3 seconds) is much shorter than the timeout set for stranger social networking (e.g., 30 seconds) to ensure that users can perform multiple matches and achieve stranger social networking.
[0055] Step 103: Construct a bipartite graph with users as nodes and the degree of interest matching between users as edges.
[0056] A bipartite graph, also known as a bipartite graph or bipartite graph, is a graph with two categories (X, Y) whose set of vertices can be decomposed into two non-empty and disjoint subsets X and Y, such that for every edge, one endpoint is in subset X and the other endpoint is in subset Y.
[0057] In this embodiment, each user can be set as a node, and the nodes can be divided into two subsets according to the business needs of stranger social networking. The degree of interest matching between users in the two subsets is calculated, and the degree of interest matching is set as the weight of the edge between users in the two subsets, thereby constructing a bipartite graph.
[0058] In practice, users can query their specified attributes based on the business needs of social networking with strangers. These attributes are usually filled in by users when they register, such as gender, region, age, etc.
[0059] If the attribute is the first value, the user is divided into nodes in the first set (subset). If the attribute is the second value, the user is divided into nodes in the second set (subset). The first and second values can be interchanged. For example, if the first value is male, the second value is female, and vice versa.
[0060] Furthermore, considering that users participating in stranger social networking are dynamically changing, the number of users with the first attribute value is not equal to the number of users with the second attribute value. In this case, the first number of users in the first set and the second number of users in the second set can be counted. If the first number and the second number are not equal, the first set and / or the second set can be adjusted until the first number and the second number are equal, which makes it easier to find a perfect match.
[0061] For example, if the first number is greater than the second number, some users in the first set are adjusted to nodes in the second set (at this time, the users in the second set who originally belonged to the first set have the same attributes as other users), and / or, nodes representing virtual users (i.e. not real users) are added in the second set until the first number is equal to the second number.
[0062] If the first number is less than the second number, then some users in the second set are adjusted to nodes in the first set (at this time, the users in the first set that originally belonged to the second set have the same attributes as other users), and / or, nodes representing virtual users (i.e. not real users) are added to the first set until the first number is equal to the second number.
[0063] Of course, the above adjustment methods are merely examples. When implementing the embodiments of the present invention, other adjustment methods can be set according to the actual situation. For example, some nodes can be deleted in the current matching until the first number is equal to the second number, and the deleted nodes can be added first in the next matching, etc. The embodiments of the present invention do not limit this. In addition, besides the above adjustment methods, those skilled in the art can also adopt other adjustment methods according to actual needs, and the embodiments of the present invention do not limit this.
[0064] For the first set and the second set, basic user data (such as geographical location, language, learning / work position, etc.) and behavioral data (such as tags, browsing objects, objects expressing positive emotions, etc.) can be called and substituted into a preset algorithm (such as calculating the cosine angle after vectorization, etc.) to calculate the degree of interest matching between each user in the first set and each user in the second set.
[0065] The interest matching degree is used to represent the degree of matching between users in the first set and users in the second set in terms of their interests in certain things. Generally, the higher the interest matching degree value, the more matched the users in the first set and users in the second set are in terms of their interests in certain things, and the greater the probability that users in the first set and users in the second set will establish a friendship relationship.
[0066] Using the degree of interest matching as an edge (weight), connect the users in the first set who calculated the degree of interest matching with the users in the second set who calculated the degree of interest matching to obtain a bipartite graph. This bipartite graph can be stored in the form of an adjacency matrix or the like.
[0067] Furthermore, if the users in the first set and the users in the second set meet the preset decay conditions, the interest matching degree between the users in the first set and the users in the second set is reduced, increasing the probability of subsequent pruning, thereby reducing the probability of the users in the first set and the users in the second set matching as user pairs.
[0068] For example, the attenuation condition is a condition that is not suitable for matching as a user pair, including at least one of the following:
[0069] The attributes of users in the first set are the same as those of users in the second set.
[0070] Users in the first set are friends with users in the second set.
[0071] Users in the first set or users in the second set are virtual users.
[0072] Step 104: In the bipartite graph, match independent users based on their degree of interest matching to obtain user pairs.
[0073] In a bipartite graph, independent users can be matched based on their degree of interest matching. Locally, two independent users have a certain degree of interest matching. Overall, when matching users pairwise, the goal is to find the edge with the largest degree of interest matching. If this is not possible, a larger edge (degree of interest matching) is used instead to achieve the optimal degree of matching overall. The two users after matching are called a user pair.
[0074] In one embodiment of the present invention, in a bipartite graph, users are divided into a first set (a subset of users whose attribute has a first value) and a second set (a subset of users whose attribute has a second value) that are independent of each other according to a specified attribute. In this embodiment, step 104 may include the following steps:
[0075] Step 1041: Add benchmarks for users that are nodes, based on the degree of interest matching as edges.
[0076] In this embodiment, users who are nodes can be initialized by referring to the degree of interest matching as edges, and a benchmark (also known as a top marker) can be added.
[0077] Furthermore, each user in the first set may have multiple edges (interest matching degree) with multiple users in the second set. When initializing the benchmark, the interest matching degree connected to each user in the first set that is not the largest can be deleted, so as to retain the interest matching degree connected to each user in the first set that has the largest value, forming a subgraph of the bipartite graph.
[0078] In the first set, the user's benchmark is assigned the highest value of interest matching connected to the user. In the second set, the user's benchmark is assigned a value of 0.
[0079] In one example, such as Figure 2A As shown, in the bipartite graph, the interest matching degrees between user A in the first set and users D, E, and F in the second set are 15, 12, and 8 respectively; the interest matching degrees between user B in the first set and users D, E, and F in the second set are 14, 6, and 8 respectively; and the interest matching degrees between user C in the first set and users D, E, and F in the second set are 13, 12, and 10 respectively. Therefore, when adding benchmarks, if... Figure 2B As shown, assign 15 as the benchmark for user A, delete the edges with interest matching degrees of 12 and 8, and keep the edge with interest matching degree of 15. Assign 14 as the benchmark for user B, delete the edges with interest matching degrees of 6 and 8, and keep the edge with interest matching degree of 14. Assign 13 as the benchmark for user C, delete the edges with interest matching degrees of 12 and 10, and keep the edge with interest matching degree of 13. Assign the benchmarks for users D, E, and F to 0.
[0080] Step 1042: Use the interest matching degree to match the benchmarks in the first set with the benchmarks in the second set to obtain the maximum match.
[0081] In this embodiment, the Hungarian algorithm can be used to find the maximum matching in the current subgraph of the bipartite graph. The maximum matching means that if each edge has a weight (degree of interest matching), then there will be a matching with the maximum weight (degree of interest matching).
[0082] Let i be the first user in the first set and j be the second user in the second set. The following requirements must be met during matching:
[0083] weight(i,j)=label(i)+label(j)
[0084] Where weight(i,j) represents the degree of interest matching between user i and user j, label(i) represents the benchmark of user i, and label(j) represents the benchmark of user j.
[0085] Step 1043: Determine if the maximum match is a complete match. If not, proceed to step 1044; if yes, proceed to step 1045.
[0086] A perfect match means that every user in the first set matches a user in the second set, or every user in the second set matches a user in the first set.
[0087] Step 1044: Modify the benchmarks and add new interest matching degrees between the benchmarks in the first set and the benchmarks in the second set through augmenting paths. Then return to execute step 1042.
[0088] If a perfect match cannot be found, the current subgraph in the bipartite graph is added by modifying the benchmark. This edge is generally the original interest matching degree, but the value is not the largest and is deleted during initialization.
[0089] Furthermore, the poles of users in the first set and all users in the second set in the augmenting path of the maximum matching are modified, and edges are added to users in the first set belonging to the augmenting path and users in the second set not belonging to the augmenting path, thereby expanding the subgraph of the bipartite graph.
[0090] An augmenting path is defined as follows: If P is an edge in a bipartite graph G connecting two unmatched nodes, and edges belonging to M and edges not belonging to M (i.e., matched and unmatched edges) alternate on P, then P is called an augmenting path relative to M.
[0091] Given a first set A and a second set B, an augmenting route connects a node in A to a node in B, and then from that node in B to another node in A, and so on.
[0092] For example, such as Figure 2CIn the bipartite graph shown, X0Y0 is the matched path, and X0Y2 and X1Y0 represent unmatched paths. The current edge is X0Y0, and an augmenting path is found through X1: X1Y0→Y0X0→X0Y2.
[0093] There are two methods for finding augmenting paths: depth-first search and breadth-first search.
[0094] For example, if we start from X2 to find an augmenting path, and it is a depth-first search, X2 finds a match for Y0, but finds that Y0 has already been matched by X1. So it goes deeper into X1 to find a new matching node for X1. However, it finds that X1 has no other matching nodes, so the match fails. X2 then looks for Y1 and finds that Y1 can match, so it finds a new augmenting path.
[0095] If it is a broad search, when X1 finds the Y0 node, since it cannot immediately get a valid match, it puts it into the queue as a candidate and continues to look for Y1. Since Y1 has already been matched, the match is successful and the result is returned.
[0096] In one example, for ease of description, let's assume that for... Figure 2A By performing matching, AD can be connected to form a new subgraph. Since point D has already been connected, it is impossible to connect point B to point D. At this time, we can add an edge, which is the edge with the largest weight that is not in the subgraph, that is, the edge with the smallest difference in weight from the edge in the subgraph.
[0097] Another variable d is introduced, d = min{C} x[i] +C y[j] -w [i][j]}, where Cx [i] It refers to the benchmark of A, Cy [j] It is the benchmark for all points except point D (i.e., the already connected point), w [i][j] This refers to the weight of the edge between the two aforementioned benchmarks.
[0098] Subsequently, for the edge AD that originally existed in the subgraph, the benchmark Cx of A is set. [i] Subtract d, the benchmark of D, Cy [d] Adding d ensures that the original edge AD is retained in the subgraph, and adds the edge AE, which has the highest weight and is connected to point A but is not in the subgraph, to the subgraph.
[0099] Because the condition for determining whether an edge exists in the subgraph is that the indices of the nodes at both ends satisfy C. x +C y ==w [x][y] For the original edge, the value of the left endpoint is reduced by d, and the value of the right endpoint is increased by d, so the final result remains unchanged, still w. [x][y] .
[0100] For the edge to be added, subtract d from the left endpoint, i.e., Cx [i] =Cx [i]-d For ease of representation, the modified Cx is shown below. [i] Considered C z[i] C z[i] =C x[i] -d, because C z[i] =C x[i] -d, d = C x[i] +C y[j] -w [i][j] Substituting d into the left side of the equation, we get C. z[i] =C x[i] -(C x[i] +C y[j] -w [i][j] Simplifying, we get C z[i] +C y[j] =w [i][j] The requirement has been met, that is, a new edge has been added.
[0101] Step 1045: Determine the user pair as the user pair where the successfully matched benchmark is located.
[0102] Repeat steps 1042 to 1044 until a perfect match is found. At this point, the perfect match is the best match, that is, the perfect match with the largest weight in the weighted bipartite graph. At this point, the user where the successfully matched pole is located is recorded as the user pair.
[0103] In another embodiment of the present invention, step 104 may further include the following steps:
[0104] Step 1046: Query the degree of interest matching between users.
[0105] Step 1047: If the degree of interest matching is less than the preset threshold, then delete the user pair.
[0106] In bipartite graphs, matching users based on interest matching degree aims to ensure that the overall result is a perfect match with the highest weight. It is difficult to guarantee that each match is a superior match. Furthermore, during the construction of the bipartite graph, in order to ensure that a perfect match can be found, an edge with a lower weight (interest matching degree) may be added to any two nodes (users) in the subset. For example, in cases where the attributes are the same, the users are virtual, or the relationship is a friend, the interest matching degree will be reduced. Therefore, the user may be matched with a lower weight (interest matching degree).
[0107] In response, this embodiment can further crop some matched users. For users with a low weight (interest matching degree) (reflected in the interest matching degree being less than a preset threshold), the match is considered to be unsuccessful, and the user pair is cropped, that is, the user pair is deleted from the match, thereby ensuring the accuracy of user matching and thus improving the conversion rate of friends.
[0108] Step 105: Establish a session for the user in the user pair and mask at least some of the user's information in the session.
[0109] For two users in a user pair, a session can be established for them, and the session interface can be displayed on their respective clients. The two users can communicate through the session interface, such as sending text, images, voice messages, etc.
[0110] In stranger social networking, at least some user information can be hidden, such as profile picture, nickname, photo album, etc., and not displayed in the conversation interface. In this case, stranger social networking can be figuratively called masked dating.
[0111] Of course, some user information, such as gender and geographical location, can also be retained and displayed in the conversation interface. This embodiment does not limit this.
[0112] Since matching may fail due to factors such as cropping, in order to prevent some users from being unable to find a suitable match and causing timeouts, this embodiment can consider the waiting time and cache the matching results (user pairs) within a recent period (such as 30 seconds) to ensure that users have better matching.
[0113] Furthermore, for each user, the first time they participate in annotation can be recorded. During the matching process, the first time the current user participates in the matching can be determined, and a preset time period (such as 30 seconds) can be added to the first time as the second time. This second time is the timeout period for the current user to participate in the matching.
[0114] If the difference between the current third time and the second time is less than a preset threshold (such as 5 seconds, 10 seconds, etc.), and no user pair has been generated for the current user in this match, then the previously matched and cached user pair can be read.
[0115] In the cached user pairs, query other users that match the current user, thereby establishing a session between the current user and other users, and masking at least some user information of the current user and other users in the session.
[0116] In this embodiment, a first user pool is determined, which records online users who participate in matching. Users are extracted from the first user pool at preset time intervals. A bipartite graph is constructed with users as nodes and the degree of interest matching between users as edges. In the bipartite graph, independent users are matched according to the degree of interest matching to obtain user pairs. If a user participates in the matching, a session is established for the users in the user pair, and at least some of the user information is hidden in the session. The structure of the bipartite graph is relatively simple, so the amount of computation for matching users in the bipartite graph is small, which can ensure real-time performance and meet the business needs of stranger social networking. Matching users by the degree of interest matching can enrich the topics that users can communicate with each other, increase the probability of establishing social relationship chains between users, that is, increase the conversion rate of friends between users, avoid users repeatedly searching for strangers, thereby avoiding repeated calculations on the server side and reducing waste of resources.
[0117] Example 2
[0118] Figure 3 This is a flowchart of a session establishment method provided in Embodiment 2 of the present invention. This embodiment is based on the foregoing embodiment and further adds A / B testing operations. The method specifically includes the following steps:
[0119] Step 301: Determine the first user pool.
[0120] The first user pool records users who are participating in the matching process and are online.
[0121] Step 302: Extract users from the first user pool at preset time intervals.
[0122] Step 303: Construct a bipartite graph with users as nodes and the degree of interest matching between users as edges.
[0123] Step 304: In the bipartite graph, match independent users based on their degree of interest matching to obtain user pairs.
[0124] Step 305: Determine the second user pool.
[0125] In this embodiment, a region for stranger social networking can be set up in the server's cache or database, referred to as the second user pool. The first user pool records users who participate in matching and are online (represented by user accounts or other identifiers).
[0126] Users in the first user pool are not the same as users in the second user pool. Users in the first user pool are matched using the method provided in this embodiment, while users in the second user pool are matched using a random method. This allows for A / B testing of the method provided in this embodiment and the random method to verify the effectiveness of the method provided in this embodiment.
[0127] Step 306: Randomly select two users from the second user pool to match them and obtain user pairs.
[0128] In this embodiment, two users can be randomly selected from the second user pool for matching. If certain conditions are met (such as matching with the opposite sex), the two users are considered to be successfully matched, and a user pair is obtained.
[0129] Step 307: Establish a session for the user in the user pair and mask at least some of the user's information in the session.
[0130] Step 308: Calculate the first probability of users adding each other as friends when matching using the first user pool.
[0131] After the first user pool has been running for a period of time, the probability of users adding each other as friends when matching using the first user pool during that period can be calculated, i.e., the friend conversion rate.
[0132] In the specific implementation, the first number of users who added each other as friends when matching using the first user pool during the time period can be counted, and the second number of all users in the first user pool during the time period (i.e., the number of active users; if the time period is 1 day, the second number is also called daily active users).
[0133] Calculate the ratio between the first number and the second number, and use it as the first probability of users adding each other as friends within that time period.
[0134] Step 309: Calculate the second probability of users adding each other as friends when matching using the second user pool.
[0135] After the second user pool has been running for a period of time, the probability of users adding each other as friends when using the second user pool for matching during that period can be calculated, i.e., the friend conversion rate.
[0136] In the specific implementation, we can count the third number of users who added each other as friends when matching using the second user pool during the time period, and count the fourth number of all users in the second user pool (i.e., the number of active users; if the time period is 1 day, the fourth number is also called daily active users).
[0137] Calculate the ratio between the third and fourth numbers as the second probability of users adding each other as friends.
[0138] Step 310: Compare the first probability with the second probability to obtain the test result.
[0139] By comparing the first probability with the second probability, the results of the A / B test can be obtained for developers to use. The A / B test shows that the first probability is significantly greater than the second probability. That is, in stranger social networking, the matching method provided in this embodiment is more effective than the matching method through random methods.
[0140] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.
[0141] Example 3
[0142] Figure 4 This is a structural block diagram of a session establishment device according to Embodiment 3 of the present invention, which may specifically include the following modules:
[0143] The first user pool determination module 401 is used to determine the first user pool, which records the online users who participate in the matching.
[0144] User extraction module 402 is used to extract the user from the first user pool at preset time intervals;
[0145] The bipartite graph construction module 403 is used to construct a bipartite graph with the user as a node and the degree of interest matching between the users as an edge.
[0146] User matching module 404 is used to match independent users in the bipartite graph according to the degree of interest matching to obtain user pairs;
[0147] The session establishment module 405 is used to establish a session for the user in the user pair and to mask at least some of the user's user information in the session.
[0148] In one embodiment of the present invention, the first user pool determination module 401 includes:
[0149] The attribute query module is used to query the specified attributes of online users who are to be matched and are recorded in the first user pool. The attributes are used to divide the bipartite graph and include a first value and a second value.
[0150] The quantity statistics module is used to count the first number of users belonging to the first value and the second number of users belonging to the second value, respectively.
[0151] The prompt message sending module is used to send prompt messages to users who have not participated in the matching, with the aim of balancing the first quantity and the second quantity;
[0152] The user writing module is used to write the user into the first user pool when it receives a confirmation message sent by the user in response to the prompt message.
[0153] In one embodiment of the present invention, the notification message sending module includes:
[0154] The quantity calculation module is used to determine the third quantity and the fourth quantity respectively, and the sum of the first quantity and the third quantity is balanced with the sum of the second quantity and the fourth quantity;
[0155] The click-through rate calculation module is used to calculate the first click-through rate of the user with the first value for the prompt message and the second click-through rate of the user with the second value for the prompt message.
[0156] The quantity mapping module is used to map the third quantity to the fifth quantity according to the first click rate and the fourth quantity to the sixth quantity according to the second click rate, respectively.
[0157] The quantity sending module is used to send prompt messages to users who belong to the first value but have not participated in the matching according to the fifth quantity, and to send prompt messages to users who belong to the second value but have not participated in the matching according to the sixth quantity.
[0158] In one embodiment of the present invention, the bipartite graph construction module 403 includes:
[0159] The attribute determination module is used to query the attribute specified by the user;
[0160] The first set partitioning module is used to partition the user into nodes in the first set if the attribute is a first value.
[0161] The second set partitioning module is used to partition the user into nodes in the second set if the attribute is a second value.
[0162] An interest matching degree calculation module is used to calculate the interest matching degree between the users in the first set and the users in the second set;
[0163] The node connection module is used to connect the users in the first set and the users in the second set with the interest matching degree as an edge to obtain a bipartite graph.
[0164] In one embodiment of the present invention, the bipartite graph construction module 403 further includes:
[0165] The set quantity statistics module is used to count the first number of users in the first set and the second number of users in the second set;
[0166] The user adjustment module is used to adjust the first set and / or the second set until the first set and the second set are equal if the first quantity is not equal to the second quantity.
[0167] In one embodiment of the present invention, the user adjustment module includes:
[0168] The first adjustment module is configured to, if the first quantity is greater than the second quantity, adjust some of the users in the first set to nodes in the second set, and / or, add nodes representing virtual users in the second set;
[0169] The second adjustment module is used to adjust some of the users in the second set to nodes in the first set if the first quantity is less than the second quantity, and / or to add nodes representing virtual users in the first set.
[0170] In one embodiment of the present invention, the bipartite graph construction module 403 further includes:
[0171] The interest matching degree reduction module is used to reduce the interest matching degree between the users in the first set and the users in the second set if a preset attenuation condition is met.
[0172] For example, the attenuation condition includes at least one of the following:
[0173] The attributes of the users in the first set are the same as the attributes of the users in the second set;
[0174] The users in the first set are friends with the users in the second set;
[0175] The users in the first set or the users in the second set are virtual users.
[0176] In one embodiment of the present invention, in the bipartite graph, the users are divided into a first set and a second set that are independent of each other;
[0177] The user matching module 404 includes:
[0178] A benchmark adding module is used to add benchmarks for the user as a node, based on the interest matching degree as an edge;
[0179] The maximum matching module is used to match the benchmarks in the first set with the benchmarks in the second set using the interest matching degree to obtain the maximum match;
[0180] The complete matching judgment module is used to determine whether the maximum match is a complete match; if not, the subgraph expansion module is called; if yes, the matching success determination module is called.
[0181] The subgraph expansion module is used to modify the benchmarks, add new interest matching degrees between the benchmarks in the first set and the benchmarks in the second set through augmenting paths, and return to execute the maximum matching search module;
[0182] The matching success determination module is used to determine that the user to which the successfully matched benchmark is located is a user pair.
[0183] In one embodiment of the present invention, the benchmarking module includes:
[0184] The edge retention module is used to delete the interest matching degree that is not the largest and is connected to each user in the first set, so as to retain the interest matching degree that is connected to each user in the first set and has the largest value.
[0185] The first set assignment module is used to assign the benchmark value of the user in the first set to the interest matching degree value that is connected to the user and has the largest value.
[0186] The second set assignment module is used to assign a benchmark value of 0 to the user in the second set.
[0187] In one embodiment of the present invention, the user matching module 404 further includes:
[0188] The interest matching degree query module is used to query the degree of interest matching between the users in the user pair;
[0189] The user pair deletion module is used to delete the user pair if the degree of interest matching is less than a preset threshold.
[0190] In one embodiment of the present invention, the session establishment module 405 includes:
[0191] The first-time determination module is used to determine the first moment when the user participates in the matching process.
[0192] The second time calculation module is used to add a preset time period to the first time as a second time.
[0193] The cache reading module is used to read the previously matched and cached user pair if the difference between the current third time and the second time is less than a preset threshold and the current matching has not generated a user pair for the current user.
[0194] The user query module is used to query other users that match the current user from the cached user pairs;
[0195] The historical session establishment module is used to establish a session between the current user and other users, and to mask at least some user information of the current user and other users in the session.
[0196] In one embodiment of the present invention, it further includes:
[0197] The second user pool determination module is used to determine the second user pool, in which the first user pool records users who are participating in the matching and are online;
[0198] The random matching module is used to randomly select two users from the second user pool for matching to obtain user pairs;
[0199] The first probability calculation module is used to calculate the first probability of users adding friends when matching using the first user pool.
[0200] The second probability calculation module is used to calculate the second probability of users adding friends when matching using the second user pool.
[0201] The test result generation module is used to compare the first probability with the second probability to obtain the test result.
[0202] In one embodiment of the present invention, the first probability calculation module includes:
[0203] The first number statistics module is used to count the first number of users who added each other as friends when matching using the first user pool;
[0204] The second number statistics module is used to count the second number of all users in the first user pool;
[0205] The first ratio calculation module is used to calculate the ratio between the first number and the second number, as the first probability of the users adding each other as friends.
[0206] In one embodiment of the present invention, the second probability calculation module includes:
[0207] The third number statistics module is used to count the third number of users who added each other as friends when matching using the second user pool;
[0208] The fourth number statistics module is used to count the fourth number of all users in the second user pool;
[0209] The second ratio calculation module is used to calculate the ratio between the third number and the fourth number, as the second probability of the users adding each other as friends.
[0210] The session establishment apparatus provided in this embodiment of the invention can execute the session establishment method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0211] Example 4
[0212] Figure 5 This is a schematic diagram of the structure of a computer device provided in Embodiment 4 of the present invention. Figure 5 A block diagram of an exemplary computer device 12 suitable for implementing embodiments of the present invention is shown. Figure 5 The computer device 12 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.
[0213] like Figure 5 As shown, the computer device 12 is represented in the form of a general-purpose computing device. The components of the computer device 12 may include, but are not limited to: one or more processors or processing units 16, system memory 28, and a bus 18 connecting different system components (including system memory 28 and processing unit 16).
[0214] Bus 18 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0215] Computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by computer device 12, including volatile and non-volatile media, removable and non-removable media.
[0216] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write non-removable, non-volatile magnetic media (…). Figure 5 Not shown; usually referred to as a "hard drive"). Although Figure 5 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of the present invention.
[0217] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 42 typically perform the functions and / or methods described in the embodiments of the present invention.
[0218] Computer device 12 can also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), and with one or more devices that enable a user to interact with computer device 12, and / or with any device that enables computer device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed via input / output (I / O) interface 22. Furthermore, computer device 12 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 20. As shown, network adapter 20 communicates with other modules of computer device 12 via bus 18. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with computer device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0219] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the session establishment method provided in the embodiments of the present invention.
[0220] Example 5
[0221] Embodiment 5 of the present invention also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the above-described session establishment method and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0222] Computer-readable storage media may include, for example, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device.
[0223] Note that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.
Claims
1. A method for establishing a session, characterized in that, include: Determine a first user pool, which records online users who are participating in the matching process; The user is retrieved from the first user pool at preset time intervals; Construct a bipartite graph using the users as nodes and the degree of interest matching between the users as edges; In the bipartite graph, independent users are matched based on their interest matching degree to obtain user pairs; Establish a session for the user in the user pair and mask at least some of the user's user information in the session; The determination of the first user pool includes: The system queries the online users in the first user pool who are to be matched and whose specified attributes are used to divide the bipartite graph, including a first value and a second value. Count the first number of users belonging to the first value and the second number of users belonging to the second value respectively; The third quantity and the fourth quantity are determined respectively, and the sum of the first quantity and the third quantity is balanced with the sum of the second quantity and the fourth quantity; The first click rate of the prompt message for the user belonging to the first value and the second click rate of the prompt message for the user belonging to the second value are respectively calculated. The third quantity is mapped to the fifth quantity according to the first click rate, and the fourth quantity is mapped to the sixth quantity according to the second click rate; Send notification messages to users who belong to the first value but did not participate in the matching according to the fifth quantity, and send notification messages to users who belong to the second value but did not participate in the matching according to the sixth quantity; If a confirmation message is received from the user in response to the prompt message, the user is added to the first user pool.
2. The method according to claim 1, characterized in that, The construction of a bipartite graph using the users as nodes and the degree of interest matching between the users as edges includes: Query the attribute specified by the user; If the attribute is the first value, then the user is divided into nodes in the first set; If the attribute is the second value, then the user is divided into nodes in the second set; Calculate the degree of interest matching between the users in the first set and the users in the second set; Using the degree of interest matching as an edge, connect the users in the first set with the users in the second set to obtain a bipartite graph.
3. The method according to claim 2, characterized in that, The step of constructing a bipartite graph using the users as nodes and the degree of interest matching between the users as edges also includes: Count the first number of users in the first set and the second number of users in the second set; If the first quantity is not equal to the second quantity, the first set and / or the second set shall be adjusted until the first quantity is equal to the second quantity.
4. The method according to claim 3, characterized in that, The adjustment of the first set and / or the second set until the first quantity is equal to the second quantity includes: If the first number is greater than the second number, then some of the users in the first set are adjusted to nodes in the second set, and / or, nodes representing virtual users are added to the second set; If the first number is less than the second number, then some of the users in the second set are adjusted to nodes in the first set, and / or, nodes representing virtual users are added to the first set.
5. The method according to claim 2, characterized in that, The step of constructing a bipartite graph using the users as nodes and the degree of interest matching between the users as edges also includes: If the users in the first set and the users in the second set meet a preset attenuation condition, then the interest matching degree between the users in the first set and the users in the second set is reduced. The attenuation condition includes at least one of the following: The attributes of the users in the first set are the same as the attributes of the users in the second set; The users in the first set are friends with the users in the second set; The users in the first set or the users in the second set are virtual users.
6. The method according to any one of claims 1-5, characterized in that, In the bipartite graph, the users are divided into a first set and a second set that are independent of each other; The process of matching independent users in the bipartite graph based on their interest matching degree to obtain user pairs includes: The user, as a node, is assigned a benchmark based on the degree of interest matching as an edge; The benchmarks in the first set and the benchmarks in the second set are matched using the interest matching degree to obtain the maximum match; Determine whether the maximum match is a perfect match; If not, modify the benchmark, add a new interest matching degree between the benchmark in the first set and the benchmark in the second set through augmenting path, and return to execute the matching of the benchmark in the first set and the benchmark in the second set using the interest matching degree to obtain the maximum match; If so, then the user to which the successfully matched benchmark is located is determined to be a user pair.
7. The method according to claim 6, characterized in that, The interest matching degree, which is used as an edge, is used to add a benchmark to the user, which is used as a node, including: Delete the interest matching degree that is not the largest and is connected to each user in the first set, so as to retain the interest matching degree that is the largest and is connected to each user in the first set; In the first set, the benchmark value for the user is the interest matching degree value that is connected to the user and has the largest value. In the second set, the benchmark value for the user is assigned to 0.
8. The method according to any one of claims 1-5 and 7, characterized in that, The step of establishing a session for the user in the user pair and masking at least some of the user's information in the session includes: Determine the first moment when the user participates in the matching process; A preset time period is added to the first time period to form a second time period; If the difference between the current third time and the second time is less than a preset threshold, and the current matching does not generate a user pair for the current user, then read the previously matched and cached user pair; In the cached user pair, query other users that match the current user; Establish a session between the current user and other users, and mask at least some user information of the current user and other users in the session.
9. The method according to any one of claims 1-5 and 7, characterized in that, Also includes: Determine a second user pool, which contains online users who participated in the matching process; Two users are randomly selected from the second user pool for matching to obtain user pairs; The probability of users adding each other as friends is calculated when matching is performed using the first user pool. The second probability of users adding each other as friends is calculated when matching is performed using the second user pool. The first probability is compared with the second probability to obtain the test result.
10. A session establishment apparatus, characterized in that, include: The first user pool determination module is used to determine the first user pool, which records the online users who participate in the matching. The user extraction module is used to extract the user from the first user pool at preset time intervals. The bipartite graph construction module is used to construct a bipartite graph with the user as a node and the degree of interest matching between the users as an edge. The user matching module is used to match independent users in the bipartite graph according to the degree of interest matching to obtain user pairs; A session establishment module is used to establish a session for the user in the user pair and to mask at least some of the user's user information in the session; The first user pool determination module includes: The attribute query module is used to query the specified attributes of online users who are to be matched and are recorded in the first user pool. The attributes are used to divide the bipartite graph and include a first value and a second value. The quantity statistics module is used to count the first number of users belonging to the first value and the second number of users belonging to the second value, respectively. The quantity calculation module is used to determine the third quantity and the fourth quantity respectively, and the sum of the first quantity and the third quantity is balanced with the sum of the second quantity and the fourth quantity; The click-through rate calculation module is used to calculate the first click-through rate of the user with the first value for the prompt message and the second click-through rate of the user with the second value for the prompt message. The quantity mapping module is used to map the third quantity to the fifth quantity according to the first click rate and the fourth quantity to the sixth quantity according to the second click rate, respectively. The quantity sending module is used to send prompt messages to users who belong to the first value and have not participated in the matching according to the fifth quantity, and to send prompt messages to users who belong to the second value and have not participated in the matching according to the sixth quantity; The user writing module is used to write the user into the first user pool when it receives a confirmation message sent by the user in response to the prompt message.
11. A computer device, characterized in that, The computer device includes: One or more processors; Memory, used to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the session establishment method as described in any one of claims 1-9.
12. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the session establishment method as described in any one of claims 1-9.
Citation Information
Patent Citations
Machine optimization devices, methods, and systems
CN102317962A
Scheduling algorithm of yield time related service data packet based on Kuhn-Munkres algorithm
CN107241813A
User matching method and device, computer equipment and storage medium
CN113014564A
System and method for performing gender balancing of an event using notifications in a network environment
US20150067070A1