(19)
(11)EP 3 258 368 B1

(12)EUROPEAN PATENT SPECIFICATION

(45)Mention of the grant of the patent:
29.01.2020 Bulletin 2020/05

(21)Application number: 16758452.3

(22)Date of filing:  26.02.2016
(51)International Patent Classification (IPC): 
G06F 7/00(2006.01)
(86)International application number:
PCT/CN2016/074728
(87)International publication number:
WO 2016/138836 (09.09.2016 Gazette  2016/36)

(54)

SIMILARITY MEASUREMENT METHOD AND EQUIPMENT

ÄHNLICHKEITSMESSVERFAHREN UND VORRICHTUNG

PROCÉDÉ ET ÉQUIPEMENT DE MESURE DE SIMILARITÉ


(84)Designated Contracting States:
AL AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HR HU IE IS IT LI LT LU LV MC MK MT NL NO PL PT RO RS SE SI SK SM TR

(30)Priority: 03.03.2015 CN 201510093574

(43)Date of publication of application:
20.12.2017 Bulletin 2017/51

(73)Proprietor: Huawei Technologies Co., Ltd.
Longgang District Shenzhen, Guangdong 518129 (CN)

(72)Inventors:
  • LI, Zhenguo
    Shenzhen Guangdong 518129 (CN)
  • CHENG, Jiefeng
    Shenzhen Guangdong 518129 (CN)
  • FAN, Wei
    Shenzhen Guangdong 518129 (CN)

(74)Representative: Kreuz, Georg Maria 
Huawei Technologies Duesseldorf GmbH Riesstraße 25
80992 München
80992 München (DE)


(56)References cited: : 
CN-A- 101 894 123
JP-A- 2013 196 201
CN-A- 103 177 414
US-A1- 2009 262 664
  
  • TAKANORI MAEHARA ET AL: "Efficient SimRank computation via linearization", KNOWLEDGE DISCOVERY AND DATA MINING, 26 November 2014 (2014-11-26), pages 1426-1435, XP055417598, 2 Penn Plaza, Suite 701 New York NY 10121-0701 USA DOI: 10.1145/2623330.2623696 ISBN: 978-1-4503-2956-9
  • DMITRY LIZORKIN ET AL: "Accuracy estimate and optimization techniques for SimRank computation", VLDB JOURNAL, SPRINGER VERLAG, BERLIN, DE, vol. 19, no. 1, 1 February 2010 (2010-02-01), pages 45-66, XP058119438, ISSN: 1066-8888, DOI: 10.1007/S00778-009-0168-8
  • WEIREN YU ET AL: "A space and time efficient algorithm for SimRank computation", WORLD WIDE WEB ; INTERNET AND WEB INFORMATION SYSTEMS, KLUWER ACADEMIC PUBLISHERS, DO, vol. 15, no. 3, 7 December 2010 (2010-12-07), pages 327-353, XP035017587, ISSN: 1573-1413, DOI: 10.1007/S11280-010-0100-6
  • David Gleich ET AL: "Fast Parallel PageRank: A Linear System Approach", , 1 January 2004 (2004-01-01), XP055450186, Retrieved from the Internet: URL:http://citeseerx.ist.psu.edu/viewdoc/d ownload?doi=10.1.1.592.64&rep=rep1&type=pd f [retrieved on 2018-02-12]
  • MAEHARA, T. ET AL.: 'Efficient SimRank Computation via Linearization' vol. 1411, 26 November 2014, page 7729, XP055417598
  • WU, DANYU: 'the Comparison between Jacobi Iteration and Gauss-Seidel Iteration' JOURNAL OF ZHONGKAI UNIVERSITY OF AGRICULTURE AND TECHNOLOGY vol. 18, no. 3, 31 December 2005, pages 48 - 50, XP009500981
  
Note: Within nine months from the publication of the mention of the grant of the European patent, any person may give notice to the European Patent Office of opposition to the European patent granted. Notice of opposition shall be filed in a written reasoned statement. It shall not be deemed to have been filed until the opposition fee has been paid. (Art. 99(1) European Patent Convention).


Description

TECHNICAL FIELD



[0001] The present invention relates to the field of data processing, and more specifically, to a similarity measurement method and device.

BACKGROUND



[0002] Nowadays, in the era of big data Internet, large graphs and large networks, such as a social network, the Internet, e-commerce, and a communications network, are common representation manners of data and information. A graph-based application may include a search and a recommendation. The search may be, for example, a Google search engine. The recommendation may be, for example, a friend recommendation from Facebook (Facebook), a vocation recommendation from LinkedIn (LinkedIn), a film recommendation from Netflix (Netflix), product recommendations from Ebay (Ebay) and Amazon (Amazon), or a message recommendation from Twitter (Twitter). Generally, a search and a recommendation are both performed based on a similarity between nodes in a graph.

[0003] For example, a social network is an important platform for sharing information between friends. More friends indicate more frequent information sharing and communication. Therefore, an important function for social network maintenance is to carry out a friend recommendation according to a similarity between nodes.

[0004] For another example, in a churn analysis of Huawei, assuming that a customer A shifts from a service of China Unicom to a service of China Mobile, China Unicom needs to understand a customer most "similar" to the customer A, consider the customer as a customer that may potentially be churned, and focus on the customer.

[0005] A method for measuring a similarity between nodes is: collecting various attributes, such as age, occupation, income, and hobbies, of all nodes, and then measuring a similarity between the nodes according to similarities between the various attributes. However, in such a method, not only a large quantity of customer information needs to be collected, a high requirement is imposed on storage, but also such a method may involve personal privacy information of a customer.

[0006] Another method for effectively measuring a similarity between nodes is SimRank. Currently, SimRank has been widely applied to various scenarios, for example, a recommendation system, information search, link prediction, a citation network, and a student course network. However, in a SimRank-based similarity measurement method in the prior art, calculation is directly performed according to a definition. Consequently, time complexity and space complexity are high, and the method is not applicable to a large network.

[0007] XP55417598A: SimRank, by Jeh and Widom, proposes a computational technique, "SimRank linearization," for computing SimRank, which converts the SimRank problem to a linear equation problem.

SUMMARY



[0008] The present invention provides a similarity measurement method in which time complexity and space complexity are low and that is applicable to a large network.

[0009] According to a first aspect, a similarity measurement method is provided, including:

obtaining a directional relationship between every two of n nodes in a network, and determining a transition matrix according to the directional relationships, where a dimension of the transition matrix is n × n, and n is a positive integer greater than or equal to 2;

obtaining an attenuation factor, and calculating a constraint matrix according to the transition matrix and the attenuation factor, where the attenuation factor is an attenuation factor defined in a SimRank similarity method, and a dimension of the constraint matrix is n × n; wherein the constraint matrix is represented by A, the correction vector is represented by x, and the system of linear equations is represented by Ax = b, wherein

b is a vector whose each element is 1;

constructing a system of linear equations according to the constraint matrix, where a coefficient matrix of the system of linear equations is the constraint matrix, and a variable of the system of linear equations is a correction vector;

solving the system of linear equations by means of iteration by using a Jacobi method, and determining the correction vector, comprises:

calculating the correction vector by using

wherein

xi represents an ith element of the correction vector x, xj represents a jth element of the correction vector x, aij represents an element in an ith row and in a jth column of the constraint matrix A, aii represents an element in the ith row and in an ith column of the constraint matrix A, bi = 1, k represents a quantity of times of iteration of the Jacobi method, i, j =1,2,···, n, and k is a positive integer;

generating a diagonal correction matrix according to the correction vector, where a diagonal element of the diagonal correction matrix is a component of the correction vector, and a dimension of the diagonal correction matrix is n × n ; and

calculating similarities between the n nodes according to the transition matrix, the attenuation factor, and the diagonal correction matrix.



[0010] With reference to the first aspect, in a first possible implementation of the first aspect, the solving the system of linear equations by means of iteration by using a Jacobi method, and determining the correction vector includes:
solving the system of linear equations by means of iteration by using the Jacobi method, and determining a solution, which is obtained when a convergence condition is met, as the correction vector, or determining a solution, which is obtained when a preset maximum quantity of times of iteration is reached, as the correction vector.

[0011] With reference to the first aspect or the first possible implementations of the first aspect, in a second possible implementation of the first aspect, the attenuation factor is represented by c, the transition matrix is represented by P, the constraint matrix is represented by A, and the calculating a constraint matrix according to the transition matrix and the attenuation factor includes:

determining that an element of the constraint matrix A is aij = eiej + cPeiPej +···+ ctPtei•Piej, where

ei and ej are orthogonal unit vectors, and t is a preset positive integer.



[0012] With reference to any one of the first aspect or the possible implementations of the first aspect, in a third possible implementation of the first aspect, the correction vector is represented by x, the diagonal correction matrix is represented by D, and the generating a diagonal correction matrix according to the correction vector includes:

determining that an element Dij of the diagonal correction matrix D is:

where

Dij represents an element in an ith row and in a jth column of the diagonal correction matrix D, and xi represents the ith element of the correction vector x, where i,j =1,2,···,n.



[0013] With reference to any one of the first aspect or the possible implementations of the first aspect, in a fourth possible implementation of the first aspect, the attenuation factor is represented by c, the transition matrix is represented by P, the diagonal correction matrix is represented by D, the similarities between the nodes are represented by S, and the calculating similarities between the n nodes according to the transition matrix, the attenuation factor, and the diagonal correction matrix includes:

calculating the similarities between the n nodes according to the following formula:

where

T represents transposition, t is a preset positive integer, and an element sij that is in an ith row and in a jth column of a matrix represented by S represents a similarity between an ith node and a jth node.



[0014] With reference to any one of the first aspect or the possible implementations of the first aspect, in a fifth possible implementation of the first aspect, the obtaining a directional relationship between every two of n nodes in a network, and determining a transition matrix according to the directional relationships includes:

constructing a graph according to the directional relationship between every two of the n nodes in the network, where the n nodes compose n nodes in the graph, and the directional relationship composes a directed edge between the nodes in the graph; and

using a first-order transition matrix in a reversal graph of the graph as the transition matrix.



[0015] With reference to any one of the first aspect or the possible implementations of the first aspect, in an sixth possible implementation of the first aspect, the transition matrix is represented by P, and

where Pij represents an element in an ith row and in a jth column of the transition matrix P, In(j) represents a set of nodes that are all directed to a node j, and E represents a set of node groups in which there is a directional relationship between nodes in the node groups.

[0016] According to a second aspect, a similarity measurement device is provided, including:

an obtaining unit, configured to: obtain a directional relationship between every two of n nodes in a network, and obtain an attenuation factor, where the attenuation factor is an attenuation factor defined in a SimRank similarity method, and n is a positive integer greater than or equal to 2; and

a processing unit, configured to: determine a transition matrix according to the directional relationships obtained by the obtaining unit, and calculate a constraint matrix according to the transition matrix and the attenuation factor that is obtained by the obtaining unit, where a dimension of the transition matrix is n × n, and a dimension of the constraint matrix is n × n, wherein the constraint matrix is represented by A, the correction vector is represented by x, and the system of linear equations is represented by Ax = b, wherein

b is a vector whose each element is 1; where

the processing unit is further configured to construct a system of linear equations according to the constraint matrix, where a coefficient matrix of the system of linear equations is the constraint matrix, and a variable of the system of linear equations is a correction vector;

the processing unit is further configured to: solve the system of linear equations by means of iteration by using a Jacobi method, and determine the correction vector; wherein the processing unit (202) is specifically configured to:

calculate the correction vector by using

wherein

xi represents an ith element of the correction vector x, xj represents a jth element of the correction vector x, aij represents an element in an ith row and in a jth column of the constraint matrix A, aii represents an element in the ith row and in an ith column of the constraint matrix A, bi = 1, k represents a quantity of times of iteration of the Jacobi method, i,j=1,2,···,n, and k is a positive integer;

the processing unit is further configured to generate a diagonal correction matrix according to the correction vector, where a diagonal element of the diagonal correction matrix is a component of the correction vector, and a dimension of the diagonal correction matrix is n × n; and

the processing unit is further configured to calculate similarities between the n nodes according to the transition matrix, the diagonal correction matrix, and the attenuation factor that is obtained by the obtaining unit.



[0017] With reference to the second aspect, in a first possible implementation of the second aspect, the processing unit is specifically configured to:
solve the system of linear equations by means of iteration by using the Jacobi method, and determine a solution, which is obtained when a convergence condition is met, as the correction vector, or determine a solution, which is obtained when a preset maximum quantity of times of iteration is reached, as the correction vector.

[0018] With reference to the second aspect or the first possible implementations of the second aspect, in a second possible implementation of the second aspect, the attenuation factor is represented by c, the transition matrix is represented by P, the constraint matrix is represented by A, and the processing unit is specifically configured to:

determine that an element of the constraint matrix A is aij = eiej + cPei•Pej +···+ ctPteiPtej, where

where ei and ej are orthogonal unit vectors, and t is a preset positive integer.



[0019] With reference to any one of the second aspect or the possible implementations of the second aspect, in a third possible implementation of the second aspect, the correction vector is represented by x, the diagonal correction matrix is represented by D, and the processing unit is specifically configured to:

determine that an element Dij of the diagonal correction matrix D is:

where Dij represents an element in an ith row and in a jth column of the diagonal correction matrix D, and xi represents the ith element of the correction vector x, where i,j=1,2,···,n.



[0020] With reference to any one of the second aspect or the possible implementations of the second aspect, in a fourth possible implementation of the second aspect, the attenuation factor is represented by c, the transition matrix is represented by P, the diagonal correction matrix is represented by D, the similarities between the n nodes are represented by S, and the processing unit is specifically configured to:

calculate the similarities between the nodes according to the following formula:

where T represents transposition, t is a preset positive integer, and an element sij that is in an ith row and in a jth column of a matrix represented by S represents a similarity between an ith node and a jth node.



[0021] With reference to any one of the second aspect or the possible implementations of the second aspect, in a fifth possible implementation of the second aspect, the processing unit is specifically configured to:

construct a graph according to the directional relationship that is between every two of the n nodes in the network and that is obtained by the obtaining unit, where the n nodes compose n nodes in the graph, and the directional relationship composes a directed edge between the nodes in the graph; and

use a first-order transition matrix in a reversal graph of the graph as the transition matrix.



[0022] With reference to any one of the second aspect or the possible implementations of the second aspect, in an sixth possible implementation of the second aspect, the transition matrix is represented by P, and

where Pij represents an element in an ith row and in a jth column of the transition matrix P, In(j) represents a set of nodes that are all directed to a node j, and E represents a set of node groups in which there is a directional relationship between nodes in the node groups.

[0023] According to a third aspect, a similarity measurement device is provided, including:

a receiver, configured to: obtain a directional relationship between every two of n nodes in a network, and obtain an attenuation factor, where the attenuation factor is an attenuation factor defined in a SimRank similarity method, and n is a positive integer greater than or equal to 2; and

a processor, configured to: determine a transition matrix according to the directional relationships obtained by the receiver, and calculate a constraint matrix according to the transition matrix and the attenuation factor that is obtained by the receiver, where a dimension of the transition matrix is n × n, and a dimension of the constraint matrix is n × n, where

the processor is further configured to construct a system of linear equations according to the constraint matrix, where a coefficient matrix of the system of linear equations is the constraint matrix, and a variable of the system of linear equations is a correction vector;

the processor is further configured to: solve the system of linear equations by means of iteration by using a Jacobi method, and determine the correction vector;

the processor is further configured to generate a diagonal correction matrix according to the correction vector, where a diagonal element of the diagonal correction matrix is a component of the correction vector, and a dimension of the diagonal correction matrix is n × n ; and

the processor is further configured to calculate similarities between the n nodes according to the transition matrix, the diagonal correction matrix, and the attenuation factor that is obtained by the receiver.



[0024] With reference to the third aspect, in a first possible implementation of the third aspect, the processor is specifically configured to:
solve the system of linear equations by means of iteration by using the Jacobi method, and determine a solution, which is obtained when a convergence condition is met, as the correction vector, or determine a solution, which is obtained when a preset maximum quantity of times of iteration is reached, as the correction vector.

[0025] With reference to the third aspect or the first possible implementation of the third aspect, in a second possible implementation of the third aspect, the constraint matrix is represented by A, the correction vector is represented by x, and the system of linear equations is represented by Ax = b, where
b is a vector whose each element is 1.

[0026] With reference to the first possible implementation of the third aspect, in a third possible implementation of the third aspect, the processor is specifically configured to:

calculate the correction vector by using

where

xi represents an ith element of the correction vector x, xj represents a jth element of the correction vector x, aij represents an element in an ith row and in a jth column of the constraint matrix A, aii represents an element in the ith row and in an ith column of the constraint matrix A, bi = 1, k represents a quantity of times of iteration of the Jacobi method, i,j=1,2,···,n, and k is a positive integer.



[0027] With reference to any one of the third aspect or the possible implementations of the third aspect, in a fourth possible implementation of the third aspect, the attenuation factor is represented by c, the transition matrix is represented by P, the constraint matrix is represented by A, and the processor is specifically configured to:

determine that an element of the constraint matrix A is aij = ei•ej + cPei•Pej +···+ ctPteiPtej, where

ei and ej are orthogonal unit vectors, and t is a preset positive integer.



[0028] With reference to any one of the third aspect or the possible implementations of the third aspect, in a fifth possible implementation of the third aspect, the correction vector is represented by x, the diagonal correction matrix is represented by D, and the processor is specifically configured to:

determine that an element Dij of the diagonal correction matrix D is:

where

Dij represents an element in an ith row and in a jth column of the diagonal correction matrix D, and xi represents the ith element of the correction vector x, where i,j=1,2,···,n



[0029] With reference to any one of the third aspect or the possible implementations of the third aspect, in a sixth possible implementation of the third aspect, the attenuation factor is represented by c, the transition matrix is represented by P, the diagonal correction matrix is represented by D, the similarities between the n nodes are represented by S, and the processor is specifically configured to:

calculate the similarities between the nodes according to the following formula:

where

T represents transposition, t is a preset positive integer, and an element sij that is in an ith row and in a jth column of a matrix represented by S represents a similarity between an ith node and a jth node.



[0030] With reference to any one of the third aspect or the possible implementations of the third aspect, in a seventh possible implementation of the third aspect, the processor is specifically configured to:

construct a graph according to the obtained directional relationship that is between every two of the n nodes in the network, where the n nodes compose n nodes in the graph, and the directional relationship composes a directed edge between the nodes in the graph; and

use a first-order transition matrix in a reversal graph of the graph as the transition matrix.



[0031] With reference to any one of the third aspect or the possible implementations of the third aspect, in an eighth possible implementation of the third aspect, the transition matrix is represented by P, and

where Pij represents an element in an ith row and in a jth column of the transition matrix P, In(j) represents a set of nodes that are all directed to a node j, and E represents a set of node groups in which there is a directional relationship between nodes in the node groups.

[0032] In the present invention, the correction vector is determined by using the Jacobi method, and further the similarities between the nodes may be calculated. In each time of iteration of the Jacobi method, elements for calculating the correction vector are independent of each other. In this way, concurrent calculation can be performed, so that a calculation time can be effectively reduced by using a computer cluster, time complexity and space complexity during calculation can be reduced, and the present invention is applicable to a large network.

BRIEF DESCRIPTION OF DRAWINGS



[0033] To describe the technical solutions of the present invention more clearly, the following briefly describes the accompanying drawings showing preferred embodiments of the present invention. Apparently, the accompanying drawings in the following description show merely some embodiments of the present invention.

FIG. 1 is a flowchart of a similarity measurement method according to an embodiment of the present invention;

FIG. 2 is a schematic diagram of a "graph" according to an embodiment of the present invention;

FIG. 3 is a structural block diagram of a similarity measurement device according to an embodiment of the present invention; and

FIG. 4 is a structural block diagram of a similarity measurement device according to another embodiment of the present invention.


DESCRIPTION OF EMBODIMENTS



[0034] The following clearly describes the technical solutions of the present invention with reference to the accompanying drawings showing preferred embodiments of the present invention. Apparently, the described embodiments are some but not all of the embodiments of the present invention.

[0035] SimRank is a model for measuring a similarity between any two nodes based on topology structure information of a graph.

[0036] In a graph G = (V,E), V is a vertex set and represents a set of nodes in the graph; and E is an arc set and represents a set of node groups in which there is a directional relationship between nodes in the node groups. That is, E is a subset of V × V.

[0037] In(i) is used to represent a set of nodes that are all directed to a node i (that is, an in-neighbor set), and s(i,j) is used to represent a SimRank similarity between two nodes i and j. Therefore, a mathematical definition of SimRank may be expressed as follows:
  1. 1. s(i,j) = 0 if In(i) = ∅ or In(j) = ∅.
  2. 2. In another case,

where c ∈ (0,1) is an attenuation factor, and ∅ represents an empty set.

[0038] It can be seen from the definition that in SimRank similarity measurement, a node has a highest similarity to the node itself, and the similarity is 1. A similarity between two nodes is multiplying an average value of similarities between nodes that are directed to the two nodes by the attenuation factor.

[0039] According to the foregoing definition, a representation form of a SimRank matrix may be:

where I is a unit matrix, P is a first-order transition matrix in a reversal graph GT of the original graph G = (V,E), and ∨ represents maximun values of corresponding elements of two matrices.

[0040] An element Pij of the first-order transition matrix P may be expressed as:



[0041] According to the representation form S = (cPTSP)∨I of the SimRank matrix, S may be divided into:

where D is a diagonal matrix, and may be referred to as a diagonal correction matrix; and further, S may be divided into:



[0042] It can be seen that, a key of calculating a SimRank similarity is to calculate the diagonal correction matrix D. Currently, the diagonal correction matrix D is calculated by using a Gauss-Seidel algorithm (Gauss-Seidel algorithm) method. Each step of calculation depends on a result of a previous step. Consequently, a long time is consumed, and calculation efficiency is low.

[0043] FIG. 1 is a flowchart of a similarity measurement method according to an embodiment of the present invention. The method shown in FIG. 1 includes the following steps.

101. Obtain a directional relationship between every two of n nodes in a network, and determine a transition matrix according to the directional relationships, where a dimension of the transition matrix is n × n, and n is a positive integer greater than or equal to 2.

102. Obtain an attenuation factor, and calculate a constraint matrix according to the transition matrix and the attenuation factor, where the attenuation factor is an attenuation factor defined in a SimRank similarity method, and a dimension of the constraint matrix is n × n.

103. Construct a system of linear equations according to the constraint matrix, where a coefficient matrix of the system of linear equations is the constraint matrix, and a variable of the system of linear equations is a correction vector.

104. Solve the system of linear equations by means of iteration by using a Jacobi method, and determine the correction vector.

105. Generate a diagonal correction matrix according to the correction vector, where a diagonal element of the diagonal correction matrix is a component of the correction vector, and a dimension of the diagonal correction matrix is n × n.

106. Calculate similarities between the n nodes according to the transition matrix, the attenuation factor, and the diagonal correction matrix.



[0044] In this embodiment of the present invention, the correction vector is determined by using the Jacobi method, and further the similarities between the nodes may be calculated. In each time of iteration of the Jacobi method, elements for calculating the correction vector are independent of each other. In this way, concurrent calculation can be performed, so that a calculation time can be effectively reduced by using a computer cluster, time complexity and space complexity during calculation can be reduced, and the similarity measurement method is applicable to a large network.

[0045] Generally, there are numerous nodes in a network, and an order of magnitude of n is also relatively high. For example, n may be on the order of millions, or even on the order of hundred millions. For example, a quantity of users registered with Facebook is greater than 2.2 billion. The users of Facebook compose nodes in a network of Facebook. Therefore, a quantity n of the nodes is also greater than 2.2 billion.

[0046] In this embodiment of the present invention, the n nodes in 101 may be all nodes in the network, or may be some nodes in the network. For example, for Facebook, n nodes may be all the registered users whose quantity is greater than 2.2 billion, or may be approximately one billion of female users, or may be users whose most recent login is in India. This is not limited in the present invention.

[0047] It should be noted that, a specific scenario of the network is not limited in this embodiment of the present invention, and a manner of obtaining the directional relationship between every two of the n nodes in the network is not limited in this embodiment of the present invention. For example, directional relationships may be determined according to a mutual following relationship between the n nodes, or directional relationships may be determined according to call records between the n nodes.

[0048] For example, the network in this embodiment of the present invention may be a social network (social network), and a node in the network may be used to represent a user in the social network. Therefore, the directional relationship between every two of the nodes may be a following relationship between every two users in the social network.

[0049] For example, relatively common social networks include MicroBlog (Weibo or MicroBlog), WeChat (WeChat), EasyChat, MiTalk (MiTalk), Facebook (Facebook), Twitter (Twitter), and LinkedIn (LinkedIn). Therefore, in a social network such as MicroBlog, if a user U1 is a follower of a user U2, it can be construed as that there is a directional relationship from the user U1 to the user U2. In a social network such as WeChat, if a user U1 is a follower of a user U2, and certainly the user U2 is also a follower of the user U1, it can be construed as that there is a directional relationship from the user U1 to the user U2, and there is also a directional relationship from the user U2 to the user U1.

[0050] For another example, the network in this embodiment of the present invention may be a communications network (such as Huawei churn), and a node in the network may be used to represent a user in the communications network. Therefore, the directional relationship between every two of the nodes may be a call relationship between every two users in the communications network.

[0051] For example, if a user U1 ever called a user U2, it can be construed as that there is a directional relationship from the user U1 to the user U2.

[0052] It can be seen that, in this embodiment of the present invention, the directional relationship is directional. For example, a directional relationship between a node N1 and a node N2 may be: The node N1 is directed to the node N2; or the node N2 is directed to the node N1; or the node N1 is directed to the node N2, and the node N2 is directed to the node N1.

[0053] Optionally, 101 may include: constructing a graph (Graph) according to the directional relationship between every two of the n nodes in the network, and using a first-order transition matrix in a reversal graph of the graph as the transition matrix. The n nodes compose nodes in the graph, and the directional relationship composes a directed edge between the nodes in the graph.

[0054] It can be understood that the constructed graph is a directed graph. The first-order transition matrix in the reversal graph of the graph is related to a quantity of nodes directed to each node in the graph. Herein, a quantity of directed edges directed to each node may be determined, and further the transition matrix is calculated according to the quantity of directed edges directed to each node.

[0055] For example, in a "graph" shown in FIG. 2, five nodes are included, and are respectively N1, N2, N3, N4, and N5, and the graph further includes directed edges between the nodes. Therefore, it can be easily determined that a quantity of nodes directed to the node N1 is 2; a quantity of nodes directed to the node N2 is 1; a quantity of nodes directed to the node N3 is 3; a quantity of nodes directed to the node N4 is 1; and a quantity of nodes directed to the node N5 is 2.

[0056] It should be noted that, for a specific description of the graph (Graph), refer to a related definition and description in the graph theory in the prior art. To avoid repetition, details are not described herein.

[0057] Specifically, in this embodiment of the present invention, the transition matrix is represented by P, the attenuation factor is represented by c, the constraint matrix is represented by A, the correction vector is represented by x, the diagonal correction matrix is represented by D, and the similarities between the nodes are represented by S.

[0058] In addition, the dimension of the transition matrix P is n × n, the dimension of the constraint matrix A is n × n, the dimension of the diagonal correction matrix D is n × n, a dimension of the similarities S between the nodes is n × n, and a dimension of the correction vector x is n, where n is a positive integer.

[0059] Correspondingly, Pij represents an element in an ith row and in a jth column of the transition matrix P, aij represents an element in an ith row and in a jth column of the constraint matrix A, xi represents an ith element of the correction vector x, and Dij represents an element in an ith row and in a jth column of the diagonal correction matrix D, where i,j=1,2,···,n.

[0060] In this embodiment of the present invention, the transition matrix P is a first-order transition matrix in a reversal graph GT of an original graph G = (V,E), and 101 may be determined by using the following formula:

where In(j) represents a set of nodes that are all directed to a node j, V represents a set of nodes in the graph, and E represents a set of node groups in which there is a directional relationship between nodes in the node groups.

[0061] A directional relationship between nodes may be determined in a process of constructing a graph. For example, in the foregoing churn analysis of Huawei, a directional relationship between nodes may be constructed according to a call record between customers. It is assumed that a customer A corresponds to a node A in a graph, and a customer B corresponds to a node B in the graph. Therefore, if the customer A ever called the customer B, a directed edge directed from the node A to the node B may be established during construction of the graph. That is, the node A is directed to the node B.

[0062] In this embodiment of the present invention, 104 may include: calculating a system of linear equations Ax = b by using the Jacobi method, where b is a vector whose each element is 1. Herein, a variable of the system of linear equations is the correction vector.

[0063] Specifically, the correction vector in 104 may be determined by means of iteration based on an initial value of the correction vector. The initial value of the correction vector is an initialized correction vector, which is represented by x(0). 104 may include: solving the system of linear equations by means of iteration by using the Jacobi method, and determining a solution, which is obtained when a convergence condition is met, as the correction vector, or determining a solution, which is obtained when a preset maximum quantity of times of iteration is reached, as the correction vector.

[0064] Specifically, a theoretical analysis process may be described as follows:

[0065] Because the attenuation factor c ∈ (0,1), according to the foregoing formula (4), the similarities S between the nodes may be approximately:

where t is a positive integer, for example, t = 5.

[0066] Further, according to the formula (1), a correlation between a node and the node itself is 1, that is, s(i,i)=1; therefore

where ei is an orthogonal unit vector, and specifically,

is satisfied.

[0067] If it is assumed that x = (D11,D22,···,Dnn)T, the following formula may be obtained based on the formula (6):



[0068] In this way, the diagonal correction matrix D may be calculated by calculating the system of linear equations Ax = b. b = (b1,b2,···,bn)T, b1 = b2 = ··· = bn = 1, A is referred to as the constraint matrix, and an element of A may be obtained by using the formula (7):



[0069] It can be learned from the foregoing analysis that, 102 may include: determining that an element of the constraint matrix A is aij = eiej + cPeiPej +···+ ctPteiPtej, where ei and ej are orthogonal unit vectors, and t is a preset positive integer.

[0070] Further, in 103, the system of linear equations Ax = b may be constructed by using the constraint matrix A, and further in 104, the system of linear equations Ax = b is solved by means of iteration to obtain the correction vector x.

[0071] For example, in 104, the correction vector may be first initialized to obtain the initialized correction vector x(0), and

Then, calculation is performed by means of iteration by using the initialized correction vector x(0).

[0072] It should be noted that, a method for initializing the correction vector is not limited in this embodiment of the present invention, and a value of the initialized correction vector is not limited either. For example, initialization may be performed by using a random (Random) function. For example, the initialized correction vector may be defined to be equal to 1.

[0073] Therefore, 104 may specifically include: calculating the correction vector by using

xi represents an ith element of the correction vector x, xj represents a jth element of the correction vector x, aij represents an element in an ith row and in a jth column of the constraint matrix A, aii represents an element in the ith row and in an ith column of the constraint matrix A, bi = 1, k represents a quantity of times of iteration of the Jacobi method, i,j=1,2,···,n, the dimension of the constraint matrix A is n × n, and k and n are both positive integers.

[0074] Optionally, in an embodiment, the correction vector determined in 104 may be a solution obtained after the system of linear equations is convergent.

[0075] For example, if

it is considered that the solution is convergent, so that a value

obtained after kth iteration may be used as the solution of the system of linear equations. Herein, ε is a predefined value, for example, ε = 10-6.

[0076] Optionally, in an embodiment, the correction vector determined in 104 may be a value, which is obtained when a preset maximum quantity of times of iteration is reached, of the system of linear equations.

[0077] For example, if it is assumed that the preset maximum quantity of times of iteration is N, a value

that is obtained after Nth iteration may be used as the solution of the system of linear equations if the system of linear equations is still not convergent when k = N.

[0078] In addition, in a process of performing iteration by using the Jacobi method, it can be seen from

that kth iteration depends on a result of k-1th iteration, but updating of each component of the kth iteration is independent. That is, calculation of

is related to

but is unrelated to

In this way, when the kth iteration is performed, calculation of n

may be concurrently performed, so that a calculation time can be shortened, and calculation efficiency can be improved.

[0079] In addition, concurrent calculation may be independently performed by multiple CPUs, or calculation may be concurrently performed by using a high performance computer cluster. Therefore, a computer cluster resource can be fully used, computer utilization can be improved, and space complexity and time complexity can be reduced.

[0080] Further, it can be seen from

that, in 102 in which the constraint matrix A is calculated, only each row of the constraint matrix A needs to be calculated online each time instead of explicitly constructing the entire constraint matrix A.

[0081] That is, in this embodiment of the present invention, 102, 103, and 104 may be concurrently performed. For example, the first row of the constraint matrix A may be first calculated in 102. Then, a linear equation is constructed in 103 by using the first row of the constraint matrix A, and the linear equation is calculated in 104. In addition, the second row, ..., and the like of the constraint matrix A may be calculated in 102 during calculation in 103 and 104.

[0082] Further, 105 may include: determining that an element Dij of the diagonal correction matrix D is:

where Dij represents an element in an ith row and in a jth column of the diagonal correction matrix D, and xi represents the ith element of the correction vector x, where i,j = 1,2,···,n, the dimension of the diagonal correction matrix D is n × n, and n is a positive integer.

[0083] That is, the diagonal correction matrix D is:



[0084] In this way, in this embodiment of the present invention, the diagonal correction matrix D is obtained through calculation by using the Jacobi method, and further the similarities between the nodes may be obtained through calculation by using the formula (5). That is, 106 may include: calculating the similarities between the nodes according to the following formula:

where T represents transposition, and t is a preset positive integer.

[0085] It can be understood that, an element sij that is in an ith row and in a jth column of the matrix S represents a similarity between an ith node and a jth node. In this way, a similarity between every two of the n nodes may be obtained through calculation. That is, a similarity between every two nodes may be obtained through calculation.

[0086] In this embodiment of the present invention, a value of t is not limited, for example, t = 5, or t = 20. It can be understood that, a larger value of t indicates higher calculation precision and higher time costs.

[0087] In this embodiment of the present invention, a value of the attenuation factor c ∈ (0,1) may be preset, for example, c = 0.6. This is not limited in the present invention.

[0088] In this embodiment of the present invention, it is assumed that an ith node of the n nodes is the node i, and a jth node of the n nodes is the node j. For the given node i and node j, the similarity between the node i and the node j may be implemented by using the following code 1 (algorithm 1), which may be referred to as SinglePairSimRank (i,j):





[0089] For example, for a social network, if only a similarity between a customer A and a customer B is expected to be calculated, calculation may be performed by using the foregoing algorithm 1. In addition, if it is assumed that a quantity of directed edges in the network is Q, time complexity of SinglePairSimRank is O(MQ), and space complexity of SinglePairSimRank is O(Q).

[0090] In this embodiment of the present invention, it is assumed that an ith node of the n nodes is the node i. For the given node i, similarities between all other nodes (that is, other n - 1 nodes in the n nodes except the node i) and the node i may be calculated. In addition, the calculation may be implemented by using the following code 2 (algorithm 2), which may be referred to as SingleSourceSimRank(i):



[0091] For example, in a churn analysis of Huawei, if a customer "similar to" a customer A is expected to be determined, calculation may be performed by using the foregoing algorithm 2. In addition, if it is assumed that a quantity of directed edges in the network is Q, time complexity of SingleSourceSimRank is O(M2Q), and space complexity of SingleSourceSimRank is O(Q).

[0092] In this embodiment of the present invention, a similarity between every two of all nodes may be calculated by using the foregoing code 2 (algorithm 2). In addition, the calculation may be implemented by using the following code 3 (algorithm 3), which may be referred to as AllPairsSimRank:





[0093] For example, in an information recommendation process, similarities between all nodes may be calculated by using the algorithm 3, and further a type of information to be separately recommended to each customer may be determined. In addition, if it is assumed that a quantity of directed edges in the network is Q, time complexity of AllPairsSimRank is O(M2Qn), and space complexity of AllPairsSimRank is O(Q).

[0094] FIG. 3 is a structural block diagram of a similarity measurement device according to an embodiment of the present invention. The device 200 shown in FIG. 3 includes an obtaining unit 201 and a processing unit 202.

[0095] The obtaining unit 201 is configured to: obtain a directional relationship between every two of n nodes in a network, and obtain an attenuation factor, where the attenuation factor is an attenuation factor defined in a SimRank similarity method, and n is a positive integer greater than or equal to 2.

[0096] The processing unit 202 is configured to: determine a transition matrix according to the directional relationships obtained by the obtaining unit 201, and calculate a constraint matrix according to the transition matrix and the attenuation factor that is obtained by the obtaining unit 201, where a dimension of the transition matrix is n × n, and a dimension of the constraint matrix is n × n.

[0097] The processing unit 202 is further configured to construct a system of linear equations according to the constraint matrix, where a coefficient matrix of the system of linear equations is the constraint matrix, and a variable of the system of linear equations is a correction vector.

[0098] The processing unit 202 is further configured to: solve the system of linear equations by means of iteration by using a Jacobi method, and determine the correction vector.

[0099] The processing unit 202 is further configured to generate a diagonal correction matrix according to the correction vector, where a diagonal element of the diagonal correction matrix is a component of the correction vector, and a dimension of the diagonal correction matrix is n × n.

[0100] The processing unit 202 is further configured to calculate similarities between the n nodes according to the transition matrix, the diagonal correction matrix, and the attenuation factor that is obtained by the obtaining unit 201.

[0101] In this embodiment of the present invention, the correction vector is determined by using the Jacobi method, and further the similarities between the nodes may be calculated. In each time of iteration of the Jacobi method, elements for calculating the correction vector are independent of each other. In this way, concurrent calculation can be performed, so that a calculation time can be effectively reduced by using a computer cluster, time complexity and space complexity during calculation can be reduced, and the similarity measurement device is applicable to a large network.

[0102] Specifically, in this embodiment of the present invention, the transition matrix is represented by P, the attenuation factor is represented by c, the constraint matrix is represented by A, the correction vector is represented by x, the diagonal correction matrix is represented by D, and the similarities between the nodes are represented by S.

[0103] In addition, the dimension of the transition matrix P is n × n, the dimension of the constraint matrix A is n × n, the dimension of the diagonal correction matrix D is n × n, a dimension of the similarities S between the nodes is n × n, and a dimension of the correction vector x is n, where n is a positive integer, and n is related to a quantity of nodes.

[0104] Correspondingly, Pij represents an element in an ith row and in a jth column of the transition matrix P, aij represents an element in an ith row and in a jth column of the constraint matrix A, xi represents an ith element of the correction vector x, and Dij represents an element in an ith row and in a jth column of the diagonal correction matrix D, where i,j=1,2,···,n.

[0105] Optionally, in an embodiment, the constraint matrix is represented by A, the correction vector is represented by x, and the system of linear equations is represented by Ax = b. The processing unit 202 is specifically configured to calculate the system of linear equations Ax = b by using the Jacobi method, where b is a vector whose each element is 1.

[0106] Specifically, the correction vector may be first initialized to obtain x(0), and further the system of linear equations Ax = b is solved by means of iteration.

[0107] When the processing unit 202 solves the system of linear equations by means of iteration by using the Jacobi method, and determines the correction vector, the processing unit 202 is specifically configured to: solve the system of linear equations by means of iteration by using the Jacobi method, and determine a solution, which is obtained when a convergence condition is met, as the correction vector, or determine a solution, which is obtained when a preset maximum quantity of times of iteration is reached, as the correction vector.

[0108] Optionally, in another embodiment, the processing unit 202 is specifically configured to: calculate the correction vector by using

xi represents an ith element of the correction vector x, xj represents a jth element of the correction vector x, aij represents an element in an ith row and in a jth column of the constraint matrix A, aii represents an element in the ith row and in an ith column of the constraint matrix A, bi = 1, k represents a quantity of times of iteration of the Jacobi method, i,j=1,2,···,n, the dimension of the constraint matrix A is n × n, and k and n are both positive integers.

[0109] Optionally, in another embodiment, the attenuation factor is represented by c, the transition matrix is represented by P, the constraint matrix is represented by A, and the processing unit 202 is specifically configured to determine that an element of the constraint matrix A is aij = eiej + cPeiPej +···+ ctPteiPtej. ei and ej are orthogonal unit vectors, and t is a preset positive integer.

[0110] Optionally, in another embodiment, the correction vector is represented by x, the diagonal correction matrix is represented by D, and the processing unit 202 is specifically configured to determine that an element Dij of the diagonal correction matrix D is

represents an element in an ith row and in a jth column of the diagonal correction matrix D, and xi represents the ith element of the correction vector x, where i,j=1,2,···,n, the dimension of the diagonal correction matrix D is n × n, and n is a positive integer.

[0111] Optionally, in another embodiment, the attenuation factor is represented by c, the transition matrix is represented by P, the diagonal correction matrix is represented by D, the similarities between the nodes are represented by S, and the processing unit 202 is specifically configured to calculate the similarities between the nodes according to the following formula: S = D + cPTDP + c2(PT)2DP2 +···+ ct(PT)tDPt, where T represents transposition, t is a preset positive integer, and an element sij that is in an ith row and in a jth column of a matrix represented by S represents a similarity between an ith node and a jth node.

[0112] Optionally, in another embodiment, after the obtaining unit 201 obtains the directional relationship, the processing unit 202 is specifically configured to: construct a graph according to the directional relationship that is between every two of the n nodes in the network and that is obtained by the obtaining unit 201, where the n nodes compose n nodes in the graph, and the directional relationship composes a directed edge between the nodes in the graph; and use a first-order transition matrix in a reversal graph of the graph as the transition matrix.

[0113] Optionally, in another embodiment, the transition matrix is represented by P, and

where Pij represents an element in an ith row and in a jth column of the transition matrix P, In(j) represents a set of nodes that are all directed to a node j, and E represents a set of node groups in which there is a directional relationship between nodes in the node groups.

[0114] Optionally, in this embodiment of the present invention, the device 200 may be a server configured to process data. For example, the device 200 may be a server of a social network.

[0115] The device 200 can be configured to implement the method in the embodiment of FIG. 1. To avoid repetition, details are not described herein again.

[0116] FIG. 4 is a structural block diagram of a similarity measurement device according to another embodiment of the present invention. The device 300 shown in FIG. 4 includes a processor 301, a receiver 302, a transmitter 303, and a memory 304.

[0117] The receiver 302 is configured to: obtain a directional relationship between every two of n nodes in a network, and obtain an attenuation factor, where the attenuation factor is an attenuation factor defined in a SimRank similarity method, and n is a positive integer greater than or equal to 2.

[0118] The processor 301 is configured to: determine a transition matrix according to the directional relationships obtained by the receiver 302, and calculate a constraint matrix according to the transition matrix and the attenuation factor that is obtained by the receiver 302, where a dimension of the transition matrix is n × n, and a dimension of the constraint matrix is n × n.

[0119] The processor 301 is further configured to construct a system of linear equations according to the constraint matrix, where a coefficient matrix of the system of linear equations is the constraint matrix, and a variable of the system of linear equations is a correction vector.

[0120] The processor 301 is further configured to: solve the system of linear equations by means of iteration by using a Jacobi method, and determine the correction vector.

[0121] The processor 301 is further configured to generate a diagonal correction matrix according to the correction vector, where a diagonal element of the diagonal correction matrix is a component of the correction vector, and a dimension of the diagonal correction matrix is n × n.

[0122] The processor 301 is further configured to calculate similarities between the n nodes according to the transition matrix, the diagonal correction matrix, and the attenuation factor that is obtained by the receiver 302.

[0123] In this embodiment of the present invention, the correction vector is determined by using the Jacobi method, and further the similarities between the nodes may be calculated. In each time of iteration of the Jacobi method, elements for calculating the correction vector are independent of each other. In this way, concurrent calculation can be performed, so that a calculation time can be effectively reduced by using a computer cluster, time complexity and space complexity during calculation can be reduced, and the similarity measurement device is applicable to a large network.

[0124] Components in the device 300 are coupled by using a bus system 305. The bus system 305 further includes a power supply bus, a control bus, and a status signal bus in addition to a data bus. However, for the purpose of clear description, all buses are marked as the bus system 305 in FIG. 4.

[0125] The methods disclosed in the foregoing embodiments of the present invention may be applied to the processor 301, or implemented by the processor 301. The processor 301 may be an integrated circuit chip and have a signal processing capability. During implementation, each step of the foregoing methods may be implemented by an integrated logic circuit of hardware in the processor 301 or by an instruction in a software form. The foregoing processor 301 may be a general purpose processor, a Digital Signal Processor (DSP), an a Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), or another programmable logic device, discrete gate or transistor logic device, or discrete hardware component. The methods, steps, and logical block diagrams disclosed in the embodiments of the present invention may be implemented or performed. The general purpose processor may be a microprocessor or the processor may be any conventional processor and the like. Steps of the methods disclosed in the embodiments of the present invention may be directly performed and completed by a hardware decoding processor, or may be performed and completed by using a combination of hardware and software modules in the decoding processor. The software module may be located in a mature storage medium in the field, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically-erasable programmable memory, or a register. The storage medium is located in the memory 304, and the processor 301 reads information in the memory 304 and completes the steps in the foregoing methods in combination with hardware of the processor.

[0126] It may be understood that the memory 304 in this embodiment of the present invention may be a volatile memory or a nonvolatile memory, or may include a volatile memory and a nonvolatile memory. The nonvolatile memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically EPROM (EEPROM), or a flash memory. The volatile memory may be a Random Access Memory (RAM), and is used as an external cache. RAMs in many forms such as a static random access memory Static RAM (SRAM), a Dynamic RAM (DRAM), a Synchronous DRAM (SDRAM), a Double Data Rate (SDRAM, DDR SDRAM), an Enhanced SDRAM (ESDRAM), a Synchlink DRAM (SLDRAM), and a Direct Rambus RAM (DR RAM) may be used, and this is an example but is not a limitative description. The memory 304 in the system and the method described in this specification is intended to include, but is not limited to, these memories and any other suitable type of memory.

[0127] It may be understood that the embodiments described in this specification may be implemented by hardware, software, firmware, middleware, microcode, or a combination thereof. For implementation by hardware, a processing unit may be implemented in one or more Application Specific Integrated Circuits (ASIC), a Digital Signal Processing (DSP), a digital signal processing device (DSP Device, DSPD), a Programmable Logic Device (PLD), a Field-Programmable Gate Array (FPGA), a general purpose processor, a controller, a microcontroller, a microprocessor, and other electronic units configured to perform the functions described in this application, or a combination thereof.

[0128] When the embodiments are implemented in software, firmware, middleware, microcode, program code, or a code segment, they may be stored in, for example, a machine-readable medium of a storage component. The code segment may indicate a process, a function, a subprogram, a program, a routine, a subroutine, a module, a software group, a type, or any combination of an instruction, a data structure, and a program statement. The code segment may be coupled to another code segment or a hardware circuit by transferring and/or receiving information, data, an independent variable, a parameter, or memory content. The information, the independent variable, the parameter, the data, or the like may be transferred, forwarded, or sent in any suitable manner such as memory sharing, message transfer, token transfer, or network transmission.

[0129] For implementation by software, the technologies in this specification may be implemented by performing the functional modules (for example, a process and a function) in this specification. Software code may be stored in a storage unit and executed by a processor. The storage unit may be implemented inside the processor or outside the processor, and in the latter case, the storage unit may be coupled to the processor by means of communication by using various means known in the art.

[0130] Specifically, in this embodiment of the present invention, the transition matrix is represented by P, the attenuation factor is represented by c, the constraint matrix is represented by A, the correction vector is represented by x, the diagonal correction matrix is represented by D, and the similarities between the nodes are represented by S.

[0131] In addition, the dimension of the transition matrix P is n × n, the dimension of the constraint matrix A is n × n, the dimension of the diagonal correction matrix D is n × n, a dimension of the similarities S between the nodes is n × n, and a dimension of the correction vector x is n, where n is a positive integer, and n is related to a quantity of nodes.

[0132] Correspondingly, Pij represents an element in an ith row and in a jth column of the transition matrix P, aij represents an element in an ith row and in a jth column of the constraint matrix A, xi represents an ith element of the correction vector x, and Dij represents an element in an ith row and in a jth column of the diagonal correction matrix D, where i,j=1,2,···,n.

[0133] Optionally, in an embodiment, the constraint matrix is represented by A, the correction vector is represented by x, and the system of linear equations is represented by Ax = b. The processor 301 is specifically configured to calculate the system of linear equations Ax = b by using the Jacobi method, where b is a vector whose each element is 1.

[0134] Specifically, the correction vector may be first initialized to obtain x(0), and further the system of linear equations Ax = b is solved by means of iteration.

[0135] When the processor 301 solves the system of linear equations by means of iteration by using the Jacobi method, and determines the correction vector, the processor 301 is specifically configured to: solve the system of linear equations by means of iteration by using the Jacobi method, and determine a solution, which is obtained when a convergence condition is met, as the correction vector, or determine a solution, which is obtained when a preset maximum quantity of times of iteration is reached, as the correction vector.

[0136] Optionally, in another embodiment, the processor 301 is specifically configured to: calculate the correction vector by using

xi represents an ith element of the correction vector x, xj represents a jth element of the correction vector x, aij represents an element in an ith row and in a jth column of the constraint matrix A, aii represents an element in the ith row and in an ith column of the constraint matrix A, bi = 1, k represents a quantity of times of iteration of the Jacobi method, i, j = 1, 2,···,n, the dimension of the constraint matrix A is n × n, and k and n are both positive integers.

[0137] Optionally, in another embodiment, the attenuation factor is represented by c, the transition matrix is represented by P, the constraint matrix is represented by A, and the processor 301 is specifically configured to determine that an element of the constraint matrix A is aij = eiej + cPeiPej +···+ ctPteiPtej. ei and ej are orthogonal unit vectors, and t is a preset positive integer.

[0138] Optionally, in another embodiment, the correction vector is represented by X, the diagonal correction matrix is represented by D, and the processor 301 is specifically configured to determine that an element Dij of the diagonal correction matrix D is

Dij represents an element in an ith row and in a jth column of the diagonal correction matrix D, and xi represents the ith element of the correction vector X, where i, j = 1,2,···,n, the dimension of the diagonal correction matrix D is n × n, and n is a positive integer.

[0139] Optionally, in another embodiment, the attenuation factor is represented by c, the transition matrix is represented by P, the diagonal correction matrix is represented by D, the similarities between the nodes are represented by S, and the processor 301 is specifically configured to calculate the similarities between the nodes according to the following formula: S = D + cPTDP + c2(PT)2DP2 +···+ ct(PT)tDPt, where T represents transposition, t is a preset positive integer, and an element sij that is in an ith row and in a jth column of a matrix represented by S represents a similarity between an ith node and a jth node.

[0140] Optionally, in another embodiment, after the receiver 302 obtains the directional relationship, the processor 301 is specifically configured to: construct a graph according to the obtained directional relationship that is between every two of the n nodes in the network, where the n nodes compose n nodes in the graph, and the directional relationship composes a directed edge between the nodes in the graph; and use a first-order transition matrix in a reversal graph of the graph as the transition matrix.

[0141] Optionally, in another embodiment, the transition matrix is represented by P, and

where Pij represents an element in an ith row and in a jth column of the transition matrix P, In(j) represents a set of nodes that are all directed to a node j, and E represents a set of node groups in which there is a directional relationship between nodes in the node groups.

[0142] It can be understood that, in this embodiment of the present invention, the transmitter 303 may be configured to output a value of the similarity obtained by the processor 301 through calculation. For example, the value may be output to a display screen of the device 300, or may be output to another device or apparatus connected to the device 300.

[0143] It can be understood that, in this embodiment of the present invention, the memory 304 may be configured to store a preset value (for example, values of c and t) that is needed for calculation; may be further configured to store code executed by the processor 301 (for example, the algorithm 1, the algorithm 2, and the algorithm 3 in the embodiment shown in FIG. 1); and may be further configured to store an intermediate result in the calculation process.

[0144] Optionally, in this embodiment of the present invention, the device 300 may be a server configured to process data. For example, the device 300 may be a server of a social network.

[0145] The device 300 can be configured to implement the method in the embodiment of FIG. 1. To avoid repetition, details are not described herein again.

[0146] A person of ordinary skill in the art may be aware that, in combination with the examples described in the embodiments disclosed in this specification, units and algorithm steps may be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are performed by hardware or software depends on particular applications and design constraint conditions of the technical solutions. A person skilled in the art may use different methods to implement the described functions for each particular application, but it should not be considered that the implementation goes beyond the scope of the present invention.

[0147] It may be clearly understood by a person skilled in the art that, for the purpose of convenient and brief description, for a detailed working process of the foregoing system, apparatus, and unit, refer to a corresponding process in the foregoing method embodiments, and details are not described herein again.

[0148] In the several embodiments provided in this application, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. For example, the described apparatus embodiment is merely an example. For example, the unit division is merely logical function division and may be other division in actual implementation. For example, a plurality of units or components may be combined or integrated into another system, or some features may be ignored or not performed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections may be implemented by using some interfaces. The indirect couplings or communication connections between the apparatuses or units may be implemented in electronic, mechanical, or other forms.

[0149] 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 position, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual requirements to achieve the objectives of the solutions of the embodiments.

[0150] In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each of the units may exist alone physically, or two or more units are integrated into one unit.

[0151] When the functions are implemented in the form of a software functional unit and sold or used as an independent product, the functions may be stored in a computer-readable storage medium. Based on such an understanding, the technical solutions of the present invention essentially, or the part contributing to the prior art, or some of the technical solutions may be implemented in a form of a software product. The software product is stored in a storage medium, and includes several instructions for instructing a computer device (which may be a personal computer, a server, or a network device) to perform all or some of the steps of the methods described in the embodiments of the present invention. The foregoing storage medium includes: any medium that can store program code, such as a USB flash drive, a removable hard disk, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk, or an optical disc.

[0152] The foregoing descriptions are merely specific implementations of the present invention, but are not intended to limit the present invention.


Claims

1. A similarity measurement method, comprising:

obtaining (101) a directional relationship between every two of n nodes in a network, and determining a transition matrix according to the directional relationships, wherein a dimension of the transition matrix is n × n, and n is a positive integer greater than or equal to 2;

obtaining (102) an attenuation factor, and calculating a constraint matrix according to the transition matrix and the attenuation factor using a processor, wherein the attenuation factor is an attenuation factor defined in a SimRank similarity method, and a dimension of the constraint matrix is n × n; wherein the constraint matrix is represented by A, a correction vector is represented by x, and the system of linear equations is represented by Ax = b, wherein b is a vector whose each element is 1;

constructing (103) a system of linear equations according to the constraint matrix, wherein a coefficient matrix of the system of linear equations is the constraint matrix, and a variable of the system of linear equations is a correction vector;

solving (104) the system of linear equations by means of iteration by using a Jacobi method, and determining the correction vector, comprises:

calculating the correction vector by using

wherein

xi represents an ith element of the correction vector x, xj represents a jth element of the correction vector x, aij represents an element in an ith row and in a jth column of the constraint matrix A, aii represents an element in the ith row and in an ith column of the constraint matrix A, bi = 1, k represents a quantity of times of iteration of the Jacobi method, i, j = 1, 2,···,n and k is a positive integer;

generating (105) a diagonal correction matrix according to the correction vector, wherein a diagonal element of the diagonal correction matrix is a component of the correction vector, and a dimension of the diagonal correction matrix is n × n; and

calculating (106) similarities between the n nodes according to the transition matrix, the attenuation factor, and the diagonal correction matrix.


 
2. The method according to claim 1, wherein the solving the system of linear equations by means of iteration by using a Jacobi method, and determining the correction vector comprises:
solving the system of linear equations by means of iteration by using the Jacobi method, and determining a solution, which is obtained when a convergence condition is met, as the correction vector, or determining a solution, which is obtained when a preset maximum quantity of times of iteration is reached, as the correction vector.
 
3. The method according to any one of claims 1 or 2, wherein the attenuation factor is represented by c, the transition matrix is represented by P, the constraint matrix is represented by A, and the calculating a constraint matrix according to the transition matrix and the attenuation factor comprises:

determining that an element of the constraint matrix A is aij = eiej + cPeiPej +···+ctPteiPtej, wherein

ei and ej are orthogonal unit vectors, and t is a preset positive integer.


 
4. The method according to any one of claims 1 to 3, wherein the correction vector is represented by x, the diagonal correction matrix is represented by D, and the generating a diagonal correction matrix according to the correction vector comprises:

determining that an element Dij of the diagonal correction matrix D is:

wherein

Dij represents an element in an ith row and in a jth column of the diagonal correction matrix D, and xi represents the ith element of the correction vector x, wherein i, j = 1, 2,···,n


 
5. The method according to any one of claims 1 to 4, wherein the attenuation factor is represented by c, the transition matrix is represented by P, the diagonal correction matrix is represented by D, the similarities between the nodes are represented by S, and the calculating similarities between the n nodes according to the transition matrix, the attenuation factor, and the diagonal correction matrix comprises:

calculating the similarities between the n nodes according to the following formula:

wherein

T represents transposition, t is a preset positive integer, and an element sij that is in an ith row and in a jth column of a matrix represented by S represents a similarity between an ith node and a jth node.


 
6. The method according to any one of claims 1 to 5, wherein obtaining (101) a directional relationship between every two of n nodes in a network, and determining a transition matrix according to the directional relationships comprises:

constructing a graph according to the directional relationship between every two of the n nodes in the network, wherein the n nodes compose n nodes in the graph, and the directional relationship composes a directed edge between the nodes in the graph; and

using a first-order transition matrix in a reversal graph of the graph as the transition matrix.


 
7. The method according to claim 6, wherein the transition matrix is represented by P, and

wherein Pij represents an element in an ith row and in a jth column of the transition matrix P, In(j) represents a set of nodes that are all directed to a node j, and E represents a set of node groups in which there is a directional relationship between nodes in the node groups.
 
8. A similarity measurement device, comprising:

an obtaining unit (201), configured to: obtain a directional relationship between every two of n nodes in a network, and obtain an attenuation factor, wherein the attenuation factor is an attenuation factor defined in a SimRank similarity method, and n is a positive integer greater than or equal to 2; and

a processing unit (202), configured to: determine a transition matrix according to the directional relationships obtained by the obtaining unit, and calculate a constraint matrix according to the transition matrix and the attenuation factor that is obtained by the obtaining unit, wherein a dimension of the transition matrix is n × n, and a dimension of the constraint matrix is n × n, wherein the constraint matrix is represented by A, the correction vector is represented by x, and the system of linear equations is represented by Ax = b, wherein

b is a vector whose each element is 1; wherein

the processing unit (202) is further configured to construct a system of linear equations according to the constraint matrix, wherein a coefficient matrix of the system of linear equations is the constraint matrix, and a variable of the system of linear equations is a correction vector;

the processing unit (202) is further configured to: solve the system of linear equations by means of iteration by using a Jacobi method, and determine the correction vector; wherein the processing unit (202) is specifically configured to:

calculate the correction vector by using

wherein

xi represents an ith element of the correction vector x, xj represents a jth element of the correction vector x, aij represents an element in an ith row and in a jth column of the constraint matrix A, aii represents an element in the ith row and in an ith column of the constraint matrix A, bi = 1, k represents a quantity of times of iteration of the Jacobi method, i, j = 1, 2,···,n, and k is a positive integer;

the processing unit (202) is further configured to generate a diagonal correction matrix according to the correction vector, wherein a diagonal element of the diagonal correction matrix is a component of the correction vector, and a dimension of the diagonal correction matrix is n × n; and

the processing unit (202) is further configured to calculate similarities between the n nodes according to the transition matrix, the diagonal correction matrix, and the attenuation factor that is obtained by the obtaining unit.


 
9. The device according to claim 8, wherein the processing unit (202) is specifically configured to:
solve the system of linear equations by means of iteration by using the Jacobi method, and determine a solution, which is obtained when a convergence condition is met, as the correction vector, or determine a solution, which is obtained when a preset maximum quantity of times of iteration is reached, as the correction vector.
 
10. The device according to any one of claims 8 or 9, wherein the attenuation factor is represented by c, the transition matrix is represented by P, the constraint matrix is represented by A, and the processing unit is specifically configured to:

determine that an element of the constraint matrix A is aij = eej + cPeiPej +···+ctPteiPtej, wherein

ei and ej are orthogonal unit vectors, and t is a preset positive integer.


 
11. The device according to any one of claims 8 to 10, wherein the correction vector is represented by x, the diagonal correction matrix is represented by D, and the processing unit is specifically configured to:

determine that an element Dij of the diagonal correction matrix D is:

wherein

Dij represents an element in an ith row and in a jth column of the diagonal correction matrix D, and xi represents the ith element of the correction vector x, wherein i ,j = 1, 2,···,n


 


Ansprüche

1. Ähnlichkeitsmessverfahren, umfassend:

Abrufen (101) einer Richtungsbeziehung zwischen allen zwei von n Knoten in einem Netzwerk und Bestimmen einer Übergangsmatrix gemäß den Richtungsbeziehungen,

wobei eine Dimension der Übergangsmatrix n x n ist; und n eine positive ganze Zahl größer als oder gleich 2 ist;

Abrufen (102) eines Dämpfungsfaktors und Berechnen einer Beschränkungsmatrix gemäß der Übergangsmatrix und dem Dämpfungsfaktor unter Verwendung eines Prozessors,

wobei der Dämpfungsfaktor ein Dämpfungsfaktor ist, der in einem SimRank-Ähnlichkeitsverfahren definiert ist, und eine Dimension der Beschränkungsmatrix n x n ist;

wobei die Beschränkungsmatrix durch A dargestellt wird, ein Korrekturvektor durch x dargestellt wird, und das System von linearen Gleichungen durch Ax = b dargestellt wird, wobei

b ein Vektor ist, von dem jedes Element 1 ist;

Erstellen (103) eines Systems von linearen Gleichungen gemäß der Beschränkungsmatrix, wobei eine Koeffizientenmatrix des Systems von linearen Gleichungen die Beschränkungsmatrix ist, und eine Variable des Systems von linearen Gleichungen ein Korrekturvektor ist;

wobei ein Lösen (104) des Systems von linearen Gleichungen mittels Iteration durch Verwenden eines Jacobi-Verfahrens und Bestimmen des Korrekturvektors umfasst:

Berechnen des Korrekturvektors durch Verwenden von

wobei xi ein i-tes Element des Korrekturvektors x darstellt, xj ein j-tes Element des Korrekturvektors x darstellt, aij ein Element in einer i-ten Zeile und in einer j-ten Spalte der Beschränkungsmatrix A darstellt, aii ein Element in der i-ten Zeile und in einer i-ten Spalte der Beschränkungsmatrix A darstellt, bi = 1, k eine Menge von Iterationsmalen des Jacobi-Verfahrens darstellt, i, j = 1, 2, ..., n, und k eine positive ganze Zahl ist;

Erzeugen (105) einer Diagonalkorrekturmatrix gemäß dem Korrekturvektor, wobei ein diagonales Element der Diagonalkorrekturmatrix eine Komponente des Korrekturvektors ist, und eine Dimension der diagonalen Korrekturmatrix n x n ist; und

Berechnen (106) von Ähnlichkeiten zwischen den n Knoten gemäß der Übergangsmatrix, dem Dämpfungsfaktor und der Diagonalkorrekturmatrix.


 
2. Verfahren nach Anspruch 1, wobei das Lösen des Systems von linearen Gleichungen mittels Iteration durch Verwenden eines Jacobi-Verfahrens und Bestimmen des Korrekturvektors umfasst:
Lösen des Systems von linearen Gleichungen mittels Iteration durch das Jacobi-Verfahren und Bestimmen einer Lösung, die erhalten wird, wenn eine Konvergenzbedingung erfüllt wird, als den Korrekturvektor oder Bestimmen einer Lösung, die erhalten wird, wenn eine vorgegebene Menge von Iterationsmalen erreicht wird, als den Korrekturvektor.
 
3. Verfahren nach einem der Ansprüche 1 oder 2, wobei der Dämpfungsfaktor durch c dargestellt wird, die Übergangsmatrix durch P dargestellt wird, die Beschränkungsmatrix durch A dargestellt wird, und das Berechnen der Beschränkungsmatrix gemäß der Übergangsmatrix und dem Dämpfungsfaktor umfasst:
Bestimmen, dass ein Element der Beschränkungsmatrix A

ist, wobei ei und ej orthogonale Einheitsvektoren sind, und t eine vorgegebene ganze Zahl ist.
 
4. Verfahren nach einem der Ansprüche 1 bis 3, wobei der Korrekturvektor durch x dargestellt wird, die Diagonalkorrekturmatrix durch D dargestellt wird, und das Erzeugen der Diagonalkorrekturmatrix gemäß dem Korrekturvektor umfasst: Bestimmen, dass ein Element Dij der Diagonalkorrekturmatrix D ist:

wobei Dij ein Element in einer i-ten Zeile und in einer j-ten Spalte der Diagonalkorrekturmatrix D darstellt, und xi das i-te Element des Korrekturvektors x darstellt, wobei i, j = 1, 2, ..., n.
 
5. Verfahren nach einem der Ansprüche 1 oder 4, wobei der Dämpfungsfaktor durch c dargestellt wird, die Übergangsmatrix durch P dargestellt wird, die Diagonalkorrekturmatrix durch D dargestellt wird, die Ähnlichkeiten zwischen den Knoten durch S dargestellt werden, und das Berechnen von Ähnlichkeiten zwischen den n Knoten gemäß der gemäß der Übergangsmatrix, dem Dämpfungsfaktor und der Beschränkungsmatrix umfasst: Berechnen der Ähnlichkeiten zwischen den n Knoten gemäß der folgenden Formel:

wobei T Transposition darstellt, t eine vorgegebene ganze Zahl ist, und ein Element Sij, das in einer i-ten Zeile und in einer j-ten Spalte einer Matrix ist, die durch S dargestellt wird, eine Ähnlichkeit zwischen einem i-ten Knoten und einem j-ten Knoten darstellt.
 
6. Verfahren nach einem der Ansprüche 1 bis 5, wobei das Abrufen (101) einer Richtungsbeziehung zwischen allen zwei von n Knoten in einem Netzwerk und Bestimmen einer Übergangsmatrix gemäß den Richtungsbeziehungen umfasst:

Erstellen eines Graphen gemäß der Richtungsbeziehung zwischen allen zwei der n Knoten im Netzwerk, wobei die n Knoten n Knoten im Graphen bilden, und die Richtungsbeziehung eine gerichtete Kante zwischen den Knoten im Graphen bildet; und

Verwenden einer Übergangsmatrix der ersten Ordnung in einem Umkehrgraphen des Graphen als die Übergangsmatrix.


 
7. Verfahren nach Anspruch 6, wobei die Übergangsmatrix durch P dargestellt wird, und

wobei Pij ein Element in einer i-ten Zeile und in einer j-ten Spalte der Übergangsmatrix P darstellt, In(j) einen Satz von Knoten darstellt, die alle zu einem Knoten j gerichtet sind, und E einen Satz von Knotengruppen darstellt, in welchen eine Richtungsbeziehung zwischen Knoten in den Knotengruppen besteht.
 
8. Ähnlichkeitsmessvorrichtung, umfassend:

eine Abrufeinheit (201), die konfiguriert ist zum: Abrufen einer Richtungsbeziehung zwischen allen zwei von n Knoten in einem Netzwerk und Abrufen eines Dämpfungsfaktors, wobei der Dämpfungsfaktor ein Dämpfungsfaktor ist, der in einem SimRank-Ähnlichkeitsverfahren definiert ist, und n eine positive ganze Zahl größer als oder gleich 2 ist; und

eine Verarbeitungseinheit (202), die konfiguriert ist zum: Bestimmen einer Übergangsmatrix gemäß den Richtungsbeziehungen, die durch die Abrufeinheit abgerufen werden, und Berechnen einer Beschränkungsmatrix gemäß der Übergangsmatrix und dem Dämpfungsfaktor, der durch die Abrufeinheit abgerufen wird, wobei eine Dimension der Übergangsmatrix n x n ist, und eine Dimension der Beschränkungsmatrix n x n ist,

wobei die Beschränkungsmatrix durch A dargestellt wird, ein Korrekturvektor durch x dargestellt wird, und das System von linearen Gleichungen durch Ax = b dargestellt wird, wobei

b ein Vektor ist, von dem jedes Element 1 ist; wobei

die Verarbeitungseinheit (202) ferner zum Erstellen eines Systems von linearen Gleichungen gemäß der Beschränkungsmatrix konfiguriert ist, wobei eine Koeffizientenmatrix des Systems von linearen Gleichungen die Beschränkungsmatrix ist, und eine Variable des Systems von linearen Gleichungen ein Korrekturvektor ist;

die Verarbeitungseinheit (202) ferner konfiguriert ist zum: Lösen des Systems von Gleichungen mittels Iteration durch Verwenden eines Jacobi-Verfahrens und Bestimmen des Korrekturvektors; wobei die Verarbeitungseinheit (202) insbesondere konfiguriert ist zum:

Berechnen des Korrekturvektors durch Verwenden von

wobei xi ein i-tes Element des Korrekturvektors x darstellt, xj ein j-tes Element des Korrekturvektors x darstellt, aij ein Element in einer i-ten Zeile und in einer j-ten Spalte der Beschränkungsmatrix A darstellt, aii ein Element in der i-ten Zeile und in einer i-ten Spalte der Beschränkungsmatrix A darstellt, bi = 1, k eine Menge von Iterationsmalen des Jacobi-Verfahrens darstellt, i, j = 1, 2, ..., n, und k eine positive ganze Zahl ist;

die Verarbeitungseinheit (202) ferner zum Erzeugen einer Diagonalkorrekturmatrix gemäß dem Korrekturvektor konfiguriert ist, wobei ein diagonales Element der Diagonalkorrekturmatrix eine Komponente des Korrekturvektors ist, und eine Dimension der diagonalen Korrekturmatrix n x n ist; und

die Verarbeitungseinheit (202) ferner zum Berechnen von Ähnlichkeiten zwischen den n Knoten gemäß der Übergangsmatrix, der Diagonalkorrekturmatrix und dem Dämpfungsfaktor, der durch die Abrufeinheit abgerufen wird, konfiguriert ist.


 
9. Vorrichtung nach Anspruch 8, wobei die Verarbeitungseinheit (202) insbesondere konfiguriert ist zum:
Lösen des Systems von linearen Gleichungen mittels Iteration durch das Jacobi-Verfahren und Bestimmen einer Lösung, die erhalten wird, wenn eine Konvergenzbedingung erfüllt wird, als den Korrekturvektor oder Bestimmen einer Lösung, die erhalten wird, wenn eine vorgegebene Menge von Iterationsmalen erreicht wird, als den Korrekturvektor.
 
10. Vorrichtung nach einem der Ansprüche 8 oder 9, wobei der Dämpfungsfaktor durch c dargestellt wird, die Übergangsmatrix durch P dargestellt wird, die Beschränkungsmatrix durch A dargestellt wird, und die Verarbeitungseinheit insbesondere konfiguriert ist zum:
Bestimmen, dass ein Element der Beschränkungsmatrix A

ist, wobei ei und ej orthogonale Einheitsvektoren sind, und t eine vorgegebene ganze Zahl ist.
 
11. Vorrichtung nach einem der Ansprüche 8 bis 10, wobei der Korrekturvektor durch x dargestellt wird, die Diagonalkorrekturmatrix durch D dargestellt wird, und die Verarbeitungseinheit insbesondere konfiguriert ist zum:
Bestimmen dass ein Element Dij der Diagonalkorrekturmatrix D ist:

wobei Dij ein Element in einer i-ten Zeile und in einer j-ten Spalte der Diagonalkorrekturmatrix D darstellt, und xi das i-te Element des Korrekturvektors x darstellt, wobei i, j = 1, 2, ..., n.
 


Revendications

1. Procédé de mesure de similarité, consistant à :

obtenir (101) une relation directionnelle entre chaque paire de n nœuds dans un réseau, et déterminer une matrice de transition selon les relations directionnelles, une dimension de la matrice de transition étant n x n, et n étant un entier positif supérieur ou égal à 2 ;

obtenir (102) un facteur d'atténuation, et calculer au moyen d'un processeur une matrice de contrainte selon la matrice de transition et le facteur d'atténuation, le facteur d'atténuation étant un facteur d'atténuation défini dans une méthode de similarité du SimRank, et une dimension de la matrice de contrainte étant n x n ; la matrice de contrainte étant représentée par A, un vecteur de correction étant représenté par x, et le système d'équations linéaires étant représenté par Ax = b, où b est un vecteur dont chaque élément est 1 ;

générer (103) un système d'équations linéaires selon la matrice de contrainte, une matrice de coefficients du système d'équations linéaires étant la matrice de contrainte, et une variable du système d'équations linéaires étant un vecteur de correction ;

résoudre (104) le système d'équations linéaires au moyen d'une itération en utilisant une méthode de Jacobi et déterminer le vecteur de correction, consistant à :

calculer le vecteur de correction en utilisant

où xi représente un ième élément du vecteur de correction x, xj représente un jième élément du vecteur de correction x, aij représente un élément dans une ième rangée et dans une jième colonne de la matrice de contrainte A, aii représente un élément dans la ième rangée et dans une ième colonne de la matrice de contrainte A, bi = 1, k représente un nombre d'itérations de la méthode de Jacobi, i, j = 1, 2, ..., n, et k est un entier positif ;

générer (105) une matrice de correction diagonale selon le vecteur de correction, un élément diagonal de la matrice de correction diagonale étant une composante du vecteur de correction, et une dimension de la matrice de correction diagonale étant n x n ; et

calculer (106) des similarités entre les n nœuds selon la matrice de transition, le facteur d'atténuation et la matrice de correction diagonale.


 
2. Procédé selon la revendication 1, dans lequel la résolution du système d'équations linéaires au moyen d'une itération en utilisant une méthode Jacobi et la détermination du vecteur de correction consistent à :
résoudre le système d'équations linéaires au moyen d'une itération en utilisant la méthode de Jacobi, et déterminer une solution, qui est obtenue quand une condition de convergence est satisfaite, en tant que vecteur de correction, ou déterminer une solution, qui est obtenue quand un nombre maximum prédéfini d'itérations est atteint, en tant que vecteur de correction.
 
3. Procédé selon l'une quelconque des revendications 1 et 2, dans lequel le facteur d'atténuation est représenté par c, la matrice de transition est représentée par P, la matrice de contrainte est représentée par A, et le calcul d'une matrice de contrainte selon la matrice de transition et le facteur d'atténuation consiste à :
déterminer qu'un élément de la matrice de contrainte A est aij = ei · ej + cPei · Pej + ··· + ctPtei · Ptej, où ei et ej sont des vecteurs unitaires orthogonaux, et t est un entier positif prédéfini.
 
4. Procédé selon l'une quelconque des revendications 1 à 3, dans lequel le vecteur de correction est représenté par x, la matrice de correction diagonale est représentée par D, et la génération d'une matrice de correction diagonale selon le vecteur de correction consiste à :

déterminer qu'un élément Dij de la matrice de correction diagonale D est :

où Dij représente un élément dans une ième rangée et dans une jième colonne de la matrice de correction diagonale D, et xi représente le ième élément du vecteur de correction x, où i, j = 1, 2, ..., n.


 
5. Procédé selon l'une quelconque des revendications 1 à 4, dans lequel le facteur d'atténuation est représenté par c, la matrice de transition est représentée par P, la matrice de correction diagonale est représentée par D, les similarités entre les nœuds sont représentées par S, et le calcul de similarités entre les n nœuds selon la matrice de transition, le facteur d'atténuation et la matrice de correction diagonale consiste à :

calculer les similarités entre les n nœuds selon la formule suivante :

où T représente une transposition, t est un entier positif prédéfini, et un élément Sij, qui est dans une ième rangée et dans une jième colonne d'une matrice représentée par S, représente une similarité entre un ième nœud et un jième nœud.


 
6. Procédé selon l'une quelconque des revendications 1 à 5, dans lequel l'obtention (101) d'une relation directionnelle entre chaque paire de n nœuds dans un réseau et la détermination d'une matrice de transition selon les relations directionnelles consistent à :

générer un graphe selon la relation directionnelle entre chaque paire de n nœuds dans le réseau, les n nœuds composant n nœuds dans le graphe, et la relation directionnelle composant un bord orienté entre les nœuds dans le graphe ; et

utiliser en tant que matrice de transition une matrice de transition de premier ordre dans un graphe inverse du graphe.


 
7. Procédé selon la revendication 6, dans lequel la matrice de transition est représentée par P, et

où Pij représente un élément dans une ième rangée et dans une jième colonne de la matrice de transition P, In(j) représente un ensemble de nœuds qui sont tous dirigés vers un nœud j, et E représente un ensemble de groupes de nœuds dans lesquels il y a une relation directionnelle entre des nœuds dans les groupes de nœuds.
 
8. Dispositif de mesure de similarité, comprenant :

une unité d'obtention (201), configurée pour : obtenir une relation directionnelle entre chaque paire de n nœuds dans un réseau, et obtenir un facteur d'atténuation, le facteur d'atténuation étant un facteur d'atténuation défini dans une méthode de similarité du SimRank, et n étant un entier positif supérieur ou égal à 2 ; et

une unité de traitement (202), configurée pour : déterminer une matrice de transition selon les relations directionnelles obtenues par l'unité d'obtention, et calculer une matrice de contrainte selon la matrice de transition et le facteur d'atténuation qui est obtenu par l'unité d'obtention, une dimension de la matrice de transition étant n x n, et

une dimension de la matrice de contrainte étant n x n, la matrice de contrainte étant représentée par A, le vecteur de correction étant représenté par x et le système d'équations linéaires étant représenté par Ax = b, où b est un vecteur dont chaque élément est 1 ; et dans lequel :

l'unité de traitement (202) est en outre configurée pour générer un système d'équations linéaires selon la matrice de contrainte, une matrice de coefficients du système d'équations linéaires étant la matrice de contrainte, et une variable du système d'équations linéaires étant un vecteur de correction ;

l'unité de traitement (202) est en outre configurée pour : résoudre le système d'équations linéaires au moyen d'une itération en utilisant une méthode de Jacobi et déterminer le vecteur de correction ; l'unité de traitement (202) étant spécifiquement configurée pour :

calculer le vecteur de correction en utilisant

où xi représente un ième élément du vecteur de correction x, xj représente un jième élément du vecteur de correction x, aij représente un élément dans une ième rangée et dans une jième colonne de la matrice de contrainte A, aii représente un élément dans la ième rangée et dans une ième colonne de la matrice de contrainte A, bi = 1, k représente un nombre d'itérations de la méthode de Jacobi, i, j = 1, 2, ..., n, et k· est un entier positif ;

l'unité de traitement (202) étant en outre configurée pour générer une matrice de correction diagonale selon le vecteur de correction, un élément diagonal de la matrice de correction diagonale étant une composante du vecteur de correction, et une dimension de la matrice de correction diagonale étant n x n ; et

l'unité de traitement (202) est en outre configurée pour calculer des similarités entre les n nœuds selon la matrice de transition, la matrice de correction diagonale et le facteur d'atténuation qui est obtenu par l'unité d'obtention.


 
9. Dispositif selon la revendication 8, dans lequel l'unité de traitement (202) est spécifiquement configurée pour :
résoudre le système d'équations linéaires au moyen d'une itération en utilisant la méthode de Jacobi, et déterminer une solution, qui est obtenue quand une condition de convergence est satisfaite, en tant que vecteur de correction, ou déterminer une solution, qui est obtenue quand un nombre maximum prédéfini d'itérations est atteint, en tant que vecteur de correction.
 
10. Dispositif selon l'une quelconque des revendications 8 et 9, dans lequel le facteur d'atténuation est représenté par c, la matrice de transition est représentée par P, la matrice de contrainte est représentée par A, et l'unité de traitement est spécifiquement configurée pour :
déterminer qu'un élément de la matrice de contrainte A est aij = ei · ej + cPei · Pej + ··· + ctPtei · Ptej, où ei et ej sont des vecteurs unitaires orthogonaux, et t est un entier positif prédéfini.
 
11. Dispositif selon l'une quelconque des revendications 8 à 10, dans lequel le vecteur de correction est représenté par x, la matrice de correction diagonale étant représentée par D, et l'unité de traitement est spécifiquement configurée pour :

déterminer qu'un élément Dij de la matrice de correction diagonale D est :

où Dij représente un élément dans une ième rangée et dans une jième colonne de la matrice de correction diagonale D, et xi représente le ième élément du vecteur de correction x, où i,j = 1, 2, ..., n.


 




Drawing