Graph data processing method, system, equipment and medium

By extracting node features and edge features of large-scale graph data, generating node feature matrix and resistance-change array, and using graph neural network for training, the problem that traditional methods are difficult to efficiently process large-scale graph data is solved, and efficient and scalable graph data processing and neural network algorithm acceleration are achieved.

CN119739986AActive Publication Date: 2025-04-01INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411894142.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-04-01
Estimated Expiration
2044-12-20

AI Technical Summary

Technical Problem

With the advent of the big data era, the scale of graph data structures has shown an explosive growth, making it difficult for traditional graph data processing methods to process large-scale graph data efficiently, especially in terms of computing speed and energy consumption.

Method used

A graph data processing method is proposed. By processing multiple pending graph data in the training data set to obtain node features and edge features, generate node feature matrix and impedance array, and use graph neural network, node feature matrix and impedance array to generate transition features, and weighted calculations are performed through graph convolution layer and readout network. Finally, the weight parameters of graph neural network are adjusted according to the Hamiltonian loss function to realize the training of graph neural network.

Benefits of technology

By using the resistance variable array as the adjacency matrix of the graph neural network, the energy consumption of data handling is reduced, the time overhead required for graph data computing is reduced, efficient and scalable graph data processing is achieved, and the neural network algorithm is significantly accelerated.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119739986A_ABST
    Figure CN119739986A_ABST
Patent Text Reader

Abstract

The invention provides a graph data processing method, system and device and a medium. The method comprises the steps that multiple pieces of to-be-processed graph data in a training data set are processed to obtain node features and edge features; generating a node feature matrix and a resistive random array according to the node features and the edge features; generating a first transition feature according to the graph neural network, the node feature matrix and the resistive array; inputting the first transition feature into one or more graph convolutional layers in a graph neural network for weighted calculation to output a second transition feature; inputting the second transition feature into a pre-constructed readout network in a graph neural network to generate a result feature; adjusting weight parameters of the graph neural network according to the result features and a Hamiltonian loss function, and training the graph neural network to obtain a target neural network; and generating target result features according to the node features and the edge features of the target map data and the target map neural network. The graph data operation time is shortened, and the processing speed is increased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of neural networks, and in particular to a graph data processing method, system, device and medium. Background Art

[0002] Graph Neural Network (GNN) is a connection model that obtains dependencies in the graph by transferring information between nodes in the network. Graph neural network updates the state of a node through neighboring nodes of any depth, and can extend the deep neural model to non-Euclidean domains. Therefore, graph neural network has received extensive attention and application in fields such as knowledge graphs, recommendation systems, and biomedical engineering.

[0003] With the advent of the big data era, the scale of graph data structures has exploded, making traditional processing methods difficult.

[0004] Therefore, there is an urgent need for a graph data processing method that can accelerate the computing speed to solve the above technical problems. Summary of the invention

[0005] Based on this, it is necessary to provide a graph data processing method, system, device and medium to address the above technical problems.

[0006] In a first aspect, the present application provides a graph data processing method, the method comprising:

[0007] Processing multiple graph data to be processed in the training data set to obtain node features and edge features;

[0008] Generate a node feature matrix and a resistive switching array according to node features and edge features;

[0009] Generate a first transition feature according to the graph neural network, the node feature matrix, and the resistive switching array;

[0010] Inputting the first transition feature into one or more graph convolutional layers in the graph neural network for weighted calculation to output a second transition feature;

[0011] Inputting the second transition feature into a pre-built readout network in the graph neural network to generate a result feature;

[0012] According to the result characteristics and Hamiltonian loss function, the weight parameters of the graph neural network are adjusted to train the graph neural network to obtain the target neural network.

[0013] The target result features are generated based on the node features, edge features of the target graph data and the target graph neural network.

[0014] In some embodiments, a method for generating a resistive switching array includes:

[0015] Create a two-dimensional matrix where the number of rows and columns of the two-dimensional matrix matches the number of node features;

[0016] Traverse the edge features of the graph data to be processed, and determine the target matrix element values ​​that match the edge start points and edge end points in the edge features;

[0017] Adjusting the target matrix element value from the second preset value to the first preset value to generate an adjacency matrix matching the graph data;

[0018] According to the matrix element values ​​in the adjacency matrix, the resistance state of the initial resistive switching array having the same scale as the adjacency matrix is ​​set to generate the resistive switching array.

[0019] In some embodiments, according to the matrix element values ​​in the adjacency matrix, setting the resistance state of the initial resistive switching array having the same scale as the adjacency matrix to generate the resistive switching array includes:

[0020] In response to detecting that the matrix element value is a first preset value, setting the resistive storage unit at the intersection matching the matrix element value in the initial resistive array to a high resistance state;

[0021] In response to detecting that the matrix element value is a second preset value, the resistive switching memory cells at the intersections corresponding to the matrix element values ​​in the initial resistive switching array are set to a low resistance state.

[0022] In some embodiments, the weight parameters of the graph neural network are adjusted according to the result features and the Hamiltonian loss function to implement training of the graph neural network to obtain a target neural network, including:

[0023] Use an optimizer to adjust the weight parameters of the graph neural network to obtain result features that match the adjusted weight parameters;

[0024] Input the adjusted result features into the Hamiltonian loss function to obtain the Hamiltonian;

[0025] Determine whether the convergence condition is met based on the Hamiltonian and the number of iterations;

[0026] In response to detecting that the convergence condition is met, training of the graph neural network is completed.

[0027] In some embodiments, the Hamiltonian loss function is:

[0028] Among them, p represents the result features, i represents the number of rows, j represents the number of columns, and Q represents the constant matrix encoded according to the actual problem solved by the graph neural network.

[0029] In some embodiments, when calculating the Hamiltonian according to the Hamiltonian loss function, the method includes:

[0030] In response to detecting that there is a negative number in the constant matrix, splitting the constant matrix into a first constant sub-matrix and a second constant sub-matrix;

[0031] Replacing the constant matrix in the Hamiltonian loss function with the first constant submatrix to calculate the first Hamiltonian to be processed;

[0032] Replacing the constant matrix in the Hamiltonian loss function with a second constant submatrix to calculate a second Hamiltonian to be processed;

[0033] A subtractor is used to connect the first Hamiltonian to be processed and the second Hamiltonian to be processed to synthesize the Hamiltonian.

[0034] In some embodiments, after generating an adjacency matrix matching the graph data to be processed, the method further includes:

[0035] Generate a self-connected adjacency matrix from the sum of the identity matrix and the adjacency matrix;

[0036] According to the matrix element values ​​in the self-connected adjacency matrix, the resistance state of the initial resistive switching array is set to generate the resistive switching array.

[0037] In a second aspect, the present application provides a graph data processing system, the system comprising:

[0038] A preprocessing module is used to process multiple graph data to be processed in the training data set to obtain node features and edge features;

[0039] The preprocessing module is also used to generate a node feature matrix and a resistive switching array according to the node features and edge features;

[0040] A first processing module, used for generating a first transition feature according to the graph neural network, the node feature matrix and the resistive switching array;

[0041] The first processing module is further used to input the first transition feature into one or more graph convolution layers in the graph neural network for weighted calculation to output a second transition feature;

[0042] A second processing module, configured to input the second transition feature into a pre-constructed readout network in the graph neural network to generate a result feature;

[0043] The second processing module is also used to adjust the weight parameters of the graph neural network according to the result characteristics and the Hamiltonian loss function, so as to train the graph neural network to obtain the target neural network;

[0044] The result generation module is used to generate target result features based on the node features, edge features and target graph neural network of the target graph data.

[0045] In a third aspect, the present application provides a computer program product, which implements the steps of the following method when the computer program is executed by a processor:

[0046] Processing multiple graph data to be processed in the training data set to obtain node features and edge features;

[0047] Generate a node feature matrix and a resistive switching array according to node features and edge features;

[0048] Generate a first transition feature according to the graph neural network, the node feature matrix, and the resistive switching array;

[0049] Inputting the first transition feature into one or more graph convolutional layers in the graph neural network for weighted calculation to output a second transition feature;

[0050] Inputting the second transition feature into a pre-built readout network in the graph neural network to generate a result feature;

[0051] According to the result characteristics and Hamiltonian loss function, the weight parameters of the graph neural network are adjusted to train the graph neural network to obtain the target neural network.

[0052] The target result features are generated based on the node features, edge features of the target graph data and the target graph neural network.

[0053] In a fourth aspect, the present application provides an electronic device, the electronic device comprising:

[0054] one or more processors;

[0055] and a memory associated with one or more processors, the memory being used to store program instructions, which, when read and executed by the one or more processors, perform the following operations:

[0056] Processing multiple graph data to be processed in the training data set to obtain node features and edge features;

[0057] Generate a node feature matrix and a resistive switching array according to node features and edge features;

[0058] Generate a first transition feature according to the graph neural network, the node feature matrix, and the resistive switching array;

[0059] Inputting the first transition feature into one or more graph convolutional layers in the graph neural network for weighted calculation to output a second transition feature;

[0060] Inputting the second transition feature into a pre-built readout network in the graph neural network to generate a result feature;

[0061] According to the result characteristics and Hamiltonian loss function, the weight parameters of the graph neural network are adjusted to train the graph neural network to obtain the target neural network.

[0062] The target result features are generated based on the node features, edge features of the target graph data and the target graph neural network.

[0063] In a fifth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, and the computer program enables a computer to perform the following operations:

[0064] Processing multiple graph data to be processed in the training data set to obtain node features and edge features;

[0065] Generate a node feature matrix and a resistive switching array according to node features and edge features;

[0066] Generate a first transition feature according to the graph neural network, the node feature matrix, and the resistive switching array;

[0067] Inputting the first transition feature into one or more graph convolutional layers in the graph neural network for weighted calculation to output a second transition feature;

[0068] Inputting the second transition feature into a pre-built readout network in the graph neural network to generate a result feature;

[0069] According to the result characteristics and Hamiltonian loss function, the weight parameters of the graph neural network are adjusted to train the graph neural network to obtain the target neural network.

[0070] The target result features are generated based on the node features, edge features of the target graph data and the target graph neural network.

[0071] The beneficial effects achieved by this application are:

[0072] The present application provides a graph data processing method, including processing a plurality of graph data to be processed in a training data set to obtain node features and edge features; generating a node feature matrix and a resistive switching array according to the node features and edge features; generating a first transition feature according to the graph neural network, the node feature matrix and the resistive switching array; inputting the first transition feature into one or more graph convolution layers in the graph neural network for weighted calculation to output a second transition feature; inputting the second transition feature into a pre-constructed readout network in the graph neural network to generate a result feature; adjusting the weight parameters of the graph neural network according to the result feature and the Hamiltonian loss function to implement training of the graph neural network to obtain a target neural network; generating a target result feature according to the node features, edge features and target graph neural network of the target graph data. Using the resistive switching array as the adjacency matrix of the graph neural network reduces the energy consumption of data transfer in the traditional architecture, reduces the time overhead required for graph data calculation, has high efficiency and scalability, and accelerates the neural network algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

[0073] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work, among which:

[0074] Figure 1 It is a schematic diagram of a graph data processing method provided in an embodiment of the present application;

[0075] Figure 2 This is a schematic diagram of a resistive switching array structure provided in an embodiment of the present application;

[0076] Figure 3 This is a schematic diagram of electrical characteristics of a binary resistive random access memory provided by an embodiment of the present application;

[0077] Figure 4 It is a schematic diagram of a maximum independent set problem provided in an embodiment of the present application;

[0078] Figure 5 is a schematic diagram of an image and an adjacency matrix of a digital image 2 provided in an embodiment of the present application;

[0079] Figure 6 It is a schematic diagram of a graph data processing system architecture provided by an embodiment of the present application;

[0080] Figure 7 It is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0081] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0082] It should be understood that in the description of the present application, unless the context clearly requires otherwise, words such as "include", "comprises", and the like in the entire specification and claims should be interpreted as having an inclusive meaning rather than an exclusive or exhaustive meaning; that is, the meaning of "including but not limited to".

[0083] It should also be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of this application, unless otherwise specified, "plurality" means two or more.

[0084] It should be noted that the terms "S1", "S2", etc. are only used for the purpose of describing the steps, and do not specifically refer to the order or sequence, nor are they used to limit the present application. They are only for the convenience of describing the method of the present application, and cannot be understood as indicating the order of the steps. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in this field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection required by the present application.

[0085] As mentioned in the background technology, traditional deep learning methods have achieved great success in extracting features from Euclidean spatial data. However, data in many practical application scenarios are generated by non-Euclidean spatial data. The performance of traditional deep learning methods in processing non-Euclidean spatial data is not ideal. Convolutional neural networks can only process Euclidean data, such as two-dimensional images and one-dimensional text data, and the special case of these data knowledge graph structures makes it difficult for convolutional neural networks to be used in general graph structures. Graph neural networks can update the state of nodes through neighboring nodes at any depth of the nodes, thereby extending the deep neural network model to non-Euclidean domains. With the advent of the big data era, the scale of graph data structures has exploded. For example, Alibaba's user and product graphs contain more than one billion users and two billion products; the social network between YouTube users contains 11,384,899 nodes and 2,990,443 edges; similar large-scale graphs contain billions of nodes and trillions of edges, which consume a lot of content capacity.

[0086] In addition, GNN training is very expensive in terms of memory and computation due to its inherent complexity, and it is difficult to support efficient and scalable parallel computing. Therefore, a new processing method is urgently needed to process graph data to meet the challenges faced by graph neural networks.

[0087] Embodiment 1

[0088] The present application embodiment provides a graph data processing method, specifically, Figure 1 As shown, including the following:

[0089] S1. Process multiple graph data to be processed in the training data set to obtain node features and edge features.

[0090] Graph data is a data structure used to represent complex relationships between entities, usually composed of nodes and edges. Nodes represent entities, and edges represent the relationship between nodes. The above-mentioned node features can be directly extracted from the node attribute information contained in the graph data, such as the age and gender of users in social networks. These attributes can be directly used as node features. Of course, node features that reflect the local or global structural characteristics of nodes can also be constructed through methods such as clustering coefficient or K-core decomposition. This application does not limit the specific method for obtaining node features. The above-mentioned edge features are features that can be directly extracted from the edge attribute information contained in the graph data to represent the relationship between nodes; edge features can also be generated by combining the features of two nodes; for example, by simply connecting the feature vectors of two nodes, or calculating the distance and similarity between them; this application does not limit the specific method for obtaining edge features. The above-mentioned graph data to be processed is the data in the training data set, which is used to train the graph neural network.

[0091] S2. Generate a node feature matrix and a resistive switching array according to the node features and edge features.

[0092] Among them, the node feature matrix is ​​a matrix generated based on the node features, and the node features are converted into numerical form using methods such as one-hot encoding or embedding layer according to the existing node features; this application will not be expanded here.

[0093] The specific method for obtaining the resistive switching array mentioned above includes: creating a two-dimensional matrix, wherein the number of rows and columns of the two-dimensional matrix matches the number of node features; traversing the edge features contained in the graph data to be processed, and determining the target matrix element values ​​that match the edge start point and edge end point in the edge features based on the information contained in the edge features; adjusting the target matrix element values ​​from the second preset value to the first preset value to generate an adjacency matrix that matches the graph data; and setting the resistance state of the initial resistive switching array of the same size as the adjacency matrix based on the matrix element values ​​in the adjacency matrix to generate a resistive switching array. This application utilizes the similarity between the resistive switching array and the adjacency matrix, and uses the resistive switching array instead of the adjacency matrix to input the relevant features of the edges in the graph structure when inputting into the graph neural network, thereby broadening the application path of the resistive switching array in neural network calculations and further accelerating the neural network algorithm.

[0094] It can be understood that the resistive switching array is actually a crossbar array based on a binary resistive switching memory. Figure 2 As shown, it consists of multiple storage units, and the electrical characteristics of a single storage unit at the intersection are as follows Figure 3 As shown. During the forward voltage scan, the device changes from a high-resistance state to a low-resistance state (i.e., the SET process). Under the subsequent reverse positive voltage scan, the memory cell device remains in a low-resistance state until the voltage polarity is reversed. Under a negative bias voltage, the memory cell device returns to a high-resistance state (i.e., the RESET process); this shows the non-volatile nature of the binary resistive memory. In a resistive array, a positive voltage from row to column causes a SET operation on the device, while a positive voltage from column to row drives a RESET operation. The selected row performs read and write operations at different bias voltages, and the other unselected rows and columns remain at half the bias voltage.

[0095] The above-mentioned setting of the resistance state of the initial resistive switching array of the same size as the adjacency matrix according to the matrix element values ​​in the adjacency matrix to generate the resistive switching array includes: in response to detecting that the matrix element value is a first preset value, setting the resistive switching storage unit at the intersection matching the matrix element value in the initial resistive switching array to a high resistance state; in response to detecting that the matrix element value is a second preset value, setting the resistive switching storage unit at the intersection corresponding to the matrix element value in the initial resistive switching array to a low resistance state. The specific setting process of the high resistance state and the low resistance state has been described above. The above-mentioned first preset value is preferably set to 1, and the above-mentioned second preset value is preferably set to 0. Of course, it can also be modified according to the setting, and the present application does not limit this.

[0096] In addition, in order to enhance the information retention ability of the matrix, prevent information loss, improve the robustness of the subsequent graph neural network and simplify the calculation, the present application also proposes that after generating the adjacency matrix matching the graph data to be processed, a self-connected adjacency matrix is ​​generated according to the sum of the unit matrix and the adjacency matrix. The formula is expressed as Where I is the identity matrix, A is the adjacency matrix, is a self-connected adjacency matrix. According to the matrix element values ​​in the self-connected adjacency matrix, the resistance state of the initial resistive switching array is set to generate a resistive switching array; the specific setting method is consistent with the setting of the resistance state of the initial resistive switching array according to the adjacency matrix mentioned above, and this application does not limit this.

[0097] S3. Generate a first transition feature based on the graph neural network, the node feature matrix and the resistive switching array.

[0098] It can be understood that the node feature matrix is ​​a matrix formed by combining the feature vectors of all nodes, and the node feature matrix is ​​randomly initialized and converted into voltage amplitude. Among them, the resistive switching array is obtained by mapping the adjacency matrix to represent the characteristics of the edges in the graph structure. The above-mentioned first transition feature is the output current vector obtained by multiplying the matrix vector of the resistive switching array and the matrix vector of the node feature matrix.

[0099] S4. Input the first transition feature into one or more graph convolutional layers in the graph neural network for weighted calculation to output a second transition feature.

[0100] One or more graph convolution layers are usually set in the graph neural network to update the representation of the current node by aggregating the information of neighboring nodes; for each layer, the new representation of the node is the result of combining the features of itself and its neighboring nodes. The above first transition feature is input into the graph convolution layer and weighted. The graph convolution formula is usually expressed as Among them, W (l) represents the weight matrix of the lth layer, H (l) represents the node feature matrix of the lth layer, H (l+1) represents the weight matrix of the l+1th layer, and softmax represents the activation function.

[0101] In the present application, the weights of the weight matrix can be mapped to the conductance values ​​of the corresponding cross-point storage units in the resistive array in the weight storage and calculation module, and the corresponding read voltage is applied to all rows of the resistive array; the weighted summation is achieved by multiplying the read voltage with each conductance value in the resistive array, and the current value after weighted summation is output from the corresponding column, wherein the entire weighted summation operation process can be expressed by the following matrix operation formula:

[0102]

[0103] Among them, G nm Represents the conductance value of each cross-point storage unit device in the resistive switching array, V m Represents the read voltage, i.e., weight, I nThe output current amplitude after weighted summation is represented, namely the second transition characteristic. The weighted calculation of the resistive switching array is realized by applying a read voltage, which further improves the calculation speed.

[0104] S5. Input the second transition feature into a pre-constructed readout network in the graph neural network to generate a result feature.

[0105] After the second transition feature is normalized, it is input into the pre-built readout network, where the readout network selects the appropriate readout mechanism according to the specific task requirements, that is, generates the final output according to the task requirements, such as node classification, graph classification, and link prediction; if it is a node-level task, directly use the node representation of the last layer; if it is a graph-level task, it is necessary to summarize the representations of all nodes, such as averaging or maximum pooling. The readout network usually uses a fully connected layer or other classification / regression layer to generate the prediction result (i.e., the result feature).

[0106] S6. Adjust the weight parameters of the graph neural network according to the result characteristics and the Hamiltonian loss function to train the graph neural network and obtain the target neural network.

[0107] Specifically, use an optimizer to adjust the weight parameters of the graph neural network to obtain result features that match the adjusted weight parameters; input the adjusted result features into the Hamiltonian loss function to obtain the Hamiltonian; determine whether the convergence condition is met based on the Hamiltonian and the number of iterations, that is, whether the Hamiltonian is the minimum value or the number of iterations reaches the set maximum number. If the Hamiltonian is the minimum value or the number of iterations reaches the maximum number, it is determined that the convergence condition is met; in response to detecting that the convergence condition is met, the training of the graph neural network is completed. The present application selects the Hamiltonian loss function as the loss function of the graph neural network to further speed up the training speed of the graph neural network and prevent the parameters in the network from overfitting the training data, especially in the case of small samples or more noise, to further improve the stability of the graph neural network.

[0108] The above optimizers include gradient descent optimizer, stochastic gradient descent optimizer, mini-batch gradient descent optimizer, momentum optimizer and Adam (Adaptive Moment Estimation) optimizer, etc., which are not limited in this application. Among them, parameter adjustment is a conventional technical means in this field, and this application will not be expanded here.

[0109] Among them, the Hamiltonian loss function is: p represents the result feature, i represents the number of rows, j represents the number of columns, and Q represents the constant matrix encoded according to the actual problem solved by the graph neural network. When calculating the Hamiltonian according to the Hamiltonian loss function, since the conductivity is usually an integer and negative numbers cannot be directly mapped, the matrix needs to be split. The present application also proposes that in response to detecting the presence of negative numbers in the constant matrix, the constant matrix is ​​split into a first constant submatrix and a second constant submatrix; the constant matrix in the Hamiltonian loss function is replaced with the first constant submatrix to calculate the first Hamiltonian to be processed; the constant matrix in the Hamiltonian loss function is replaced with the second constant submatrix to calculate the second Hamiltonian to be processed; and the first Hamiltonian to be processed and the second Hamiltonian to be processed are connected by a subtractor to synthesize the Hamiltonian. It can be understood that the above-mentioned constant matrix, the first constant submatrix and the second constant submatrix can be mapped to the resistive variable array for storage and reading.

[0110] S7. Generate target result features based on the node features, edge features of the target graph data and the target graph neural network.

[0111] After the training is completed, another set of test samples consisting of data not in the training data set is used to test the accuracy of recognition; and after the accuracy reaches a preset threshold, the target graph neural network is put into use. The target graph neural network is used to process the target graph data to classify or predict the target graph data.

[0112] This application proposes to use the resistive switching array as the adjacency matrix of the graph neural network, which reduces the energy consumption of data transportation in the traditional architecture, reduces the time overhead required for large-scale data calculations, has high efficiency and scalability, and accelerates the neural network algorithm.

[0113] It is understandable that the graph neural network implemented above can be used to solve a variety of problems. For example, in the specific implementation scenario of solving combinatorial optimization problems, the maximum independent set problem is used as an example. The subset I of the vertex set of the graph in the graph data is called the independent set of the graph G, which means that any two points in I are not connected by edges. The independent set with the largest number of vertices in the graph G is called the maximum independent set of the graph G. The MIS problem is a typical NP-hard problem. Take the MIS problem of a graph with four vertices and four edges as an example. Assume that each edge between nodes has the same weight. The specific structure of the graph and the adjacency matrix are as follows: Figure 4As shown. A 4*4 array is used to represent the graph, and the connection of the node is mapped to the conductivity of the resistive variable array, specifically by writing voltage to the row input, grounding the column, and writing the corresponding conductivity value. As an unsupervised node classification task, the maximum independent set problem does not require any labeled data. The input node feature vector is randomly initialized and converted to the voltage amplitude applied to the array. After the output current is normalized, the output current vector is obtained after matrix-vector multiplication based on the resistive variable array. The output classification probability (p) is obtained by reading out the network, where p∈[0,1]. The soft probability is then output as the result feature input into the loss function based on the Hamiltonian. In a specific example, the constant matrix Q generated after encoding the actual problem to be solved is defined as:

[0114]

[0115] At this time, the constant matrix Q with negative numbers is split to obtain the first constant submatrix Q1 and the second constant submatrix Q2.

[0116] Two 4*4 resistive switching arrays can be used as Q1 and Q2, and the output results can be connected with a subtractor to obtain the final result. After the training is completed, the obtained soft probability P is mapped back to the binary integer variable representing the classification result to divide the four nodes into two categories and obtain the maximum set success. The mapping formula is as follows:

[0117]

[0118] In the digital image recognition task scenario, we first obtain the adjacency matrix corresponding to each digital image. The adjacency matrix represents the connection relationship between different pixels in the image. A matrix element value of 1 indicates that the two pixels are connected, otherwise it is 0, indicating that the two pixels are not connected. Take the number 2 as an example to illustrate, Figure 5 The image of the number 2 consisting of 3*5 pixels and its corresponding adjacency matrix. The values ​​of the adjacency matrix with self-connection are mapped to a binary resistive switching array of size 15*15. For different digital images, the input node feature vector is different, which represents the grayscale of each pixel. Specifically, in Figure 5 In the figure, white represents 0 and gray represents 1. For different digital images, different pixel values ​​are generated, and then the pixel values ​​are converted into voltage signals and applied to the rows of the resistive switching array. Subsequently, the second transition feature after weighted processing of the corresponding resistive switching array and node feature vector is input into the readout network for training and classification.

[0119] Embodiment 2

[0120] Corresponding to the above-mentioned embodiment 1 and embodiment 2, as Figure 6 As shown, the embodiment of the present application also provides a graph data processing system, including:

[0121] A preprocessing module 610 is used to process a plurality of graph data to be processed in a training data set to obtain node features and edge features;

[0122] The preprocessing module 610 is further used to generate a node feature matrix and a resistive switching array according to the node features and the edge features;

[0123] A first processing module 620, configured to generate a first transition feature according to the graph neural network, the node feature matrix, and the resistive switching array;

[0124] The first processing module 620 is further used to input the first transition feature into one or more graph convolution layers in the graph neural network for weighted calculation to output a second transition feature;

[0125] A second processing module 630, for inputting the second transition feature into a pre-constructed readout network in the graph neural network to generate a result feature;

[0126] The second processing module 630 is further used to adjust the weight parameters of the graph neural network according to the result characteristics and the Hamiltonian loss function, so as to train the graph neural network to obtain a target neural network;

[0127] The result generation module 640 is used to generate target result features based on the node features, edge features and target graph neural network of the target graph data.

[0128] In some implementation scenarios, the preprocessing module 610 is further used to create a two-dimensional matrix, wherein the number of rows and columns of the two-dimensional matrix matches the number of node features; traverse the edge features of the graph data to be processed, and determine the target matrix element values ​​that match the edge start point and edge end point in the edge features; adjust the target matrix element values ​​from the second preset value to the first preset value to generate an adjacency matrix matching the graph data; and set the resistance state of an initial resistive switching array having the same scale as the adjacency matrix according to the matrix element values ​​in the adjacency matrix to generate a resistive switching array. .

[0129] In some implementation scenarios, the second processing module 630 is also used to set the resistive storage cells at the intersections matching the matrix element values ​​in the initial resistive array to a high resistance state in response to detecting that the matrix element value is a first preset value; and to set the resistive storage cells at the intersections corresponding to the matrix element values ​​in the initial resistive array to a low resistance state in response to detecting that the matrix element value is a second preset value.

[0130] In some implementation scenarios, the second processing module 630 is further used to use an optimizer to adjust the weight parameters of the graph neural network to obtain result features that match the adjusted weight parameters; input the adjusted result features into the Hamiltonian loss function to obtain the Hamiltonian; determine whether the convergence condition is met according to the Hamiltonian and the number of iterations; and complete the training of the graph neural network in response to detecting that the convergence condition is met. The Hamiltonian loss function is: Among them, p represents the result features, i represents the number of rows, j represents the number of columns, and Q represents the constant matrix encoded according to the actual problem solved by the graph neural network.

[0131] In some implementation scenarios, the second processing module 630 is also used to calculate the Hamiltonian according to the Hamiltonian loss function, and the method includes: in response to detecting the presence of a negative number in the constant matrix, splitting the constant matrix into a first constant sub-matrix and a second constant sub-matrix; replacing the constant matrix in the Hamiltonian loss function with the first constant sub-matrix to calculate the first Hamiltonian to be processed; replacing the constant matrix in the Hamiltonian loss function with the second constant sub-matrix to calculate the second Hamiltonian to be processed; and connecting the first Hamiltonian to be processed and the second Hamiltonian to be processed using a subtractor to synthesize the Hamiltonian.

[0132] In some implementation scenarios, the preprocessing module 610 is further used to generate a self-connected adjacency matrix according to the sum of the unit matrix and the adjacency matrix; and to set the resistance state of the initial resistive switching array according to the matrix element values ​​in the self-connected adjacency matrix to generate a resistive switching array.

[0133] Embodiment 3

[0134] Corresponding to all the above embodiments, the present application provides a computer program product, which implements the steps of the following method when the computer program is executed by a processor:

[0135] Processing multiple graph data to be processed in the training data set to obtain node features and edge features;

[0136] Generate a node feature matrix and a resistive switching array according to node features and edge features;

[0137] Generate a first transition feature according to the graph neural network, the node feature matrix, and the resistive switching array;

[0138] Inputting the first transition feature into one or more graph convolutional layers in the graph neural network for weighted calculation to output a second transition feature;

[0139] Inputting the second transition feature into a pre-built readout network in the graph neural network to generate a result feature;

[0140] According to the result characteristics and Hamiltonian loss function, the weight parameters of the graph neural network are adjusted to train the graph neural network to obtain the target neural network.

[0141] The target result features are generated based on the node features, edge features of the target graph data and the target graph neural network.

[0142] In some implementation scenarios, when the computer program is executed by a processor, the steps of the following method are also implemented:

[0143] Create a two-dimensional matrix where the number of rows and columns of the two-dimensional matrix matches the number of node features;

[0144] Traverse the edge features of the graph data to be processed, and determine the target matrix element values ​​that match the edge start points and edge end points in the edge features;

[0145] Adjusting the target matrix element value from the second preset value to the first preset value to generate an adjacency matrix matching the graph data;

[0146] According to the matrix element values ​​in the adjacency matrix, the resistance state of the initial resistive switching array having the same scale as the adjacency matrix is ​​set to generate the resistive switching array.

[0147] In some implementation scenarios, when the computer program is executed by a processor, the steps of the following method are also implemented:

[0148] In response to detecting that the matrix element value is a first preset value, setting the resistive storage unit at the intersection matching the matrix element value in the initial resistive array to a high resistance state;

[0149] In response to detecting that the matrix element value is a second preset value, the resistive switching memory cells at the intersections corresponding to the matrix element values ​​in the initial resistive switching array are set to a low resistance state.

[0150] In some implementation scenarios, when the computer program is executed by a processor, the steps of the following method are also implemented:

[0151] Use an optimizer to adjust the weight parameters of the graph neural network to obtain result features that match the adjusted weight parameters;

[0152] Input the adjusted result features into the Hamiltonian loss function to obtain the Hamiltonian;

[0153] Determine whether the convergence condition is met based on the Hamiltonian and the number of iterations;

[0154] In response to detecting that the convergence condition is met, training of the graph neural network is completed.

[0155] The Hamiltonian loss function is:

[0156] Among them, p represents the result features, i represents the number of rows, j represents the number of columns, and Q represents the constant matrix encoded according to the actual problem solved by the graph neural network.

[0157] In some implementation scenarios, when the computer program is executed by a processor, the steps of the following method are also implemented:

[0158] In response to detecting that there is a negative number in the constant matrix, splitting the constant matrix into a first constant sub-matrix and a second constant sub-matrix;

[0159] Replacing the constant matrix in the Hamiltonian loss function with the first constant submatrix to calculate the first Hamiltonian to be processed;

[0160] Replacing the constant matrix in the Hamiltonian loss function with a second constant submatrix to calculate a second Hamiltonian to be processed;

[0161] A subtractor is used to connect the first Hamiltonian to be processed and the second Hamiltonian to be processed to synthesize the Hamiltonian.

[0162] In some implementation scenarios, when the computer program is executed by a processor, the steps of the following method are also implemented:

[0163] Generate a self-connected adjacency matrix from the sum of the identity matrix and the adjacency matrix;

[0164] According to the matrix element values ​​in the self-connected adjacency matrix, the resistance state of the initial resistive switching array is set to generate the resistive switching array.

[0165] Embodiment 4

[0166] Corresponding to all the above embodiments, an embodiment of the present application provides an electronic device, including: one or more processors; and a memory associated with the one or more processors, the memory is used to store program instructions, and when the program instructions are read and executed by the one or more processors, the following operations are performed:

[0167] Processing multiple graph data to be processed in the training data set to obtain node features and edge features;

[0168] Generate a node feature matrix and a resistive switching array according to node features and edge features;

[0169] Generate a first transition feature according to the graph neural network, the node feature matrix, and the resistive switching array;

[0170] Inputting the first transition feature into one or more graph convolutional layers in the graph neural network for weighted calculation to output a second transition feature;

[0171] Inputting the second transition feature into a pre-built readout network in the graph neural network to generate a result feature;

[0172] According to the result characteristics and Hamiltonian loss function, the weight parameters of the graph neural network are adjusted to train the graph neural network to obtain the target neural network.

[0173] The target result features are generated based on the node features, edge features of the target graph data and the target graph neural network.

[0174] in, Figure 7 The architecture of the electronic device is shown as an example, which may include a processor 710, a video display adapter 711, a disk drive 712, an input / output interface 713, a network interface 714, and a memory 720. The processor 710, the video display adapter 711, the disk drive 712, the input / output interface 713, the network interface 714, and the memory 720 may be communicatively connected via a bus 730.

[0175] Among them, the processor 710 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solution provided in this application.

[0176] The memory 720 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 720 can store an operating system 721 for controlling the execution of the electronic device 700, and a basic input and output system (BIOS) 722 for controlling the low-level operations of the electronic device 700. In addition, a web browser 723, a data storage management system 724, and an icon font processing system 725, etc. can also be stored. The above-mentioned icon font processing system 725 can be an application program that specifically implements the operations of the aforementioned steps in the embodiment of the present application. In short, when the technical solution provided in the present application is implemented by software or firmware, the relevant program code is stored in the memory 720 and is called and executed by the processor 710.

[0177] The input / output interface 713 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.

[0178] The network interface 714 is used to connect to a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).

[0179] The bus 730 comprises a pathway for transmitting information between the various components of the device (eg, the processor 710, the video display adapter 711, the disk drive 712, the input / output interface 713, the network interface 714, and the memory 720).

[0180] In addition, the electronic device 700 can also obtain information on specific collection conditions from the virtual resource object collection condition information database for use in condition judgment, etc.

[0181] It should be noted that, although the above device only shows a processor 710, a video display adapter 711, a disk drive 712, an input / output interface 713, a network interface 714, a memory 720, a bus 730, etc., in the specific implementation process, the device may also include other components necessary for normal execution. In addition, it can be understood by those skilled in the art that the above device may also only include components necessary for implementing the solution of the present application, and does not necessarily include all the components shown in the figure.

[0182] It can be seen from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solution of the present application can essentially or in other words, the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a disk, an optical disk, etc., including several instructions for a computer device (which can be a personal computer, a cloud service end, or a network device, etc.) to execute the methods of various embodiments of the present application or certain parts of the embodiments.

[0183] Embodiment 5

[0184] Corresponding to all the above embodiments, the embodiments of the present application further provide a computer-readable storage medium storing a computer program, which enables a computer to perform the following operations:

[0185] Processing multiple graph data to be processed in the training data set to obtain node features and edge features;

[0186] Generate a node feature matrix and a resistive switching array according to node features and edge features;

[0187] Generate a first transition feature according to the graph neural network, the node feature matrix, and the resistive switching array;

[0188] Inputting the first transition feature into one or more graph convolutional layers in the graph neural network for weighted calculation to output a second transition feature;

[0189] Inputting the second transition feature into a pre-built readout network in the graph neural network to generate a result feature;

[0190] According to the result characteristics and Hamiltonian loss function, the weight parameters of the graph neural network are adjusted to train the graph neural network to obtain the target neural network.

[0191] The target result features are generated based on the node features, edge features of the target graph data and the target graph neural network.

[0192] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, in which the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0193] The above are only preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims

1. A graph data processing method, characterized in that: The method comprises: Processing multiple graph data to be processed in the training data set to obtain node features and edge features; Generate a node feature matrix and a resistive switching array according to the node features and edge features; Generate a first transition feature according to the graph neural network, the node feature matrix and the resistive switching array; Inputting the first transition feature into one or more graph convolutional layers in a graph neural network for weighted calculation to output a second transition feature; Inputting the second transition feature into a pre-constructed readout network in the graph neural network to generate a result feature; Adjusting the weight parameters of the graph neural network according to the result characteristics and the Hamiltonian loss function to train the graph neural network to obtain a target neural network; Generate target result features based on the node features, edge features of the target graph data and the target graph neural network.

2. The method according to claim 1, characterized in that The method for generating the resistive switching array includes: Creating a two-dimensional matrix, wherein the number of rows and columns of the two-dimensional matrix matches the number of node features; Traversing the edge features of the graph data to be processed, and determining target matrix element values ​​that match the edge start points and edge end points in the edge features; Adjusting the target matrix element value from the second preset value to the first preset value to generate an adjacency matrix matching the graph data; According to the matrix element values ​​in the adjacency matrix, the resistance state of an initial resistive switching array having the same scale as the adjacency matrix is ​​set to generate a resistive switching array.

3. The method according to claim 2, characterized in that The step of setting the resistance state of an initial resistive switching array having the same scale as the adjacency matrix according to the matrix element values ​​in the adjacency matrix to generate the resistive switching array comprises: In response to detecting that the matrix element value is a first preset value, setting the resistive switching memory cells at the intersections matching the matrix element value in the initial resistive switching array to a high resistance state; In response to detecting that the matrix element value is a second preset value, the resistive switching memory cells at the intersections corresponding to the matrix element values ​​in the initial resistive switching array are set to a low resistance state.

4. The method according to claim 1, characterized in that The step of adjusting the weight parameters of the graph neural network according to the result characteristics and the Hamiltonian loss function to train the graph neural network to obtain a target neural network includes: Use an optimizer to adjust the weight parameters of the graph neural network to obtain result features that match the adjusted weight parameters; Inputting the adjusted result feature into the Hamiltonian loss function to obtain the Hamiltonian; Determine whether the convergence condition is met according to the Hamiltonian and the number of iterations; In response to detecting that a convergence condition is met, training of the graph neural network is completed.

5. The method according to claim 4, characterized in that The Hamiltonian loss function is: Among them, p represents the result feature, i represents the number of rows, j represents the number of columns, and Q represents a constant matrix encoded according to the actual problem solved by the graph neural network.

6. The method according to claim 5, characterized in that When calculating the Hamiltonian according to the Hamiltonian loss function, the method includes: In response to detecting that there are negative numbers in the constant matrix, splitting the constant matrix into a first constant sub-matrix and a second constant sub-matrix; Replacing the constant matrix in the Hamiltonian loss function with a first constant submatrix to calculate a first Hamiltonian to be processed; Replacing the constant matrix in the Hamiltonian loss function with a second constant submatrix to calculate a second Hamiltonian to be processed; The first Hamiltonian to be processed and the second Hamiltonian to be processed are connected by a subtractor to synthesize the Hamiltonian.

7. The method according to claim 2, characterized in that: After generating an adjacency matrix matching the graph data to be processed, the method further includes: Generate a self-connected adjacency matrix from the sum of the identity matrix and the adjacency matrix; According to the matrix element values ​​in the self-connected adjacency matrix, the resistance state of the initial resistive switching array is set to generate a resistive switching array.

8. A graph data processing system, characterized in that: The system comprises: A preprocessing module is used to process multiple graph data to be processed in the training data set to obtain node features and edge features; The preprocessing module is further used to generate a node feature matrix and a resistive switching array according to the node features and edge features; A first processing module, used for generating a first transition feature according to the graph neural network, the node feature matrix and the resistive switching array; The first processing module is further used to input the first transition feature into one or more graph convolution layers in the graph neural network for weighted calculation to output a second transition feature; A second processing module, configured to input the second transition feature into a pre-constructed readout network in the graph neural network to generate a result feature; The second processing module is further used to adjust the weight parameters of the graph neural network according to the result characteristics and the Hamiltonian loss function, so as to train the graph neural network to obtain a target neural network; The result generation module is used to generate target result features based on the node features, edge features of the target graph data and the target graph neural network.

9. An electronic device, characterized in that: The electronic device comprises: one or more processors; And a memory associated with the one or more processors, the memory is used to store program instructions, and when the program instructions are read and executed by the one or more processors, the method according to any one of claims 1-7 is executed.

10. A computer-readable storage medium, characterized in that: The computer program stores a computer program, wherein the computer program enables a computer to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Graph neural network calculation method and device based on resistive random access memory

    CN114186598A

  • Graph neural network training method and device, equipment and storage medium

    CN114330670A

  • Isin solver based on graph convolutional neural network and method for realizing Isin model

    CN114444665A

  • Image semantic segmentation method and device of chaotic back propagation graph neural network

    CN115761240A

  • Network embedding method and system based on graph neural network

    CN117493617A