Recommended group generation method, device, server and computer-readable storage medium
By randomly selecting group leaders in dating software, building user sets, calculating matching degrees and linear planning, optimizing group division, the problem of mismatch of interests and hobbies caused by random group building is solved, and the recommendation success rate and user experience are improved.
Patent Information
- Application Number
- CN202110793785.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-14
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2041-07-14
AI Technical Summary
When existing dating software is randomly established, it is easy for users in the same group to lack common interests and hobbies, resulting in a low recommendation success rate.
By receiving the matching user set, randomly selecting the group leader, building the group leader user set and the first matching user set, performing matching degree calculation and 0-1 linear planning operations, splitting the user set, generating multiple recommendation groups, and optimizing group division to improve matching degree.
It improves the success rate of recommended groups, enhances the user experience, ensures that users in the group have common interests and hobbies, and improves the effectiveness of dating activities.
Smart Images

Figure CN114764478B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technologies, and particularly to a method, apparatus, server, and computer-readable storage medium for generating recommended groups. Background Art
[0002] With the development of the times and the acceleration of the pace of life, more and more young people are busy with work and, at the same time, are restricted by time and space, greatly shrinking their social circles. In such an environment, Internet dating has become an important way for people to expand their social circles. People can participate in online social activities or receive pushed users by downloading social software on electronic devices.
[0003] When users participate in online social activities, usually all users are pulled into the same social group, and they can freely communicate and make friends in the activity dating group. However, when the number of participants in the dating activity is too large, the number of group members in the interactive dating group is too large, and users often cannot communicate with everyone. At this time, all users need to be divided into multiple groups and recommended separately. Currently, most dating software randomly forms groups, and the group division scheme of random group formation is not the optimal recommendation scheme in most cases, and it is easy to have a situation where there is a lack of common interests among users in the same group, resulting in a low recommendation success rate. Summary of the Invention
[0004] Embodiments of the present application provide a method, apparatus, server, and computer-readable storage medium for generating recommended groups to improve the recommendation success rate.
[0005] In a first aspect, an embodiment of the present application provides a method for generating recommended groups, including:
[0006] Receiving a set of matching users, randomly selecting multiple users from the set of matching users as multiple group leaders, constructing a set of group leader users based on the multiple group leaders, and constructing a first set of matching users based on the set of matching users and the set of group leader users;
[0007] Performing a matching degree calculation on the set of group leader users and the first set of matching users to obtain a first matching degree matrix, constructing a first constraint condition, and performing a 0-1 linear programming operation on the first matching degree matrix to obtain a first linear matrix;
[0008] Splitting the first set of matching users based on the first linear matrix to obtain a second set of matching users and a third set of matching users, and performing a group division operation on the second set of matching users based on the first linear matrix and the multiple group leaders to obtain multiple groups to be assigned;
[0009] Perform the matching degree calculation for the multiple groups to be assigned and the third set of matching users to obtain a second matching degree matrix, construct a second constraint condition, and perform a 0-1 linear programming operation on the second matching degree matrix to obtain a second linear matrix;
[0010] Based on the second linear matrix and the multiple groups to be assigned, perform the group division operation on the third set of matching users to obtain multiple groups corresponding to the set of matching users;
[0011] Pull the matching users corresponding to the multiple groups respectively to generate multiple recommended groups.
[0012] In one embodiment, the first constraint condition includes a first sub-constraint condition, a second sub-constraint condition, a third sub-constraint condition, and a fourth sub-constraint condition; the first sub-constraint condition includes: for the first matching user and the group leader of any pair of successfully matched users, the constraint eigenvalue corresponding to the first matching user is not equal to the constraint eigenvalue of the group leader; the second sub-constraint condition includes: for any group leader in the set of group leaders, the first matching users successfully matched by the group leader satisfy a first quantity, where the first quantity is one-half of the preset number of group members, and the number of group members is even; the third sub-constraint condition includes: for any first matching user in the first set of matching users, there is one and only one group leader successfully matched with the any first matching user; the fourth sub-constraint condition includes: the function value of the preset objective function satisfies the maximum value.
[0013] In one embodiment, the second constraint condition includes a fifth sub-constraint condition, a sixth sub-constraint condition, a seventh sub-constraint condition, and an eighth sub-constraint condition; the fifth sub-constraint condition is: for any set of successfully matched groups to be assigned and the third set of matching users, the constraint eigenvalue of the third matching user is equal to the constraint eigenvalue of the group leader of the group to be assigned; the sixth sub-constraint condition is: the third matching users successfully matched by any group to be assigned satisfy a second quantity, where the second quantity plus one is equal to one-half of the preset number of group members, and the number of group members is even; the seventh sub-constraint condition is: for any third matching user in the third set of matching users, there is one and only one group to be assigned successfully matched with the any third matching user; the eighth sub-constraint condition is: the function value of the preset objective function satisfies the maximum value.
[0014] In one embodiment, the objective function includes the sum of the first cost corresponding to the first matching degree matrix and the second cost corresponding to the second matching degree matrix; the first cost includes the sum of the matrix elements of the first matching degree matrix; the second cost includes the sum of the matrix elements of the second matching degree matrix.
[0015] In one embodiment, calculating the second matching degree matrix of the multiple groups to be assigned and the third matching user set includes: extracting multiple first group member sets corresponding to the multiple groups to be assigned; calculating multiple matching degree row matrices of each of the multiple first group member sets and the third matching user set; and constructing the second matching degree matrix based on the multiple matching degree row matrices.
[0016] In one embodiment, calculating the multiple matching degree row matrices of each of the multiple first group member sets and the third matching user set includes: for each of the multiple first group member sets, obtaining at least one target first group member of the first group member set; calculating at least one target row matrix of the at least one target first group member and the third matching user set; and performing a matrix addition operation on the at least one target row matrix to obtain the matching degree row matrix of the first group member set and the third matching user set.
[0017] In one embodiment, after splitting the first matching user set based on the first linear matrix to obtain a second matching user set and a third matching user set, it further includes: determining whether the third matching user set is an empty set; if the third matching user set is an empty set, performing the group operation on the second matching user set based on the first linear matrix and the multiple group leaders to obtain the multiple groups; if the third matching user set is a non-empty set, performing the operation of calculating the second matching degree matrix of the multiple groups to be assigned and the third matching user set.
[0018] In a second aspect, an embodiment of the present application provides a recommended group generation device, including:
[0019] An acquisition unit, configured to receive a matching user set, randomly select multiple users from the matching user set as multiple group leaders, construct a group leader user set based on the multiple group leaders, and construct a first matching user set based on the matching user set and the group leader user set;
[0020] A first calculation unit, configured to perform a matching degree calculation on the group leader user set and the first matching user set to obtain a first matching degree matrix, construct a first constraint condition, and perform a 0-1 linear programming operation on the first matching degree matrix to obtain a first linear matrix;
[0021] A first grouping unit, configured to split the first matching user set based on the first linear matrix to obtain a second matching user set and a third matching user set, and perform a group division operation on the second matching user set based on the first linear matrix and the multiple group leaders to obtain multiple groups to be assigned;
[0022] A second calculation unit, configured to perform the matching degree calculation for the multiple groups to be allocated and the third set of matching users, obtain a second matching degree matrix, construct a second constraint condition, and perform a 0-1 linear programming operation on the second matching degree matrix to obtain a second linear matrix;
[0023] A second grouping unit, configured to perform the grouping operation on the third set of matching users based on the second linear matrix and the multiple groups to be allocated, to obtain multiple groups corresponding to the set of matching users;
[0024] A pulling unit, configured to respectively pull the matching users corresponding to the multiple groups to generate multiple recommended groups.
[0025] In a third aspect, an embodiment of the present application provides a server, which includes a processor, a memory, a communication interface, and one or more programs. The one or more programs are stored in the memory and are configured to be executed by the processor. The programs include instructions for performing some or all of the steps described in the method according to the first aspect of the embodiment of the present application.
[0026] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium is used to store a computer program, and the computer program is executed by a processor to implement some or all of the steps described in the method according to the first aspect of the embodiment of the present application.
[0027] It can be seen that in the embodiment of the present application, the server receives a matching user set, randomly selects multiple users from the matching user set as multiple group leaders, constructs a group leader user set based on the multiple group leaders, and constructs a first matching user set based on the matching user set and the group leader user set; calculates the matching degree for the group leader user set and the first matching user set to obtain a first matching degree matrix, constructs a first constraint condition to perform a 0-1 linear programming operation on the first matching degree matrix to obtain a first linear matrix; splits the first matching user set based on the first linear matrix to obtain a second matching user set and a third matching user set, performs a group division operation on the second matching user set based on the first linear matrix and the multiple group leaders to obtain multiple groups to be assigned; calculates the matching degree for the multiple groups to be assigned and the third matching user set to obtain a second matching degree matrix, constructs a second constraint condition to perform a 0-1 linear programming operation on the second matching degree matrix to obtain a second linear matrix; performs the group division operation on the third matching user set based on the second linear matrix and the multiple groups to be assigned to obtain multiple groups corresponding to the matching user set; respectively pulls the matching users corresponding to the multiple groups to generate multiple recommended groups. In this way, the first matching degree matrix and the second matching degree matrix of the users in the matching user set can be calculated, so as to calculate the matching degree between the users in the matching user set. Then, by constructing the first constraint condition and the second constraint condition to perform a linear programming operation on the first matching degree matrix and the second matching degree matrix, an optimal group division scheme that can maximize the overall matching degree can be obtained. Finally, based on the group division scheme, multiple recommended groups are pulled, and the recommended groups are pulled based on the matching degree, which is beneficial to improving the recommendation success rate and thus beneficial to improving the user experience. Description of the Drawings
[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0029] Figure 1 It is a schematic diagram of the application environment of a recommended group generation method disclosed in an embodiment of the present application;
[0030] Figure 2 It is a schematic flowchart of a recommended group generation method disclosed in an embodiment of the present application;
[0031] Figure 3 It is a schematic flowchart of another recommended group generation method provided by an embodiment of the present application;
[0032] Figure 4 It is a schematic structural diagram of a server 400 provided by an embodiment of the present application;
[0033] Figure 5 It is a schematic structural diagram of a recommended group generation device disclosed by an embodiment of the present application. Detailed implementation manners
[0034] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without making creative efforts belong to the scope of protection of the present invention.
[0035] The terms "first", "second", "third", and "fourth", etc. in the specification and claims of the present invention and the accompanying drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes steps or units not listed, or optionally further includes other steps or units inherent to these processes, methods, products, or devices.
[0036] Referring to "embodiment" in this article means that the specific features, results, or characteristics described in conjunction with the embodiment can be included in at least one embodiment of the present invention. The phrase appears in various positions in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.
[0037] Hereinafter, some terms in the present application will be explained to facilitate the understanding of those skilled in the art.
[0038] An electronic device may include various handheld devices, vehicle-mounted devices, wearable devices (such as smart watches, smart bracelets, pedometers, etc.) with wireless communication functions, computing devices, or other processing devices connected to a wireless modem, as well as various forms of user equipment (UE), mobile stations (MS), terminal devices, and so on. For convenience of description, the devices mentioned above are collectively referred to as electronic devices.
[0039] The recommended group generation method provided by the present application can be applied to, for example Figure 1In the application environment shown. Among them, the user connects to the cloud server 102 through the electronic device 101. The electronic device 101 can be but is not limited to various personal computers, laptop computers, smart phones, tablet computers, and portable wearable devices. The user sends a participation request for a friend-making activity to the cloud server 102 through the electronic device 101. The electronic device 101 is used to record user data and send the user data to the cloud server 102. The cloud server 102 receives a set of matching users and receives the user data sent by the electronic device 101 corresponding to the matching users. Among them, the user data includes but is not limited to: preset information of the matching users, usage data of the matching users for the target application, etc. The cloud server 102 pushes multiple matching users and user data to the matching server 103. The matching server 103 randomly selects multiple users from the set of matching users as multiple group leaders, constructs a set of group leader users based on the multiple group leaders, and constructs a first set of matching users based on the set of matching users and the set of group leader users; performs a matching degree calculation on the set of group leader users and the first set of matching users to obtain a first matching degree matrix, constructs a first constraint condition, and performs a 0-1 linear programming operation on the first matching degree matrix to obtain a first linear matrix; splits the first set of matching users based on the first linear matrix to obtain a second set of matching users and a third set of matching users, performs a group division operation on the second set of matching users based on the first linear matrix and the multiple group leaders to obtain multiple groups to be assigned; performs the matching degree calculation on the multiple groups to be assigned and the third set of matching users to obtain a second matching degree matrix, constructs a second constraint condition, and performs a 0-1 linear programming operation on the second matching degree matrix to obtain a second linear matrix; performs the group division operation on the third set of matching users based on the second linear matrix and the multiple groups to be assigned to obtain multiple groups corresponding to the set of matching users. The matching server 103 sends the group information of the multiple groups to the cloud server 102. After receiving the group information of the multiple groups, the cloud server pulls the matching users corresponding to the multiple groups respectively to generate multiple recommended groups. In this way, it is beneficial to improve the recommendation success rate of group social interaction.
[0040] Among them, the cloud server 102 and the matching server 103 can be implemented by an independent server or a server cluster composed of multiple servers.
[0041] In one embodiment, Figure 2 is a schematic flowchart of a method for generating a recommended group disclosed in an embodiment of the present application. Taking the method applied to the Figure 1 server as an example, it includes the following steps:
[0042] Step 201: Receive the set of matching users, randomly select multiple users from the set of matching users as multiple group leaders, construct a set of group leader users based on the multiple group leaders, and construct a first set of matching users based on the set of matching users and the set of group leader users.
[0043] Optionally, when the dating activity is an offline activity, before obtaining the set of matching users participating in the dating activity, receive an activity participation request from the user device, determine the list of users to participate in the matching based on the activity participation request, within the preset activity preparation time, obtain the geographical location information of each user device in the list of users to participate in the matching, determine whether the geographical location information is within the location area range of the dating activity, if so, determine that the user to participate in the matching is a matching user; obtain all the matching users within the activity preparation time to form a set of matching users.
[0044] Optionally, when the dating activity is an online activity, obtain all the matching users who submitted registration information during the registration time of the dating activity to form a set of matching users.
[0045] Optionally, before randomly selecting multiple users from the set of matching users as multiple group leaders, it further includes: obtaining the total number of matching users in the set of matching users, and obtaining the group rules, where the group rules include: the number of users in each group and / or the number of groups, the number of users in each group represents the number of users included in each group, and the number of groups represents the number of groups. That is, assuming the total number of matching users is 100 and the group rule includes 4 users in each group, it can be determined that this method needs to divide the set of matching users into 25 groups; assuming the total number of matching users is 100 and the group rule includes 25 groups, it can be determined that the number of users in each group is 4.
[0046] Further, randomly selecting multiple users from the set of matching users as multiple group leaders includes: randomly extracting multiple users based on the number of groups. That is, when the number of groups is 25, 25 users need to be randomly selected from the set of matching users as the group leaders of 25 groups.
[0047] Among them, the random selection may include numbering the users in the set of matching users, randomly selecting multiple numbers through a random value function, and extracting the users corresponding to the multiple numbers as multiple group leaders; it may also be to select the first N users or the last N users in the set of matching users as multiple group leaders. The random selection method is not limited here.
[0048] Among them, the union of the first set of matching users and the set of group leader users is consistent with the set of matching users.
[0049] Step 202: Perform a matching degree calculation for the group leader user set and the first matching user set to obtain a first matching degree matrix, and construct a first constraint condition to perform a 0-1 linear programming operation on the first matching degree matrix to obtain a first linear matrix;
[0050] Optionally, performing a matching degree calculation for the group leader user set and the first matching user set may include: extracting the group leader feature set of the group leader user set, extracting the first matching user feature set of the first matching user set, and performing the matching degree calculation based on the group leader feature set and the first matching user feature set to obtain the first matching degree matrix.
[0051] Further, performing the matching degree calculation based on the group leader feature set and the first matching user feature set may include: for any group leader feature A in the group leader feature set, calculating a feature matching degree matrix A1 of the any group leader feature A and each first matching user feature in the first matching user feature set, where the feature matching degree matrix A1 is a 1*M row vector matrix, and M is the number of first matching users in the first matching user set; therefore, a plurality of row vector matrices A1-AN of the group leader user feature set and the first matching user feature set are calculated, where N is the number of groups, and the N row vector matrices correspond one by one to the N group leaders in the group leader user set, and the N row vector matrices are spliced to obtain the first matching degree matrix.
[0052] The 0-1 linear programming described in the embodiments of the present application is a special case of the linear integer programming problem. In the linear programming problem, some optimal solutions may be fractions or decimals, but for some specific problems, it is often required that the solutions of some variables must be integers. For example, when the variable represents the number of machines, the number of workers, or the number of trucks for loading goods, etc., in order to meet the integer requirement, it seems at first glance that as long as the obtained non-integer solution is rounded to an integer. In fact, the rounded number may not necessarily be a feasible solution and an optimal solution, so there should be a special method to solve the integer programming. In integer programming, if all variables are restricted to integers, it is called a pure integer programming; if only a part of the variables are restricted to integers, it is called a mixed integer programming, where a special case of integer programming is 0-1 programming, and its variables are limited to 0 or 1.
[0053] Optionally, each matrix element in the first matching degree matrix corresponds to a user pair, and the user pair includes a group leader and a first matching user, that is, each matrix element represents the matching degree of the corresponding user pair.
[0054] Optionally, the first constraint condition includes a first sub-constraint condition, a second sub-constraint condition, a third sub-constraint condition, and a fourth sub-constraint condition; the first sub-constraint condition includes: for any user pair with successful matching, the first matching user and the group leader, the constraint feature value corresponding to the first matching user is not equal to the constraint feature value of the group leader; the second sub-constraint condition includes: for any one of the group leaders in the group leader user set, the first matching users successfully matched by the group leader satisfy a first quantity, where the first quantity is one-half of the preset number of group members, and the number of group members is an even number; the third sub-constraint condition includes: for any one of the first matching user sets, there is exactly one group leader who is successfully matched with the any one of the first matching users; the fourth sub-constraint condition includes: the function value of the preset objective function satisfies the maximum value.
[0055] Among them, in the first linear matrix, if the matrix element is the numerical value 1, it indicates successful matching, and if the matrix element is the numerical value 0, it indicates failed matching. For any user pair with successful matching in the first sub-constraint condition, that is, for any matrix element with the numerical value 1 in the first linear matrix, obtain the corresponding user pair, extract the first matching user and the group leader corresponding to the user pair, and extract the constraint feature value of the first matching user and the constraint feature value of the group leader based on the preset constraint feature extraction rule. The constraint feature value corresponding to the first matching user is not equal to the constraint feature value of the group leader.
[0056] In a possible embodiment, the constraint feature may be a gender feature, that is, the constraint feature extraction rule may be that when the user is a male user, the constraint feature value is 1, and when the user is a female user, the constraint feature value is 0. Then, the first sub-constraint condition is for any user pair with successful matching, that is, for any matrix element with the numerical value 1 in the first linear matrix. When the constraint feature value corresponding to the first matching user is 1, the constraint feature value of the group leader is 0, and when the constraint feature value corresponding to the first matching user is 0, the constraint feature value of the group leader is 1. Therefore, the first sub-constraint condition is that the gender of the group leader corresponding to the successfully matched user pair is opposite to the gender of the first matching user. When the group leader corresponding to the user pair is a female user, the first matching user needs to be a male user, and when the group leader corresponding to the user pair is a male user, the first matching user needs to be a female user.
[0057] Among them, in the first linear matrix, the first linear matrix is split into multiple row matrices. Each row matrix represents the matching results between the team leader corresponding to this row matrix and multiple first matching users in the first matching user set. Therefore, the second sub-constraint condition means that for any row matrix, there is exactly one matrix element with a value of 1 that satisfies the first quantity in this row matrix. That is, if the preset number of people in the group is 4, then for any row matrix in the first linear matrix, there are exactly 2 matrix elements with a value of 1, and the sum of its matrix elements is 2.
[0058] Among them, in the first linear matrix, the first linear matrix is split into multiple column matrices. Each column matrix represents the matching results between the first matching user corresponding to this column matrix and multiple team leaders. Therefore, the third sub-constraint condition means that for any column matrix, there is exactly one matrix element with a value of 1 in this column matrix. That is, for any column matrix in the first linear matrix, the sum of its matrix elements is 1.
[0059] Among them, the fourth sub-constraint condition includes: the function value of the preset objective function satisfies the maximum value, that is, based on the first linear matrix, the function value of the objective function can reach the maximum value.
[0060] Step 203: Split the first matching user set based on the first linear matrix to obtain a second matching user set and a third matching user set, and group the second matching user set based on the first linear matrix and the multiple team leaders to obtain multiple groups to be assigned;
[0061] Optionally, splitting the first matching user set based on the first linear matrix includes: determining multiple first matching users who have successfully matched in the first matching user set based on the first linear matrix, and the multiple first matching users who have successfully matched constitute the second matching user set; determining multiple first matching users who have failed to match in the first matching user set based on the first linear matrix, and the multiple first matching users who have failed to match constitute the third matching user set.
[0062] Optionally, after splitting the first matching user set based on the first linear matrix to obtain a second matching user set and a third matching user set, it further includes: judging whether the third matching user set is an empty set; if the third matching user set is an empty set, then perform the operation of grouping the second matching user set based on the first linear matrix and the multiple team leaders to obtain the multiple groups; if the third matching user set is a non-empty set, then perform the operation of calculating the second matching degree matrix of the multiple groups to be assigned and the third matching user set.
[0063] Among them, grouping the second set of matching users based on the first linear matrix and multiple group leaders includes: splitting the first linear matrix to obtain multiple first row matrices, where the multiple first row matrices correspond one by one to the multiple group leaders. Based on the first constraint condition, each first row matrix has exactly two matrix elements equal to 1. Obtain the two second matching users corresponding to the matrix elements equal to 1 in each first row matrix from the second set of matching users, and mark and group the two second matching users based on the first row matrix.
[0064] Step 204: Perform the matching degree calculation on the multiple groups to be assigned and the third set of matching users to obtain a second matching degree matrix, and construct a second constraint condition to perform a 0-1 linear programming operation on the second matching degree matrix to obtain a second linear matrix.
[0065] Optionally, performing the matching degree calculation on the multiple groups to be assigned and the third set of matching users includes: extracting multiple first group member sets corresponding to the multiple groups to be assigned; extracting the first group member characteristics of each first group member in each first group member set, and extracting the third matching user characteristic set of the third set of matching users; calculating multiple characteristic matching degree row matrices of the first group member set and the third set of matching users based on each first group member characteristic and the third matching user characteristic set, and constructing the second matching degree matrix based on the multiple characteristic matching degree row matrices.
[0066] Among them, taking any one of the multiple first group member sets as the target set, obtaining multiple third matching users of the third set of matching users, calculating multiple target matching degrees of the target set and the multiple third matching users, and constructing a matching degree row matrix corresponding to the target set and the third set of matching users based on the multiple target matching degrees.
[0067] Optionally, calculating the multiple matching degree row matrices of each of the multiple first group member sets and the third set of matching users includes: for each of the multiple first group member sets, obtaining at least one target first group member of the first group member set; calculating at least one target row matrix of the at least one target first group member and the third set of matching users; performing a matrix addition operation on the at least one target row matrix to obtain the matching degree row matrix of the first group member set and the third set of matching users.
[0068] In the specific implementation process, if the first group member set includes two first group members, calculate the two matching degree row matrices of the two first group members and the third set of matching users respectively, and add the two matching degree row matrices to obtain the matching degree row matrix of the first group member set and the third set of matching users.
[0069] In the specific implementation process, it may further include: assuming that the first group member set includes two first group members, for any target user in the third matching user set, calculate the two target first matching degrees between the two first group members and the target user respectively, and add the two target first matching degrees to obtain the matching degree between the first group member set and the target user. In this way, the matching degree row matrix of the first group member set for each third user in the third matching user set can be calculated.
[0070] Optionally, the second constraint condition includes a fifth sub-constraint condition, a sixth sub-constraint condition, a seventh sub-constraint condition, and an eighth sub-constraint condition; the fifth sub-constraint condition is that for any successfully matched to-be-assigned group and third matching user, the constraint feature value of the third matching user is equal to the constraint feature value of the leader of the to-be-assigned group; the sixth sub-constraint condition is that the third matching users successfully matched by any to-be-assigned group satisfy a second quantity, where the second quantity plus one is equal to half of the preset group size, and the group size is an even number; the seventh sub-constraint condition is that for any third matching user in the third matching user set, there is one and only one to-be-assigned group that is successfully matched with the third matching user; the eighth sub-constraint condition is that the function value of the preset objective function satisfies the maximum value.
[0071] Among them, in the second linear matrix, if the matrix element is the numerical value 1, it indicates successful matching, and if the matrix element is the numerical value 0, it indicates failed matching. For any successfully matched to-be-assigned group and third matching user in the fifth sub-constraint condition, that is, for any matrix element with the numerical value 1 in the second linear matrix, obtain the corresponding to-be-assigned group and third matching user, and extract the constraint feature value of the third matching user and the constraint feature value of the leader of the to-be-assigned group based on the preset constraint feature extraction rule. The constraint feature value corresponding to the third matching user is equal to the constraint feature value of the leader.
[0072] In a possible embodiment, the constraint feature may be a gender feature, that is, the constraint feature extraction rule may be that when the user is a male user, the constraint feature value is 1, and when the user is a female user, the constraint feature value is 0. Then, the fifth sub-constraint condition is that for any successfully matched to-be-assigned group and third matching user, that is, for any matrix element with the numerical value 1 in the second linear matrix, when the constraint feature value corresponding to the third matching user is 1, the constraint feature value of the leader of the to-be-assigned group is 1, and when the constraint feature value corresponding to the third matching user is 0, the constraint feature value of the leader of the to-be-assigned group is 0. Therefore, the fifth sub-constraint condition is that the gender of the leader of the successfully matched to-be-assigned group is the same as the gender of the third matching user. When the leader of the to-be-assigned group is a female user, the third matching user needs to be a female user, and when the leader of the to-be-assigned group is a male user, the third matching user needs to be a male user.
[0073] Among them, in the second linear matrix, the second linear matrix is split into multiple row matrices, and each row matrix represents the matching result between the group leader corresponding to the row matrix and multiple first-matching users in the first matching user set. Therefore, the sixth sub-constraint condition means that for any row matrix, there is exactly one matrix element with a value of 1 that satisfies the second quantity, where the second quantity plus 1 is half of the preset group size. That is, assuming the preset group size is 4, for any row matrix, there is exactly one matrix element with a value of 1, and the sum of the matrix elements of the row matrix is 1.
[0074] Among them, in the second linear matrix, the second linear matrix is split into multiple column matrices, and each column matrix represents the matching result between the third matching user corresponding to the column matrix and multiple group leaders. Therefore, the seventh sub-constraint condition means that for any column matrix, there is exactly one matrix element with a value of 1 in the column matrix. That is, for any column matrix in the second linear matrix, the sum of its matrix elements is 1.
[0075] Among them, the eighth sub-constraint condition includes: the function value of the preset objective function satisfies the maximum value, that is, based on the second linear matrix, the function value of the objective function can reach the maximum value.
[0076] Optionally, the objective function includes the sum of the first cost corresponding to the first matching degree matrix and the second cost corresponding to the second matching degree matrix; the first cost includes the sum of the matrix elements of the first matching degree matrix; the second cost includes the sum of the matrix elements of the second matching degree matrix.
[0077] Step 205: Group the third matching user set based on the second linear matrix and the multiple groups to be assigned, and obtain multiple groups corresponding to the matching user set.
[0078] Optionally, grouping the third matching user set based on the second linear matrix and multiple groups to be assigned includes: splitting the second linear matrix to obtain multiple second row matrices, and the multiple second row matrices correspond one-to-one to the multiple groups to be assigned. Based on the second constraint condition, obtain the third matching users corresponding to the matrix element 1 in each second row matrix from the third matching user set, and assign the third matching users to their corresponding groups to be assigned based on the second row matrix, so as to obtain multiple groups.
[0079] Step 206: Pull the matching users corresponding to the multiple groups respectively to generate multiple recommended groups.
[0080] In the specific implementation process, assume that there are 40 users participating in an activity, including 20 male users and 20 female users. First, a set of matching users is generated based on the 40 users. According to the preset group rules, the number of people in each group is 4, that is, the 40 users are grouped into 10 groups of 4 people each, and the ratio of male users to female users within each group is 1:1, that is, any group includes 2 male users and 2 female users; 10 users are randomly selected from the set of matching users as the group leaders of these 10 groups, and the ratio of male users to female users among these 10 users is random and not limited here; a set of leader users is generated based on these 10 group leaders, and a first set of matching users is constructed based on the set of matching users and the set of leader users, that is, 30 users in the set of matching users who do not belong to the set of leader users are obtained to form the first set of matching users.
[0081] First, perform the first round of matching. Calculate the matching degree matrix of the set of leader users and the first set of matching users, that is, for the 10 group leaders included in the set of leader users, calculate the matching degree between each group leader and the 30 first matching users in the first set of matching users respectively, and form the first matching degree matrix. Assume that the 10 group leaders are respectively represented as , , and the 30 first matching users are respectively represented as , , then the matching degree between the i-th group leader and the j-th first matching user is expressed as , and the first matching degree matrix can be expressed as:
[0082] ;
[0083] Construct the first constraint condition, and perform a 0-1 linear programming operation on the first matching degree matrix based on the first constraint condition to obtain the first linear matrix, where the first linear matrix can be expressed as:
[0084] ;
[0085] Among them, 1 indicates successful matching, and 0 indicates failed matching. Further, the first constraint condition includes 4 sub-constraint conditions. The first sub-constraint condition includes: for any pair of users with successful matching, the gender of the first matching user corresponding to the pair of users is different from the gender of the group leader corresponding to the pair of users. That is, in the first linear matrix, for any group leader and the first matching user corresponding to the value of "1", the gender of this group leader is opposite to the gender of this first matching user . That is, when the gender of the group leader is female, and the first matching user matched successfully with this group leader The gender must be male; the second sub-constraint includes: for any one of the group leader users in the group leader user set , the group leader The first matching users with successful matching Meet the first quantity, where the first quantity is one-half of the preset group size, and the group size is an even number. When the group size is 4, the first quantity is 2, that is, for any one group leader , the first matching users with successful matching with this group leader There are exactly 2, that is, for each row matrix of the first linear matrix, there are exactly two matrix elements with a value of "1"; the third sub-constraint includes: for any one first matching user in the first matching user set , the group leader with successful matching with the any one first matching user There is exactly one, that is, any one first matching user can only be successfully matched with 1 group leader, then in each column matrix of the first linear matrix, there is exactly 1 matrix element with a value of "1"; the fourth sub-constraint includes: the function value of the preset objective function meets the maximum value. After obtaining the first linear matrix, based on the first linear matrix, the first matching user set is split into a second matching user set and a third matching user set. Among them, the second matching user set is the users in the first matching user set who are successfully matched with 10 group leaders. According to the first linear matrix, the second matching user set is grouped into 10 to-be-assigned groups, where each to-be-assigned group contains 1 group leader and 2 first group members. The third matching user set includes the users in the first matching user set who fail to be matched with 10 group leaders. In the embodiments of the present application, the second matching user set contains 20 second matching users, and the third matching user set contains 10 third matching users.
[0086] Then perform the second round of matching, calculate the second matching degree matrix of the 10 to-be-assigned groups and the third matching user set, extract the 10 first group member sets of the 10 to-be-assigned groups, where each first group member set contains 2 first group members, and calculate the matching degree matrix of the 10 first group member sets and 10 third matching users as the second matching degree matrix; assume that the 10 group leaders are respectively represented as , , the 10 third matching users are respectively represented as , , then the matching degree between the i-th group leader and the r-th third matching user is represented as , then the second matching degree matrix can be represented as:
[0087] ;
[0088] Construct the second constraint condition, and perform a 0-1 linear programming operation on the second matching degree matrix based on the second constraint condition to obtain a second linear matrix, where the first linear matrix can be expressed as:
[0089] ;
[0090] Among them, 1 indicates successful matching, and 0 indicates failed matching.
[0091] Furthermore, the second constraint condition includes 4 sub-constraint conditions. The fifth sub-constraint condition includes: for any one of the to-be-allocated groups that matches successfully and the third matching user in the third matching user set , the third matching user has the same gender as the leader of any one of the to-be-allocated groups , that is, in the second linear matrix, for any matrix element corresponding to a value of "1", the leader and the third matching user , the gender of this leader is the same as the gender of this third matching user , that is, the gender of this third matching user needs to be opposite to the gender of the first member of this group. When the gender of the leader is female, the gender of the first member is male, and the gender of the successfully matched third matching user must be female; the sixth sub-constraint condition includes: the third matching user successfully matched by any one of the to-be-allocated groups meets the second quantity, where the second quantity plus one is equal to half of the preset group size. In this embodiment, when the group size is 4, half of the group size is 2, and the second quantity is 1, that is, for any one of the to-be-allocated groups, there is exactly 1 third matching user successfully matched with this to-be-allocated group, that is, for each row matrix of the second linear matrix, there is exactly 1 matrix element with a value of "1"; the seventh sub-constraint condition includes: for any third matching user in the third matching user set, there is exactly one to-be-allocated group that matches successfully with the any third matching user , that is, any third matching user can only be successfully matched with 1 to-be-allocated group, then in each column matrix of the second linear matrix, there is exactly 1 matrix element with a value of "1"; the eighth sub-constraint condition includes: the function value of the preset objective function meets the maximum value.
[0092] Among them, the objective function includes the sum of the first cost corresponding to the first matching degree matrix and the second cost corresponding to the second matching degree matrix, and the objective function can be expressed as a cost function: , c is the number of rounds of matching to be performed in the user matching method. In the embodiment of the present application, c = 2, where, represents the total matching cost, represents the cost generated by the d-th round of matching, , that is represents the cost generated by the first round of matching, represents the cost generated by the second round of matching, that is represents the sum of the matching costs of all rounds in the matching group activities executed in the embodiment of the present application. In each round of matching, the cost generated by each round of matching can be calculated as:
[0093] ,
[0094] where, m is the number of groups. In this embodiment, m = 10, is the matching degree of the i-th group in this round of matching. The calculation function of the matching degree can include: , where, n is the number of users in the user set participating in the matching in this round of matching; thus, in the embodiment of the present application, the calculation formula of the first cost corresponding to the first matching degree matrix can include: , and the calculation formula of the second cost corresponding to the second matching degree matrix can include: .
[0095] Further, based on the second linear matrix and multiple groups to be allocated, the third set of matching users is grouped. 10 third matching users serve as the second group members and form multiple groups of the user activity set with multiple groups to be allocated. Among them, any one group includes: 1 team leader, 2 first group members, and 1 second group member. Multiple recommended groups are generated by pulling the matching users corresponding to multiple groups respectively.
[0096] It can be seen that in the embodiment of the present application, the server receives a set of matching users, randomly selects multiple users from the set of matching users as multiple group leaders, constructs a set of group leader users based on the multiple group leaders, and constructs a first set of matching users based on the set of matching users and the set of group leader users; calculates the matching degree between the set of group leader users and the first set of matching users to obtain a first matching degree matrix, constructs a first constraint condition to perform a 0-1 linear programming operation on the first matching degree matrix to obtain a first linear matrix; splits the first set of matching users based on the first linear matrix to obtain a second set of matching users and a third set of matching users, performs a group division operation on the second set of matching users based on the first linear matrix and the multiple group leaders to obtain multiple groups to be assigned; calculates the matching degree between the multiple groups to be assigned and the third set of matching users to obtain a second matching degree matrix, constructs a second constraint condition to perform a 0-1 linear programming operation on the second matching degree matrix to obtain a second linear matrix; performs the group division operation on the third set of matching users based on the second linear matrix and the multiple groups to be assigned to obtain multiple groups corresponding to the set of matching users; respectively pulls the matching users corresponding to the multiple groups to generate multiple recommended groups. In this way, by calculating the first matching degree matrix and the second matching degree matrix of the users in the set of matching users, the matching degree between the users in the set of matching users can be calculated, and then by constructing the first constraint condition and the second constraint condition to perform a linear programming operation on the first matching degree matrix and the second matching degree matrix, an optimal group division scheme that can maximize the overall matching degree can be obtained. Finally, based on the group division scheme, multiple recommended groups are pulled, and the recommended groups are pulled based on the matching degree, which is beneficial to improving the recommendation success rate and thus beneficial to improving the user experience.
[0097] Please refer to Figure 3 , Figure 3 FIG. is a schematic flowchart of another method for generating recommended groups provided by an embodiment of the present application. As shown in the figure, this method first obtains a set of matching users. In the first round of matching, the set of matching users may include a set of group leader users and a first set of matching users, calculates the user matching degree between the set of group leader users and the first set of matching users, then sets an objective function, where the objective function is used to set the constraint conditions for linear programming, sets the constraint conditions, and the constraint conditions include at least one constraint sub-condition. Based on the constraint conditions, a linear programming calculation is performed on the user matching degree to obtain a matching result, that is, a linear matrix. Based on the linear matrix, the set of matching users can be grouped, and it is judged whether all the users who signed up for the activity are matched. If so, the group is pulled based on the matching result, and the recommended group generation process ends. If not, the second round of matching is performed. It should be understood that although Figure 2-3The steps in the flowchart are shown in sequence according to the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2-3 At least some of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least some of the sub-steps or stages of other steps or other steps.
[0098] Please refer to Figure 4 , Figure 4 FIG. is a schematic structural diagram of a server 400 provided by an embodiment of the present application. As shown in the figure, the server 400 includes: an application processor 410, a memory 420, a communication interface 430, and one or more programs 421. Among them, the one or more programs 421 are stored in the above-mentioned memory 420 and are configured to be executed by the above-mentioned application processor 410. The one or more programs 421 include instructions for performing the following steps:
[0099] Receive a set of matching users, randomly select multiple users from the set of matching users as multiple group leaders, construct a set of leader users based on the multiple group leaders, and construct a first set of matching users based on the set of matching users and the set of leader users;
[0100] Perform a matching degree calculation on the set of leader users and the first set of matching users to obtain a first matching degree matrix, construct a first constraint condition, and perform a 0-1 linear programming operation on the first matching degree matrix to obtain a first linear matrix;
[0101] Based on the first linear matrix, split the first set of matching users to obtain a second set of matching users and a third set of matching users, and perform a group division operation on the second set of matching users based on the first linear matrix and the multiple group leaders to obtain multiple groups to be assigned;
[0102] Perform the matching degree calculation on the multiple groups to be assigned and the third set of matching users to obtain a second matching degree matrix, construct a second constraint condition, and perform a 0-1 linear programming operation on the second matching degree matrix to obtain a second linear matrix;
[0103] Based on the second linear matrix and the multiple groups to be assigned, perform the group division operation on the third set of matching users to obtain multiple groups corresponding to the set of matching users;
[0104] Pull the matching users corresponding to the multiple groups respectively to generate multiple recommended groups.
[0105] It can be seen that in the embodiment of the present application, the server receives a set of matching users, randomly selects multiple users from the set of matching users as multiple group leaders, constructs a set of group leader users based on the multiple group leaders, and constructs a first set of matching users based on the set of matching users and the set of group leader users; performs a matching degree calculation on the set of group leader users and the first set of matching users to obtain a first matching degree matrix, constructs a first constraint condition, and performs a 0-1 linear programming operation on the first matching degree matrix to obtain a first linear matrix; splits the first set of matching users based on the first linear matrix to obtain a second set of matching users and a third set of matching users, performs a group division operation on the second set of matching users based on the first linear matrix and the multiple group leaders to obtain multiple groups to be assigned; performs the matching degree calculation on the multiple groups to be assigned and the third set of matching users to obtain a second matching degree matrix, constructs a second constraint condition, and performs a 0-1 linear programming operation on the second matching degree matrix to obtain a second linear matrix; performs the group division operation on the third set of matching users based on the second linear matrix and the multiple groups to be assigned to obtain multiple groups corresponding to the set of matching users; respectively pulls the matching users corresponding to the multiple groups to generate multiple recommended groups. In this way, the matching degree between the users in the set of matching users can be calculated by calculating the first matching degree matrix and the second matching degree matrix of the users in the set of matching users, and then the first constraint condition and the second constraint condition are constructed to perform a linear programming operation on the first matching degree matrix and the second matching degree matrix, so as to obtain an optimal group division scheme that can make the overall matching degree reach the maximum value. Finally, multiple recommended groups are pulled based on the group division scheme, and the recommended groups are pulled based on the matching degree, which is beneficial to improving the recommendation success rate and thus beneficial to improving the user experience.
[0106] In one embodiment, the first constraint condition includes a first sub-constraint condition, a second sub-constraint condition, a third sub-constraint condition, and a fourth sub-constraint condition; the first sub-constraint condition includes: for any pair of first matching users and group leaders with successful matching, the constraint feature value corresponding to the first matching user is not equal to the constraint feature value of the group leader; the second sub-constraint condition includes: for any one of the group leaders in the set of group leader users, the number of first matching users with successful matching of the group leader meets a first quantity, where the first quantity is one-half of the preset number of people in the group, and the number of people in the group is an even number; the third sub-constraint condition includes: for any one of the first matching users in the first set of matching users, there is exactly one group leader with successful matching with the any one of the first matching users; the fourth sub-constraint condition includes: the function value of the preset objective function meets the maximum value.
[0107] In one embodiment, the second constraint condition includes a fifth sub-constraint condition, a sixth sub-constraint condition, a seventh sub-constraint condition, and an eighth sub-constraint condition; the fifth sub-constraint condition is that for any group of successfully matched groups to be assigned and the third matched user, the constraint feature value of the third matched user is equal to the constraint feature value of the group leader of the group to be assigned; the sixth sub-constraint condition is that the number of third matched users successfully matched by any group to be assigned meets a second quantity, where the second quantity plus one is equal to one-half of the preset number of group members, and the number of group members is an even number; the seventh sub-constraint condition is that for any third matched user in the third matched user set, there is exactly one group to be assigned that is successfully matched with the any third matched user; the eighth sub-constraint condition is that the function value of the preset objective function meets the maximum value.
[0108] In one embodiment, the objective function includes the sum of the first cost corresponding to the first matching degree matrix and the second cost corresponding to the second matching degree matrix; the first cost includes the sum of the matrix elements of the first matching degree matrix; the second cost includes the sum of the matrix elements of the second matching degree matrix.
[0109] In one embodiment, for calculating the second matching degree matrix of the multiple groups to be assigned and the third matched user set, the one or more programs are mainly used to execute instructions for the following steps: extracting multiple first group member sets corresponding to the multiple groups to be assigned; calculating multiple matching degree row matrices of each of the multiple first group member sets and the third matched user set; and constructing the second matching degree matrix based on the multiple matching degree row matrices.
[0110] In one embodiment, for calculating the multiple matching degree row matrices of each of the multiple first group member sets and the third matched user set, the one or more programs are mainly used to execute instructions for the following steps: for each of the multiple first group member sets, obtaining at least one target first group member of the first group member set; calculating at least one target row matrix of the at least one target first group member and the third matched user set; and performing a matrix addition operation on the at least one target row matrix to obtain the matching degree row matrix of the first group member set and the third matched user set.
[0111] In one embodiment, after splitting the first matching user set based on the first linear matrix to obtain a second matching user set and a third matching user set, the one or more programs are further configured to execute instructions for the following steps: determining whether the third matching user set is an empty set; if the third matching user set is an empty set, performing a grouping operation on the second matching user set based on the first linear matrix and the multiple group leaders to obtain the multiple groups; if the third matching user set is a non-empty set, performing an operation of calculating a second matching degree matrix between the multiple to-be-allocated groups and the third matching user set.
[0112] The above mainly introduces the solution of the embodiment of the present application from the perspective of the execution process on the method side. It can be understood that in order for the electronic device to implement the above functions, it includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed in this article, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the way of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0113] The embodiments of the present application can divide the functional units of the electronic device according to the above method examples. For example, each functional unit can be divided corresponding to each function, or two or more functions can be integrated into one control unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit. It should be noted that the division of units in the embodiments of the present application is illustrative, only a logical function division, and there may be other division methods in actual implementation.
[0114] Please refer to Figure 5 , Figure 5 FIG. is a schematic structural diagram of a recommended group generation device disclosed in an embodiment of the present application, including: an acquisition unit 501, a first calculation unit 502, a first group unit 503, a second calculation unit 504, a second group unit 505, and a pulling unit 506, where:
[0115] The acquisition unit 501 is configured to receive a matching user set, randomly select multiple users from the matching user set as multiple group leaders, construct a group leader user set based on the multiple group leaders, and construct a first matching user set based on the matching user set and the group leader user set;
[0116] The first computing unit 502 is configured to perform a matching degree calculation for the group leader user set and the first matching user set, obtain a first matching degree matrix, construct a first constraint condition, and perform a 0-1 linear programming operation on the first matching degree matrix to obtain a first linear matrix;
[0117] The first grouping unit 503 is configured to split the first matching user set based on the first linear matrix to obtain a second matching user set and a third matching user set, and perform a grouping operation on the second matching user set based on the first linear matrix and the multiple group leaders to obtain multiple groups to be assigned;
[0118] The second computing unit 504 is configured to perform the matching degree calculation for the multiple groups to be assigned and the third matching user set, obtain a second matching degree matrix, construct a second constraint condition, and perform a 0-1 linear programming operation on the second matching degree matrix to obtain a second linear matrix;
[0119] The second grouping unit 505 is configured to perform the grouping operation on the third matching user set based on the second linear matrix and the multiple groups to be assigned to obtain multiple groups corresponding to the matching user set;
[0120] The pulling unit 506 is configured to respectively pull the matching users corresponding to the multiple groups to generate multiple recommended groups.
[0121] It can be seen that in the embodiment of the present application, the server receives a set of matching users, randomly selects multiple users from the set of matching users as multiple group leaders, constructs a set of group leader users based on the multiple group leaders, and constructs a first set of matching users based on the set of matching users and the set of group leader users; performs a matching degree calculation on the set of group leader users and the first set of matching users to obtain a first matching degree matrix, constructs a first constraint condition to perform a 0-1 linear programming operation on the first matching degree matrix to obtain a first linear matrix; splits the first set of matching users based on the first linear matrix to obtain a second set of matching users and a third set of matching users, performs a group division operation on the second set of matching users based on the first linear matrix and the multiple group leaders to obtain multiple groups to be assigned; performs the matching degree calculation on the multiple groups to be assigned and the third set of matching users to obtain a second matching degree matrix, constructs a second constraint condition to perform a 0-1 linear programming operation on the second matching degree matrix to obtain a second linear matrix; performs the group division operation on the third set of matching users based on the second linear matrix and the multiple groups to be assigned to obtain multiple groups corresponding to the set of matching users; respectively pulls the matching users corresponding to the multiple groups to generate multiple recommended groups. In this way, the first matching degree matrix and the second matching degree matrix of the users in the set of matching users can be calculated, so as to calculate the matching degree between the users in the set of matching users, and then the first constraint condition and the second constraint condition are constructed to perform a linear programming operation on the first matching degree matrix and the second matching degree matrix, so as to obtain an optimal group division scheme that can make the overall matching degree reach the maximum value. Finally, multiple recommended groups are pulled based on the group division scheme, and the recommended groups are pulled based on the matching degree, which is beneficial to improving the recommendation success rate and thus beneficial to improving the user experience.
[0122] In one of the embodiments, the first constraint condition includes a first sub-constraint condition, a second sub-constraint condition, a third sub-constraint condition, and a fourth sub-constraint condition; the first sub-constraint condition includes: for any pair of first matching users and group leaders with successful matching, the constraint feature value corresponding to the first matching user is not equal to the constraint feature value of the group leader; the second sub-constraint condition includes: for any one of the group leader users in the set of group leader users, the first matching users with successful matching of the group leader satisfy a first quantity, where the first quantity is one-half of the preset number of people in the group, and the number of people in the group is an even number; the third sub-constraint condition includes: for any one of the first matching users in the first set of matching users, there is exactly one group leader with successful matching with the any one of the first matching users; the fourth sub-constraint condition includes: the function value of the preset objective function satisfies the maximum value.
[0123] In one embodiment, the second constraint condition includes a fifth sub-constraint condition, a sixth sub-constraint condition, a seventh sub-constraint condition, and an eighth sub-constraint condition; the fifth sub-constraint condition is that for any set of successfully matched groups to be assigned and the third matched user, the constraint feature value of the third matched user is equal to the constraint feature value of the group leader of the group to be assigned; the sixth sub-constraint condition is that the third matched users successfully matched by any group to be assigned satisfy a second quantity, where the second quantity plus one is equal to one-half of the preset number of group members, and the number of group members is an even number; the seventh sub-constraint condition is that for any third matched user in the third matched user set, there is one and only one group to be assigned that is successfully matched with the third matched user; the eighth sub-constraint condition is that the function value of the preset objective function satisfies the maximum value.
[0124] In one embodiment, the objective function includes the sum of the first cost corresponding to the first matching degree matrix and the second cost corresponding to the second matching degree matrix; the first cost includes the sum of the matrix elements of the first matching degree matrix; the second cost includes the sum of the matrix elements of the second matching degree matrix.
[0125] In one embodiment, in calculating the second matching degree matrix of the multiple groups to be assigned and the third matched user set, the second calculation unit 505 is specifically configured to: extract multiple first group member sets corresponding to the multiple groups to be assigned; calculate multiple matching degree row matrices of each of the multiple first group member sets and the third matched user set; and form the second matching degree matrix based on the multiple matching degree row matrices.
[0126] In one embodiment, in calculating the multiple matching degree row matrices of each of the multiple first group member sets and the third matched user set, the second calculation unit 505 is specifically configured to: for each of the multiple first group member sets, obtain at least one target first group member of the first group member set; calculate at least one target row matrix of the at least one target first group member and the third matched user set; and perform a matrix addition operation on the at least one target row matrix to obtain the matching degree row matrix of the first group member set and the third matched user set.
[0127] In one of the embodiments, after splitting the first matching user set based on the first linear matrix to obtain a second matching user set and a third matching user set, the first grouping unit 503 is further configured to: determine whether the third matching user set is an empty set; if the third matching user set is an empty set, then perform the grouping operation on the second matching user set based on the first linear matrix and the multiple group leaders to obtain the multiple groups; if the third matching user set is a non-empty set, then perform the operation of calculating the second matching degree matrix between the multiple groups to be assigned and the third matching user set.
[0128] An embodiment of the present application further provides a computer storage medium, where the computer storage medium stores a computer program for electronic data exchange, and the computer program enables a computer to execute some or all of the steps of any of the methods described in the above method embodiments. The above computer includes a server.
[0129] An embodiment of the present application further provides a computer program product. The computer program product includes a non-transitory computer-readable storage medium storing a computer program. The computer program is operable to enable a computer to execute some or all of the steps of any of the methods described in the above method embodiments. The computer program product may be a software installation package, and the above computer includes a server.
[0130] It should be noted that, for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present application is not limited by the described action sequence, because according to the present application, certain steps may be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present application.
[0131] In the above embodiments, the descriptions of the various embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
[0132] In several embodiments provided by the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the above division of units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection may be through some interfaces. The indirect coupling or communication connection of the device or unit can be in an electrical or other form.
[0133] The units described above as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0134] In addition, in each embodiment of the present application, the various functional units may be integrated in a processing unit, may exist separately as individual physical units, or two or more units may be integrated in one unit. The above integrated units may be implemented in the form of hardware or in the form of software functional units.
[0135] If the above integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the above methods in each embodiment of the present application. The aforementioned memory includes: USB flash drives, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), mobile hard disks, magnetic disks, or optical discs, etc., which can store program codes.
[0136] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing relevant hardware through a program. This program can be stored in a computer-readable memory. The memory can include: flash drives, read-only memories (abbreviation: ROM), random access memories (abbreviation: RAM), magnetic disks, or optical discs, etc.
[0137] The above has introduced the embodiments of the present application in detail. Specific examples are used in this article to elaborate on the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those of ordinary skill in the art, according to the idea of the present application, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be construed as a limitation to the present application.
Claims
1. A method for generating a recommended group, characterized in that Including: Receiving a set of matching users, randomly selecting multiple users from the set of matching users as multiple group leaders, constructing a set of group leader users based on the multiple group leaders, and constructing a first set of matching users based on the set of matching users and the set of group leader users; Performing a matching degree calculation on the set of group leader users and the first set of matching users to obtain a first matching degree matrix, constructing a first constraint condition, and performing a 0-1 linear programming operation on the first matching degree matrix to obtain a first linear matrix; Splitting the first set of matching users based on the first linear matrix to obtain a second set of matching users and a third set of matching users. Among them, based on the first linear matrix, determining multiple first matching users who have successfully matched in the first set of matching users, and the multiple successfully matched first matching users constitute the second set of matching users; based on the first linear matrix, determining multiple first matching users who have failed to match in the first set of matching users, and the multiple first matching users who have failed to match constitute the third set of matching users; Performing a group division operation on the second set of matching users based on the first linear matrix and the multiple group leaders to obtain multiple groups to be assigned; Performing the matching degree calculation on the multiple groups to be assigned and the third set of matching users to obtain a second matching degree matrix, constructing a second constraint condition, and performing a 0-1 linear programming operation on the second matching degree matrix to obtain a second linear matrix; Performing the group division operation on the third set of matching users based on the second linear matrix and the multiple groups to be assigned to obtain multiple groups corresponding to the set of matching users; Pulling the matching users corresponding to the multiple groups respectively to generate multiple recommended groups.
2. The method according to claim 1, wherein The first constraint condition includes a first sub-constraint condition, a second sub-constraint condition, a third sub-constraint condition, and a fourth sub-constraint condition; The first sub-constraint condition includes: for any pair of first matching users and group leaders with successful matching, the constraint eigenvalue corresponding to the first matching user is not equal to the constraint eigenvalue of the group leader; The second sub-constraint condition includes: for any one of the group leader users in the set of group leader users, the first matching users with successful matching of the group leader satisfy a first quantity, where the first quantity is one-half of the preset number of people in the group, and the number of people in the group is an even number; The third sub-constraint condition includes: for any one of the first matching users in the first set of matching users, there is exactly one group leader who has successfully matched with the any one of the first matching users; The fourth sub-constraint condition includes: the function value of the preset objective function satisfies the maximum value.
3. The method according to claim 1, characterized in that, The second constraint condition includes a fifth sub-constraint condition, a sixth sub-constraint condition, a seventh sub-constraint condition, and an eighth sub-constraint condition; The fifth sub-constraint condition is: for any group to be assigned and the third set of matching users with successful matching, the constraint eigenvalue of the third set of matching users is equal to the constraint eigenvalue of the group leader of the group to be assigned; The sixth sub-constraint is that the third matching users successfully matched by any one of the to-be-allocated groups meet a second quantity, where the second quantity plus one is equal to half of the preset number of people in the group, and the number of people in the group is an even number; The seventh sub-constraint is that for any one of the third matching users in the third matching user set, there is one and only one to-be-allocated group that is successfully matched with the any one of the third matching users; The eighth sub-constraint is that the function value of the preset objective function meets the maximum value.
4. The method according to any one of claims 2 or 3, characterized in that, The objective function includes the sum of the first cost corresponding to the first matching degree matrix and the second cost corresponding to the second matching degree matrix; The first cost includes the sum of the matrix elements of the first matching degree matrix; The second cost includes the sum of the matrix elements of the second matching degree matrix.
5. The method according to claim 1, wherein The calculating the second matching degree matrix of the multiple to-be-allocated groups and the third matching user set includes: extracting multiple first group member sets corresponding to the multiple to-be-allocated groups; calculating multiple matching degree row matrices of each of the multiple first group member sets and the third matching user set; constituting the second matching degree matrix based on the multiple matching degree row matrices.
6. The method according to claim 5, characterized in that, The calculating the multiple matching degree row matrices of each of the multiple first group member sets and the third matching user set includes: for each of the multiple first group member sets, obtaining at least one target first group member of the first group member set; calculating at least one target row matrix of the at least one target first group member and the third matching user set; performing a matrix addition operation on the at least one target row matrix to obtain a matching degree row matrix of the first group member set and the third matching user set.
7. The method according to claim 1, characterized in that, After splitting the first matching user set based on the first linear matrix to obtain a second matching user set and a third matching user set, it further includes: judging whether the third matching user set is an empty set; if the third matching user set is an empty set, then performing the group operation on the second matching user set based on the first linear matrix and the multiple group leaders to obtain the multiple groups; if the third matching user set is a non-empty set, then performing the operation of calculating the second matching degree matrix of the multiple to-be-allocated groups and the third matching user set.
8. A recommended group generation device, characterized in that, It includes: an obtaining unit, configured to receive a matching user set, randomly select multiple users from the matching user set as multiple group leaders, construct a group leader user set based on the multiple group leaders, and construct a first matching user set based on the matching user set and the group leader user set; a first calculation unit, configured to perform a matching degree calculation on the group leader user set and the first matching user set to obtain a first matching degree matrix, construct a first constraint condition, and perform a 0-1 linear programming operation on the first matching degree matrix to obtain a first linear matrix; The first grouping unit is configured to split the first set of matching users based on the first linear matrix to obtain a second set of matching users and a third set of matching users. Among them, based on the first linear matrix, multiple first matching users who have successfully matched in the first set of matching users are determined, and the multiple successfully matched first matching users constitute the second set of matching users; based on the first linear matrix, multiple first matching users who have failed to match in the first set of matching users are determined, and the multiple first matching users who have failed to match constitute the third set of matching users. A grouping operation is performed on the second set of matching users based on the first linear matrix and the multiple group leaders to obtain multiple groups to be assigned; The second calculation unit is configured to perform the matching degree calculation on the multiple groups to be assigned and the third set of matching users to obtain a second matching degree matrix, and construct a second constraint condition to perform a 0-1 linear programming operation on the second matching degree matrix to obtain a second linear matrix; The second grouping unit is configured to perform the grouping operation on the third set of matching users based on the second linear matrix and the multiple groups to be assigned to obtain multiple groups corresponding to the set of matching users; The pulling unit is configured to pull the matching users corresponding to the multiple groups respectively to generate multiple recommended groups.
9. A server, characterized in that, It includes a processor, a memory, a communication interface, and one or more programs. The one or more programs are stored in the memory and are configured to be executed by the processor. The programs include instructions for performing the steps in the method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method for group role distribution problem with conflict distribution object
CN107067098A
User group recommendation method and device, memory medium and server
CN107947951A