Disclosure of Invention
The invention provides a social platform user influence calculation method and device, which are used for solving the technical problem of PR value loss caused by the fact that the number of directed edges is used as a calculation basis and PR values are averagely distributed to an outgoing page in the prior art.
The invention provides a social platform user influence calculation method, which comprises the following steps:
s1: acquiring fan relation list data, message forwarding relation list data and message comment relation list data of a platform user in a scrapy distributed crawler mode;
s2: respectively counting the forwarding number of the messages issued by each second user to the first user, the message forwarding total amount of each second user and the number of the users forwarded by each second user according to the message forwarding relation list data, obtaining the forwarding influence regulating coefficient of each second user to the first user through calculation, and obtaining the forwarding influence of the first user through calculation of a forwarding influence calculating formula according to the forwarding influence regulating coefficient of each second user to the first user and the obtained forwarding influences of all the second users;
s3: according to the message comment relation list data, respectively counting the number of comments of each third user on the message issued by the first user, the total number of message comments of each third user and the number of users commented by each third user, obtaining a comment influence adjusting coefficient of each third user on the first user through calculation, and according to the comment influence adjusting coefficient of each third user on the first user and the obtained comment influences of all third users, obtaining the comment influence of the first user through calculation of a comment influence calculation formula;
s4: counting vermicelli influence data of all vermicelli users of the first user according to the vermicelli relation list data of the platform user, and calculating to obtain the vermicelli influence of the first user through a vermicelli influence calculation formula;
s5: and obtaining the comprehensive influence data of the first user through a user comprehensive influence calculation formula according to the forwarding influence, the comment influence and the fan influence of the first user.
Preferably, step S2 specifically includes:
s21: respectively counting the forwarding number of the messages issued by each second user to the first user, the message forwarding total amount of each second user and the number of the users forwarded by each second user according to the message forwarding relation list data, obtaining the forwarding influence adjusting coefficient of each second user to the first user through calculation, and obtaining the forwarding influence of the first user through a forwarding influence calculation formula according to the forwarding influence adjusting coefficient of each second user to the first user and the obtained forwarding influences of all the second users, wherein the forwarding influence calculation formula specifically comprises the following steps:
wherein, R _ Rank represents the forwarding influence of the user, k represents the kth second user, T represents the second user set forwarding the first user i, and QR represents the forwarding capacity of the userkRepresenting the total number of users, r, who have forwarded the message by the second user kikIndicating that the second user k forwarded the total number of messages of the first user i, RkRepresenting the total number of messages forwarded by the second user k, q representing the damping coefficient, and N representing the total number of platform users.
Preferably, step S3 specifically includes:
s31: according to the message comment relation list data, respectively counting the comment quantity of each third user on the message issued by the first user, the message comment total quantity of each third user and the user quantity of each third user comment, obtaining a comment influence regulating coefficient of each third user on the first user through calculation, and according to the comment influence regulating coefficient of each third user on the first user and the obtained comment influences of all third users, calculating the comment influence of the first user through a comment influence calculation formula, wherein the comment influence calculation formula specifically comprises:
wherein C _ Rank represents the comment influence of the user, e represents the e-th third user, M represents the third user set commenting the first user i, and QCeRepresenting the total number of users having reviewed the message by the third user e, cieIndicating that the third user e has commented on the number of first user i messages, CeRepresenting the total number of messages commented by the third user e, q representing the damping coefficient, and N representing the total number of platform users.
Preferably, step S4 specifically includes:
s41: counting vermicelli influence data of all vermicelli users of the first user according to the vermicelli relation list data of the platform user, and calculating to obtain the vermicelli influence of the first user through a vermicelli influence calculation formula, wherein the vermicelli influence calculation formula specifically comprises the following steps:
wherein F _ Rank represents the fan influence of users, G represents a fan relation set among the users, q represents a damping coefficient, N represents the total number of platform users, and L represents the number of user fans.
Preferably, step S5 specifically includes:
s51: according to the forwarding influence, the comment influence and the fan influence of the first user, obtaining comprehensive influence data of the first user through a user comprehensive influence calculation formula, wherein the user comprehensive influence calculation formula specifically comprises the following steps:
Rank(i)=α*F_Rank(i)+β*R_Rank(i)+γ*C_Rank(i)
wherein Rank represents the comprehensive influence of the user, alpha represents the weight coefficient of the fan influence, beta represents the weight coefficient of the forwarding influence, and gamma represents the weight coefficient of the comment influence.
The invention provides a social platform user influence computing device, which comprises:
the system comprises a data acquisition unit, a message forwarding unit and a message comment relation unit, wherein the data acquisition unit is used for acquiring fan relation list data, message forwarding relation list data and message comment relation list data of a platform user in a script distributed crawler mode;
the forwarding influence calculation unit is used for respectively counting the forwarding number of the messages issued by each second user to the first user, the message forwarding total amount of each second user and the number of the users forwarded by each second user according to the message forwarding relation list data, obtaining the forwarding influence adjusting coefficient of each second user to the first user through calculation, and obtaining the forwarding influence of the first user through calculation of a forwarding influence calculation formula according to the forwarding influence adjusting coefficient of each second user to the first user and the obtained forwarding influences of all the second users;
the comment influence calculation unit is used for respectively counting the number of comments of each third user on the message issued by the first user, the total number of the message comments of each third user and the number of users commented by each third user according to the message comment relation list data, obtaining a comment influence adjustment coefficient of each third user on the first user through calculation, and obtaining the comment influence of the first user through calculation of a comment influence calculation formula according to the comment influence adjustment coefficient of each third user on the first user and the obtained comment influences of all third users;
the fan influence calculation unit is used for counting fan influence data of all fan users of the first user according to the fan relation list data of the platform users, and calculating the fan influence of the first user through a fan influence calculation formula;
and the comprehensive influence calculating unit is used for obtaining the comprehensive influence data of the first user through the user comprehensive influence calculating formula according to the forwarding influence, the comment influence and the fan influence of the first user.
Preferably, the forwarding impact calculation unit is specifically configured to:
respectively counting the forwarding number of the messages issued by each second user to the first user, the message forwarding total amount of each second user and the number of the users forwarded by each second user according to the message forwarding relation list data, obtaining the forwarding influence adjusting coefficient of each second user to the first user through calculation, and obtaining the forwarding influence of the first user through a forwarding influence calculation formula according to the forwarding influence adjusting coefficient of each second user to the first user and the obtained forwarding influences of all the second users, wherein the forwarding influence calculation formula specifically comprises the following steps:
wherein, R _ Rank represents the forwarding influence of the user, k represents the kth second user, T represents the second user set forwarding the first user i, and WikIndicating the forwarding-influence adjustment factor, QRkRepresenting the total number of users, r, who have forwarded the message by the second user kikIndicating that the second user k forwarded the total number of messages of the first user i, RkRepresenting the total number of messages forwarded by the second user k, q representing the damping coefficient, and N representing the total number of platform users.
Preferably, the comment influence calculation unit is specifically configured to:
according to the message comment relation list data, respectively counting the comment quantity of each third user on the message issued by the first user, the message comment total quantity of each third user and the user quantity of each third user comment, obtaining a comment influence regulating coefficient of each third user on the first user through calculation, and according to the comment influence regulating coefficient of each third user on the first user and the obtained comment influences of all third users, calculating the comment influence of the first user through a comment influence calculation formula, wherein the comment influence calculation formula specifically comprises:
wherein C _ Rank represents influence of user message comment, e represents the e-th third user, M represents a third user set commenting the first user i, and U representsieExpressing the comment influence adjustment coefficient, QCeRepresenting the total number of users having reviewed the message by the third user e, cieIndicating that the third user e has commented on the number of first user i messages, CeRepresenting the total number of messages commented by the third user e, q representing the damping coefficient, and N representing the total number of platform users.
Preferably, the fan force calculation unit is specifically configured to:
counting vermicelli influence data of all vermicelli users of the first user according to the vermicelli relation list data of the platform user, and calculating to obtain the vermicelli influence of the first user through a vermicelli influence calculation formula, wherein the vermicelli influence calculation formula specifically comprises the following steps:
wherein F _ Rank represents the fan influence of users, G represents a fan relation set among the users, q represents a damping coefficient, N represents the total number of platform users, and L represents the number of user fans.
Preferably, the comprehensive influence calculation unit is specifically configured to:
according to the forwarding influence, the comment influence and the fan influence of the first user, obtaining comprehensive influence data of the first user through a user comprehensive influence calculation formula, wherein the user comprehensive influence calculation formula specifically comprises the following steps:
Rank(i)=α*F_Rank(i)+β*R_Rank(i)+γ*C_Rank(i)
wherein Rank represents the comprehensive influence of the user, alpha represents the weight coefficient of the fan influence, beta represents the weight coefficient of the forwarding influence, and gamma represents the weight coefficient of the comment influence.
According to the technical scheme, the invention has the following advantages:
the social platform user influence calculation method provided by the invention compensates the forwarding influence and the comment influence calculated according to the message forwarding relation and the message comment relation among the users through the forwarding influence adjustment coefficient calculated according to the actual forwarding quantity of the users and the comment influence adjustment coefficient calculated according to the actual comment quantity, and avoids the technical problem that the traditional social platform user comprehensive influence calculation method takes the number of directed edges as a calculation basis and allocates PR values to the linked pages and adopts a mean value allocation mode to cause loss of PR values.
Detailed Description
The embodiment of the invention provides a social platform user influence calculation method and device, which are used for solving the technical problem of PR value loss caused by the fact that the number of directed edges is used as a calculation basis and PR values are evenly distributed on an outgoing page in the prior art.
In order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the embodiments described below are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 3 and fig. 4, an embodiment of the present invention provides a social platform user influence calculation method, including:
101. acquiring fan relation list data, message forwarding relation list data and message comment relation list data of a platform user in a scrapy distributed crawler mode;
102. respectively counting the forwarding number of the messages issued by each second user to the first user, the message forwarding total amount of each second user and the number of the users forwarded by each second user according to the message forwarding relation list data, obtaining the forwarding influence regulating coefficient of each second user to the first user through calculation, and obtaining the forwarding influence of the first user through calculation of a forwarding influence calculating formula according to the forwarding influence regulating coefficient of each second user to the first user and the obtained forwarding influences of all the second users;
it should be noted that, the forwarding impact calculation formula is specifically:
wherein, R _ Rank represents the forwarding influence of the user, k represents the kth second user, T represents the second user set forwarding the first user i, and QR represents the forwarding capacity of the userkRepresenting the total number of users, r, who have forwarded the message by the second user kikIndicating that the second user k forwarded the total number of messages of the first user i, RkRepresenting the total number of messages forwarded by a second user k, q represents a damping coefficient, and N represents the total number of platform users;
the first user represents any user of the platform, the second user represents one of the users who forward the message issued by the first user, for example, the user a forwards the message issued by the user D, at this time, the user D is the first user, and the user a is the second user.
103. According to the message comment relation list data, respectively counting the number of comments of each third user on the message issued by the first user, the total number of message comments of each third user and the number of users commented by each third user, obtaining a comment influence adjusting coefficient of each third user on the first user through calculation, and according to the comment influence adjusting coefficient of each third user on the first user and the obtained comment influences of all third users, obtaining the comment influence of the first user through calculation of a comment influence calculation formula;
it should be noted that the comment influence calculation formula specifically includes:
wherein, C _ Rank represents the influence of user message comment, e represents the e-th third user, M represents the third user set commenting the first user i, and QCeRepresenting the total number of users having reviewed the message by the third user e, cieIndicating that the third user e has commented on the number of first user i messages, CeThe total number of the messages commented by the third user e is represented, q represents a damping coefficient, the general value q is 0.85, and N represents the total number of the platform users;
the first user represents any user of the platform, the third user represents one of the users who comment on the message issued by the first user, for example, the user B comments on the message of the user D, at this time, the user D is the first user, and the user B is the third user.
104. Counting vermicelli influence data of all vermicelli users of the first user according to the vermicelli relation list data of the platform user, and calculating to obtain the vermicelli influence of the first user through a vermicelli influence calculation formula;
it should be noted that the calculation formula of the vermicelli influence is specifically as follows:
wherein F _ Rank represents the fan influence of users, G represents a fan relation set among the users, q represents a damping coefficient, N represents the total number of platform users, and L represents the number of user fans.
105. And obtaining the comprehensive influence data of the first user through a user comprehensive influence calculation formula according to the forwarding influence, the comment influence and the fan influence of the first user.
It should be noted that, the user comprehensive influence calculation formula is specifically:
Rank(i)=α*F_Rank(i)+β*R_Rank(i)+γ*C_Rank(i)
where Rank represents the integrated influence of the user, α represents a weight coefficient of fan influence, β represents a weight coefficient of relay influence, γ represents a weight coefficient of review influence, and α + β + γ is 1.
To better illustrate the technical solution of the present embodiment, the following description is made with reference to fig. 3 and 4.
Taking message forwarding as an example, in combination with fig. 3, a user a forwards two microblogs of a user D, but because in the calculation process of the conventional PageRank algorithm, when a directed graph as in fig. 4 is constructed, edges with the same direction cannot exist at the same time, in fig. 4, a broken line indicates a lost edge, and the algorithm is to add a value that the lost edge should be transmitted, so as to compensate for the loss of the PR value, and the specific calculation process is as follows:
with WDAFor example, the total number of messages that user A forwards user D in FIG. 3, i.e. the total number of edges that user A points to other user messages (here, there are 2 edges- - - - - - [ r ]) is calculatedDA2), the remeasuring user a forwards several users' messages (here 3 solid lines, three users: user B, user C, user D- - -QRA3) and calculates how many messages user a has forwarded in total (here including the dotted line, for a total of 4 lines-R)A4), W can be calculatedDAW can be calculated by using 3/2 as the same as 2 × 3/4BA1 × 3/4 ═ 3/4, similarly WCA=1*3/4=3/4;
Then, according to the forwarding influence calculation formula, the sum of forwarding influence variables of each user who has forwarded the message of the user D is calculated
And finally, obtaining the forwarding influence of the user D through a complete forwarding influence calculation formula, and obtaining the comment influence and the fan influence of the user D in the same way.
According to the social platform user influence calculation method provided by the embodiment of the invention, the PR value calculated according to the message forwarding relation or the message comment relation among the users is compensated through the forwarding influence adjustment coefficient calculated according to the actual forwarding amount of the users and the comment influence adjustment coefficient calculated according to the actual comment amount, so that the technical problem that the traditional social platform user comprehensive influence calculation method takes the number of directed edges as a calculation basis and adopts a mean value distribution mode to distribute the PR value to the linked pages to cause loss of the PR value is solved.
The above is a detailed description of an embodiment of a social platform user influence calculation method provided by the present invention, and the following is a detailed description of an embodiment of a social platform user influence calculation apparatus provided by the present invention.
Referring to fig. 2, the present invention provides a social platform user influence computing device, including:
the data acquisition unit 201 is configured to acquire platform user fan relation list data, message forwarding relation list data, and message comment relation list data in a scrapy distributed crawler manner;
a forwarding influence calculation unit 202, configured to separately calculate, according to the message forwarding relationship list data, the forwarding number of messages issued by each second user to the first user, the message forwarding total amount of each second user, and the number of users forwarded by each second user, obtain, through calculation, a forwarding influence adjustment coefficient of each second user to the first user, and calculate, according to the forwarding influence adjustment coefficient of each second user to the first user and the obtained forwarding influences of all second users, the forwarding influence of the first user through a forwarding influence calculation formula;
the comment influence calculation unit 203 is configured to count the number of comments of each third user on the message posted by the first user, the total number of the message comments of each third user, and the number of users commented by each third user according to the message comment relationship list data, obtain a comment influence adjustment coefficient of each third user on the first user through calculation, and obtain a comment influence of the first user through calculation of a comment influence calculation formula according to the comment influence adjustment coefficient of each third user on the first user and the obtained comment influences of all third users;
the fan influence calculation unit 204 is used for counting fan influence data of all fan users of the first user according to the fan relation list data of the platform users, and calculating the fan influence of the first user through a fan influence calculation formula;
and the comprehensive influence calculating unit 205 is configured to obtain comprehensive influence data of the first user according to the forwarding influence, the comment influence and the fan influence of the first user through the user comprehensive influence calculating formula.
Further, the forwarding impact calculation unit 202 is specifically configured to:
respectively counting the forwarding number of the messages issued by each second user to the first user, the message forwarding total amount of each second user and the number of the users forwarded by each second user according to the message forwarding relation list data, obtaining the forwarding influence adjusting coefficient of each second user to the first user through calculation, and obtaining the forwarding influence of the first user through a forwarding influence calculation formula according to the forwarding influence adjusting coefficient of each second user to the first user and the obtained forwarding influences of all the second users, wherein the forwarding influence calculation formula specifically comprises the following steps:
wherein, R _ Rank represents the forwarding influence of the user, k represents the kth second user, T represents the second user set forwarding the first user i, and WikIndicating the forwarding-influence adjustment factor, QRkRepresenting the total number of users, r, who have forwarded the message by the second user kikIndicating that the second user k forwarded the total number of messages of the first user i, RkRepresenting the total number of messages forwarded by the second user k, q representing the damping coefficient, and N representing the total number of platform users.
Further, the comment influence calculation unit 203 is specifically configured to:
according to the message comment relation list data, respectively counting the comment quantity of each third user on the message issued by the first user, the message comment total quantity of each third user and the user quantity of each third user comment, obtaining a comment influence regulating coefficient of each third user on the first user through calculation, and according to the comment influence regulating coefficient of each third user on the first user and the obtained comment influences of all third users, calculating the comment influence of the first user through a comment influence calculation formula, wherein the comment influence calculation formula specifically comprises:
wherein C _ Rank represents influence of user message comment, e represents the e-th third user, M represents a third user set commenting the first user i, and U representsieExpressing the comment influence adjustment coefficient, QCeRepresenting the total number of users having reviewed the message by the third user e, cieIndicating that the third user e has commented on the number of first user i messages, CeRepresenting the total number of messages commented by the third user e, q representing the damping coefficient, and N representing the total number of platform users.
Further, the fan influence calculation unit 204 is specifically configured to:
counting vermicelli influence data of all vermicelli users of the first user according to the vermicelli relation list data of the platform user, and calculating to obtain the vermicelli influence of the first user through a vermicelli influence calculation formula, wherein the vermicelli influence calculation formula specifically comprises the following steps:
wherein F _ Rank represents the fan influence of users, G represents a fan relation set among the users, q represents a damping coefficient, N represents the total number of platform users, and L represents the number of user fans.
Further, the comprehensive influence calculating unit 205 is specifically configured to:
according to the forwarding influence, the comment influence and the fan influence of the first user, obtaining comprehensive influence data of the first user through a user comprehensive influence calculation formula, wherein the user comprehensive influence calculation formula specifically comprises the following steps:
Rank(i)=α*F_Rank(i)+β*R_Rank(i)+γ*C_Rank(i)
wherein Rank represents the comprehensive influence of the user, alpha represents the weight coefficient of the fan influence, beta represents the weight coefficient of the forwarding influence, and gamma represents the weight coefficient of the comment influence.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.