Data processing method and device, product, equipment and medium

By constructing a social distance set and encoding the graph nodes, the problem of lack of position information of graph nodes is solved, and the accuracy of graph data business processing and the accuracy of social object recommendations are achieved.

CN120336313APending Publication Date: 2025-07-18TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410078966.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-18
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

The lack of location information of graph nodes in graph data leads to inaccurate business processing, and it is difficult for the prior art to effectively use social relationship diagrams for accurate business processing.

Method used

By constructing a social distance set, the graph nodes are position coded based on social distance, accurate position code information is generated, node information of graph nodes is enriched, and position code information is used for business processing.

Benefits of technology

Accurate encoding of graph nodes is achieved, and the accuracy of business processing is improved, especially in scenarios such as social object recommendation and visual analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120336313A_ABST
    Figure CN120336313A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method and device, a product, equipment and a medium. The method comprises the steps that an object relation graph is acquired; the object relation graph comprises N graph nodes and connecting edges among the N graph nodes, N is a positive integer, one graph node is used for representing a corresponding social object, and a social association relationship exists between two social objects corresponding to two graph nodes connected by any connecting edge in the object relation graph; constructing a social distance set among the N graph nodes based on the object relation graph; any two graph nodes have a social distance in a social distance set, and the social distance between any two graph nodes is determined based on connectivity between any two graph nodes; and on the basis of the social distance set, encoding the position of each graph node in the N graph nodes in the object relation graph to generate position encoding information of each graph node. By adopting the method and the device, accurate position coding information can be generated for each graph node in the object relation graph.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of data processing, and in particular, to a data processing method, apparatus, product, device, and medium. Background Art

[0002] Graph data can be composed of multiple graph nodes and the edges between these multiple graph nodes. In a social scenario, graph data can be used to represent and process social relationships between users, and a user can be a graph node in the graph data.

[0003] However, graph data is a typical network structure in a non-Euclidean space. Each graph node in the graph data does not have its own position information in the graph data, which makes the node information of each graph node in the graph data relatively scarce, resulting in inaccurate business processing based on the graph data. Summary of the Invention

[0004] This application provides a data processing method, apparatus, product, device, and medium, which can generate accurate position encoding information for each graph node in an object relationship graph, thereby enriching the node information of each graph node itself, and can also accurately process the business based on the object relationship graph through the position encoding information of each graph node.

[0005] On the one hand, this application provides a data processing method, which includes:

[0006] Obtain an object relationship graph; the object relationship graph contains N graph nodes and the edges between the N graph nodes, N is a positive integer, a graph node is used to represent a corresponding social object, and there is a social association relationship between the two social objects corresponding to the two graph nodes connected by any edge in the object relationship graph;

[0007] Construct a social distance set between the N graph nodes based on the object relationship graph; there is a social distance in the social distance set between any two graph nodes, and the social distance between any two graph nodes is determined based on the connectivity between any two graph nodes;

[0008] Based on the social distance set, perform encoding processing on the positions of each of the N graph nodes in the object relationship graph to generate the position encoding information of each graph node.

[0009] On the one hand, this application provides a data processing apparatus, which includes:

[0010] An acquisition module for acquiring an object relationship graph; the object relationship graph includes N graph nodes and the edges connecting the N graph nodes, where N is a positive integer. One graph node is used to represent a corresponding social object, and there is a social association relationship between the two social objects corresponding to the two graph nodes connected by any edge in the object relationship graph.

[0011] A construction module for constructing a social distance set between the N graph nodes based on the object relationship graph; there is a social distance in the social distance set between any two graph nodes, and the social distance between any two graph nodes is determined based on the connectivity between any two graph nodes.

[0012] A generation module for encoding the positions of each of the N graph nodes in the object relationship graph based on the social distance set to generate the position encoding information of each graph node.

[0013] Optionally, the connectivity between any two graph nodes means that any two graph nodes can be connected or cannot be connected.

[0014] Among them, the ability to connect between any two graph nodes includes: there is a shortest connected path between any two graph nodes in the object relationship graph; the shortest connected path between any two graph nodes includes one or more edges used to connect the two graph nodes.

[0015] The inability to connect between any two graph nodes includes: there is no shortest connected path between any two graph nodes in the object relationship graph.

[0016] Optionally, the way for the construction module to construct the social distance set between the N graph nodes based on the object relationship graph includes:

[0017] If any two graph nodes can be connected, obtain the number of edges included in the shortest connected path between the two graph nodes as the social distance between the two graph nodes; and,

[0018] If any two graph nodes cannot be connected, obtain a preset non - connected distance as the social distance between the two graph nodes.

[0019] Optionally, the way for the generation module to encode the positions of each of the N graph nodes in the object relationship graph based on the social distance set to generate the position encoding information of each graph node includes:

[0020] Normalize each social distance in the social distance set to generate a normalized social distance set; after a social distance in the social distance set is normalized, it corresponds to a normalized social distance in the normalized social distance set.

[0021] Encode the positions of each graph node in the object relationship graph based on the canonical social distance set to generate the position encoding information of each graph node.

[0022] Optionally, any two graph nodes include a first graph node and a second graph node, and the target social distance between the first graph node and the second graph node is included in the social distance set;

[0023] The generation module normalizes each social distance in the social distance set. The ways to generate the canonical social distance set include:

[0024] Take the graph node that is connected to the first graph node and has the maximum social distance from the first graph node among the N graph nodes as the reference graph node corresponding to the first graph node;

[0025] Determine the social distance between the first graph node and the reference graph node as the reference social distance;

[0026] Normalize the target social distance based on the ratio between the target social distance and the reference social distance to obtain the canonical social distance corresponding to the target social distance.

[0027] Optionally, the canonical social distance set is represented as a canonical distance matrix;

[0028] The generation module encodes the positions of each graph node in the object relationship graph based on the canonical social distance set. The ways to generate the position encoding information of each graph node include:

[0029] Perform an equivariant transformation on the canonical distance matrix to generate an information compression matrix;

[0030] Use the information compression matrix to perform information compression on the canonical distance matrix to generate a position encoding matrix;

[0031] Among them, the dimension of the position encoding matrix is smaller than that of the canonical distance matrix, and the position encoding matrix contains the position encoding information obtained by encoding the positions of each graph node in the object relationship graph.

[0032] Optionally, the ways for the generation module to perform an equivariant transformation on the canonical distance matrix to generate an information compression matrix include:

[0033] Obtain the transpose matrix of the canonical distance matrix, and obtain the product between the transpose matrix and the canonical distance matrix as the transformation matrix;

[0034] Perform an equivariant decomposition on the transformation matrix to generate an information compression matrix.

[0035] Optionally, the transformation matrix contains N columns of elements; the ways for the generation module to perform an equivariant decomposition on the transformation matrix to generate an information compression matrix include:

[0036] Calculate the characteristic coefficients corresponding to each column element in the transformation matrix; the characteristic coefficient corresponding to any column element is used to indicate the amount of information contained in any column element.

[0037] Generate a diagonal matrix based on the characteristic coefficients corresponding to each column element; the N characteristic coefficients corresponding to the N column elements are arranged in descending order in the diagonal direction of the diagonal matrix.

[0038] Based on the diagonal matrix, perform an equivariant decomposition process on the transformation matrix to generate a decomposition matrix; the decomposition matrix contains N column elements, and each column element in the N column elements is arranged in descending order of the corresponding characteristic coefficient in the decomposition matrix.

[0039] Use the first m column elements in the decomposition matrix to construct an information compression matrix; m is a positive integer and m is less than N.

[0040] Optionally, the N graph nodes have object attribute information of their respective corresponding social objects; the above device further includes a recommendation module, and the recommendation module is used for:

[0041] Based on the object attribute information and position encoding information of each graph node, perform feature embedding processing on each graph node to generate node embedding features of each graph node.

[0042] Based on the node embedding features of each graph node, recommend social objects for establishing social association relationships to the social objects corresponding to each graph node.

[0043] Optionally, the way that the recommendation module performs feature embedding processing on each graph node based on the object attribute information and position encoding information of each graph node to generate node embedding features of each graph node includes:

[0044] Use the position encoding information of each graph node to perform information augmentation processing on the object attribute information of each graph node respectively to obtain the augmented attribute information of each graph node.

[0045] Call the feature embedding network to perform feature embedding processing on each graph node based on the object relationship graph and the augmented attribute information of each graph node to generate node embedding features of each graph node.

[0046] Optionally, any one of the N graph nodes is a target graph node; the way that the recommendation module recommends social objects for establishing social association relationships to the social objects corresponding to each graph node based on the node embedding features of each graph node includes:

[0047] Determine the graph nodes whose corresponding social objects in the N graph nodes do not have a social association relationship with the social object corresponding to the target graph node as candidate graph nodes.

[0048] Obtain the feature similarity between the node embedding features of the target graph node and the node embedding features of each candidate graph node;

[0049] Sort each candidate graph node in descending order according to the feature similarity between the node embedding features of the target graph node and the node embedding features of each candidate graph node, to obtain the sorted candidate graph nodes;

[0050] Recommend the social objects corresponding to the top K candidate graph nodes in the sorted candidate graph nodes to the social object corresponding to the target graph node to establish a social association relationship; K is a positive integer.

[0051] Optionally, the position encoding information of each graph node respectively includes the encoding information of each graph node in m dimensions, m is a positive integer, and the m dimensions correspond to m color channels; the above device further includes a display module, and the display module is used for:

[0052] Based on the encoding information of each graph node in m dimensions, respectively determine the node colors of each graph node in m color channels;

[0053] Based on the node colors of each graph node in m color channels, perform color processing on each graph node in the object relationship graph to obtain the colored object relationship graph.

[0054] Optionally, the position encoding information of each graph node respectively includes the encoding information of each graph node in m dimensions, m is a positive integer, and the m dimensions correspond to m coordinate axes in the target coordinate system; the display module is further used for:

[0055] Based on the encoding information of each graph node in m dimensions, respectively determine the coordinate values of each graph node on the m coordinate axes in the target coordinate system;

[0056] Display each graph node at the corresponding coordinate position in the target coordinate system according to the coordinate values of each graph node on the m coordinate axes.

[0057] On the one hand, the present application provides a computer device, including a memory and a processor. When the computer program stored in the memory is executed by the processor, the processor executes the method in one aspect of the present application.

[0058] On the one hand, the present application provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the method in the above one aspect.

[0059] According to one aspect of the present application, there is provided a computer program product, which includes a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the methods provided in the above-mentioned one aspect and various alternative manners.

[0060] The present application can obtain an object relationship graph; the object relationship graph includes N graph nodes and edges connecting the N graph nodes, where N is a positive integer, and one graph node is used to represent a corresponding social object. There is a social association relationship between the two social objects corresponding to the two graph nodes connected by any edge in the object relationship graph; and a social distance set between the N graph nodes can be constructed based on the object relationship graph; there is a social distance in the social distance set between any two graph nodes, and the social distance between any two graph nodes is determined based on the connectivity between any two graph nodes; thus, based on the social distance set, the positions of each of the N graph nodes in the object relationship graph can be encoded to generate position encoding information for each graph node. It can be seen that the method proposed in the present application can accurately encode the positions of each graph node in the object relationship graph based on the social distance between each graph node, so as to obtain accurate position encoding information for each graph node, which can enrich the node information of each graph node itself, and moreover, through the accurate position encoding information of each graph node, accurate processing of services (such as social object recommendation services) carried out through the object relationship graph can also be achieved. Description of the Drawings

[0061] In order to more clearly illustrate the technical solutions in the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0062] Figure 1 is a schematic structural diagram of a network architecture provided by an embodiment of the present application;

[0063] Figure 2 is a schematic diagram of a scenario for encoding the position of a graph node provided by an embodiment of the present application;

[0064] Figure 3 is a schematic flowchart of a data processing method provided by an embodiment of the present application;

[0065] Figure 4 is a schematic structural diagram of an object relationship graph provided by an embodiment of the present application;

[0066] Figure 5 It is a schematic structural diagram of another object relationship diagram provided by an embodiment of the present application;

[0067] Figure 6 It is a schematic diagram of a scene for isomorphic graph testing provided by an embodiment of the present application;

[0068] Figure 7 It is a schematic diagram of a scene for visual analysis of graph nodes provided by an embodiment of the present application;

[0069] Figure 8 It is a schematic flowchart of a method for position encoding processing of graph nodes provided by an embodiment of the present application;

[0070] Figure 9 It is a schematic flowchart of a recommendation method for social objects provided by an embodiment of the present application;

[0071] Figure 10 It is a schematic interface diagram for recommending social objects provided by an embodiment of the present application;

[0072] Figure 11 It is a schematic flowchart of position encoding and application provided by an embodiment of the present application;

[0073] Figure 12 It is a schematic structural diagram of a data processing device provided by an embodiment of the present application;

[0074] Figure 13 It is a schematic structural diagram of a computer device provided by an embodiment of the present application. Detailed implementation manners

[0075] Next, the technical solutions in the present application will be clearly and completely described in conjunction with the accompanying drawings in the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without making creative efforts shall fall within the protection scope of the present application.

[0076] The present application relates to related technologies of artificial intelligence. Among them, artificial intelligence (AI) is to use a digital computer or a machine controlled by a digital computer to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to obtain the best results in theory, methods, technologies, and application systems. In other words, artificial intelligence is a comprehensive technology of computer science. It attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a way similar to human intelligence. Artificial intelligence is also to study the design principles and implementation methods of various intelligent machines, so that the machines have the functions of perception, reasoning, and decision-making.

[0077] Artificial intelligence technology is an interdisciplinary subject with a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, and mechatronics. The software technologies of artificial intelligence mainly include several major directions such as computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0078] This application mainly involves machine learning in artificial intelligence. Among them, Machine Learning (ML) is an interdisciplinary subject that involves multiple disciplines such as probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory. It specializes in studying how computers simulate or implement human learning behaviors to acquire new knowledge or skills and reorganize the existing knowledge structure to continuously improve its own performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications cover all fields of artificial intelligence. Machine learning and deep learning usually include technologies such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and rote learning.

[0079] The machine learning involved in this application mainly refers to that an accurate node embedding feature of a graph node can be generated by a feature embedding network obtained through training. Furthermore, through the node embedding feature of the graph node, an accurate recommendation between social objects can be realized. For specific details, please refer to the following Figure 3 description in the corresponding embodiments.

[0080] First of all, it should be noted that all the data collected in this application (such as object relationship graphs, social association relationships between social objects, and object attribute information of social objects, etc.) are collected with the consent and authorization of the object to which the data belongs (such as users, institutions, or enterprises), and the collection, use, and processing of relevant data need to comply with relevant laws, regulations, and standards in the relevant region.

[0081] Please refer to Figure 1 , Figure 1 which is a schematic structural diagram of a network architecture provided by an embodiment of this application. As Figure 1 shown, the network architecture may include a server 200 and a cluster of terminal devices. The cluster of terminal devices may include one or more terminal devices, and the number of terminal devices will not be limited here. As Figure 1 shown, the multiple terminal devices may specifically include terminal device 1, terminal device 2, terminal device 3,..., terminal device n; as Figure 1As shown, terminal device 1, terminal device 2, terminal device 3, …, terminal device n can all be network-connected to server 200, so that each terminal device can perform data interaction with server 200 through the network connection.

[0082] As Figure 1 shown, server 200 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The terminal device can be: smart phones, tablets, laptop computers, desktop computers, smart TVs, vehicle-mounted terminals, smart homes and other intelligent terminals. Hereinafter, taking the communication between terminal device 1 and server 200 as an example, the specific description of the embodiments of the present application will be carried out.

[0083] This terminal device 1 can be the terminal device of a user (such as a social object). The terminal device 1 can include a social platform. The social object is a user who can socialize with other social objects in this social platform. Server 200 can be the background server of this social platform. Server 200 can screen out other social objects in the social platform for recommendation to the social object to which terminal device 1 belongs, and can push the other social objects to terminal device 1, so that terminal device 1 can output the recommended other social objects in the social platform to suggest that the social object to which terminal device 1 belongs can establish a social association relationship (such as a friendship relationship) with the recommended other social objects.

[0084] Please refer to Figure 2 , Figure 2 which is a schematic diagram of a scenario for position encoding of graph nodes provided by the embodiments of the present application. As Figure 2 shown, the social object set constructed by social objects in the social platform can include social object 1, social object 2, social object 3, social object 4, social object 5, and social object 6. There can be social association relationships between the social objects in the social object set.

[0085] Through the social association relationships among various social objects in the social object set, a corresponding object relationship graph can be constructed. The object relationship graph can include graph nodes corresponding to each social object, that is, a graph node in the object relationship graph can represent a corresponding social object. Here, the object relationship graph can include graph node g1, graph node g2, graph node g3, graph node g4, graph node g5, and graph node g6. Graph node g1 can correspond to social object 1, graph node g2 can correspond to social object 2, graph node g3 can correspond to social object 3, graph node g4 can correspond to social object 4, graph node g5 can correspond to social object 5, and graph node g6 can correspond to social object 6.

[0086] Among them, two graph nodes with an edge connection in the graph nodes can be used to indicate that there is a social association relationship between the two social objects corresponding to the two graph nodes. For example, there is an edge connection between graph node g1 and graph node g4 (that is, graph node g1 and graph node g4 are connected to each other), indicating that there is a social association relationship between social object 1 corresponding to graph node g1 and social object 4 corresponding to graph node g4; again, for example, there is no edge connection between graph node g1 and graph node g2, indicating that there is no social association relationship between social object 1 corresponding to graph node g1 and social object 2 corresponding to graph node g2.

[0087] Server 200 can obtain the social distance set between each graph node through the above object relationship graph. There can be a social distance between any two graph nodes, and the social distance between any two graph nodes can be determined based on the connectivity of the two graph nodes in the object relationship graph. For the specific determination method, please refer to the relevant description in the following Figure 3 corresponding embodiment.

[0088] Furthermore, server 200 can then perform position encoding processing on each graph node through the social distance set between each graph node to generate the position encoding information of each graph node in the object relationship graph. Here, the position encoding information w1 of graph node g1, the position encoding information w2 of graph node g2, the position encoding information w3 of graph node g3, the position encoding information w4 of graph node g4, the position encoding information w5 of graph node g5, and the position encoding information w6 of graph node g6 can be generated.

[0089] Server 200 can use the position encoding information generated for each graph node as the augmented attribute information of the social object corresponding to each graph node, so as to realize the mutual recommendation between social objects. The specific process can be referred to in the following Figure 9 corresponding embodiment.

[0090] By using the method provided in this application, the accurate encoding of the positions of each graph node is achieved through the social association relationships among social objects. Furthermore, through the accurate position encoding information obtained by encoding each graph node, more accurate business processing can also be achieved through the object relationship graph (such as more accurately recommending social objects to each other).

[0091] Please refer to Figure 3 , Figure 3 which is a schematic flowchart of a data processing method provided by an embodiment of this application. The execution subject in the embodiment of this application can be a data processing device, and this data processing device can be a computer device or a computer device cluster composed of multiple computer devices. This computer device can be a server, a terminal device, or other devices, and no limitation is imposed thereon. As Figure 3 shown, the method may include:

[0092] Step S101, obtain an object relationship graph; the object relationship graph includes N graph nodes and the edges between the N graph nodes. N is a positive integer. A graph node is used to represent a corresponding social object, and there is a social association relationship between the two social objects corresponding to the two graph nodes connected by any edge in the object relationship graph.

[0093] Optionally, the data processing device can obtain an object relationship graph, which may include N graph nodes and the edges between the N graph nodes. The object relationship graph can be any network graph used to represent the social association relationships among social objects. N is a positive integer, and the specific value of N can be determined according to the actual application scenario. A graph node can be used to represent a corresponding social object. Therefore, the value of N can be the total number of social objects. Among them, the social object can be a user in a social platform (also referred to as a social user), and the social platform can be any virtual platform for social interaction among users.

[0094] In a social platform, social objects can establish social association relationships with each other. Optionally, the social association relationship can be a friendship relationship between social objects (in an actual application scenario, it can also be other association relationships). For example, if there is (i.e., a friendship relationship is established) a friendship relationship between social object S1 and social object S2 (i.e., social object S1 and social object S2 are friends with each other), it indicates that there is a social association relationship between social object S1 and social object S2.

[0095] Among them, the edges between the N graph nodes in the object relationship graph can be connected based on the social association relationships between the respective social objects corresponding to the N graph nodes. There is a social association relationship between the two social objects corresponding to the two graph nodes connected by any edge in the object relationship graph. In other words, if there is an edge between two graph nodes in the object relationship graph (i.e., the two graph nodes are connected to each other), it indicates that there is a social association relationship between the two social objects corresponding to the two graph nodes. Conversely, if there is no edge between two graph nodes in the object relationship graph (i.e., the two graph nodes are not connected), it indicates that there is no social association relationship between the two social objects corresponding to the two graph nodes.

[0096] Please refer to Figure 4 , Figure 4 which is a schematic structural diagram of an object relationship graph provided by an embodiment of the present application. As Figure 4 shown, here, the object relationship graph may include a total of 13 graph nodes from graph node a1 to graph node a13. There is a social association relationship between the two social objects corresponding to the two connected graph nodes, and there is no established social association relationship between the two social objects corresponding to the two unconnected graph nodes.

[0097] For example, graph node a6 and graph node a7 are connected to each other. Therefore, there is a social association relationship between the social object corresponding to graph node a6 and the social object corresponding to graph node a7. Again, for example, graph node a12 and graph node a10 are not connected to each other. Therefore, there is no social association relationship between the social object corresponding to graph node a12 and the social object corresponding to graph node a10.

[0098] From the above description, it can be seen that the object relationship graph can be used to represent the social association relationships between various social objects in a social platform. This object relationship graph can also be called an attribute graph. Each graph node in this object relationship graph can also have object attribute information of the corresponding social object, that is, a graph node can have or be understood as being associated with object attribute information of the corresponding social object (which can also be called node attribute information). This object attribute information can include any attribute information of this social object. For example, this object attribute information can include object tags, geographical locations, object classifications, and / or object identities of this social object, etc.

[0099] Among them, according to different actual application scenarios, the object attribute information of social objects may also be different. For example, in the application scenario of a game, the object attribute information of a social object (which can be a game player) can include information about the social object's commonly used game characters, game level information, geographical location information of game playing time, information about the commonly played lanes in the game, and so on.

[0100] Among them, the above object relationship graph can be represented based on the corresponding adjacency matrix. The dimension of the adjacency matrix can be N*N, that is, the number of rows and columns of the adjacency matrix can both be the number N of graph nodes. Each row of the adjacency matrix can respectively correspond to each graph node, one row corresponding to one graph node, and each column of the adjacency matrix can also respectively correspond to each graph node, one column corresponding to one graph node. For example, N graph nodes can be numbered, numbered from graph node 1 (i.e., the encoding of this graph node is 1) to graph node N (i.e., the encoding of this graph node is 2). The first row of the adjacency matrix can correspond to graph node 1, the second row of the adjacency matrix can correspond to graph node 2, and so on. The Nth row of the adjacency matrix can correspond to graph node N; similarly, the first column of the adjacency matrix can also correspond to graph node 1, the second column of the adjacency matrix can correspond to graph node 2, and so on. The Nth column of the adjacency matrix can correspond to graph node N.

[0101] The value of any element in the adjacency matrix can be 1 or 0. If the value of the element at the i-th row and j-th column of the adjacency matrix is 1, it can indicate that there is an edge between graph node i and graph node j (that is, there is a social association relationship between the social object corresponding to graph node i and the social object corresponding to graph node j); if the value of the element at the i-th row and j-th column of the adjacency matrix is 0, it can indicate that there is no edge between graph node i and graph node j (that is, there is no social association relationship between the social object corresponding to graph node i and the social object corresponding to graph node j). Both i and j can be positive integers, both i and j are less than or equal to N, and i can be equal to or not equal to j.

[0102] Subsequently, the social distance set between N graph nodes can be constructed through this adjacency matrix.

[0103] Step S102, construct a social distance set between N graph nodes based on the object relationship graph; there is a social distance in the social distance set between any two graph nodes, and the social distance between any two graph nodes is determined based on the connectivity between any two graph nodes.

[0104] Optionally, the data processing device can construct a social distance set between N graph nodes through the connection relationship between N graph nodes in the above object relationship graph. The social distance set can include the social distances between N graph nodes. There can be a social distance in the social distance set between any two graph nodes, and the social distance between any two graph nodes can be determined based on the connectivity between any two graph nodes.

[0105] Among them, the connectivity between any two graph nodes can refer to that any two graph nodes can be connected (that is, any two graph nodes are interconnected in the object relationship graph) or any two graph nodes cannot be connected (that is, any two graph nodes are not interconnected in the object relationship graph).

[0106] If any two graph nodes can be connected, it may include: there exists a shortest connected path between any two graph nodes in the object relationship graph, and the shortest connected path may include one or more connecting edges for connecting any two graph nodes and having the minimum quantity. As the name implies, the shortest connected path between any two graph nodes is the path formed by connecting any two graph nodes with the minimum number of connecting edges in the object relationship graph, that is, the path is formed by connecting edges with the minimum quantity for connecting any two graph nodes.

[0107] Optionally, any suitable shortest path detection algorithm can be adopted to detect the shortest connected path between two-by-two graph nodes that can be connected in the object relationship graph. For example, algorithms such as Dijkstra (Dijkstra's algorithm, an algorithm for detecting the shortest path between vertices) can be adopted to detect the shortest connected path between two-by-two graph nodes that can be connected in the object relationship graph.

[0108] If any two graph nodes cannot be connected, it may include: there is no shortest connected path between any two graph nodes in the object relationship graph, which can also be understood as there are no connecting edges for connecting any two graph nodes in the object relationship graph.

[0109] For example, if graph node T1 and graph node T2 are connected to each other in the object relationship graph (that is, there is a connecting edge between graph node T1 and graph node T2), graph node T2 and graph node T3 are connected to each other in the object relationship graph (that is, there is a connecting edge between graph node T2 and graph node T3), and graph node T3 and graph node T4 are connected to each other in the object relationship graph (that is, there is a connecting edge between graph node T3 and graph node T4), and, graph node T5 and graph node T6 are connected to each other (that is, there is a connecting edge between graph node T5 and graph node T6), but both graph node T5 and graph node T6 are not connected to graph nodes T1 to T4, then any two graph nodes among graph nodes T1 to T4 can be connected to each other, graph node T5 and graph node T6 can also be connected to each other, and any one of graph nodes T1 to T4 and graph node T5 or graph node T6 cannot be connected.

[0110] Therefore, the process of constructing a social distance set between N graph nodes through the object relationship graph may include: if any two graph nodes can be connected, the data processing device can obtain the quantity of the connecting edges included in the shortest connected path between any two graph nodes as the social distance between any two graph nodes.

[0111] It can be understood that there may be multiple shortest connected paths between any two graph nodes (i.e., the number of edges included in these multiple shortest connected paths is the same), but in this application, the multiple shortest connected paths between two graph nodes do not need to be distinguished. Instead, the focus is mainly on the number of edges included in the shortest connected path (the number of edges included in any one of these multiple shortest connected paths), that is, mainly on the social distance between two graph nodes.

[0112] If any two graph nodes cannot be connected, the data processing device can obtain a preset non - connected distance as the social distance between these two graph nodes. Since these two graph nodes are not connected, the preset non - connected distance can be represented by ∞ (infinity), that is, the social distance between two non - connected graph nodes can be infinity.

[0113] Please refer to Figure 5 , Figure 5 which is a schematic structural diagram of another object relationship graph provided by an embodiment of this application. As Figure 5 shown, this object relationship graph can include a total of 8 graph nodes from graph node b1 to graph node b8. This object relationship graph can include two sub - graphs, including sub - Figure 1 and sub - Figure 2 . Sub - Figure 1 includes graph nodes b1 to b5, and sub - Figure 2 includes graph nodes b6 to b8. The graph nodes in sub - Figure 1 are not connected to the graph nodes in sub - Figure 2 . Any two graph nodes in sub - Figure 1 are all connected to each other, and any two graph nodes in sub - Figure 2 are also all connected to each other. Sub - Figure 1 and sub - Figure 2 belong to different connected components. Therefore, it can be understood that the graph nodes in the same sub - graph are on the same connected component, and the graph nodes in different sub - graphs are on different connected components.

[0114] Among them, the above - mentioned social distance set can be represented by a corresponding distance matrix. The dimension of this distance matrix can be N×N, that is, the number of rows and columns of this distance matrix can both be equal to the total number N of graph nodes. Therefore, specifically, it can be understood that the above - mentioned social distance set can also include the social distance between each graph node and itself. In this application, the social distance between a graph node and itself can be equal to 0.

[0115] Each row of the distance matrix can respectively correspond to each graph node, different rows correspond to different graph nodes, and one row can correspond to one graph node. Similarly, each column of the distance matrix can also respectively correspond to each graph node, different columns correspond to different graph nodes, and one column can correspond to one graph node.

[0116] For example, each graph node can be numbered (it can be any number). The first row of the distance matrix can correspond to graph node 1 (i.e., the number of this graph node is 1), the second row of the distance matrix can correspond to graph node 2 (i.e., the number of this graph node is 2), the third row of the distance matrix can correspond to graph node 3 (i.e., the number of this graph node is 3), and so on. The Nth row of the distance matrix can correspond to graph node N (i.e., the number of this graph node is N); similarly, the first column of the distance matrix can also correspond to graph node 1, the second column of the distance matrix can correspond to graph node 2, the third column of the distance matrix can correspond to graph node 3, and so on. The Nth column of the distance matrix can also correspond to graph node N. The element at the ith row and jth column in the distance matrix can be the social distance between graph node i and graph node j.

[0117] It can be understood that since the social distance from a graph node to itself is 0, therefore, the values of the elements in the diagonal direction (i.e., the direction of the diagonal) of the distance matrix can all be equal to 0. Among them, the above object relationship graph can be represented as a corresponding adjacency matrix. Therefore, the above distance matrix (i.e., the social distance set) can be constructed by the data processing device through this adjacency matrix, and the construction principle is the same as the principle described above.

[0118] By representing the social distance set as a corresponding distance matrix, it is convenient to implement subsequent position encoding processing for each graph node, as described below.

[0119] Step S103, based on the social distance set, perform position encoding processing on each of the N graph nodes in the object relationship graph to generate position encoding information for each graph node.

[0120] Optionally, the data processing device can perform position encoding processing on each of the N graph nodes in the object relationship graph through the above social distance set (such as through the distance matrix) to generate position encoding information for each graph node. A graph node can have one position encoding information, and this position encoding information can be represented based on a sequence or a vector. The dimensions of the position encoding information of each graph node can be the same.

[0121] Among them, for the specific method of performing position encoding processing on each graph node through the social distance set to obtain the position encoding information of each graph node, reference can be made to the description in the following Figure 8 corresponding embodiments.

[0122] After obtaining the position encoding information of each graph node through encoding, according to actual application requirements, the position encoding information of each graph node can be applied to more scenarios. The following exemplarily describes several scenarios for applying the position encoding information of graph nodes, but the application scenarios of graph nodes are not limited to the several scenarios described below.

[0123] In the scenario of social object recommendation: The position encoding information of each graph node can be used as attribute information for augmenting the node attribute information of each graph node. For example, the object attribute information of each graph node can be combined with the position encoding information of each graph node respectively to obtain the augmented attribute information of each graph node. The augmented attribute information of each graph node can be the augmented attribute information of the social object corresponding to each graph node. Subsequently, through the augmented attribute information of each graph node, feature embedding processing of each graph node is implemented to obtain the node embedding features of each graph node (i.e., the feature representations of each graph node). Furthermore, through the similarity between the node embedding features of each graph node, mutual recommendation of social objects can be performed. The specific process can refer to the description in the corresponding embodiment below. Figure 9 Description in the corresponding embodiment.

[0124] Among them, by applying the position encoding information of each graph node encoded in this application to the scenario of social object recommendation, it is possible to recommend other social objects with closer positions (which can be understood as smaller social distances, that is, closer social association relationships) to social objects, thereby improving the social experience (such as game experience) of social objects and making it easier for social objects to establish social association relationships with the recommended social objects.

[0125] In a scenario where visual analysis of graph nodes is required: The position encoding information of each graph node can respectively include the encoding information of each graph node in m dimensions, where m is a positive integer. That is, the position encoding information of any graph node can include the encoding information of this graph node in m dimensions. For example, the position encoding information of any graph node can be a 3-dimensional vector (i.e., a vector containing 3 elements), and one element in this vector can be the encoding information of this graph node in one dimension.

[0126] Among them, the m dimensions can correspond to m color channels. For example, m can be equal to 3, and the 3 dimensions can correspond to the 3 color channels: color channel R (the color channel of red), color channel G (the color channel of green), and color channel B (the color channel of blue). Therefore, through the encoding information of each graph node in the m dimensions, the node color of each graph node under the m color channels can be obtained. For example, the value of the first element in the position encoding information of a graph node can be used as the color value of the graph node under color channel R, the value of the second element in the position encoding information of this graph node can be used as the color value of the graph node under color channel G, and the value of the third element in the position encoding information of this graph node can be used as the color value of the graph node under color channel B. Furthermore, the color values of this graph node under all color channels can be used to represent the node color of this graph node.

[0127] Through the above process, that is, through the encoding information of each graph node in the m dimensions in the position encoding information of each graph node, the node color of each graph node under the m color channels can be obtained, and a graph node can have a node color.

[0128] The data processing device can perform coloring processing on each graph node in the object relationship graph through the node colors of each graph node in the above N graph nodes under the m color channels, so as to display each graph node in the object relationship graph as the node color that each graph node has, and thus the colored object relationship graph can be obtained.

[0129] Through this colored object relationship graph, relevant developers can achieve visual analysis of the social association relationships between each graph node. Moreover, the present application has also carried out relevant experiments to verify the reliability of this visual analysis. In the present application, for graph nodes with closer social distances in the object relationship graph, their node colors are closer (i.e., more similar). It can be understood that the node colors of graph nodes closer in position in the object relationship graph are closer.

[0130] Combined with the node colors obtained for graph nodes by adopting the above method, the present application can also be applied to the test scenario of isomorphic graphs: for any two network graphs (which can be the same as the above object relationship graph, or network graphs constructed through other channels, and the structure of the network graphs constructed through other channels can also be similar to the above object relationship graph, such as including graph nodes and edges between graph nodes), the any two network graphs can include a first network graph and a second network graph. The first network graph and the second network graph can be two object relationship graphs, or the first network graph and the second network graph can also be any two network graphs constructed through other channels. The network graph can also be called a relationship graph, which is used to represent the relationship between the objects corresponding to the graph nodes.

[0131] The data processing device can adopt the method of this application to perform position encoding processing on each graph node in the first network graph, so as to generate the position encoding information of each graph node in the first network graph, and can obtain the node color of each graph node through the position encoding information of each graph node in the first network graph.

[0132] Similarly, the data processing device can also adopt the method of this application to perform position encoding processing on each graph node in the second network graph, generate the position encoding information of each graph node in the second network graph, and can obtain the node color of each graph node through the position encoding information of each graph node in the second network graph.

[0133] Furthermore, the data processing device can detect whether the node colors of each graph node in the first network graph are in one-to-one correspondence with the node colors of each graph node in the second network graph, that is, whether the node color of any graph node in the first network graph can find a corresponding graph node with the same node color in the second network graph, and different graph nodes in the first network graph correspond to different graph nodes in the second network graph (it can be understood that whether the color set composed of the node colors of each graph node in the first network graph is the same as the color set composed of the node colors of each graph node in the second network graph). If the node colors of each graph node in the first network graph are in one-to-one correspondence with the node colors of each graph node in the second network graph (in fact, it can also be understood that the position encoding information of each graph node in the first network graph is in one-to-one correspondence with the position encoding information of each graph node in the second network graph), then it can be determined that the first network graph and the second network graph are isomorphic to each other. On the contrary, if the node colors of each graph node in the first network graph are not in one-to-one correspondence with the node colors of each graph node in the second network graph, then it can be determined that the first network graph and the second network graph are not isomorphic to each other.

[0134] Through the above process, the test of whether any two network graphs are isomorphic can be realized.

[0135] Please refer to Figure 6 , Figure 6 which is a schematic diagram of a scenario for testing isomorphic graphs provided by an embodiment of this application. As Figure 6 shown, the network graph here can include an object relationship graph H1, an object relationship graph H2, and an object relationship graph H3. Among them, the object relationship graph H1 and the object relationship graph H2 are isomorphic to each other. Therefore, the node colors of each graph node in the object relationship graph H1 are in one-to-one correspondence with the node colors of each graph node in the object relationship graph H2.

[0136] The object relationship diagram H1 and the object relationship diagram H3 are not isomorphic to each other. Therefore, the node colors of the respective graph nodes in the object relationship diagram H1 and the node colors of the respective graph nodes in the object relationship diagram H3 are not in one-to-one correspondence; and, the object relationship diagram H2 and the object relationship diagram H3 are also not isomorphic to each other. Therefore, the node colors of the respective graph nodes in the object relationship diagram H2 and the node colors of the respective graph nodes in the object relationship diagram H3 are also not in one-to-one correspondence.

[0137] Moreover, in another scenario where visual analysis of graph nodes is required: the position encoding information of each graph node can also respectively include the encoding information of each graph node in m dimensions, and the m dimensions can correspond to m coordinate axes in the target coordinate system, and one dimension can correspond to one coordinate axis.

[0138] Therefore, the data processing device can obtain the coordinate values of each graph node on the m coordinate axes in the target coordinate system through the encoding information of each graph node in m dimensions. For example, m can be equal to 2 (in this case, it is not necessary to use the above node colors to achieve visual analysis of graph nodes). At this time, the target coordinate system can be a two-dimensional coordinate system, which can include a horizontal axis (x-axis) and a vertical axis (y-axis). The position encoding information of a graph node can be a two-dimensional vector (a vector containing 2 elements). The value of the first element in the vector can be used as the coordinate value of the graph node on the horizontal axis, and the value of the second element in the vector can be used as the coordinate value of the graph node on the vertical axis. Through the coordinate value of the graph node on the horizontal axis and the coordinate value on the vertical axis in the target coordinate system, the two-dimensional coordinate position corresponding to the graph node in the target coordinate system can be determined.

[0139] For another example, m can be equal to 3. At this time, the target coordinate system can be a three-dimensional coordinate system, which can include a horizontal axis (x-axis), a vertical axis (y-axis), and a vertical axis (z-axis). The position encoding information of a graph node can be a three-dimensional vector (a vector containing 3 elements). The value of the first element in the vector can be used as the coordinate value of the graph node on the horizontal axis, the value of the second element in the vector can be used as the coordinate value of the graph node on the vertical axis, and the value of the third element in the vector can be used as the coordinate value of the graph node on the vertical axis. Through the coordinate value of the graph node on the horizontal axis, the coordinate value on the vertical axis, and the coordinate value on the vertical axis in the target coordinate system, the three-dimensional coordinate position corresponding to the graph node in the target coordinate system can be determined. A graph node can have a corresponding coordinate position in the target coordinate system.

[0140] Therefore, in the present application, each graph node can be displayed at the coordinate position corresponding to the axes of each graph node on the m coordinate axes in the target coordinate system. The visualization analysis of the social association relationship between each graph node can also be realized through the graph nodes displayed in the target coordinate system. Moreover, relevant experiments are also conducted to verify the reliability of the visualization analysis in the present application. In the present application, for graph nodes with closer social distances in the object relationship graph, their coordinate positions in the target coordinate system are closer (i.e., nearer). It can be understood that the coordinate positions of graph nodes that are closer in the object relationship graph are closer to each other.

[0141] Please refer to Figure 7 , Figure 7 which is a schematic diagram of a scenario for visualizing the analysis of graph nodes provided by an embodiment of the present application. As Figure 7 shown, the above-mentioned target coordinate system can be a two-dimensional coordinate system, and each graph node can be displayed in the target coordinate system according to the corresponding coordinate position in the target coordinate system. In Figure 7 , the white dots can be used to represent the graph nodes of the first community members (i.e., social objects in the first community), and the black dots can be used to represent the graph nodes of the second community members (i.e., social objects in the second community). The first community and the second community can be different user groups, such as different friend groups.

[0142] It can be understood that in the actual application scenario, all or most of the social objects among the social objects in the same community are friends with each other, while all or most of the social objects among the social objects in different communities are not friends with each other. Therefore, as Figure 7 can be seen, the positions of the graph nodes of each social object in the first community are relatively close and concentrated, and the positions of the graph nodes of each social object in the second community are also relatively close and concentrated. Moreover, the graph nodes of the two community members can be linearly separable in the target coordinate system. For example, a straight line can divide the graph nodes of the first community members and the graph nodes of the second community members into two regions, which also proves the usability of the position encoding method of the present application. The position encoding information in the present application can well reflect the true position information of the graph nodes in the object relationship graph.

[0143] By adopting the above method of the present application, the accurate encoding of the positions of each graph node in the object relationship graph is achieved. The position encoding information obtained by encoding each graph node can also be applied to richer graph processing application scenarios. For example, in addition to being used for graph isomorphism testing, social object recommendation, and graph visualization analysis, the present application can also be used for node classification (such as classifying graph nodes with similar social association relationship structures (i.e., with similar position encoding information) into the same class), link prediction (such as predicting whether a social association relationship will be established between two social objects), graph classification (such as the classification of isomorphic graphs), and can also be applied to more downstream tasks, such as recommendation systems related to various object relationship graphs, or subgraph classification tasks, etc., which can be determined according to the actual application scenario and are not limited herein.

[0144] The present application can obtain an object relationship graph; the object relationship graph includes N graph nodes and the edges between the N graph nodes, where N is a positive integer. A graph node is used to represent a corresponding social object, and there is a social association relationship between the two social objects corresponding to the two graph nodes connected by any edge in the object relationship graph; and it can construct a social distance set between the N graph nodes based on the object relationship graph; there is a social distance in the social distance set between any two graph nodes, and the social distance between any two graph nodes is determined based on the connectivity between any two graph nodes; thus, based on the social distance set, the position of each graph node among the N graph nodes in the object relationship graph can be encoded to generate the position encoding information of each graph node. It can be seen that the method proposed by the present application can accurately encode the positions of each graph node in the object relationship graph based on the social distance between each graph node, so as to obtain the accurate position encoding information of each graph node, which can enrich the node information of each graph node itself, and moreover, through the accurate position encoding information of each graph node, the accurate processing of the services (such as the service of social object recommendation) carried out through the object relationship graph can also be realized.

[0145] Please refer to Figure 8 , Figure 8 is a schematic flowchart of a method for encoding the position of a graph node provided by an embodiment of the present application. As Figure 8 shown, the method may include:

[0146] Step S201, perform normalization processing on each social distance in the social distance set to generate a set of normalized social distances; after a social distance in the social distance set is normalized, it corresponds to a normalized social distance in the set of normalized social distances.

[0147] Optionally, since the social distance set can be represented as a corresponding distance matrix, normalizing each social distance in the social distance set, that is, normalizing the distance matrix, which means normalizing each element in the distance matrix to generate a normalized distance matrix. The normalized distance matrix is obtained by normalizing the distance matrix. A social distance in the distance matrix can correspond to a normalized social distance at the same position (same row and column values) in the normalized distance matrix, and the normalized social distance is obtained by normalizing the social distance.

[0148] The dimension of the normalized distance matrix is the same as that of the distance matrix. The normalized distance matrix can be a form of representation of the normalized social distance set. It can be understood that the normalized social distance set can contain each element in the normalized distance matrix.

[0149] Among them, any two of the N graph nodes can include a first graph node and a second graph node. Both the first graph node and the second graph node can be any of the N graph nodes, and the first graph node and the second graph node can be different graph nodes. The social distance set can contain the social distance between the first graph node and the second graph node. The social distance between the first graph node and the second graph node can be called the target social distance, and the target social distance can be the social distance at the position indicated by the row number corresponding to the first graph node and the column number corresponding to the second graph node in the distance matrix.

[0150] The social distance between the second graph node and the first graph node can refer to the social distance at the position indicated by the row number corresponding to the second graph node and the column number corresponding to the first graph node in the distance matrix. Although the value of this social distance is the same as that of the target social distance, the process of normalizing these two social distances will be different, as described below.

[0151] Here, taking the normalization of the target social distance between the first graph node and the second graph node as an example: The data processing device can use the graph node that is connected to the first graph node (i.e., the graph node corresponding to the row where the target social distance is located) among the N graph nodes and has the largest social distance from the first graph node as the reference graph node corresponding to the first graph node. The reference graph node can be used to normalize the social distances in the entire row corresponding to the row number of the first graph node in the distance matrix.

[0152] The data processing device can use the social distance between the first graph node and the reference graph node as the reference social distance, and the reference social distance can be defined as the diameter of the first graph node. It can be understood that the reference social distance can be the largest social distance in the entire row corresponding to the row number of the first graph node in the distance matrix.

[0153] Thus, the data processing device can normalize the target social distance through the ratio between the target social distance and the reference social distance to obtain the normalized social distance corresponding to the target social distance. As shown in the following formula:

[0154]

[0155] Among them, is the ratio between the target social distance and the reference social distance, d mb represents the target social distance, d ck represents the reference social distance, π represents the pi, cos represents the cosine function, represents the normalized social distance corresponding to the target social distance, and u is a hyperparameter. Through the in the above formula, the target social distance (at this time, the second graph node can be any graph node connected to the first graph node) can be mapped to the phase [0, π]. Furthermore, through the cosine function cos to perform an operation on the , the target social distance can be mapped to (i.e., normalized to) the range [-1, 1].

[0156] When the first graph node and the second graph node cannot be connected (i.e., when d mb = ∞), the normalized social distance of the target social distance between the first graph node and the second graph node can be set to u. Optionally, since the graph nodes are not connected in this case, u can be set to a value smaller than -1, such as u can be set to -1.5.

[0157] Optionally, the social distance at any position in the distance matrix (including the social distance between a graph node and itself) can be normalized according to the principle of the above formula (1) to obtain the corresponding normalized social distance.

[0158] Step S202: Based on the set of normalized social distances, perform encoding processing on the positions of each graph node in the object relationship graph to generate the position encoding information of each graph node.

[0159] Optionally, if the indices (such as numbers) between the graph nodes in the exchange object relationship graph are exchanged, the rows and columns of the canonical distance matrix will be permuted simultaneously, resulting in no one-to-one correspondence between the rows of the permuted canonical distance matrix and the rows of the canonical distance matrix before permutation. Therefore, the canonical distance matrix does not have the property of permutation equivariance. In the application scenarios of graph processing, it is usually desired to process graph data (such as data associated with the object relationship graph, such as the position encoding matrix), so that when there are multiple network graphs and the indices of the same social object are different in different network graphs, the establishment of social association relationships between social objects can also be ensured to conform to the actual situation, that is, to ensure the accuracy of the position encoding of each social object, because the position encoding of each social object depends on the establishment of social association relationships between each social object.

[0160] Therefore, since the dimension of the canonical distance matrix is too large, including the canonical social distances between all nodes in the entire object relationship graph, and the canonical distance matrix does not have the property of permutation equivariance, therefore, in this application, the rows in the canonical distance matrix are not directly used as the position encoding information obtained by finally encoding the graph nodes, but the canonical distance matrix can be further subjected to an equivariant transformation to achieve compression of the dimension of the canonical distance matrix and make the compressed canonical distance matrix have the property of permutation equivariance, as described below.

[0161] Therefore, the data processing device can further encode the positions of each of the above N graph nodes in the object relationship graph through the obtained canonical distance matrix to generate the position encoding information of each graph node.

[0162] The data processing device can perform an equivariant transformation on the canonical distance matrix to generate an information compression matrix. The dimension of this information compression matrix is smaller than the dimension of the canonical distance matrix. This information compression matrix can be a matrix used to compress the dimension of the canonical distance matrix (i.e., information compression). Exemplarily, the process of performing an equivariant transformation on the canonical distance matrix to generate an information compression matrix can include:

[0163] The data processing device can obtain the transpose matrix of the canonical distance matrix and can obtain the product between the transpose matrix and the canonical distance matrix (such as left-multiplying the canonical distance matrix by its transpose matrix) as the transformation matrix, that is, this transformation matrix can be the matrix obtained after left-multiplying the canonical distance matrix by its transpose matrix. The dimension of this transformation matrix is the same as the dimension of the canonical distance matrix. For example, the dimension of the transformation matrix can also be N*N.

[0164] It can be understood that by left - multiplying the canonical distance matrix by its transpose matrix, it can be considered that the elements in the canonical distance matrix are squared. In this way, the values of all elements in the canonical distance matrix can be transformed into values greater than or equal to 0, so as to facilitate subsequent matrix decomposition processing.

[0165] The data processing device can perform an equivariant decomposition process on this transformation matrix to generate the above - mentioned information compression matrix. This process can include:

[0166] The above - mentioned transformation matrix can contain N columns of elements. The data processing device can calculate the eigen - coefficients corresponding to each column of elements in the transformation matrix. One column of elements corresponds to one eigen - coefficient, and this eigen - coefficient is also called the eigenvalue of the matrix (a concept in linear algebra), which is used to describe the transformation property of the matrix (here it can be used to describe the transformation property of each column of elements in the transformation matrix) and can be calculated by any eigenvalue - solving method. The concept of this eigenvalue can include: assuming that A is a square matrix of order p, if there exist a number q and a non - zero p - dimensional column vector r such that Ar = qr holds, then q is called an eigenvalue or eigen - value of A.

[0167] Among them, the eigen - coefficients of each column of elements in the transformation matrix can be used to characterize the amount of information contained in each column of elements. If the eigen - coefficient of a column of elements is larger, it indicates that the column of elements contains more information, that is, it has more information value; conversely, if the eigen - coefficient of a column of elements is smaller, it indicates that the column of elements contains less information, that is, it has less information value.

[0168] Furthermore, the data processing device can generate a diagonal matrix through the eigen - coefficients corresponding to each column of elements in the transformation matrix. In the diagonal direction (i.e., the direction of the diagonal) of this diagonal matrix, the N eigen - coefficients corresponding to the N columns of elements in the transformation matrix are arranged in descending order. For example, the element at the first row and first column in this diagonal matrix can be the largest of the N eigen - coefficients, the element at the second row and second column in this diagonal matrix can be the second - largest of the N eigen - coefficients, and so on.

[0169] The data processing device can perform an equivariant decomposition process on the transformation matrix through the above - mentioned diagonal matrix to generate a decomposition matrix. This decomposition matrix can be composed of the N columns of elements in the transformation matrix, that is, this decomposition matrix can contain each column of elements in the transformation matrix. Each column of elements in these N columns of elements in the decomposition matrix can be arranged in descending order according to the corresponding eigen - coefficients. For example, the column of elements with the largest eigen - coefficient can be the first column of elements in the decomposition matrix, the column of elements with the second - largest eigen - coefficient can be the second column of elements in the decomposition matrix, and so on.

[0170] Among them, the decomposition matrix can be obtained by performing an equivariant decomposition on the transformation matrix using the decomposition algorithm (the principal component analysis algorithm) shown in the following formula, as shown in the following formula:

[0171]

[0172] The above-mentioned can be the above-mentioned canonical distance matrix, is the transpose matrix of the canonical distance matrix, is the above-mentioned transformation matrix, V is the above-mentioned decomposition matrix, is the above-mentioned diagonal matrix, V T is the transpose matrix of the decomposition matrix. Through the above process, an equivariant decomposition process can be performed on the transformation matrix to generate a decomposition matrix. Or in an actual application scenario, other decomposition algorithms can also be used to decompose the transformation matrix to obtain a corresponding decomposition matrix and information compression matrix, which is not limited in this application.

[0173] Furthermore, the data processing device can use the first m column elements in the decomposition matrix to construct the above-mentioned information compression matrix, that is, the information compression matrix can be composed of the elements arranged in the first m columns of the decomposition matrix. The first m column elements can be the m column elements with the largest amount of information (that is, the most information, which can also be understood as the most features) in the transformation matrix. These m column elements can be understood as the principal components in the transformation matrix. m is a positive integer, m is less than N, and the value of m can be determined according to the actual application scenario. For example, m can take the value of 2 or 3 or other values. The dimension of the information compression matrix can be N*m.

[0174] The data processing device can use the above-generated information compression matrix to perform information compression processing on the canonical distance matrix to generate a final position encoding matrix, as shown in the following formula:

[0175]

[0176] The above-mentioned can be the position encoding matrix, is the above-mentioned canonical distance matrix, is the above-mentioned information compression matrix. Since has a dimension of N*N, has a dimension of N*m, therefore, is finally compressed into For the N*m dimension, if the dimension of the position encoding matrix is less than that of the canonical distance matrix, the position encoding matrix contains the position encoding information obtained by encoding the positions of each of the above N graph nodes in the object relationship graph. Each graph node has one position encoding information. For example, a vector composed of a row of elements in the position encoding matrix can be the position encoding information of a corresponding graph node, and the dimension of this position encoding information can be 1*m.

[0177] Through the above process of this application, that is, using the social association relationships between social objects to encode, the position encoding information of each social object is generated. Through the position encoding information of each social object obtained by encoding, the object relationship graph in the non-Euclidean space is mapped to the corresponding Euclidean space, enabling more accurate business processing using the object relationship graph in the Euclidean space subsequently.

[0178] In summary, the technical solution of this application does not learn the network graph by redesigning the graph neural network, but directly performs deterministic position encoding on the graph nodes based on the position information (such as connection relationships) between graph node pairs. In terms of design, this encoding method can handle the position encoding between graph nodes on different connected components (i.e., graph nodes that cannot be connected). Moreover, the position encoding information in this application can be pre-computed (i.e., pre-calculated). Therefore, when processing large-scale graph neural networks, it can only be used as an augmented object attribute, so there will be no more additional overhead. In addition, the position encoding in this application is permutation-equivariant and has no randomness (because it is equivariantly encoded through a series of deterministic mathematical operations), which also ensures the certainty and accuracy of the position encoding of each graph node. Also, in the actual offline experiments of this application, it has been proved that the position encoding in this application has extremely strong representation ability and cross-graph generalization ability.

[0179] Furthermore, the method of this application has been specifically experimented in the graph isomorphism test scenario, and the experimental results are as shown in Table 1 below.

[0180]

[0181] Table 1

[0182] Among them, Graph8C, SR25, and EXP are three different isomorphic graph test datasets. Through these three test datasets, this application conducts experiments on various isomorphic graph test methods and obtains the number of samples with test errors of various isomorphic graph test methods on these three test datasets. Therefore, the fewer the number of samples with test errors, the more accurate the test. The various isomorphic graph test methods include MLP (a test method based on a multi-layer perceptron), GCN (a test method based on the graph convolutional network GCN), GAT (a test method based on the graph attention network GAT), GIN (a test method based on the graph isomorphism network GIN), CHEBNET (a test method based on the Chebyshev network CHEBNET), F-GNN (a test method of a graph neural network based on a high-order WL Test (a graph isomorphism test) equivalent graph isomorphism algorithm), PEG (a test method based on Laplacian matrix factorization), SBIN (another test method based on Laplacian matrix factorization), GNNML1 (a test method of a graph neural network based on matrix language), GNNML3 (a test method of a graph neural network based on high-order matrix language), and the test method based on this application (i.e., this method, which is a test method based on the position encoding information generated by this application).

[0183] As shown in Table 1 above, for the isomorphic graph test method provided with position encoding information based on this application, the number of samples with test errors on each test dataset is the least, which also reflects the reliability and effectiveness of the position encoding of graph nodes in this application.

[0184] In addition, the method of this application has also been specifically experimented in the recommendation scenario of social objects, and the experimental results are as shown in Table 2 below.

[0185]

[0186] Table 2

[0187] Cora, CiteSeer, ENZYMES, PROTEINS, and MUTAG in Table 2 above are 5 publicly available network graph datasets (which can be abbreviated as graph datasets for short). In this application, corresponding experiments on various graph neural networks and positional encodings for multiple graph processing tasks were carried out through these 5 publicly available graph datasets, and the accuracy rates (i.e., the correct rates) of various graph neural networks and positional encodings in various graph processing tasks were obtained. These multiple graph processing tasks include node classification tasks (i.e., tasks of classifying graph nodes), link prediction tasks (such as predicting whether there is a connection between two graph nodes), and graph classification tasks (such as tasks of classifying isomorphic graphs). These various graph neural networks and positional encodings include GCN (a type of multi-layer perceptron), SAGE (a type of graph neural network), GAT (a type of graph attention network), GIN (a type of graph isomorphism network), F-GNN (a graph neural network of a high-order WL Test equivalent graph isomorphism algorithm), ID-GNN (a label-aware graph neural network), GraphSNN (a graph neural network based on subgraph similarity), Laplacian PE (a positional encoding based on principal component analysis dimensionality reduction using the graph Laplacian matrix), RNI (a positional encoding that uses random augmentation for graph nodes), PEG (a positional encoding based on Laplacian matrix factorization), and this method (i.e., the method based on positional encoding information).

[0188] As shown in Table 2 above, overall, the application of the positional encoding information in this application has a high accuracy rate in the process of multiple graph processing tasks, which also reflects that the positional encoding in this application has good cross-graph and cross-task generalization capabilities.

[0189] Please refer to Figure 9 , Figure 9 is a schematic flowchart of a recommendation method for social objects provided by an embodiment of this application. As Figure 9 shown, the method may include:

[0190] Step S301, based on the object attribute information and positional encoding information of each graph node, perform feature embedding processing on each graph node to generate the node embedding features of each graph node.

[0191] Optionally, each of the N graph nodes may have the object attribute information of its corresponding social object. Therefore, the data processing device may perform feature embedding processing on each graph node through the object attribute information of each graph node and the positional encoding information obtained by the above encoding to generate the node embedding features of each graph node. A graph node may have one node embedding feature, and the node embedding feature of a graph node may be used to represent the object feature of the social object corresponding to the graph node. Optionally, the node embedding feature of a graph node may be a feature vector.

[0192] Among them, the process by which the data processing device performs feature embedding processing on each graph node through the object attribute information and position encoding information of each graph node to generate the node embedding features of each graph node may include:

[0193] The data processing device may use the position encoding information of each graph node to perform information augmentation processing on the object attribute information of each graph node respectively to obtain the augmented attribute information of each graph node. The augmented attribute information of a graph node may be obtained by combining the object attribute information of the graph node and the position encoding information of the graph node. For example, the object attribute information of a graph node and the position encoding information of the graph node may be concatenated to obtain the augmented attribute information of the graph node, and the augmented attribute information may also be a vector. As shown in the following formula:

[0194]

[0195] The above CONCAT represents horizontal concatenation. X is a matrix composed of the object attribute information of each graph node. is the above position encoding matrix. is the augmented attribute matrix obtained by concatenating the object attribute information and position encoding information of each graph node, and the augmented attribute matrix contains the augmented attribute information of each graph node.

[0196] The data processing device may also obtain a feature embedding network. The feature embedding network may be a pre-trained neural network that can be used to perform feature embedding processing on information, and the feature embedding network may be a network that can process graph data (such as an object relationship graph). For example, the feature embedding network may be a GNN network (a neural network that can process graph data), and the GNN network may be but is not limited to GCN (a graph convolutional neural network), GraphSAGE (a graph neural network), GAT (a graph attention network), and GIN (a graph isomorphism network).

[0197] Therefore, the data processing device may call the feature embedding network to perform feature embedding processing on each graph node through the above object relationship graph and the augmented attribute information of each graph node, and thus generate the node embedding features of each graph node. As shown in the following formula:

[0198]

[0199] Among them, GNN represents the above graph neural network, and B can be used to represent the adjacency matrix corresponding to the object relationship graph. That is the augmented attribute matrix mentioned above. Y represents the embedding feature matrix generated by the GNN network through the adjacency matrix and the augmented attribute matrix for embedding each graph node. This embedding feature matrix contains the node embedding features of each graph node. For example, a vector formed by a row of elements in this embedding feature matrix can be the node embedding feature of a corresponding graph node.

[0200] Step S302: Based on the node embedding features of each graph node, recommend social objects for establishing social association relationships to the social objects corresponding to each graph node.

[0201] Optionally, the data processing device can recommend other social objects for establishing social association relationships to the social objects corresponding to each graph node based on the similarity between the node embedding features of each graph node. For example, social objects corresponding to graph nodes with similar node embedding features can be recommended to each other.

[0202] Exemplarily, any one of the above N graph nodes can be a target graph node. Here, taking the example of recommending more social objects to the social object corresponding to the target graph node for illustration, it can be understood that the principle of recommending more social objects to the social objects corresponding to each graph node can be the same, as described below.

[0203] The data processing device can use the graph nodes whose corresponding social objects have no social association relationship with the social object corresponding to the target graph node among the above N graph nodes as candidate graph nodes. Generally speaking, there can be many candidate graph nodes.

[0204] Furthermore, the data processing device can obtain the feature similarity between the node embedding feature of the target graph node and the node embedding features of each candidate graph node. For example, the data processing device can obtain the cosine similarity between the node embedding feature of the target graph node and the node embedding features of each candidate graph node as the feature similarity between the node embedding feature of the target graph node and the node embedding features of each candidate graph node. There is a feature similarity between the node embedding feature of the target graph node and the node embedding feature of a candidate graph node.

[0205] It can be understood that the greater the feature similarity between the node embedding features of a target graph node and those of a candidate graph node, the more similar the node embedding features of the target graph node are to those of the candidate graph node, that is, the more similar the object features of the social object corresponding to the target graph node are to the object features of the social object corresponding to the candidate graph node. Conversely, the smaller the feature similarity between the node embedding features of a target graph node and those of a candidate graph node, the less similar the node embedding features of the target graph node are to those of the candidate graph node, that is, the less similar the object features of the social object corresponding to the target graph node are to the object features of the social object corresponding to the candidate graph node.

[0206] The data processing device can sort each candidate graph node in descending order of the feature similarity between the node embedding features of the target graph node and those of each candidate graph node to obtain the sorted candidate graph nodes. Among the sorted candidate graph nodes, each candidate graph node can be arranged in descending order of the feature similarity between the corresponding node embedding features and the node embedding features of the target graph node.

[0207] The data processing device can use the social objects corresponding to the top K candidate graph nodes among the sorted candidate graph nodes as the social objects whose object features are similar to those of the social object corresponding to the target graph node, and can recommend the social objects corresponding to the top K candidate graph nodes to the social object corresponding to the target graph node to establish a social association relationship. K is a positive integer, and K can be less than the total number of candidate graph nodes.

[0208] Please refer to Figure 10 , Figure 10 which is a schematic diagram of an interface for recommending social objects provided by an embodiment of the present application. As Figure 10 shown, the social objects in the present application can be game players. Therefore, the recommendation interface for social objects can be a game interface. In the recommended friend list in the game interface, other social objects recommended to the social object (including the social objects to which the nicknames 1, 2, and 3 belong here) can be displayed, and the user is supported to click the "Apply to Add" button in the game interface to add the corresponding social object as their game friend, that is, establish a social association relationship with the corresponding social object.

[0209] Through the above process, accurate mutual recommendation between the social objects corresponding to each graph node is achieved by combining the position encoding information of each graph node, enabling mutual recommendation of social objects with closer social distances, thereby improving the accuracy of recommending social objects and enhancing the social experience of social objects.

[0210] Please refer to Figure 11 , Figure 11 which is a schematic flow chart of position encoding and application provided by an embodiment of this application. As Figure 11 shown, this flow may include:

[0211] Step S401, the data processing device may obtain the friend relationship chain of players (such as game players), that is, obtain the friend relationships (i.e., social association relationships) between various game players in a social platform (such as a game application). Here, obtaining the friend relationship chain may be obtaining the above object relationship graph, and the object relationship graph contains the friend relationships between various game players.

[0212] Step S402, the data processing device may calculate a shortest path length matrix, and this shortest path length matrix may be the above distance matrix, and the distance matrix may contain the shortest path lengths (i.e., social distances) between various game players.

[0213] Step S403, the data processing device may perform an equivariant position encoding on each graph node through the above shortest path length matrix to generate position encoding information for each graph node.

[0214] Step S404, the data processing device may apply the position encoding information generated for each graph node above to a downstream recommendation task, and this recommendation task may be the above Figure 9 task of recommending game players in the corresponding embodiment.

[0215] By using the above method provided by this application, accurate position encoding information can be obtained for the graph nodes of each game player. Furthermore, the position encoding information of the graph nodes of each game player can be applied to more downstream tasks.

[0216] Please refer to Figure 12 , Figure 12 which is a schematic structural diagram of a data processing device provided by an embodiment of this application. As Figure 12 shown, this data processing device 120 may include: an acquisition module 1201, a construction module 1202, and a generation module 1203.

[0217] The acquisition module 1201 is configured to acquire an object relationship graph; the object relationship graph contains N graph nodes and the edges between the N graph nodes, N is a positive integer, one graph node is used to represent a corresponding social object, and there is a social association relationship between the two social objects corresponding to the two graph nodes connected by any edge in the object relationship graph;

[0218] A construction module 1202 is configured to construct a set of social distances between N graph nodes based on an object relationship graph; there is one social distance in the set of social distances between any two graph nodes, and the social distance between any two graph nodes is determined based on the connectivity between any two graph nodes;

[0219] A generation module 1203 is configured to perform encoding processing on the positions of each of the N graph nodes in the object relationship graph based on the set of social distances, and generate position encoding information for each graph node.

[0220] Optionally, the connectivity between any two graph nodes means that any two graph nodes can be connected or cannot be connected;

[0221] Among them, that any two graph nodes can be connected includes: there is a shortest connected path between any two graph nodes in the object relationship graph; the shortest connected path between any two graph nodes includes one or more connecting edges for connecting any two graph nodes;

[0222] That any two graph nodes cannot be connected includes: there is no shortest connected path between any two graph nodes in the object relationship graph.

[0223] Optionally, the way for the construction module 1202 to construct a set of social distances between N graph nodes based on the object relationship graph includes:

[0224] If any two graph nodes can be connected, obtain the number of connecting edges included in the shortest connected path between any two graph nodes as the social distance between any two graph nodes; and,

[0225] If any two graph nodes cannot be connected, obtain a preset non - connection distance as the social distance between any two graph nodes.

[0226] Optionally, the way for the generation module 1203 to perform encoding processing on the positions of each of the N graph nodes in the object relationship graph based on the set of social distances and generate position encoding information for each graph node includes:

[0227] Normalize each social distance in the set of social distances to generate a set of normalized social distances; after a social distance in the set of social distances is normalized, it corresponds to a normalized social distance in the set of normalized social distances;

[0228] Based on the set of normalized social distances, perform encoding processing on the positions of each graph node in the object relationship graph to generate position encoding information for each graph node.

[0229] Optionally, any two graph nodes include a first graph node and a second graph node, and the set of social distances includes a target social distance between the first graph node and the second graph node;

[0230] The generation module 1203 normalizes each social distance in the social distance set to generate a set of normalized social distances, and the methods include:

[0231] Regarding the graph node that is connected to the first graph node among the N graph nodes and has the largest social distance from the first graph node as the reference graph node corresponding to the first graph node;

[0232] Determine the social distance between the first graph node and the reference graph node as the reference social distance;

[0233] Based on the ratio between the target social distance and the reference social distance, normalize the target social distance to obtain the normalized social distance corresponding to the target social distance.

[0234] Optionally, the set of normalized social distances is represented as a normalized distance matrix;

[0235] The generation module 1203 encodes the positions of each graph node in the object relationship graph based on the set of normalized social distances, and the methods for generating the position encoding information of each graph node include:

[0236] Perform an equivariant transformation on the normalized distance matrix to generate an information compression matrix;

[0237] Use the information compression matrix to perform information compression on the normalized distance matrix to generate a position encoding matrix;

[0238] Among them, the dimension of the position encoding matrix is smaller than that of the normalized distance matrix, and the position encoding matrix contains the position encoding information obtained by encoding the positions of each graph node in the object relationship graph.

[0239] Optionally, the method for the generation module 1203 to perform an equivariant transformation on the normalized distance matrix to generate an information compression matrix includes:

[0240] Obtain the transpose matrix of the normalized distance matrix, and obtain the product between the transpose matrix and the normalized distance matrix as the transformation matrix;

[0241] Perform an equivariant decomposition on the transformation matrix to generate an information compression matrix.

[0242] Optionally, the transformation matrix contains N columns of elements; the method for the generation module 1203 to perform an equivariant decomposition on the transformation matrix to generate an information compression matrix includes:

[0243] Calculate the characteristic coefficients corresponding to each column of elements in the transformation matrix; the characteristic coefficient corresponding to any column of elements is used to indicate the amount of information contained in any column of elements;

[0244] Generate a diagonal matrix based on the feature coefficients corresponding to each column of elements; the N feature coefficients corresponding to the N columns of elements are arranged in descending order and sequentially arranged in the diagonal direction of the diagonal matrix;

[0245] Based on the diagonal matrix, perform an equivariant decomposition process on the transformation matrix to generate a decomposition matrix; the decomposition matrix contains N columns of elements, and each column of elements in the N columns of elements is sequentially arranged in the decomposition matrix in the order of the corresponding feature coefficients from large to small;

[0246] Use the first m columns of elements in the decomposition matrix to construct an information compression matrix; m is a positive integer and m is less than N.

[0247] Optionally, the N graph nodes have object attribute information of their respective corresponding social objects; the above device 120 further includes a recommendation module 1204, and the recommendation module 1204 is configured to:

[0248] Based on the object attribute information and position encoding information of each graph node, perform feature embedding processing on each graph node to generate node embedding features of each graph node;

[0249] Based on the node embedding features of each graph node, recommend social objects for establishing social association relationships to the social objects corresponding to each graph node.

[0250] Optionally, the manner in which the recommendation module 1204 performs feature embedding processing on each graph node based on the object attribute information and position encoding information of each graph node to generate node embedding features of each graph node includes:

[0251] Use the position encoding information of each graph node to perform information augmentation processing on the object attribute information of each graph node respectively to obtain the augmented attribute information of each graph node;

[0252] Call a feature embedding network to perform feature embedding processing on each graph node based on the object relationship graph and the augmented attribute information of each graph node to generate node embedding features of each graph node.

[0253] Optionally, any one of the N graph nodes is a target graph node; the manner in which the recommendation module 1204 recommends social objects for establishing social association relationships to the social objects corresponding to each graph node based on the node embedding features of each graph node includes:

[0254] Determine the graph nodes whose corresponding social objects in the N graph nodes do not have a social association relationship with the social object corresponding to the target graph node as candidate graph nodes;

[0255] Obtain the feature similarity between the node embedding feature of the target graph node and the node embedding features of each candidate graph node;

[0256] Sort each candidate graph node according to the feature similarity between the node embedding features of the target graph node and the node embedding features of each candidate graph node in descending order to obtain the sorted candidate graph nodes;

[0257] Recommend the social objects corresponding to the top K candidate graph nodes among the sorted candidate graph nodes to the social object corresponding to the target graph node to establish a social association relationship; K is a positive integer.

[0258] Optionally, the position encoding information of each graph node respectively includes the encoding information of each graph node in m dimensions, where m is a positive integer, and the m dimensions correspond to m color channels; the above device 120 further includes a display module 1205, and the display module 1205 is configured to:

[0259] Based on the encoding information of each graph node in m dimensions, respectively determine the node colors of each graph node in m color channels;

[0260] Based on the node colors of each graph node in m color channels, perform a coloring process on each graph node in the object relationship graph to obtain the colored object relationship graph.

[0261] Optionally, the position encoding information of each graph node respectively includes the encoding information of each graph node in m dimensions, where m is a positive integer, and the m dimensions correspond to m coordinate axes in the target coordinate system; the display module 1205 is further configured to:

[0262] Based on the encoding information of each graph node in m dimensions, respectively determine the coordinate values of each graph node on the m coordinate axes in the target coordinate system;

[0263] Display each graph node at the corresponding coordinate position in the target coordinate system according to the coordinate values of each graph node on the m coordinate axes.

[0264] According to an embodiment of the present application, Figure 3 The steps involved in the data processing method shown can be Figure 12 executed by each module in the data processing device 120 shown. For example, Figure 3 the step S101 shown in Figure 12 can be executed by the acquisition module 1201 in Figure 3 the step S102 shown in Figure 12 can be executed by the construction module 1202 in; Figure 3 the step S103 shown in Figure 12 can be executed by the generation module 1203 in.

[0265] This application can obtain an object relationship graph; the object relationship graph includes N graph nodes and the edges connecting the N graph nodes, where N is a positive integer. A graph node is used to represent a corresponding social object, and there is a social association relationship between the two social objects corresponding to the two graph nodes connected by any edge in the object relationship graph; and it can construct a social distance set between the N graph nodes based on the object relationship graph; there is a social distance in the social distance set between any two graph nodes, and the social distance between any two graph nodes is determined based on the connectivity between any two graph nodes; thus, based on the social distance set, the positions of each of the N graph nodes in the object relationship graph can be encoded to generate the position encoding information of each graph node. It can be seen that the device proposed in this application can accurately encode the positions of each graph node in the object relationship graph based on the social distance between each graph node, so as to obtain the accurate position encoding information of each graph node, which can enrich the node information of each graph node itself, and moreover, through the accurate position encoding information of each graph node, it is also possible to accurately process the services (such as social object recommendation services) carried out through the object relationship graph.

[0266] According to an embodiment of the present application, Figure 12 Each module in the data processing device 120 shown can be separately or all combined into one or several units to form, or a certain one (or some) of the units can be further split into multiple smaller sub-units in terms of function, and the same operations can be achieved without affecting the realization of the technical effects of the embodiments of the present application. The above modules are divided based on logical functions. In actual applications, the function of one module can also be realized by multiple units, or the functions of multiple modules can be realized by one unit. In other embodiments of the present application, the data processing device 120 can also include other units. In actual applications, these functions can also be assisted by other units and can be realized by the cooperation of multiple units.

[0267] In the embodiments of the present application, the term "module" or "unit" refers to a computer program with a predetermined function or a part of a computer program, which works together with other related parts to achieve a predetermined goal, and can be fully or partially implemented by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of the overall module or unit that includes the function of the module or unit.

[0268] According to an embodiment of the present application, a computer program capable of executing the steps involved in the corresponding methods shown in the embodiments of the present application can be run on a general-purpose computer device (which may include processing elements and storage elements such as a central processing unit (CPU), a random access storage medium (RAM), and a read-only storage medium (ROM)) to construct a data processing device 120 as shown in Figure 12 . The above computer program can be recorded on a computer-readable recording medium, and can be loaded into the above computer device through the computer-readable recording medium and run therein.

[0269] Please refer to Figure 13 , Figure 13 which is a schematic structural diagram of a computer device provided by an embodiment of the present application. As shown in Figure 13 , the computer device 1000 may include: a processor 1001, a network interface 1004, and a memory 1005. In addition, in some embodiments, the computer device 1000 may further include: a user interface 1003, and at least one communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. Among them, the user interface 1003 may include a display screen (Display) and a keyboard (Keyboard). Optionally, the user interface 1003 may further include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a non-volatile memory, such as at least one disk memory. Optionally, the memory 1005 may also be at least one storage device located far from the aforementioned processor 1001. As shown in Figure 13 , the memory 1005, as a computer storage medium, may include an operating system, a network communication module, a user interface module, and a device control application program.

[0270] In the computer device 1000 shown in Figure 13 , the network interface 1004 can provide network communication functions; while the user interface 1003 is mainly used to provide an input interface for users; and the processor 1001 can be used to call the device control application program stored in the memory 1005 to implement:

[0271] Obtain an object relationship graph; the object relationship graph contains N graph nodes and the edges between the N graph nodes. N is a positive integer. A graph node is used to represent a corresponding social object. There is a social association relationship between the two social objects corresponding to the two graph nodes connected by any edge in the object relationship graph;

[0272] Construct a social distance set between N graph nodes based on an object relationship graph; there is a social distance in the social distance set between any two graph nodes, and the social distance between any two graph nodes is determined based on the connectivity between any two graph nodes;

[0273] Based on the social distance set, perform encoding processing on the positions of each of the N graph nodes in the object relationship graph to generate position encoding information for each graph node.

[0274] It should be understood that the computer device 1000 described in the embodiments of the present application can execute the descriptions of the above data processing methods in the embodiments of the present application, and can also execute the descriptions of the above data processing device 120 in the corresponding embodiments described above, which will not be elaborated here. In addition, the description of the beneficial effects of using the same method will not be elaborated either. Figure 12

[0275]

[0275] In addition, it should be pointed out here that: the present application also provides a computer-readable storage medium, and a computer program is stored in the computer-readable storage medium. When the processor executes the computer program, it can execute the descriptions of the data processing methods in the embodiments of the present application. Therefore, it will not be elaborated here. In addition, the description of the beneficial effects of using the same method will not be elaborated either. For the technical details not disclosed in the embodiments of the computer storage medium involved in the present application, please refer to the description of the method embodiments of the present application.

[0276] As an example, the above computer program can be deployed to be executed on a computer device, or deployed to be executed on multiple computer devices located at one location. Or, it can be executed on multiple computer devices distributed at multiple locations and interconnected through a communication network. The multiple computer devices distributed at multiple locations and interconnected through a communication network can form a blockchain network.

[0277] The above computer-readable storage medium can be an internal storage unit of the above computer device, such as the hard disk or memory of the computer device. The computer-readable storage medium can also be an external storage device of the computer device, such as a plug-in hard disk equipped on the computer device, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Further, the computer-readable storage medium can also include both the internal storage unit and the external storage device of the computer device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium can also be used to temporarily store the data that has been output or will be output.

[0278] The present application provides a computer program product, which includes a computer program stored in a computer-readable storage medium. The processor of the computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the description of the above data processing method in the embodiments of the present application. Therefore, it will not be elaborated here. In addition, the beneficial effects of using the same method will not be elaborated either. For the technical details not disclosed in the embodiments of the computer-readable storage medium involved in the present application, please refer to the description of the method embodiments of the present application.

[0279] In the description of the embodiments of the present application, the terms "first", "second", etc. in the specification, claims and drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, device, product or equipment that includes a series of steps or units is not limited to the listed steps or modules, but may optionally further include unlisted steps or modules, or may optionally further include other step units inherent to these processes, methods, devices, products or equipment.

[0280] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been generally described according to their functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.

[0281] The above-disclosed are only the preferred embodiments of the present application, and of course, the scope of the rights of the present application cannot be limited thereby. Therefore, equivalent changes made according to the claims of the present application still fall within the scope covered by the present application.

Claims

1. A data processing method, characterized in that, The method includes: Obtaining an object relationship graph; the object relationship graph includes N graph nodes and the edges between the N graph nodes, where N is a positive integer, and one graph node is used to represent a corresponding social object, and there is a social association relationship between the two social objects corresponding to the two graph nodes connected by any edge in the object relationship graph; Constructing a social distance set between the N graph nodes based on the object relationship graph; there is a social distance in the social distance set between any two graph nodes, and the social distance between any two graph nodes is determined based on the connectivity between the any two graph nodes; Based on the social distance set, encoding the positions of the respective graph nodes in the object relationship graph among the N graph nodes to generate position encoding information of the respective graph nodes.

2. The method according to claim 1, wherein The connectivity between any two graph nodes means that the any two graph nodes can be connected or cannot be connected; Among them, the situation that the any two graph nodes can be connected includes: there is a shortest connected path between the any two graph nodes in the object relationship graph; the shortest connected path between the any two graph nodes includes one or more edges for connecting the any two graph nodes; The situation that the any two graph nodes cannot be connected includes: there is no shortest connected path between the any two graph nodes in the object relationship graph.

3. The method according to claim 2, characterized in that The constructing the social distance set between the N graph nodes based on the object relationship graph includes: If the any two graph nodes can be connected, obtaining the number of edges included in the shortest connected path between the any two graph nodes as the social distance between the any two graph nodes; and If the any two graph nodes cannot be connected, obtaining a preset non-connected distance as the social distance between the any two graph nodes.

4. The method according to claim 1, characterized in that, The encoding the positions of the respective graph nodes in the object relationship graph among the N graph nodes based on the social distance set to generate the position encoding information of the respective graph nodes includes: Normalizing each social distance in the social distance set to generate a normalized social distance set; after a social distance in the social distance set is normalized, it corresponds to a normalized social distance in the normalized social distance set; Based on the normalized social distance set, encoding the positions of the respective graph nodes in the object relationship graph to generate the position encoding information of the respective graph nodes.

5. The method according to claim 4, wherein The any two graph nodes include a first graph node and a second graph node, and the target social distance between the first graph node and the second graph node is included in the social distance set; The normalizing each social distance in the social distance set to generate a normalized social distance set includes: Taking the graph node that is connected to the first graph node and has the largest social distance from the first graph node among the N graph nodes as the reference graph node corresponding to the first graph node; Determining the social distance between the first graph node and the reference graph node as the reference social distance; Normalize the target social distance based on the ratio between the target social distance and the reference social distance to obtain the normalized social distance corresponding to the target social distance.

6. The method according to claim 4, characterized in that, The set of normalized social distances is represented as a normalized distance matrix; Encoding the positions of the respective graph nodes in the object relationship graph based on the set of normalized social distances to generate position encoding information for the respective graph nodes, including: Performing an equivariant transformation on the normalized distance matrix to generate an information compression matrix; Using the information compression matrix to perform information compression on the normalized distance matrix to generate a position encoding matrix; Wherein, the dimension of the position encoding matrix is less than the dimension of the normalized distance matrix, and the position encoding matrix contains position encoding information obtained by encoding the positions of the respective graph nodes in the object relationship graph.

7. The method according to claim 6, characterized in that The performing an equivariant transformation on the normalized distance matrix to generate an information compression matrix includes: Obtaining the transpose matrix of the normalized distance matrix, and obtaining the product between the transpose matrix and the normalized distance matrix as a transformation matrix; Performing an equivariant decomposition on the transformation matrix to generate the information compression matrix.

8. The method according to claim 7, wherein The transformation matrix contains N columns of elements; the performing an equivariant decomposition on the transformation matrix to generate the information compression matrix includes: Calculating the characteristic coefficients corresponding to each column of elements in the transformation matrix; the characteristic coefficient corresponding to any column of elements is used to indicate the amount of information contained in the any column of elements; Generating a diagonal matrix based on the characteristic coefficients corresponding to each column of elements respectively; the N characteristic coefficients corresponding to the N columns of elements are arranged in descending order in the diagonal direction of the diagonal matrix in sequence; Performing an equivariant decomposition on the transformation matrix based on the diagonal matrix to generate a decomposition matrix; the decomposition matrix contains the N columns of elements, and each column of elements in the N columns of elements is arranged in descending order of the corresponding characteristic coefficient in the decomposition matrix in sequence; Using the first m columns of elements in the decomposition matrix to construct the information compression matrix; m is a positive integer and m is less than N.

9. The method according to claim 1, wherein The N graph nodes have object attribute information of their respective corresponding social objects; the method further includes: Performing feature embedding on the respective graph nodes based on the object attribute information and position encoding information of the respective graph nodes to generate node embedding features of the respective graph nodes; Based on the node embedding features of the respective graph nodes, recommending social objects for establishing social association relationships to the social objects corresponding to the respective graph nodes.

10. The method according to claim 9, characterized in that The performing feature embedding on the respective graph nodes based on the object attribute information and position encoding information of the respective graph nodes to generate node embedding features of the respective graph nodes includes: Using the position encoding information of the respective graph nodes to perform information augmentation processing on the object attribute information of the respective graph nodes to obtain the augmented attribute information of the respective graph nodes; Invoke the feature embedding network to perform feature embedding processing on each of the graph nodes based on the object relationship graph and the augmented attribute information of each graph node, and generate the node embedding features of each graph node.

11. The method according to claim 9, characterized in that, Any one of the N graph nodes is a target graph node; based on the node embedding features of each graph node, recommending social objects for establishing social association relationships to the social objects corresponding to each graph node includes: Determine the graph nodes whose corresponding social objects among the N graph nodes do not have a social association relationship with the social object corresponding to the target graph node as candidate graph nodes; Obtain the feature similarity between the node embedding feature of the target graph node and the node embedding features of each candidate graph node; Perform sorting processing on each candidate graph node according to the order of the feature similarity between the node embedding feature of the target graph node and the node embedding features of each candidate graph node from large to small, and obtain the sorted candidate graph nodes; Recommend the social objects corresponding to the top K candidate graph nodes in the sorted candidate graph nodes to the social object corresponding to the target graph node for establishing a social association relationship; K is a positive integer.

12. The method according to claim 1, characterized in that, The position encoding information of each graph node respectively includes the encoding information of each graph node in m dimensions, where m is a positive integer, and the m dimensions correspond to m color channels; The method further includes: Based on the encoding information of each graph node in the m dimensions, respectively determine the node colors of each graph node in the m color channels; Based on the node colors of each graph node in the m color channels, perform coloring processing on each graph node in the object relationship graph to obtain the colored object relationship graph.

13. The method according to claim 1, characterized in that, The position encoding information of each graph node respectively includes the encoding information of each graph node in m dimensions, where m is a positive integer, and the m dimensions correspond to m coordinate axes in a target coordinate system; The method further includes: Based on the encoding information of each graph node in the m dimensions, respectively determine the coordinate values of each graph node on the m coordinate axes in the target coordinate system; Display each graph node at the corresponding coordinate position in the target coordinate system according to the coordinate values of each graph node on the m coordinate axes.

14. A data processing device, characterized in that, The apparatus includes: An acquisition module for acquiring an object relationship graph; the object relationship graph includes N graph nodes and the edges between the N graph nodes, where N is a positive integer, one graph node is used to represent a corresponding social object, and there is a social association relationship between the two social objects corresponding to the two graph nodes connected by any edge in the object relationship graph; A construction module for constructing a social distance set between the N graph nodes based on the object relationship graph; there is a social distance in the social distance set between any two graph nodes, and the social distance between any two graph nodes is determined based on the connectivity between the any two graph nodes; A generation module, configured to perform encoding processing on the positions of each of the N graph nodes in the object relationship graph based on the social distance set, so as to generate position encoding information of each of the graph nodes.

15. A computer program product, comprising a computer program which, when executed by a processor, implements the steps of the method according to any one of claims 1-13.

16. A computer device, characterized in that, It includes a memory and a processor. The memory stores a computer program which, when executed by the processor, causes the processor to execute the steps of the method according to any one of claims 1-13.

17. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program which is adapted to be loaded and executed by a processor to perform the method according to any one of claims 1-13.