Property graph processing method, device, electronic device and readable storage medium

By training the graph convolution neural network model, combining the original information and similarity information of the attribute graph, the problem of inaccurate attribute graph clustering results in the existing technology is solved, and more accurate node clustering is achieved.

CN113822315BActive Publication Date: 2025-04-11SHENZHEN TENCENT COMP SYST CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110671978.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-17
Publication Date
2025-04-11
Estimated Expiration
2041-06-17

AI Technical Summary

Technical Problem

The prior art fails to effectively retain the inter-node similarity information in high-dimensional feature representations in attribute graph clustering, resulting in inaccurate clustering results.

Method used

By obtaining the original information of the sample attribute graph in the training dataset, including the adjacency matrix and the initial feature representation of the node, the initial graph structural features of the graph and the similarity between nodes is determined. Then, the training is repeated based on the graph convolution neural network model until the training loss value meets the conditions and the model parameters are adjusted. Finally, the target feature representation of each node in the graph is output, and the similarity between the original graph structure information and the attribute information between nodes is preserved.

Benefits of technology

The accuracy of the attribute graph clustering results is improved, and the quality of target feature representation is enhanced by retaining high-dimensional feature similarity information between nodes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113822315B_ABST
    Figure CN113822315B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a method, device, electronic device and readable storage medium for processing a property graph, and relate to the fields of artificial intelligence and blockchain technology. The method includes: obtaining a training data set, each sample in the training data set includes an adjacency matrix of a sample property graph and an initial feature representation of each node, and the initial feature representation of a node represents the attribute information of the node; for each sample property graph, determining the initial graph structure feature of the graph based on at least one item in the original information, and determining the first similarity between the nodes in the graph based on the initial feature representation of each node in the graph; repeatedly performing training operations on the initial graph convolutional neural network model based on the training data set until the training loss value meets the training end condition, and obtaining a trained graph convolutional neural network model. The target feature representation obtained in the present application retains the original graph structure information and the similarity between the nodes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the fields of artificial intelligence and blockchain technology. Specifically, the present application relates to a method, device, electronic device and readable storage medium for processing a property graph. Background Art

[0002] At present, most attribute graph clustering methods are based on graph convolutional neural networks. By reconstructing the adjacency matrix, the feature representation of nodes with higher dimensions (which can be called high-dimensional feature representation) is compressed to a feature representation with lower dimensions (which can be called low-dimensional feature representation). Finally, traditional clustering algorithms (such as K-Means, K-means clustering algorithm) are applied on the basis of the low-dimensional feature representation to generate the final clustering results.

[0003] However, since the graph structure of the attribute graph can be divided into a low-order (lower level) information part and a high-order (deeper level) information part, and the low-dimensional feature representation of the nodes in the prior art does not retain the similarity information between the nodes in the high-dimensional feature representation, the final clustering result is inaccurate. Summary of the invention

[0004] The present application relates to a method, device, electronic device and readable storage medium for processing an attribute graph, which can enable the obtained target feature representation to still retain the original graph structure information of the attribute graph and the similarity of the attribute information between the nodes in the graph.

[0005] On the one hand, an embodiment of the present application provides a method for processing a property graph, the method comprising:

[0006] Obtain a training data set, where each sample in the training data set includes original information of a sample attribute graph, and the original information includes an adjacency matrix of the sample attribute graph and an initial feature representation of each node in the sample attribute graph, where the initial feature representation of a node represents the attribute information of the node;

[0007] For each sample attribute graph, determine an initial graph structure feature of the graph based on at least one item in the original information, and determine a first similarity between the nodes in the graph based on the initial feature representation of each node in the graph;

[0008] Based on the training data set, the following training operations are repeatedly performed on the initial graph convolutional neural network model until the training loss value meets the training end condition, and a trained graph convolutional neural network model is obtained:

[0009] For each sample attribute graph, the original information is input into the graph convolutional neural network model to obtain the target feature representation of each node in the graph, and based on the target feature representation of each node in the graph, the target graph structural features of the graph and the second similarity between the nodes in the graph are determined;

[0010] For each sample attribute graph, determining a first difference between an initial graph structure feature and a target graph structure feature of the graph, and a second difference between a first similarity and a second similarity between nodes in the graph;

[0011] Based on the first difference and the second difference corresponding to each sample attribute graph, the training loss value of the graph convolutional neural network model is determined. If the training loss value does not meet the training end condition, the model parameters of the graph convolutional neural network are adjusted.

[0012] On the other hand, an embodiment of the present application provides a method for processing a property graph, including:

[0013] Obtain the attribute graph to be processed and the attribute information of each node in the attribute graph to be processed;

[0014] Determine the adjacency matrix of the attribute graph to be processed;

[0015] For each node, an initial feature representation of the node is determined based on the attribute information of the node;

[0016] The adjacency matrix and the initial feature representation of each node are output to the graph convolutional neural network model to obtain the target feature representation of each node, wherein the graph convolutional neural network model is trained based on the method of training the graph convolutional neural network model described in the previous article.

[0017] Optionally, the method further includes:

[0018] Based on the target feature representation of each node, each node in the attribute graph to be processed is classified to obtain the classification result of each node.

[0019] On the other hand, an embodiment of the present application provides a device for processing a property graph, the device comprising:

[0020] A data acquisition module is used to acquire a training data set. Each sample in the training data set includes original information of a sample attribute graph. The original information includes an adjacency matrix of the sample attribute graph and an initial feature representation of each node in the sample attribute graph. The initial feature representation of a node represents the attribute information of the node.

[0021] An initial information determination module, configured to determine, for each sample attribute graph, an initial graph structural feature of the graph based on at least one item in the original information, and determine a first similarity between the nodes in the graph based on an initial feature representation of each node in the graph;

[0022] The model training module is used to repeatedly perform the following training operations on the initial graph convolutional neural network model based on the training data set until the training loss value meets the training end condition, thereby obtaining a trained graph convolutional neural network model:

[0023] For each sample attribute graph, the original information is input into the graph convolutional neural network model to obtain the target feature representation of each node in the graph, and based on the target feature representation of each node in the graph, the target graph structural features of the graph and the second similarity between the nodes in the graph are determined;

[0024] For each sample attribute graph, determining a first difference between an initial graph structure feature and a target graph structure feature of the graph, and a second difference between a first similarity and a second similarity between nodes in the graph;

[0025] Based on the first difference and the second difference corresponding to each sample attribute graph, the training loss value of the graph convolutional neural network model is determined. If the training loss value does not meet the training end condition, the model parameters of the graph convolutional neural network are adjusted.

[0026] Optionally, for each sample attribute graph, when the model training module inputs the original information into the graph convolutional neural network model to obtain the target feature representation of each node in the graph, and based on the target feature representation of each node in the graph, is specifically used to:

[0027] Based on the original information, the initial graph neural network model performs the following operations to obtain the target feature representation of each node in the graph:

[0028] Based on the adjacency matrix of the graph, obtaining a first graph structure feature of the graph corresponding to at least two levels;

[0029] For the first graph structural feature of each level, based on the initial feature matrix of the graph and the first graph structural feature of the level, a first feature matrix of the graph corresponding to the level is obtained, wherein the initial feature matrix contains the initial feature representation of each node of the graph, and the first feature matrix contains the first feature representation of each node of the graph;

[0030] For each node in the graph, a second feature representation of the node is obtained by fusing the first feature representations of the nodes at each level in at least two levels;

[0031] Based on the second feature representation of each node in the sample attribute graph, the target feature representation of each node in the graph is extracted.

[0032] Optionally, when the model training module obtains the first graph structure feature corresponding to at least two levels of the graph based on the adjacency matrix of the graph, it is specifically used to:

[0033] Get the degree matrix of the graph;

[0034] Add the adjacency matrix based on the graph to the identity matrix to obtain the processed adjacency matrix;

[0035] The processed adjacency matrix is ​​normalized based on the degree matrix of the graph to obtain a standardized adjacency matrix;

[0036] The standardized adjacency matrix is ​​used as a first graph structural feature of a level of the graph, and the standardized adjacency matrix is ​​subjected to at least one self-multiplication operation to obtain a first graph structural feature of the graph corresponding to at least one level, wherein the self-multiplication power of each multiplication process is different.

[0037] Optionally, for each sample attribute graph, when the model training module determines the target graph structural features of the graph based on the target feature representation of each node in the graph, it is specifically used to:

[0038] Determine a third similarity between the nodes in the graph based on the target feature representation of each node in the graph;

[0039] Based on the third similarity between the nodes in the graph, a target graph structural feature of the graph is determined.

[0040] Optionally, for each sample attribute graph, when the model training module determines the initial graph structure feature of the graph based on at least one item of the original information, it is specifically used for any of the following:

[0041] Based on the adjacency matrix of the graph, determine the initial graph structure characteristics of the graph;

[0042] Based on the original information, the third feature representation of each node in the graph is extracted through a pre-trained feature extraction model, and based on the third feature representation of each node, the initial graph structure characteristics of the graph are determined.

[0043] Optionally, when the model training module determines the initial graph structure features of the graph based on the third feature representation of each node, it is specifically used to:

[0044] Determining a fourth similarity between the nodes in the graph based on the third feature representation between the nodes;

[0045] Based on the fourth similarity between the nodes in the graph, an initial graph structural feature of the graph is determined.

[0046] Optionally, for each sample attribute graph, when the initial information determination module determines the first similarity between each node based on the initial feature representation of each node in the graph, it is specifically used to:

[0047] For every two nodes in the graph, based on the initial feature representations of the two nodes in the graph, a first joint distribution probability between the nodes based on a standard Gaussian distribution is determined, where the first joint distribution probability represents a first similarity between the two nodes;

[0048] For each sample attribute graph, the model training module determines the second similarity between the nodes in the graph based on the target feature representation of each node in the graph, specifically for:

[0049] For every two nodes in the graph, based on the target feature representations of the two nodes in the graph, a second joint distribution probability based on t-distributed random neighbor embedding between the two nodes is determined, and the second joint distribution probability characterizes a second similarity between the two nodes.

[0050] Optionally, after executing a preset number of training operations, for each sample attribute graph, the original information is input into the graph convolutional neural network model to obtain the target feature representation of each node in the graph, and the initial model training module is further used to:

[0051] Based on the target feature representation of each node in the graph, each node in the graph is divided into at least two categories;

[0052] For each of the at least two categories, determining intra-class differences between nodes belonging to the category based on the target feature representation of each node belonging to the category, and determining inter-class differences between different categories based on the target feature representation of each node belonging to the category and the target feature representation of each node belonging to each category in other categories, the other categories being categories other than the category in the at least two categories;

[0053] When the model training module determines the training loss value of the graph convolutional neural network model based on the first difference and the second difference corresponding to each sample attribute graph, it is specifically used to:

[0054] Based on the first difference, the second difference, the intra-class difference and the inter-class difference corresponding to each sample attribute graph, the training loss value of the graph convolutional neural network model is determined.

[0055] Optionally, for each of the at least two categories, the model training module, when determining the intra-class differences between the nodes belonging to the category based on the target feature representation of each node belonging to the category, and determining the inter-class differences between different categories based on the target feature representation of each node belonging to the category and the target feature representation of each node belonging to each category in other categories, is specifically used to:

[0056] Determine the category feature representation of the category;

[0057] For each node belonging to the category, determining a third difference between the target feature representation of the node and the category feature representation of the category, and obtaining intra-category differences between the nodes belonging to the category based on the third differences corresponding to the nodes belonging to the category;

[0058] For each node belonging to a category, the fourth difference between the target feature representation of the node and the category feature identifier of each category in other categories is determined, and based on the fourth difference corresponding to each node belonging to the category, the inter-class difference between the category and each category in other categories is obtained.

[0059] Optionally, the model training module is also used to:

[0060] Obtaining weights corresponding to the first difference, the second difference, and the category difference, respectively, wherein the category difference includes intra-category difference and inter-category difference;

[0061] weighting the first difference, the second difference, and the category difference based on their respective corresponding weights;

[0062] The weighted first difference, weighted second difference and weighted category difference corresponding to each sample attribute graph are summed, and the sum is used as the training loss value.

[0063] In another aspect, an embodiment of the present application provides a device for processing a property graph, the device comprising:

[0064] The module for obtaining data to be processed is used to obtain the attribute graph to be processed and the attribute information of each node in the attribute graph to be processed;

[0065] An adjacency matrix determination module, used to determine the adjacency matrix of the attribute graph to be processed;

[0066] An initial feature representation determination module, used to determine, for each node, an initial feature representation of the node based on the attribute information of the node;

[0067] The target feature representation determination module is used to output the adjacency matrix and the initial feature representation of each node to the graph convolutional neural network model to obtain the target feature representation of each node, wherein the graph convolutional neural network model is trained based on the method of training the graph convolutional neural network model described in the previous article.

[0068] The device also includes a classification module for:

[0069] Based on the target feature representation of each node, each node in the attribute graph to be processed is classified to obtain the classification result of each node.

[0070] On the other hand, an embodiment of the present application provides an electronic device, including a processor and a memory: the memory is configured to store a computer program, and when the computer program is executed by the processor, the processor executes the above-mentioned property graph processing method.

[0071] On the other hand, an embodiment of the present application further provides a computer-readable storage medium, which is used to store a computer program. When the computer program runs on a computer, the computer executes the method for processing a property graph.

[0072] The present application provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the property graph processing method provided in any optional embodiment of the present application.

[0073] The beneficial effects of the technical solution provided by the embodiment of the present application are:

[0074] In an embodiment of the present application, for a sample attribute graph, since the initial graph structure features of the graph represent the original graph structure information of the graph, and the initial features of each node in the graph represent the attribute information of the node, the first similarity between the nodes in the graph represents the similarity of the attribute information between the nodes in the graph. At this time, the training of the model is constrained by the difference between the initial graph structure features and the target graph structure features of the sample attribute graph, and the difference between the first similarity and the second similarity between the nodes in the graph. This allows the graph convolutional neural network model finally trained to retain the original graph structure information of the attribute graph and the similarity of the attribute information between the nodes in the graph in the target feature representation when predicting the target feature representation of each node in the attribute graph, thereby effectively improving the accuracy of the classification results when performing classification processing based on the target feature representation of the node. BRIEF DESCRIPTION OF THE DRAWINGS

[0075] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in describing the embodiments of the present application are briefly introduced below.

[0076] Figure 1 A schematic diagram of a process flow of a method for processing a property graph provided in an embodiment of the present application;

[0077] Figure 2 A schematic diagram of a process for performing a training operation on an initial graph convolutional neural network model provided in an embodiment of the present application;

[0078] Figure 3 Schematic diagram of the calculation principle of two graph convolutional neural networks provided in the embodiments of the present application;

[0079] Figure 4 A schematic diagram of an architecture for training a graph convolutional neural network provided in an embodiment of the present application;

[0080] Figure 5 Schematic diagram of P distribution and Q distribution provided in the embodiments of the present application;

[0081] Figure 6A schematic flow chart of another method for processing a property graph provided in an embodiment of the present application;

[0082] Figure 7 A schematic diagram of the structure of a property graph processing device provided in an embodiment of the present application;

[0083] Figure 8 A schematic diagram of the structure of a property graph processing device provided in an embodiment of the present application;

[0084] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0085] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be interpreted as limiting the present application.

[0086] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.

[0087] First, several terms that may be involved in this application are introduced and explained:

[0088] 1. Attribute graph: A graph structure in which each node has its own attributes (also called features).

[0089] 2. Clustering: Divide the nodes in the graph into different clusters so that the nodes within a cluster are as similar as possible, while the nodes between clusters are as different as possible.

[0090] 3. Property graph clustering: Clustering is performed by combining the graph structure information of the property graph and the attribute information of the nodes in the property graph.

[0091] 4.PS (Parameter Server): Parameter server is used to store (update) large-scale parameters in a distributed manner in the field of machine learning.

[0092] 5. Angel: A high-performance distributed machine learning platform developed based on the concept of parameter server.

[0093] 6.Spark: A fast and general computing engine designed for large-scale data processing.

[0094] 7. Spark on Angel (SONA): A high-performance distributed computing platform that combines Angel’s powerful parameter server functionality with Spark’s large-scale data processing capabilities. It supports traditional machine learning, deep learning, and various graph algorithms.

[0095] At present, when clustering attribute graphs, most of them are based on graph convolutional neural networks. By reconstructing the adjacency matrix, the high-dimensional feature representation of the original nodes is compressed into a low-dimensional space, and finally the traditional clustering algorithm is applied on the basis of the low-dimensional vector representation to generate the final clustering result. However, after research and invention by the inventors, at present, when clustering attribute graphs, there are at least the following problems:

[0096] (1) Since the graph structure of the attribute graph can be divided into low-order information and high-order information, the existing technology can only use the first-order graph structure information, that is, which nodes are directly connected, but does not use the high-order graph structure information. For example, two nodes with similar neighbors should obviously have similar low-dimensional feature representations, but the existing methods do not have constraints during the training process to make the low-dimensional feature representations of the two nodes as similar as possible, thus losing this part of information.

[0097] (2) In addition to the graph structure information, the input of the attribute graph also includes the feature representation of the nodes. The high-dimensional features of the nodes indicate that similar nodes have a higher probability of belonging to the same cluster. Therefore, maintaining the similarity information in the high-dimensional feature representation is also beneficial to the clustering results. The existing technology handles the similarity information in the high-dimensional feature representation, which is equivalent to selecting only a part of the positive samples with higher confidence (i.e., connected nodes, which can be called "false" positive samples). However, this method has two problems. On the one hand, there are node pairs belonging to different clusters in these positive samples. Training these "false" positive samples will lead to a decline in the final clustering effect. On the other hand, there should be differences between different positive samples. According to the existing technology, the probability that all connected nodes belong to the same cluster is 1. This approach is obviously flawed.

[0098] (3) In practical applications, the edges in the attribute graph can be divided into two categories: one is the edges within the cluster, and the other is the edges between clusters. However, the feature representation of the nodes for clustering in the prior art is a relatively generalized low-dimensional node representation, and no corresponding optimization is made for the clustering task. In addition, due to the existence of "false" positive samples, the boundaries between clusters tend to be blurred, and the clustering results are inaccurate.

[0099] Based on this, the embodiments of the present application provide a property graph processing method, device, electronic device and readable storage medium, aiming to solve some or all of the technical problems in the prior art.

[0100] Optionally, in the embodiment of the present application, the acquired initial graph neural network model can be trained to obtain a trained graph neural network, and the target feature representation of each node in the attribute graph to be processed can be obtained based on the trained graph neural network. Among them, when training the initial graph neural network model, machine learning technology in artificial intelligence technology is specifically involved.

[0101] Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science. It attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making. Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level technology and software-level technology. Basic artificial intelligence technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, and mechatronics. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0102] Machine Learning (ML) is a multi-disciplinary subject that involves probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning.

[0103] Optionally, the data processing / computation involved in the embodiments of the present application (such as the calculation to determine the similarity between nodes) can be obtained based on cloud computing. Cloud computing is a computing model that distributes computing tasks on a resource pool composed of a large number of computers, so that various application systems can obtain computing power, storage space and information services as needed. The network that provides resources is called a "cloud". The resources in the "cloud" are infinitely expandable in the eyes of users, and can be obtained at any time, used on demand, expanded at any time, and paid for by use.

[0104] As a provider of basic cloud computing capabilities, a cloud computing resource pool (referred to as a cloud platform, generally referred to as an IaaS (Infrastructure as a Service) platform) will be established, and various types of virtual resources will be deployed in the resource pool for external customers to choose to use. The cloud computing resource pool mainly includes: computing devices (virtualized machines, including operating systems), storage devices, and network devices. According to the logical function division, the PaaS (Platform as a Service) layer can be deployed on the IaaS (Infrastructure as a Service) layer, and the SaaS (Software as a Service) layer can be deployed on the PaaS layer. SaaS can also be deployed directly on IaaS. PaaS is a platform for software operation, such as databases, web containers, etc. SaaS is a variety of business software, such as web portals, SMS mass senders, etc. Generally speaking, SaaS and PaaS are upper layers relative to IaaS.

[0105] Optionally, in the embodiment of the present application, the training samples for training the graph neural network model can be stored based on the blockchain. Among them, blockchain is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. The blockchain can include the blockchain underlying platform, the platform product service layer, and the application service layer.

[0106] The underlying blockchain platform can include processing modules such as user management, basic services, smart contracts, and operation monitoring. Among them, the user management module is responsible for the identity information management of all blockchain participants, including maintaining public and private key generation (account management), key management, and the maintenance of the correspondence between the user's real identity and the blockchain address (authority management), etc., and, under authorization, supervises and audits the transactions of certain real identities and provides risk control rule configuration (risk control audit); the basic service module is deployed on all blockchain node devices to verify the validity of business requests, and records valid requests to storage after consensus is reached. For a new business request, the basic service first adapts the interface for parsing and authentication (interface adaptation), and then encrypts the business information through the consensus algorithm (consensus management). The smart contract module is responsible for the registration and issuance of contracts, as well as contract triggering and contract execution. Developers can define the contract logic in a programming language and publish it to the blockchain (contract registration). According to the logic of the contract terms, the key or other events are called to trigger the execution and complete the contract logic. It also provides the function of contract upgrade and cancellation. The operation monitoring module is mainly responsible for the deployment, configuration modification, contract setting, cloud adaptation and real-time status visualization output of the product during the product release process, such as alarm, network monitoring, node equipment health monitoring, etc.

[0107] The platform product service layer provides the basic capabilities and implementation framework of typical applications. Developers can superimpose business features based on these basic capabilities to complete the blockchain implementation of business logic. The application service layer provides application services based on blockchain solutions for business participants to use.

[0108] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0109] Optionally, the method provided in the present application can be executed by any electronic device, such as a server or a terminal device. The server can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services. The terminal device can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc., but is not limited thereto. The terminal device and the server can be directly or indirectly connected via wired or wireless communication, and the present application does not limit this.

[0110] Figure 1FIG. 1 is a flow chart showing a method for processing a property graph provided in an embodiment of the present application. Figure 1 As shown, the method includes:

[0111] Step S101, obtaining a training data set, each sample in the training data set includes original information of a sample attribute graph, the original information includes an adjacency matrix of the sample attribute graph and initial feature representations of each node in the sample attribute graph, and the initial feature representation of a node represents the attribute information of the node.

[0112] The training data set refers to a data set used to train the initial graph convolutional neural network model, and the training data set includes a large number of training samples. In an embodiment of the present application, the original information of a sample attribute graph is used as a sample in the training data set. Among them, the original information of a sample attribute graph may include the adjacency matrix of the sample attribute graph and the initial feature representation of each node in the sample attribute graph. The initial feature representation of a node represents the attribute information of the node. The initial feature representation of each node in the sample attribute graph can form an initial feature matrix. At this time, each row in the initial feature matrix can represent the initial feature representation of a node (that is, the initial feature vector), the number of rows of the matrix is ​​equal to the total number of nodes in the sample attribute graph, and the number of columns is the feature dimension of the initial feature representation, or the number of columns of the matrix is ​​equal to the total number of nodes, each column represents the initial feature representation of a node, and the number of rows is the feature dimension of the initial feature representation.

[0113] In general, the initial feature representation of each node in the attribute graph is usually a high-dimensional feature vector. For subsequent graph processing tasks, such as classifying the nodes contained in the graph, it is necessary to process the initial feature vectors of each node in the graph to generate a low-dimensional node representation (i.e., the target feature representation). It should be noted that the above high-dimensional and low-dimensional are relative concepts. For example, the dimensions of the initial feature representation and the target feature representation of a node can be feature vectors of different orders of magnitude. For example, the feature dimension of the initial feature representation is dozens of dimensions (i.e., the feature vector is a vector containing dozens of eigenvalues), and the feature dimension of the target feature representation is a few dimensions (i.e., the feature vector is a vector containing several eigenvalues).

[0114] For a property graph, a one-dimensional array can be used to store all vertex data in the graph, and a two-dimensional array can be used to store the data of the relationship between vertices (edges or arcs). The two-dimensional array obtained at this time is called the adjacency matrix of the property graph, that is, the many-to-many nonlinear structure of the graph is represented in a matrix manner, specifically representing the connection status of the nodes in the graph. It can be understood that for different application scenarios, the meanings of the nodes and the edges between nodes in the above sample property graph are likely to be different. For example, for a social application, the sample property graph can be a graph structure corresponding to the users in the application, and each node in the graph corresponds to a user of the application. If there is an association relationship between two users (such as information interaction, such as sending messages to each other), there is an edge between the nodes corresponding to the two users, and the attribute information corresponding to each node can be the attribute information of the user corresponding to the node, such as the user's age, gender, preferences, etc.

[0115] Step S102: for each sample attribute graph, determine the initial graph structure feature of the graph based on at least one item in the original information, and determine the first similarity between the nodes in the graph based on the initial feature representation of each node in the graph.

[0116] The graph structure is a nonlinear structure (i.e., discrete structure) that is more complex than the tree structure. The basic structure of the graph includes the nodes in the graph and the edges between the nodes. For a graph, the graph structure feature (i.e., the structural feature of the graph) refers to the feature vector that can characterize the overall structure of the graph. Since the initial feature representation of each node in the graph represents the attribute information of each node in the graph, and the adjacency matrix of the graph is obtained based on the attribute information of each node in the graph and the connection relationship between the nodes, for a sample attribute graph, the initial graph structure feature of the graph can be determined based on at least one of the adjacency matrix of the sample attribute graph or the initial feature representation of each node in the graph.

[0117] For a sample attribute graph, based on the initial feature representation of each node in the graph, the specific method of determining the first similarity between each node is not limited in the embodiment of the present application. For example, for any two nodes in the graph, the similarity between the two nodes can be determined by calculating the distance between the initial feature representations of the two nodes (such as the Euclidean distance).

[0118] Step S103, repeatedly performing the following training operations on the initial graph convolutional neural network model based on the training data set until the training loss value meets the training end condition, thereby obtaining a trained graph convolutional neural network model.

[0119] The above training operation of the initial graph convolutional neural network model is repeated as follows: Figure 2 As shown, it may include steps S201 to S203:

[0120] Step S201: For each sample attribute graph, the original information is input into the graph convolutional neural network model to obtain the target feature representation of each node in the graph, and based on the target feature representation of each node in the graph, the target graph structural features of the graph and the second similarity between the nodes in the graph are determined.

[0121] Step S202: for each sample attribute graph, determine a first difference between an initial graph structure feature and a target graph structure feature of the graph, and a second difference between a first similarity and a second similarity between nodes in the graph.

[0122] Step S203, based on the first difference and the second difference corresponding to each sample attribute graph, determine the training loss value of the graph convolutional neural network model. If the training loss value does not meet the training end condition, adjust the model parameters of the graph convolutional neural network.

[0123] After obtaining the training data set, each sample in the training data set (i.e., the original information of each sample attribute graph) can be input into the graph convolutional neural network model, and the graph convolutional neural network model can output the target feature representation of each node in each sample attribute graph. The target feature representation is the feature vector of each node predicted by the model, and the dimension of the target feature representation of a node is smaller than the initial feature representation of the node.

[0124] For each sample attribute graph, after obtaining the target feature representation of each node in the graph, the target graph structural features of the graph can be determined based on the target feature representation of each node in the graph, and the similarity between the nodes in the graph (i.e., the second similarity) can be determined based on the target feature representation of each node in the graph.

[0125] For a sample attribute graph, since the initial graph structure features of the graph represent the original graph structure information of the graph, and since the initial features of each node in the graph represent the attribute information of the node, the first similarity between the nodes in the graph represents the similarity of the attribute information between the nodes in the graph. In order to make the final trained graph convolutional neural network model retain the original graph structure information of the attribute graph and the similarity of the attribute information between the nodes in the graph in the target feature representation when predicting the target feature representation of each node in the attribute graph, the training of the model can be constrained by the difference between the initial graph structure features of the sample attribute graph and the target graph structure features, as well as the difference between the first similarity and the second similarity between the nodes in the graph.

[0126] Among them, the training end condition can be pre-set according to actual needs, such as being set to a training loss value less than a preset threshold, etc., and the embodiments of the present application are not limited thereto, such as the training end condition can also include the number of training times reaching a set number of times, etc. After the training loss value of the graph convolutional neural network is calculated based on the first difference and the second difference corresponding to all sample attribute graphs, if the training loss value does not meet the training end condition, it means that the model parameters of the current graph convolutional neural network do not meet the requirements, and the graph convolutional neural network still needs to be trained. The model parameters of the graph convolutional neural network can be adjusted, and the above training operation can be continued for the graph convolutional neural network after the model parameters are adjusted based on the training data set until the training loss value meets the training end condition.

[0127] In practical applications, different application scenarios and application requirements may also have different requirements for the model performance of the graph convolutional neural network model. For example, for the two levels of the above-mentioned graph structure information and the similarity of the attribute information between the nodes in the graph, some scenarios may focus more on the graph structure information, while some scenarios may focus more on the similarity between the attribute information between the nodes in the graph. In order to better meet these application requirements, different weights can be assigned to training losses at different levels. Optionally, the above-mentioned determination of the training loss value of the graph convolutional neural network model based on the first difference and the second difference corresponding to each sample attribute graph may include:

[0128] Obtaining a first weight corresponding to the first difference and a second weight corresponding to the second difference;

[0129] Weighting the first difference of each sample attribute graph according to the first weight, and weighting the second difference of each sample attribute graph according to the second weight;

[0130] The weighted first difference and second difference corresponding to each sample attribute graph are summed, and the training loss value of the graph convolutional neural network model is obtained based on the summation result.

[0131] Optionally, when different weights can be assigned to training losses at different levels, a first weight corresponding to the first difference and a second weight corresponding to the second difference can be obtained, and then the first difference of each sample attribute graph is weighted according to the first weight and the second difference of each sample attribute graph is weighted according to the second weight, and then the weighted first difference and second difference are summed, and the sum obtained at this time is the training loss value of the graph convolutional neural network model.

[0132] In an embodiment of the present application, for a sample attribute graph, since the initial graph structure features of the graph represent the original graph structure information of the graph, and the initial features of each node in the graph represent the attribute information of the node, the first similarity between the nodes in the graph represents the similarity of the attribute information between the nodes in the graph. At this time, the training of the model is constrained by the difference between the initial graph structure features and the target graph structure features of the sample attribute graph, and the difference between the first similarity and the second similarity between the nodes in the graph. This allows the graph convolutional neural network model finally trained to retain the original graph structure information of the attribute graph and the similarity of the attribute information between the nodes in the graph in the target feature representation when predicting the target feature representation of each node in the attribute graph, thereby effectively improving the accuracy of the classification results when performing classification processing based on the target feature representation of the node.

[0133] In an optional embodiment of the present application, for each sample attribute graph, the original information is input into the graph convolutional neural network model to obtain the target feature representation of each node in the graph, and based on the target feature representation of each node in the graph, including:

[0134] Based on the original information, the initial graph neural network model performs the following operations to obtain the target feature representation of each node in the graph:

[0135] Based on the adjacency matrix of the graph, obtaining a first graph structure feature of the graph corresponding to at least two levels;

[0136] For the first graph structural feature of each level, based on the initial feature matrix of the graph and the first graph structural feature of the level, a first feature matrix of the graph corresponding to the level is obtained, wherein the initial feature matrix contains the initial feature representation of each node of the graph, and the first feature matrix contains the first feature representation of each node of the graph;

[0137] For each node in the graph, a second feature representation of the node is obtained by fusing the first feature representations of the nodes at each level in at least two levels;

[0138] Based on the second feature representation of each node in the sample attribute graph, the target feature representation of each node in the graph is extracted.

[0139] The adjacency matrix of a graph is obtained based on the attribute information of each node in the graph and the association between the attribute information of each node. At this time, the adjacency matrix of the graph can be used as a basic graph structure feature of the graph, that is, it can be used as a low-order (i.e. low-level) graph structure information, and the initial feature representation of the nodes in the graph is an initial feature vector of the node. Therefore, the adjacency matrix containing the graph structure information and the initial feature representation of each node in the graph can be used to obtain the target feature representation that simultaneously integrates the attribute information of the node and the association relationship between the nodes through the graph convolutional neural network model.

[0140] From the previous description, it can be seen that since the adjacency matrix of the graph utilizes the low-order graph structure information in the graph, that is, which nodes in the graph are directly connected, but does not utilize the high-order graph structure information in the graph, in order to obtain the target features of the nodes with better feature expression capabilities, the high-order graph structure information of the graph can be obtained based on the adjacency matrix of the graph, and based on the initial feature representation of each node in the graph and the graph structure features of each level, the feature representation of each node corresponding to each level (that is, the first feature representation) is obtained. After that, for each node in the graph, the feature representation of the node at each level in at least two levels can be integrated to obtain a second feature representation that simultaneously integrates the graph structure information of multiple levels and the attribute information of the node. Further, based on the second feature representation of each node in the sample attribute graph, the target feature representation of each node in the graph can be extracted.

[0141] It can be seen that in the embodiment of the present application, the second feature representation of each node is a fusion of the first graph structure features of at least two levels, and the first graph structure features of at least two levels represent the graph structure features of different levels. Therefore, when the target feature representation of each node in the sample attribute graph is extracted based on the second feature representation of each node in the graph, the information represented by the target feature representation of each node obtained will be richer and have better feature expression capabilities. When further processing is performed based on the target feature representation, the processing effect can be further improved.

[0142] In an optional embodiment of the present application, based on the adjacency matrix of the graph, obtaining the first graph structure features of the graph corresponding to at least two levels includes:

[0143] Get the degree matrix of the graph;

[0144] Add the adjacency matrix based on the graph to the identity matrix to obtain the processed adjacency matrix;

[0145] The processed adjacency matrix is ​​normalized based on the degree matrix of the graph to obtain a standardized adjacency matrix;

[0146] The standardized adjacency matrix is ​​used as the first graph structure feature of a level of the graph, and the standardized adjacency matrix is ​​subjected to at least one self-multiplication operation to obtain the first graph structure feature of the graph corresponding to at least one level, wherein the self-multiplication power of each multiplication process is different.

[0147] Among them, for a sample attribute graph, the degree matrix of the graph refers to the matrix used to describe the degree of each node in the graph. The degree of a node represents the number of edges connected to the node, and the degree matrix is ​​a diagonal matrix.

[0148] Optionally, for a sample attribute graph, since the diagonal of the adjacency matrix of the graph is 0, its inner product with the feature matrix is ​​equivalent to the weighted sum of the adjacency matrix. At this time, the value of the node feature becomes the weight of the adjacency matrix, and its own features are ignored. To avoid this situation, the unit matrix can be added to the adjacency matrix and the unit matrix of the graph to obtain the processed adjacency matrix. At this time, the diagonal elements of the processed adjacency matrix become 1. However, since the adjacency matrix A has not been normalized, it is difficult to limit the data to a certain range. At this time, the data can be made comparable through normalization, but the relationship between the data is relatively maintained. Therefore, in order to avoid the inner product multiplication of the adjacency matrix and the feature matrix to change the original distribution of the features, it is necessary to standardize the processed adjacency matrix based on the degree matrix of the graph to obtain a standardized adjacency matrix. At this time, the obtained standardized adjacency matrix can be regarded as the first graph structure feature of a level of the graph. Furthermore, in order to obtain more levels of first graph structural features, the standardized adjacency matrix may be subjected to at least one self-multiplication operation of different powers to obtain at least one operation result, and each operation result obtained at this time is regarded as the first graph structural feature of the graph corresponding to a level. For example, for a standardized adjacency matrix, the pair of standardized adjacency matrices may be subjected to at least three self-multiplication operations of different powers, and at this time, the self-multiplication operation of the pair of standardized adjacency matrices to a power of one may be regarded as the first graph structural feature of the first level, the self-multiplication operation of the pair of standardized adjacency matrices to a power of two may be regarded as the first graph structural feature of the second level, and the self-multiplication operation of the pair of standardized adjacency matrices to a power of three may be regarded as the first graph structural feature of the third level.

[0149] In an optional embodiment of the present application, for each sample attribute graph, based on the target feature representation of each node in the graph, the target graph structural feature of the graph is determined, including:

[0150] Determine a third similarity between the nodes in the graph based on the target feature representation of each node in the graph;

[0151] Based on the third similarity between the nodes in the graph, a target graph structural feature of the graph is determined.

[0152] For a sample attribute graph, the higher the similarity between any two nodes in the graph, the more similar the graph structures corresponding to the two nodes in the graph are. Therefore, the target graph structure feature of the graph can be determined based on the third similarity between the nodes in the attribute graph. Optionally, the similarity matrix corresponding to the sample attribute graph can be used as the target graph structure feature of the graph, or the element values ​​in the similarity matrix (that is, the third similarity) can be normalized and the normalized similarity matrix can be used as the target graph structure feature of the graph, wherein the similarity matrix contains the third similarity between the nodes in the sample attribute graph.

[0153] Among them, the specific method of determining the third similarity between nodes based on the target feature representation of each node is not limited in the embodiment of the present application. For example, the cosine similarity between the target feature representations of two nodes can be used to measure the third similarity between the two nodes. Optionally, for any sample attribute graph, assuming that Z represents the target feature matrix of the graph, the matrix contains the target feature representation of each node in the graph (such as each row corresponds to the target feature representation of a node), then the target graph structural features of the sample attribute graph can be expressed as follows:

[0154]

[0155] Among them, S represents the target graph structural features, Z represents the target feature matrix containing the target feature representation of each node in the sample attribute graph, and Z T Transform the dimension of the target feature matrix. It means to square the 2-norm of Z.

[0156] In an optional embodiment of the present application, for each sample attribute graph, the initial graph structure feature of the graph is determined based on at least one item in the original information, including any of the following:

[0157] Based on the adjacency matrix of the graph, determine the initial graph structure characteristics of the graph;

[0158] Based on the original information, the third feature representation of each node in the graph is extracted through a pre-trained feature extraction model, and based on the third feature representation of each node, the initial graph structure characteristics of the graph are determined.

[0159] Optionally, the initial graph structural features of a sample attribute graph can be determined based on different methods. One optional method is to determine the initial graph structural features of the sample attribute graph directly based on the adjacency matrix of the graph. For example, the adjacency matrix of the sample attribute graph can be used as the initial graph structural features of the sample attribute graph, or the adjacency matrix of the sample attribute graph can be further processed to obtain the initial graph structural features. For example, the adjacency matrix of the sample attribute graph can be standardized and the standardized adjacency matrix can be used as the initial graph structural features of the sample attribute graph, or the standardized adjacency matrix can be self-multiplied to obtain the initial graph structural features of the sample attribute graph, wherein the power of self-multiplication of the standardized adjacency matrix is ​​not limited in the embodiments of the present application. The above-mentioned method of standardizing the adjacency matrix of the sample attribute graph can be to add the adjacency matrix of the sample attribute graph and the unit matrix to obtain the processed adjacency matrix, and standardize the processed adjacency matrix based on the degree matrix of the sample attribute graph to obtain the standardized adjacency matrix.

[0160] Another optional implementation is to obtain a pre-trained feature extraction model, and then input the original information of the sample attribute graph into the feature extraction model, perform feature extraction on the original information of the sample attribute graph through the feature extraction model, obtain the first feature representation of each node in the sample attribute graph, and then extract the third feature representation based on each node to determine the initial graph structure characteristics of the sample attribute graph. Among them, the feature extraction model may refer to a model that can extract high-order graph structure information again, wherein the specific model structure of the feature extraction model is not limited in the embodiment of the present application, such as it can be a DeepWalk model, etc.

[0161] In an optional embodiment of the present application, determining the initial graph structure feature of the graph based on the third feature representation of each node includes:

[0162] Determining a fourth similarity between the nodes in the graph based on the third feature representation between the nodes;

[0163] Based on the fourth similarity between the nodes in the graph, an initial graph structural feature of the graph is determined.

[0164] For a sample attribute graph, the higher the similarity between any two nodes in the graph, the more similar the graph structures corresponding to the two nodes in the graph are. Therefore, the fourth similarity between the nodes in the graph can be determined based on the third feature representation between the nodes, and the initial graph structure feature of the graph can be determined based on the fourth similarity between the nodes in the attribute graph. Optionally, the similarity matrix corresponding to the sample attribute graph can be used as the initial graph structure feature of the graph, or the element values ​​in the similarity matrix (that is, the fourth similarity) can be normalized, and the normalized similarity matrix can be used as the initial graph structure feature of the graph, wherein the similarity matrix contains the fourth similarity between the nodes in the sample attribute graph.

[0165] In an optional embodiment of the present application, for each sample attribute graph, based on the initial feature representation of each node in the graph, determining the first similarity between the nodes includes:

[0166] For every two nodes in the graph, based on the initial feature representations of the two nodes in the graph, a first joint distribution probability between the nodes based on a standard Gaussian distribution is determined, where the first joint distribution probability represents a first similarity between the two nodes;

[0167] For each sample attribute graph, based on the target feature representation of each node in the graph, the second similarity between the nodes in the graph is determined, including:

[0168] For every two nodes in the graph, based on the target feature representations of the two nodes in the graph, a second joint distribution probability based on t-distributed random neighbor embedding between the two nodes is determined, and the second joint distribution probability characterizes a second similarity between the two nodes.

[0169] Optionally, when determining the similarity between nodes, the Euclidean distance between nodes can be converted into a joint probability distribution, and the similarity between nodes can be represented by each probability value in the joint probability distribution. At this time, for each sample attribute graph, for every two nodes in the graph, the first joint distribution probability between the nodes based on the standard Gaussian distribution (i.e., P distribution) can be determined based on the initial feature representation of the two nodes. The first joint distribution probability represents the first similarity between the two nodes. After obtaining the target feature representation of each node in the graph, for every two nodes in the graph, the second joint distribution probability between the two nodes based on t-distributed random neighbor embedding (i.e., Q distribution in the following text) can be determined based on the target feature representation of each node in the graph. At this time, the second joint distribution probability can be regarded as the second similarity between the two nodes.

[0170] In an optional embodiment of the present application, after each preset number of training operations are performed, for each sample attribute graph, the original information is input into the graph convolutional neural network model, and after the target feature representation of each node in the graph is obtained, the method further includes:

[0171] Based on the target feature representation of each node in the graph, each node in the graph is divided into at least two categories;

[0172] For each of the at least two categories, determining intra-class differences between nodes belonging to the category based on the target feature representation of each node belonging to the category, and determining inter-class differences between different categories based on the target feature representation of each node belonging to the category and the target feature representation of each node belonging to each category in other categories, the other categories being categories other than the category in the at least two categories;

[0173] Based on the first difference and the second difference corresponding to each sample attribute graph, determining the training loss value of the graph convolutional neural network model includes:

[0174] Based on the first difference, the second difference, the intra-class difference and the inter-class difference corresponding to each sample attribute graph, the training loss value of the graph convolutional neural network model is determined.

[0175] Optionally, for each sample attribute graph, after obtaining the target feature representation of each node in the graph, each node in the graph can be classified based on the target feature representation of each node, and each node can be divided into at least two categories. When classifying the nodes in the graph, a preset clustering algorithm can be selected for clustering according to needs, such as a K-Means algorithm, etc., which is not limited in the embodiments of the present application.

[0176] Furthermore, for each category obtained by the division, the differences between the nodes belonging to the category can be determined, that is, the intra-class differences of the category can be determined, and the intra-class differences can be determined based on the target feature representations of the nodes belonging to the category. Similarly, for different categories, the differences between different categories (i.e., inter-class differences) can also be determined. At this time, when determining the inter-class differences between a certain category and other categories, it can be determined based on the target feature representations of the nodes belonging to the category and the target feature representations of the nodes belonging to each category in the other categories.

[0177] Correspondingly, after determining the intra-class differences of each category corresponding to each sample attribute graph and the inter-class differences between different categories, the training loss value of the graph convolutional neural network model can be determined based on the first difference, the second difference, the intra-class difference and the inter-class difference corresponding to each sample attribute graph.

[0178] In an optional embodiment of the present application, for each of the at least two categories, based on the target feature representation of each node belonging to the category, determining the intra-class difference between the nodes belonging to the category, and based on the target feature representation of each node belonging to the category and the target feature representation of each node belonging to each category in the other categories, determining the inter-class difference between different categories, including:

[0179] Determine the category feature representation of the category;

[0180] For each node belonging to the category, determining a third difference between the target feature representation of the node and the category feature representation of the category, and obtaining intra-category differences between the nodes belonging to the category based on the third differences corresponding to the nodes belonging to the category;

[0181] For each node belonging to a category, the fourth difference between the target feature representation of the node and the category feature identifier of each category in other categories is determined, and based on the fourth difference corresponding to each node belonging to the category, the inter-class difference between the category and each category in other categories is obtained.

[0182] Among them, the category feature representation of a category is used to represent the category feature vector of a category, which characterizes the commonality between the nodes belonging to the category. The category feature representation of a category can be understood as the central feature vector of the category, that is, the class center (that is, the cluster center or cluster centroid, each class can be called a cluster).

[0183] Optionally, when determining the intra-class difference of a category, the category feature representation of the category can be determined. The category feature of the category can be determined based on the target feature representation of the nodes belonging to this class, or it can be determined in the process of classifying each node. Then the third difference between the target feature representation of each node belonging to the category and the category feature representation of the category can be determined. Further, based on the third difference between the target feature representation of each node and the category feature representation of the category, the intra-class difference between the nodes belonging to the category can be obtained. When determining the inter-class difference between a category and the categories in other categories, the difference between the target feature representation of each node belonging to the category and the category feature identifier of each category in the other categories (i.e., the fourth difference) can be determined. Then, based on the fourth difference corresponding to each node belonging to the category, the inter-class difference between the category and the categories in the other categories can be obtained.

[0184] In an optional embodiment of the present application, the method further includes:

[0185] Obtaining weights corresponding to the first difference, the second difference, and the category difference, respectively, wherein the category difference includes intra-category difference and inter-category difference;

[0186] weighting the first difference, the second difference, and the category difference based on their respective corresponding weights;

[0187] The weighted first difference, weighted second difference and weighted category difference corresponding to each sample attribute graph are summed, and the sum is used as the training loss value.

[0188] In practical applications, different application scenarios and application requirements may also have different requirements for the model performance of graph convolutional neural network models. For example, for the three levels of graph structure information, similarity of attribute information between nodes in the graph, and category results, some scenarios may focus more on graph structure information, while some scenarios may focus more on the differences within and between results of each category. In order to better meet these application requirements, different weights can be given to training losses at different levels.

[0189] Optionally, intra-class differences and inter-class differences can be divided into category differences. In this case, the weight values ​​of the first difference, the second difference and the category difference can be obtained, and then the first difference, the second difference and the category difference are weighted based on their respective corresponding weights. Then, the weighted first difference, the weighted second difference and the weighted category difference corresponding to each sample attribute graph are summed, and the obtained sum is used as the training loss value.

[0190] In order to better understand the process of training the graph convolutional neural network model in the embodiment of the present application, the training method is described in detail below. In the prior art, the input of the graph convolutional neural network is the adjacency matrix of the attribute graph and the initial feature representation of each node in the attribute graph, where the graph convolutional neural network formula is as follows:

[0191]

[0192]

[0193] Among them, X (l) and X (l+1) are the target feature matrices containing the target feature representations of each node obtained based on the lth layer and the l+1th layer in the graph convolutional neural network. When l=1, X (l) is the initial feature matrix including the initial feature representation of each node in the attribute graph, I N is the identity matrix, is the degree matrix, express The value of the element in the i-th row and i-th column, j represents The number of columns in Express The elements of the i-th row in are summed column by column, A is the adjacency matrix of the attribute graph, W (l) is the weight matrix of the lth layer (i.e., model parameters), and σ represents the nonlinear activation function. At this time, it can be seen from this formula that if the graph convolutional neural network includes K layers, the target feature representation of each node obtained by the graph convolutional neural network can capture the graph information within the K layers.

[0194] However, since each node in each layer of the graph convolutional neural network requires the feature representation of many other nodes during training, there will be a problem of weak scalability and low efficiency when facing large-scale attribute graphs. Therefore, the decoupled graph convolutional neural network was proposed. Based on the graph convolutional neural network formula, it can be seen that each layer of the undecoupled graph convolutional neural network can be divided into two processes. The first step is left multiplication. That is, to achieve the feature representation of the aggregated neighbor nodes (Propagation, abbreviated as P), the second step is to right-multiply the weight matrix W (l) , that is, to achieve a dimensional transformation (Transformation, abbreviated as T), and the decoupled graph convolutional neural network can decompose these two steps and complete all the left multiplications first The operation is then followed by a normal logistic regression (i.e., dimension transformation). The difference between the decoupled graph convolutional neural network and the undecoupled graph convolutional neural network can be seen as follows: Figure 3 As shown, through Figure 3It can be seen that P and T in the undecoupled graph convolutional neural network are adjacent in sequence, that is, each time the left multiplication is performed first Then right multiply the weight matrix W (l) , and all Ps in the decoupled graph convolutional neural network are adjacent to each other and then to all Ts, that is, all left multiplications are realized. operation, and then a normal logistic regression. Correspondingly, the training cost of the decoupled graph convolutional neural network is much smaller than that of the undecoupled graph convolutional neural network, and it has stronger scalability and can still have good efficiency when facing large-scale attribute graphs. If it is assumed that the undecoupled graph convolutional neural network has k layers, then the formula of the decoupled graph convolutional neural network is as follows:

[0195]

[0196] Among them, Z represents the target feature matrix containing the target feature representation of each node in the attribute graph, Express To the kth power, the Based on the previous article about The formula is calculated and will not be repeated here. X represents the initial feature matrix including the initial feature representation of each node in the attribute graph, W represents the weight matrix (ie, model parameters), and σ represents the nonlinear activation function.

[0197] Optionally, the graph convolutional neural network model in this example can be a decoupled graph convolutional neural network or an undecoupled graph convolutional neural network. The following takes the graph convolutional neural network model as a decoupled graph convolutional neural network as an example to describe in detail the process of training the decoupled graph convolutional neural network.

[0198] like Figure 4 As shown, an embodiment of the present application provides a schematic diagram of the architecture for training the decoupled graph convolutional neural network. Optionally, when training the decoupled graph convolutional neural network, the decoupled graph convolutional neural network can be trained based on Angel through PS using the spark training framework to obtain a trained graph convolutional neural network, or the decoupled graph convolutional neural network can be trained through the high-performance distributed computing platform Spark on Angel (SONA) to obtain a trained graph convolutional neural network, and then the target feature representation of each node in the attribute graph is obtained based on the trained graph convolutional neural network.

[0199] In this example, the original information of the sample attribute graph obtained includes the adjacency matrix A of the sample attribute graph and the initial feature matrix X including the initial feature representation of each node in the sample attribute graph, wherein the initial feature representation of each node in the sample attribute graph and the adjacency matrix of the sample attribute graph can be obtained by extracting information from the sample attribute graph based on the information extractor. Furthermore, the original information of each sample attribute graph can be input into the decoupled graph convolutional neural network to obtain the target feature representation of each node in each sample attribute graph. Further, based on the target feature representation of each node in the sample attribute graph, the target feature matrix Z corresponding to the sample attribute graph can be obtained, and then based on the target feature matrix Z corresponding to each sample attribute graph, the initial feature matrix X corresponding to each sample attribute graph, and the adjacency matrix A corresponding to each sample attribute graph, the node feature representation partial loss is determined (by L s Represents), self-supervised training part loss (through L c Representation) and graph structure loss (L p Representation) is used to train the decoupled graph convolutional neural network until the corresponding training loss value converges. Among them, when performing partial loss of node feature representation, it means that the joint distribution probability of P distribution and the joint distribution probability of Q distribution can be calculated based on the target feature matrix Z corresponding to each sample attribute graph and the initial feature matrix X corresponding to each sample attribute graph, and then the decoupled graph convolutional neural network is trained based on the obtained results; when performing partial loss of self-supervised training, it means that clustering is performed based on the target feature matrix Z corresponding to each sample attribute graph to obtain clustering results, and then the decoupled graph convolutional neural network is trained based on the obtained clustering results and the target feature matrix Z corresponding to each sample attribute graph; when performing partial loss of graph structure, it means that the similarity between each node when the target feature representation is adopted can be determined based on the target feature matrix Z corresponding to each sample attribute graph, and the similarity between each node when the initial feature representation is adopted can be determined based on the adjacency matrix A of each sample attribute graph, and then the decoupled graph convolutional neural network is trained based on the obtained similarity difference.

[0200] Optionally, for each sample attribute graph, you can get the degree matrix of the graph Then the adjacency matrix A of the graph and the identity matrix I N Add together to get the processed adjacency matrix The processed adjacency matrix is ​​standardized based on the degree matrix of the sample attribute graph to obtain a standardized adjacency matrix Further, the standardized adjacency matrix Perform k self-multiplication operations to obtain the first graph structure features corresponding to k levels of the graph For each node, the initial feature matrix X and the first graph structure feature of each level can be Fusion is performed separately to obtain the first feature representation of the node Then, the first feature representations of the node at each level can be concatenated to obtain the second feature representation of the node. Incorporating it into the decoupled graph convolutional neural network formula in the previous article, we get the target feature representation Z of the node. At this time, the decoupled graph convolutional neural network formula can be expressed as

[0201] Specifically, the following is a partial loss (by L s Represents), self-supervised training part loss (through L c Representation) and graph structure loss (L p Representation) is used to implement the training process of the decoupled graph convolutional neural network in detail.

[0202] (1) Determine the partial loss of graph structure:

[0203] Specifically, for each sample attribute graph, the initial graph structure feature can be determined based on the adjacency matrix A of the graph (specifically, characterization), and The calculation method of can be found in the previous description, which will not be repeated here. Further, the target graph structural features of the graph can be determined based on the target feature representation Z of each node in the graph. Among them, when determining the target graph structural features, it can be determined specifically by the following formula:

[0204]

[0205] Among them, S represents the target graph structural features, Z represents the target feature matrix containing the target feature representation of each node in the sample attribute graph, and Z T Indicates the dimension transformation of the target feature matrix. Indicates that the 2 norm of Z is squared

[0206] Furthermore, a first difference between the initial graph structure feature and the target graph structure feature of the graph may be determined as a graph structure partial loss, which may be specifically determined based on the following formula:

[0207]

[0208] Among them, L p represents the value of the graph structure loss, N represents the number of nodes, S represents the target graph structure characteristics, represents the initial graph structure features, Express Each element in the obtained matrix is ​​squared and then summed, and then the obtained sum is squared.

[0209] Optionally, when determining the initial graph structural features of the graph, the adjacency matrix A of the graph and the initial feature representation of each node in the graph may be input into other pre-trained models to obtain a matrix Z containing the third feature representation of each node in the graph. DW , then Z DW Substitute into the formula In the above example, we get the initial graph structure feature S DW , further, the initial graph structure feature S of the graph can be determined DW The first difference between the target graph structure feature S and the target graph structure feature S is used as the graph structure partial loss, which can be determined based on the following formula:

[0210]

[0211] Among them, L p represents the value of the graph structure loss, N represents the number of nodes, S represents the target graph structure feature, S DW represents the initial graph structure features, Indicates that SS DW Each element in the obtained matrix is ​​squared and then summed, and then the obtained sum is squared.

[0212] In the embodiments of the present application, k power Contains the graph structure information within k layers in the decoupled graph convolutional neural network. The i-th row of The larger the value of , the more similar the graph structures of nodes i and j are within the kth layer. In this example, the model is trained by using the power of the adjacency matrix or other pre-trained models to determine the difference between the initial graph structure features and the target graph structure features, so that the target feature representation of each node obtained by the decoupled graph convolutional neural network retains the graph structure information in the initial feature representation.

[0213] (2) Determine the node feature representation partial loss:

[0214] In practical applications, since there is a large gap in dimension between the initial feature representation of the node and the final target feature representation (generally one to two orders of magnitude), and the capacity of the target feature representation is much larger than that of the initial feature representation, for a node using the target feature representation, all other nodes can be abstractly divided into three categories according to the distance from the node: near nodes, medium-distance nodes and far nodes. At this time, due to the huge difference in capacity when using the target feature representation and when using the initial feature representation, some of the medium-distance nodes when using the initial feature representation may become far nodes when using the target feature representation, thereby destroying the clustering structure when using the initial feature representation and increasing the difficulty of clustering. Based on this, in an embodiment of the present application, the classic visualization method t-SNE can be imitated to convert the Euclidean distance between the nodes in the sample attribute graph into a joint probability distribution to represent the similarity between the nodes. Specifically, in the initial feature representation, the similarity between the nodes (i.e., the first similarity) can be represented based on the Gaussian distribution joint distribution probability, while in the target feature representation, the t distribution (i.e., one of the "heavy-tailed distributions") can be used. Figure 4 The Q distribution in ( ) represents the similarity between nodes (i.e., the second similarity), which can be specifically described as follows: Figure 5 Based on this Figure 5 It can be seen that when the degree of freedom of the t distribution is set to 1 (i.e., df=1), compared with the degree of freedom being set to 10 (i.e., df=10), the distribution is more similar to the standard Gaussian distribution, and the probability distribution function decreases more slowly in the second half. At this time, the Q distribution can be as close to the P distribution (i.e., Gaussian distribution) as possible, ensuring that the similarity information of the initial features of each node is retained in the target feature representation of each node.

[0215] Among them, the Gaussian distribution joint distribution probability can be obtained by the following formula:

[0216]

[0217] Among them, p ij represents the similarity between the initial feature representation of node i and the initial feature representation of node j, X i represents the initial feature representation of node i, X j represents the initial feature representation of node j, X k represents the initial feature representation of node k, X l represents the initial feature representation of node l, and σ represents the nonlinear activation function.

[0218] The joint distribution probability of Q distribution can be obtained by the following formula:

[0219]

[0220] Among them, qij represents the similarity between the target feature representation of node i and the target feature representation of node j, Z i represents the target feature representation of node i, Z j represents the target feature representation of node j, Z k represents the target feature representation of node k, Z l Represents the target feature representation of node l.

[0221] Furthermore, the difference between the joint distribution probability of the Gaussian distribution and the joint distribution probability of the Q distribution between each node in the sample attribute graph (i.e., the second difference) can be determined and used as the node feature to represent the partial loss to train the decoupled graph convolutional neural network.

[0222] In this example, KL divergence can be used as a node feature to represent partial loss, as shown in the following formula:

[0223] L s =KL(P||Q).

[0224] Among them, L s It represents the value of partial loss represented by the node feature, P represents the Gaussian joint distribution probability of each node, and Q represents the joint distribution probability of the Q distribution of each node.

[0225] (3) Determine the loss of self-supervised training:

[0226] Specifically, after obtaining the target feature representation of each node in the sample attribute graph, the K-Means clustering algorithm can be run once after a fixed iteration interval (5 or 10 iterations) based on the target feature representation of each node in the sample attribute graph to divide each node in the sample attribute graph into at least two categories. Furthermore, based on the category results obtained by the division and the target feature representation of the nodes belonging to each category, the category difference corresponding to the category result can be obtained and used as the partial loss of self-supervised training. Among them, the category difference corresponding to the category result includes the intra-class difference between each node in each category, and the inter-class difference between each category and each category in other categories. Specifically, the value of the partial loss of self-supervised training can be determined based on the following formula:

[0227]

[0228] in, It represents the inter-class difference between each class and each class in other classes. represents the intra-class difference between nodes in each class, γ represents the hyperparameter, N represents the number of nodes, and C j represents the node in category j as the centroid, represents the target feature representation of the node as the centroid in category j, Zi represents the target feature representation of node i, Y i represents the node as the centroid in the category to which node i belongs, The target feature representation of the node as the centroid in the category to which node i belongs, and k represents the number of layers included in the decoupled graph convolutional neural network.

[0229] In an embodiment of the present application, when the model is trained based on the self-supervised training partial loss, for each node, the distance from the node to the centroid of the category can be minimized based on the obtained classification result, and the distance from the node to all other categories can be maximized, which is equivalent to generating two forces, one force makes each point closer to the category to which it belongs, and the other force makes each point farther away from other categories. These two forces make the boundaries between categories clearer. In addition, through the self-supervised training method, the decoupled graph convolutional neural network can also be optimized for clustering tasks, further exploring the potential of the decoupled graph convolutional neural network for clustering tasks.

[0230] Furthermore, after obtaining the node feature representation partial loss, the self-supervised training partial loss, and the graph structure partial loss, the value of the loss function of the decoupled graph convolutional neural network can be obtained based on the node feature representation partial loss, the self-supervised training partial loss, and the graph structure partial loss, and then the decoupled graph convolutional neural network is trained based on the value of the loss function until the training end condition is met, and the trained graph convolutional neural network is obtained. The value of the loss function of the decoupled graph convolutional neural network is as follows:

[0231] L=L s +αL p +βL c

[0232] Among them, L represents the value of the loss function of the decoupled graph convolutional neural network, α and β represent weight values, which can be adjusted according to different data sets, L s represents the value of the partial loss of the node feature representation, L p The value of the loss of the graph structure, L c Represents the loss value of the self-supervised training part.

[0233] In the present application, the loss function is redesigned for the processing of the graph structure of each node in the attribute graph and the initial feature representation of each node in the attribute graph to train the graph convolutional neural network model. At this time, the target feature representation of each node obtained based on the trained graph neural network model retains the similarity information between the nodes in the initial feature representation of each node, and because a self-supervised training method is also introduced, the side effects brought by the edges between clusters are reduced, and the potential of the graph convolutional neural network model in clustering tasks is further developed, and the graph convolutional neural network model can be trained based on an end-to-end training mode.

[0234] Figure 6 FIG. 1 is a flow chart of a method for processing a property graph provided in an embodiment of the present application. Figure 6 As shown, the method includes:

[0235] Step S601: Obtain the attribute graph to be processed and the attribute information of each node in the attribute graph to be processed.

[0236] Step S602, determining the adjacency matrix of the attribute graph to be processed.

[0237] Step S603: for each node, determine the initial feature representation of the node based on the attribute information of the node.

[0238] Among them, the attribute graph to be processed may include the attribute information of each node. At this time, for each node included, the initial feature representation of the node can be determined by the attribute information of the node, that is, the attribute information of a node can be characterized based on the initial feature representation. Further, the adjacency matrix of the attribute graph to be processed can be determined, and the adjacency matrix can be determined by the graph structure of the attribute graph to be processed. For example, assuming that the adjacency matrix is ​​an n*n matrix, at this time if there is an edge connecting node i and node j, then fill 1 in the i-th row and j-th column and the j-th row and i-th column, and fill 0 in the rest of the places. Based on the same principle, each eigenvalue in the n*n matrix is ​​determined to obtain the adjacency matrix.

[0239] Step S604: output the adjacency matrix and the initial feature representation of each node to the graph convolutional neural network model to obtain the target feature representation of each node, wherein the graph convolutional neural network model is obtained based on training the initial graph convolutional neural network model.

[0240] Specifically, after obtaining the adjacency matrix of the attribute graph to be processed and the initial feature representation of each node included therein, the adjacency matrix and the initial feature representation of each node can be output to the graph convolutional neural network model to obtain the target feature representation of each node. At this time, for a node, the dimension of the target feature representation of the node is smaller than the dimension of the initial feature representation of the node, and the target feature representation of each node in the attribute graph to be processed retains the similarity information in the initial features of each node. Among them, the training method of the graph convolutional neural network model has been described in detail in the previous article, and the details can be found in the previous article, so it will not be repeated again.

[0241] In an optional embodiment of the present application, the method further includes:

[0242] Based on the target feature representation of each node, each node in the attribute graph to be processed is classified to obtain the classification result of each node.

[0243] Optionally, after obtaining the target feature representation of each node, each node in the attribute graph to be processed can be classified based on the target feature representation of each node to obtain the classification result of each node. For example, when classifying images, all images to be classified can be regarded as an attribute graph to be processed, and each image to be classified can be regarded as a node in the attribute graph to be processed. At this time, the attribute information of each image to be classified can be obtained, and the initial feature representation of each image to be classified can be determined based on the attribute information of the image to be classified, and the adjacency matrix of the attribute graph to be processed can be determined, and then the adjacency matrix and the initial feature representation of each image to be classified are input into the graph convolutional neural network model to obtain the target feature representation of each image to be classified, and finally, the clustering algorithm is used to classify based on the target feature representation of each image to be classified to obtain each classification result.

[0244] It can be understood that the application scenarios of the attribute graph processing method provided in the embodiments of the present application include but are not limited to image classification, and can be applied to any efficient processing scenarios of large-scale attribute problems, such as node classification, link prediction, business recommendations, and knowledge graphs.

[0245] Among them, when applied to link prediction, each node in the attribute graph is the node that needs to be connected in the link. At this time, the target feature representation of each node that needs to be connected can be obtained based on the attribute graph processing method provided in the embodiment of the present application, and then classification processing is performed based on the target feature representation of each node that needs to be connected to obtain each classification result. Further, the nodes belonging to the same classification result can be connected to obtain each link; when applied to business recommendation, each node in the attribute graph is the business information to be recommended. At this time, the target feature representation of each business information to be recommended can be obtained based on the attribute graph processing method provided in the embodiment of the present application, and then Then, classification processing is performed based on the target feature representation of each commercial information to be recommended to obtain each classification result. The commercial information to be recommended belonging to the same classification result can be further recommended to the user as information of the same type. When applied in the knowledge graph, each node in the attribute graph is each knowledge information. At this time, the target feature representation of each knowledge information can be obtained based on the attribute graph processing method provided in the embodiment of the present application. Then, classification processing is performed based on the target feature representation of each knowledge information to obtain each classification result. At this time, an association relationship can be established for the knowledge information belonging to the same classification result, thereby obtaining a knowledge graph composed of each knowledge information.

[0246] The present application embodiment provides a device for processing a property graph, such as Figure 7 As shown, the property graph processing device 70 may include: a data acquisition module 701, an initial information determination module 702 and a model training module 703, wherein:

[0247] The data acquisition module 701 is used to acquire a training data set. Each sample in the training data set includes original information of a sample attribute graph. The original information includes an adjacency matrix of the sample attribute graph and an initial feature representation of each node in the sample attribute graph. The initial feature representation of a node represents the attribute information of the node.

[0248] An initial information determination module 702 is used to determine, for each sample attribute graph, an initial graph structure feature of the graph based on at least one item in the original information, and determine a first similarity between the nodes in the graph based on the initial feature representation of each node in the graph;

[0249] The model training module 703 is used to repeatedly perform the following training operations on the initial graph convolutional neural network model based on the training data set until the training loss value meets the training end condition, thereby obtaining a trained graph convolutional neural network model:

[0250] For each sample attribute graph, the original information is input into the graph convolutional neural network model to obtain the target feature representation of each node in the graph, and based on the target feature representation of each node in the graph, the target graph structural features of the graph and the second similarity between the nodes in the graph are determined;

[0251] For each sample attribute graph, determining a first difference between an initial graph structure feature and a target graph structure feature of the graph, and a second difference between a first similarity and a second similarity between nodes in the graph;

[0252] Based on the first difference and the second difference corresponding to each sample attribute graph, the training loss value of the graph convolutional neural network model is determined. If the training loss value does not meet the training end condition, the model parameters of the graph convolutional neural network are adjusted.

[0253] Optionally, for each sample attribute graph, when the model training module inputs the original information into the graph convolutional neural network model to obtain the target feature representation of each node in the graph, and based on the target feature representation of each node in the graph, is specifically used to:

[0254] Based on the original information, the initial graph neural network model performs the following operations to obtain the target feature representation of each node in the graph:

[0255] Based on the adjacency matrix of the graph, obtaining a first graph structure feature of the graph corresponding to at least two levels;

[0256] For the first graph structural feature of each level, based on the initial feature matrix of the graph and the first graph structural feature of the level, a first feature matrix of the graph corresponding to the level is obtained, wherein the initial feature matrix contains the initial feature representation of each node of the graph, and the first feature matrix contains the first feature representation of each node of the graph;

[0257] For each node in the graph, a second feature representation of the node is obtained by fusing the first feature representations of the nodes at each level in at least two levels;

[0258] Based on the second feature representation of each node in the sample attribute graph, the target feature representation of each node in the graph is extracted.

[0259] Optionally, when the model training module obtains the first graph structure feature of the graph corresponding to at least two levels based on the adjacency matrix of the graph, it is specifically used to:

[0260] Get the degree matrix of the graph;

[0261] Add the adjacency matrix based on the graph to the identity matrix to obtain the processed adjacency matrix;

[0262] The processed adjacency matrix is ​​normalized based on the degree matrix of the graph to obtain a standardized adjacency matrix;

[0263] The standardized adjacency matrix is ​​used as a first graph structural feature of a level of the graph, and the standardized adjacency matrix is ​​subjected to at least one self-multiplication operation to obtain a first graph structural feature of the graph corresponding to at least one level, wherein the self-multiplication power of each multiplication process is different.

[0264] Optionally, for each sample attribute graph, when the model training module determines the target graph structural features of the graph based on the target feature representation of each node in the graph, it is specifically used to:

[0265] Determine a third similarity between the nodes in the graph based on the target feature representation of each node in the graph;

[0266] Based on the third similarity between the nodes in the graph, a target graph structural feature of the graph is determined.

[0267] Optionally, for each sample attribute graph, when the model training module determines the initial graph structure feature of the graph based on at least one item of the original information, it is specifically used for any of the following:

[0268] Based on the adjacency matrix of the graph, determine the initial graph structure characteristics of the graph;

[0269] Based on the original information, the third feature representation of each node in the graph is extracted through a pre-trained feature extraction model, and based on the third feature representation of each node, the initial graph structure characteristics of the graph are determined.

[0270] Optionally, when the model training module determines the initial graph structure features of the graph based on the third feature representation of each node, it is specifically used to:

[0271] Determining a fourth similarity between the nodes in the graph based on the third feature representation between the nodes;

[0272] Based on the fourth similarity between the nodes in the graph, an initial graph structural feature of the graph is determined.

[0273] Optionally, for each sample attribute graph, when the initial information determination module determines the first similarity between each node based on the initial feature representation of each node in the graph, it is specifically used to:

[0274] For every two nodes in the graph, based on the initial feature representations of the two nodes in the graph, a first joint distribution probability between the nodes based on a standard Gaussian distribution is determined, where the first joint distribution probability represents a first similarity between the two nodes;

[0275] For each sample attribute graph, the model training module determines the second similarity between the nodes in the graph based on the target feature representation of each node in the graph, specifically for:

[0276] For every two nodes in the graph, based on the target feature representations of the two nodes in the graph, a second joint distribution probability based on t-distributed random neighbor embedding between the two nodes is determined, and the second joint distribution probability characterizes a second similarity between the two nodes.

[0277] Optionally, after executing a preset number of training operations, for each sample attribute graph, the original information is input into the graph convolutional neural network model to obtain the target feature representation of each node in the graph, and the initial model training module is further used to:

[0278] Based on the target feature representation of each node in the graph, each node in the graph is divided into at least two categories;

[0279] For each of the at least two categories, determining intra-class differences between nodes belonging to the category based on the target feature representation of each node belonging to the category, and determining inter-class differences between different categories based on the target feature representation of each node belonging to the category and the target feature representation of each node belonging to each category in other categories, the other categories being categories other than the category in the at least two categories;

[0280] When the model training module determines the training loss value of the graph convolutional neural network model based on the first difference and the second difference corresponding to each sample attribute graph, it is specifically used to:

[0281] Based on the first difference, the second difference, the intra-class difference and the inter-class difference corresponding to each sample attribute graph, the training loss value of the graph convolutional neural network model is determined.

[0282] Optionally, for each of the at least two categories, the model training module, when determining the intra-class differences between the nodes belonging to the category based on the target feature representation of each node belonging to the category, and determining the inter-class differences between different categories based on the target feature representation of each node belonging to the category and the target feature representation of each node belonging to each category in other categories, is specifically used to:

[0283] Determine the category feature representation of the category;

[0284] For each node belonging to the category, determining a third difference between the target feature representation of the node and the category feature representation of the category, and obtaining intra-category differences between the nodes belonging to the category based on the third differences corresponding to the nodes belonging to the category;

[0285] For each node belonging to a category, the fourth difference between the target feature representation of the node and the category feature identifier of each category in other categories is determined, and based on the fourth difference corresponding to each node belonging to the category, the inter-class difference between the category and each category in other categories is obtained.

[0286] Optionally, the model training module is also used to:

[0287] Obtaining weights corresponding to the first difference, the second difference, and the category difference, respectively, wherein the category difference includes intra-category difference and inter-category difference;

[0288] weighting the first difference, the second difference, and the category difference based on their respective corresponding weights;

[0289] The weighted first difference, weighted second difference and weighted category difference corresponding to each sample attribute graph are summed, and the sum is used as the training loss value.

[0290] The present application embodiment provides a device for processing a property graph, such as Figure 8 As shown, the property graph processing device 80 may include: a to-be-processed data acquisition module 801, an adjacency matrix determination module 802, an initial feature representation determination module 803, and a target feature representation determination module 804, wherein:

[0291] The to-be-processed data acquisition module 801 is used to acquire the to-be-processed attribute graph and the attribute information of each node in the to-be-processed attribute graph;

[0292] The adjacency matrix determination module 802 is used to determine the adjacency matrix of the attribute graph to be processed;

[0293] An initial feature representation determination module 803 is used to determine, for each node, an initial feature representation of the node based on the attribute information of the node;

[0294] The target feature representation determination module 804 is used to output the adjacency matrix and the initial feature representation of each node to the graph convolutional neural network model to obtain the target feature representation of each node, wherein the graph convolutional neural network model is trained based on the method of training the graph convolutional neural network model described in the previous text.

[0295] The device also includes a classification module for:

[0296] Based on the target feature representation of each node, each node in the attribute graph to be processed is classified to obtain the classification result of each node.

[0297] The property graph processing device of the embodiment of the present application can execute a property graph processing method provided by the embodiment of the present application. The implementation principle is similar and will not be repeated here.

[0298] The property graph processing device may be a computer program (including program code) running in a computer device, for example, the property graph processing device is an application software; the device may be used to execute the corresponding steps in the method provided in the embodiment of the present application.

[0299] In some embodiments, the property graph processing device provided by the embodiment of the present invention can be implemented in a combination of software and hardware. As an example, the property graph processing device provided by the embodiment of the present invention can be a processor in the form of a hardware decoding processor, which is programmed to execute the property graph processing method provided by the embodiment of the present invention. For example, the processor in the form of a hardware decoding processor can adopt one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs) or other electronic components.

[0300] The present application embodiment provides an electronic device, such as Fig. 9 As shown, Fig. 9 The electronic device 2000 shown includes: a processor 2001 and a memory 2003. The processor 2001 and the memory 2003 are connected, such as through a bus 2002. Optionally, the electronic device 2000 may also include a transceiver 2004. It should be noted that in actual applications, the transceiver 2004 is not limited to one, and the structure of the electronic device 2000 does not constitute a limitation on the embodiments of the present application.

[0301] The processor 2001 is used in the embodiment of the present application to implement Figure 7 and Figure 8 The functions of each module are shown.

[0302] Processor 2001 may be a CPU, a general-purpose processor, a DSP, an ASIC, an FPGA or other programmable logic device, a transistor logic device, a hardware component or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 2001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0303] The bus 2002 may include a path to transmit information between the above components. The bus 2002 may be a PCI bus or an EISA bus, etc. The bus 2002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig. 9 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0304] Memory 2003 may be ROM or other types of static storage devices that can store static information and computer programs, RAM or other types of dynamic storage devices that can store information and computer programs, or may be EEPROM, CD-ROM or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store or in the form of a data structure the desired computer program and can be accessed by a computer, but is not limited thereto.

[0305] The memory 2003 is used to store a computer program for executing the application program of the present application solution, and the execution is controlled by the processor 2001. The processor 2001 is used to execute the computer program of the application program stored in the memory 2003 to implement Figure 7 and Figure 8 The illustrated embodiment provides actions of a device for processing a property graph.

[0306] An embodiment of the present application provides an electronic device, including a processor and a memory: the memory is configured to store a computer program, and when the computer program is executed by the processor, the processor performs any one of the methods in the above embodiments.

[0307] An embodiment of the present application provides a computer-readable storage medium, which is used to store a computer program. When the computer program runs on a computer, the computer can execute any one of the methods in the above embodiments.

[0308] The embodiment of the present application provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. The processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided in the above various optional implementations.

[0309] The nouns and implementation principles involved in a computer-readable storage medium in the present application can be specifically referred to a method for processing a property graph in an embodiment of the present application, and will not be repeated here.

[0310] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0311] The above description is only a partial implementation method of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for processing an attribute graph, characterized in that: include: Acquire a training data set, wherein each sample in the training data set includes original information of a sample attribute graph, wherein the original information includes an adjacency matrix of the sample attribute graph and an initial feature representation of each node in the sample attribute graph, wherein the initial feature representation of a node represents the attribute information of the node; For each of the sample attribute graphs, determining an initial graph structure feature of the graph based on at least one item of the original information, and determining a first similarity between the nodes in the graph based on an initial feature representation of each node in the graph; The following training operations are repeatedly performed on the initial graph convolutional neural network model based on the training data set until the training loss value meets the training end condition, thereby obtaining a trained graph convolutional neural network model: For each of the sample attribute graphs, the original information is input into a graph convolutional neural network model to obtain a target feature representation of each node in the graph, and based on the target feature representation of each node in the graph, a target graph structural feature of the graph and a second similarity between each node in the graph are determined; wherein the feature dimension of the initial feature representation of each node in the graph is higher than the feature dimension of the target feature representation of each node; For each of the sample attribute graphs, determining a first difference between an initial graph structure feature and a target graph structure feature of the graph, and a second difference between a first similarity and a second similarity between nodes in the graph; Based on the first difference and the second difference corresponding to each of the sample attribute graphs, the training loss value of the graph convolutional neural network model is determined; if the training loss value does not meet the training end condition, the model parameters of the graph convolutional neural network are adjusted.

2. The method according to claim 1, characterized in that: For each of the sample attribute graphs, the original information is input into a graph convolutional neural network model to obtain a target feature representation of each node in the graph, including: Based on the original information, the graph convolutional neural network model performs the following operations to obtain target feature representations of each node in the graph: Based on the adjacency matrix of the graph, obtaining first graph structural features of the graph corresponding to at least two levels; For the first graph structural feature of each level, based on the initial feature matrix of the graph and the first graph structural feature of the level, a first feature matrix of the graph corresponding to the level is obtained, wherein the initial feature matrix includes initial feature representations of each node of the graph, and the first feature matrix includes first feature representations of each node of the graph; For each node in the graph, obtaining a second feature representation of the node by fusing first feature representations of the node at each level in the at least two levels; Based on the second feature representation of each node in the sample attribute graph, a target feature representation of each node in the graph is extracted.

3. The method according to claim 2, characterized in that The step of obtaining the first graph structure features of the graph corresponding to at least two levels based on the adjacency matrix of the graph includes: Obtaining a degree matrix of the graph; Adding the adjacency matrix based on the graph to the identity matrix to obtain a processed adjacency matrix; Normalizing the processed adjacency matrix based on the degree matrix of the graph to obtain a standardized adjacency matrix; The standardized adjacency matrix is ​​used as the first graph structure feature of a level of the graph, and the standardized adjacency matrix is ​​subjected to at least one self-multiplication operation to obtain the first graph structure feature of the graph corresponding to at least one level, wherein the self-multiplication power of each multiplication process is different.

4. The method according to claim 1, characterized in that: For each of the sample attribute graphs, determining the target graph structural features of the graph based on the target feature representation of each node in the graph includes: Determining a third similarity between the nodes in the graph based on the target feature representation of each node in the graph; Based on the third similarity between the nodes in the graph, a target graph structural feature of the graph is determined.

5. The method according to claim 1, characterized in that For each of the sample attribute graphs, determining an initial graph structure feature of the graph based on at least one item of the original information, Include any of the following: Determining initial graph structural features of the graph based on an adjacency matrix of the graph; Based on the original information, a third feature representation of each node in the graph is extracted through a pre-trained feature extraction model, and based on the third feature representation of each node, an initial graph structure feature of the graph is determined.

6. The method according to claim 5, characterized in that The determining of the initial graph structure feature of the graph based on the third feature representation of each node includes: Determining a fourth similarity between the nodes in the graph based on a third feature representation between the nodes; Based on the fourth similarity between the nodes in the graph, an initial graph structural feature of the graph is determined.

7. The method according to claim 1, characterized in that For each of the sample attribute graphs, determining a first similarity between the nodes in the graph based on the initial feature representation of each node in the graph includes: For every two nodes in the graph, based on initial feature representations of the two nodes in the graph, determining a first joint distribution probability between the two nodes based on a standard Gaussian distribution, wherein the first joint distribution probability represents a first similarity between the two nodes; For each of the sample attribute graphs, determining a second similarity between the nodes in the graph based on the target feature representation of each node in the graph includes: For every two nodes in the graph, based on the target feature representation of the two nodes in the graph, a second joint distribution probability based on t-distributed random neighbor embedding between the two nodes is determined, and the second joint distribution probability characterizes a second similarity between the two nodes.

8. The method according to claim 1, characterized in that After executing the training operation for a preset number of times, for each of the sample attribute graphs, the original information is input into the graph convolutional neural network model to obtain the target feature representation of each node in the graph, and further includes: Based on the target feature representation of each node in the graph, each node in the graph is divided into at least two categories; For each of the at least two categories, determining intra-class differences between nodes belonging to the category based on target feature representations of the nodes belonging to the category, and determining inter-class differences between the category and each category in the other categories based on the target feature representations of the nodes belonging to the category and the target feature representations of the nodes belonging to each category in the other categories, the other categories being categories other than the category in the at least two categories; The determining of the training loss value of the graph convolutional neural network model based on the first difference and the second difference corresponding to each of the sample attribute graphs includes: Based on the first difference, the second difference, the intra-class difference and the inter-class difference corresponding to each of the sample attribute graphs, the training loss value of the graph convolutional neural network model is determined.

9. The method according to claim 8, characterized in that For each of the at least two categories, determining the intra-class difference between the nodes belonging to the category based on the target feature representation of each node belonging to the category, and determining the inter-class difference between the category and each category in the other categories based on the target feature representation of each node belonging to the category and the target feature representation of each node belonging to each category in the other categories, includes: determining a class feature representation of the class; For each node belonging to the category, determining a third difference between the target feature representation of the node and the category feature representation of the category, and obtaining intra-category differences between the nodes belonging to the category based on the third differences corresponding to the nodes belonging to the category; For each node belonging to the category, determine the fourth difference between the target feature representation of the node and the category feature identifier of each category in other categories, and based on the fourth difference corresponding to each node belonging to the category, obtain the inter-class difference between the category and each category in the other categories.

10. The method according to claim 8, characterized in that The training loss value is obtained in the following way: Obtaining weights corresponding to the first difference, the second difference, and the category difference, respectively, wherein the category difference includes the intra-category difference and the inter-category difference; weighting the first difference, the second difference, and the category difference based on their respective corresponding weights; The weighted first difference, the weighted second difference and the weighted category difference corresponding to each of the sample attribute graphs are summed, and the sum is used as the training loss value.

11. A method for processing an attribute graph, characterized in that: include: Obtaining a property graph to be processed and property information of each node in the property graph to be processed; Determine the adjacency matrix of the attribute graph to be processed; For each node, determining an initial feature representation of the node based on attribute information of the node; The adjacency matrix and the initial feature representation of each node are output to a graph convolutional neural network model to obtain a target feature representation of each node, wherein the graph convolutional neural network model is trained based on the method described in any one of claims 1-10.

12. The method according to claim 11, characterized in that Also includes: Based on the target feature representation of each node, each node in the to-be-processed attribute graph is classified to obtain a classification result of each node.

13. A property graph processing device, characterized in that: include: A data acquisition module is used to acquire a training data set, wherein each sample in the training data set includes original information of a sample attribute graph, wherein the original information includes an adjacency matrix of the sample attribute graph and an initial feature representation of each node in the sample attribute graph, wherein the initial feature representation of a node represents the attribute information of the node; An initial information determination module, configured to determine, for each of the sample attribute graphs, an initial graph structural feature of the graph based on at least one item of the original information, and determine a first similarity between the nodes in the graph based on an initial feature representation of each node in the graph; The model training module is used to repeatedly perform the following training operations on the initial graph convolutional neural network model based on the training data set until the training loss value meets the training end condition, thereby obtaining a trained graph convolutional neural network model: For each of the sample attribute graphs, the original information is input into a graph convolutional neural network model to obtain a target feature representation of each node in the graph, and based on the target feature representation of each node in the graph, a target graph structural feature of the graph and a second similarity between each node in the graph are determined; wherein the feature dimension of the initial feature representation of each node in the graph is higher than the feature dimension of the target feature representation of each node; For each of the sample attribute graphs, determining a first difference between an initial graph structure feature and a target graph structure feature of the graph, and a second difference between a first similarity and a second similarity between nodes in the graph; Based on the first difference and the second difference corresponding to each of the sample attribute graphs, the training loss value of the graph convolutional neural network model is determined; if the training loss value does not meet the training end condition, the model parameters of the graph convolutional neural network are adjusted.

14. The device according to claim 13, characterized in that The target feature representation of each node in the graph is obtained in the following way: Based on the original information, the graph convolutional neural network model performs the following operations to obtain target feature representations of each node in the graph: Based on the adjacency matrix of the graph, obtaining first graph structural features of the graph corresponding to at least two levels; For the first graph structural feature of each level, based on the initial feature matrix of the graph and the first graph structural feature of the level, a first feature matrix of the graph corresponding to the level is obtained, wherein the initial feature matrix includes initial feature representations of each node of the graph, and the first feature matrix includes first feature representations of each node of the graph; For each node in the graph, obtaining a second feature representation of the node by fusing first feature representations of the node at each level in the at least two levels; Based on the second feature representation of each node in the sample attribute graph, a target feature representation of each node in the graph is extracted.

15. The device according to claim 14, characterized in that The first graph structure feature corresponding to at least two levels of the graph is obtained in the following manner: Obtaining a degree matrix of the graph; Adding the adjacency matrix based on the graph to the identity matrix to obtain a processed adjacency matrix; Normalizing the processed adjacency matrix based on the degree matrix of the graph to obtain a standardized adjacency matrix; The standardized adjacency matrix is ​​used as the first graph structure feature of a level of the graph, and the standardized adjacency matrix is ​​subjected to at least one self-multiplication operation to obtain the first graph structure feature of the graph corresponding to at least one level, wherein the self-multiplication power of each multiplication process is different.

16. The device according to claim 13, characterized in that For each of the sample attribute graphs, the target graph structure features of the graph are obtained in the following manner: Determining a third similarity between the nodes in the graph based on the target feature representation of each node in the graph; Based on the third similarity between the nodes in the graph, a target graph structural feature of the graph is determined.

17. The device according to claim 13, characterized in that For each of the sample attribute graphs, the initial graph structure features of the graph are obtained by any of the following methods: Determining initial graph structural features of the graph based on an adjacency matrix of the graph; Based on the original information, a third feature representation of each node in the graph is extracted through a pre-trained feature extraction model, and based on the third feature representation of each node, an initial graph structure feature of the graph is determined.

18. The device according to claim 17, characterized in that For each of the sample attribute graphs, the initial graph structure features of the graph are obtained in the following manner: Determining a fourth similarity between the nodes in the graph based on a third feature representation between the nodes; Based on the fourth similarity between the nodes in the graph, an initial graph structural feature of the graph is determined.

19. The device according to claim 13, characterized in that For each of the sample attribute graphs, the first similarity between the nodes in the graph is obtained in the following manner: For every two nodes in the graph, based on initial feature representations of the two nodes in the graph, determining a first joint distribution probability between the two nodes based on a standard Gaussian distribution, wherein the first joint distribution probability represents a first similarity between the two nodes; For each of the sample attribute graphs, the second similarity between the nodes in the graph is obtained in the following manner: For every two nodes in the graph, based on the target feature representation of the two nodes in the graph, a second joint distribution probability based on t-distributed random neighbor embedding between the two nodes is determined, and the second joint distribution probability characterizes a second similarity between the two nodes.

20. The device according to claim 13, characterized in that After executing the training operation for a preset number of times, for each of the sample attribute graphs, the model training module, after obtaining the target feature representation of each node in the graph, is further used to: Based on the target feature representation of each node in the graph, each node in the graph is divided into at least two categories; For each of the at least two categories, determining intra-class differences between nodes belonging to the category based on target feature representations of the nodes belonging to the category, and determining inter-class differences between the category and each category in the other categories based on the target feature representations of the nodes belonging to the category and the target feature representations of the nodes belonging to each category in the other categories, the other categories being categories other than the category in the at least two categories; The training loss value of the graph convolutional neural network model is obtained in the following way: Based on the first difference, the second difference, the intra-class difference and the inter-class difference corresponding to each of the sample attribute graphs, the training loss value of the graph convolutional neural network model is determined.

21. The device according to claim 20, characterized in that For each of the at least two categories, the intra-class differences between nodes belonging to the category and the inter-class differences between the category and each of the categories in other categories are obtained by: determining a class feature representation of the class; For each node belonging to the category, determining a third difference between the target feature representation of the node and the category feature representation of the category, and obtaining intra-category differences between the nodes belonging to the category based on the third differences corresponding to the nodes belonging to the category; For each node belonging to the category, determine the fourth difference between the target feature representation of the node and the category feature identifier of each category in other categories, and based on the fourth difference corresponding to each node belonging to the category, obtain the inter-class difference between the category and each category in the other categories.

22. The device according to claim 20, characterized in that The training loss value is obtained in the following way: Obtaining weights corresponding to the first difference, the second difference, and the category difference, respectively, wherein the category difference includes the intra-category difference and the inter-category difference; weighting the first difference, the second difference, and the category difference based on their respective corresponding weights; The weighted first difference, the weighted second difference and the weighted category difference corresponding to each of the sample attribute graphs are summed, and the sum is used as the training loss value.

23. A property graph processing device, characterized in that: include: A module for acquiring data to be processed, used to acquire the attribute graph to be processed and the attribute information of each node in the attribute graph to be processed; An adjacency matrix determination module, used to determine the adjacency matrix of the attribute graph to be processed; An initial feature representation determination module, configured to determine, for each node, an initial feature representation of the node based on attribute information of the node; A target feature representation determination module is used to output the adjacency matrix and the initial feature representation of each node to a graph convolutional neural network model to obtain a target feature representation of each node, wherein the graph convolutional neural network model is trained based on the method described in any one of claims 1-10.

24. The device according to claim 23, characterized in that The device also includes: The classification module is used to classify each node in the attribute graph to be processed based on the target feature representation of each node to obtain a classification result for each node.

25. An electronic device, characterized in that: Including processor and memory: The memory is configured to store a computer program, which, when executed by the processor, causes the processor to perform the method of any one of claims 1-10, or to perform the method of any one of claims 11-12.

26. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program. When the computer program is run on a computer, the computer executes the method according to any one of claims 1 to 10, or executes the method according to any one of claims 11 to 12.

Citation Information

Patent Citations

  • Specific target emotion classification method based on graph neural network

    CN111563164A

  • Graph-based network community discovery method and device, equipment and storage medium

    CN112231592A