A method, system, and medium for node classification of a homogeneous and heterogeneous matching network based on macro-micro message passing for graph contrastive learning

By constructing k-nearest neighbor graphs and view role definitions based on node feature similarity, combining ASP-SGC encoder and InfoNCE loss function, the problem of poor performance of hetero-allocation networks in the existing technology is solved, and efficient node classification performance improvement is achieved.

CN119273991BActive Publication Date: 2025-07-25NANJING UNIV OF AERONAUTICS & ASTRONAUTICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411440423.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-15
Publication Date
2025-07-25
Estimated Expiration
2044-10-15

AI Technical Summary

Technical Problem

The existing graph comparison learning method is not effective when dealing with hetero-configuration networks, mainly due to insufficient understanding of the message transmission differences at the macro and micro levels, resulting in high computing costs and insufficient performance.

Method used

Using a graph comparison learning method based on macro-micromessage delivery, a k-nearest neighbor graph based on node feature similarity is constructed, structural views and feature views are generated, priority views and auxiliary views are defined, view alignment encoding is used using ASP-SGC encoder, and InfoNCE comparison loss function is constructed for optimization training.

Benefits of technology

It significantly improves the node classification performance of graph comparison learning in homogeneous and heterogeneous networks, enhances the generalization ability of the model and the quality of node representation, and reduces the computational complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119273991B_ABST
    Figure CN119273991B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, system and medium for node classification of a homogeneous and heterogeneous matching network based on macro-micro message passing for graph contrastive learning, including: First, construct a k-nearest neighbor graph based on node feature similarity using the node features of the original graph, and randomly remove connected edges from the original graph and the k-nearest neighbor graph respectively to generate corresponding structural views and feature views. Then, define view roles for the structural views and feature views according to the homogeneous and heterogeneous matching types of the network to determine the priority view and the auxiliary view; Next, perform alignment encoding on the priority view and the auxiliary view to obtain node representations under different views; Furthermore, construct an InfoNCE contrastive loss function to optimize and train the node embedding representation of the model; Finally, use the optimized node embedding representation for the node classification task for training and evaluation. The present invention can effectively improve the quality of node representations, thereby improving the accuracy of node classification in homogeneous and heterogeneous matching networks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of graph contrast learning, and more particularly, to a method, system and medium for node classification of a homogeneous and heterogeneous matching network for graph contrast learning based on macro and micro message passing. Background Art

[0002] As a self-supervised representation learning method for graph data, graph contrast learning has made significant progress in recent years in reducing the dependence on expensive and time-consuming labeled data. The core idea of this technology is to construct a contrast loss function by maximizing the similarity of positive sample pairs and the difference of negative sample pairs, so as to learn effective node or graph representations. Generally, graph contrast learning includes three main steps: view enhancement, view encoding, and contrast training. Existing research has significantly improved the performance of graph contrast learning in downstream graph tasks such as node classification by developing new data augmentation or model augmentation strategies, and optimizing the contrast objective.

[0003] Although existing graph contrast learning methods perform well on homogeneous networks, due to their general dependence on graph neural network (GNN) encoders in the view encoding process, and these encoders are usually based on the homogeneity assumption, these methods perform poorly when dealing with heterogeneous networks. The so-called homogeneity assumption means that nodes with the same label tend to be closely connected, but this assumption often does not hold in heterogeneous networks, resulting in existing methods being difficult to adapt to the characteristics of heterogeneous networks. For example, social networks usually have homogeneity, and individuals tend to establish connections based on the same interests or backgrounds; while in protein structure diagrams, different types of amino acids tend to be connected together, showing heterogeneity. This assumption limits the direction (macro level) and manner (micro level) of message passing to a certain extent, weakening the performance of graph contrast learning in processing heterogeneous graphs.

[0004] Specifically, at the macro level, homogeneous networks mainly rely on structural neighbors for message passing, while heterogeneous networks rely more on feature neighbors based on node feature similarity. However, most existing methods fail to fully recognize this difference and still use structural neighbors to process heterogeneous networks, resulting in poor performance. At the micro level, traditional GNNs use the node itself as a neighbor for feature propagation, but this way of treating the node itself and its neighbors equally is difficult to adapt to the characteristics of heterogeneous networks, because in heterogeneous networks, the feature differences between nodes and their neighbors are often large. Although some studies have tried to solve this problem through diverse high-order neighbor aggregation strategies, these methods usually increase the algorithm complexity and may weaken the processing ability for homogeneous networks.

[0005] In summary, although existing work has been dedicated to improving the performance of graph contrastive learning in homophilous and heterophilous networks, due to the insufficient understanding of the differences in the macro direction and micro manner of message passing in these two types of networks, existing methods still have limitations in terms of computational cost and practical effects. Therefore, developing a more efficient graph contrastive learning method to encourage the model to fully learn the important features of homophilous and heterophilous networks and improve the performance of graph contrastive learning in downstream graph tasks such as node classification has become one of the urgent problems in the current field. Summary of the Invention

[0006] Aiming at the impact of the homophily assumption on the node classification task of homophilous and heterophilous networks, the present invention proposes a method, system, and medium for node classification of homophilous and heterophilous networks based on macro-micro message passing for graph contrastive learning.

[0007] The object of the present invention is achieved by the following technical solutions:

[0008] In the first aspect, a method for node classification of homophilous and heterophilous networks based on macro-micro message passing for graph contrastive learning is provided, including the following steps:

[0009] S1: Based on the original graph where A is the adjacency matrix and X is the node feature matrix, calculate the cosine distance between node features and construct a k-nearest neighbor graph based on node feature similarity;

[0010] S2: Perform view enhancement operations of randomly removing edges on the original graph and the k-nearest neighbor graph respectively to generate corresponding structural views v str and feature views v att ;

[0011] S3: Determine the homophilous and heterophilous types of the network according to the edge homophily ratio h edge of the original graph, and then define the preferred view v p of the homophilous network as the structural view v str , the auxiliary view v s as the feature view v att ; the preferred view v p of the heterophilous network as the feature view v att , the auxiliary view v s as the structural view v str ;

[0012] S4: Use two independent ASP-SGC encoders to perform alignment encoding of the preferred view v p and the auxiliary view v s respectively to obtain the node representation H p after encoding the preferred view and the node representation H sa after encoding the aligned auxiliary view;

[0013] S5: Based on the node representation H p and H sa , define the positive and negative sample pairs of the anchor node v i , construct the InfoNCE contrastive loss function, and optimize and train the node embedding representation of the model through this loss function.

[0014] S6: Input the optimized node embedding representation into the logistic regression node classifier for training and evaluation.

[0015] Preferably, in S1, the cosine distance calculation formula between node features is:

[0016]

[0017] where x i and x j are the feature vectors between nodes v i and v j respectively. According to the cosine distance calculation result, select k nearest neighbor nodes for each node and add corresponding edges to construct a k-nearest neighbor graph based on node feature similarity.

[0018] Preferably, in S3, the edge homogeneity ratio h edge for measuring the network homogeneity level is calculated as:

[0019]

[0020] If then it is a disassortative network. If then it is an assortative network.

[0021] Preferably, in S4, the ASP-SGC encoder uses an adaptive self-propagation strategy to decompose the node self-loop feature propagation into neighbor assimilation propagation and self-independent propagation:

[0022]

[0023] where the first term (1 - ω)H (k) represents the self-independent propagation part, which emphasizes the independence of the self-loop feature propagation without relying on neighbor node features; the second term represents the neighbor assimilation propagation part, where the self-loop acts as a neighbor for feature propagation; k represents the node representation H (k) of the k-th layer, ω is the weight coefficient of self-independent propagation, and Θ is the trainable weight matrix.

[0024] Preferably, in S4, first use the priority view v p and the auxiliary view v sRespective ASP-SGC encoders encode the corresponding views to obtain node representations H p and H s ; then, the ASP-SGC encoder of the auxiliary view encodes the priority view v p from a global perspective and adds it to the initial node representation v s of the auxiliary view to generate the final node representation H sa of the aligned auxiliary view:

[0025]

[0026] Preferably, in S5, the positive sample pair of the anchor node v i is defined as The negative sample pairs include and The InfoNCE contrast loss is constructed as:

[0027]

[0028] where τ is the temperature parameter and s(·) is the cosine similarity.

[0029] In a second aspect, a same-different matching network node classification system for graph contrast learning based on macro-micro message passing is provided, which is used to execute the graph contrast learning method for improving the same-different matching network node classification performance based on macro-micro message passing according to any one of the first aspects, and includes the following modules:

[0030] A neighborhood expansion module, which is used to generate a k-nearest neighbor graph to enrich the directions of message passing between nodes;

[0031] An enhanced view generation module, which is used to generate enhanced views required for contrast learning;

[0032] A view role definition module, which is used to determine the priority or auxiliary roles of the structure view and the feature view according to the same-different matching nature of the network;

[0033] A priority-auxiliary view alignment encoding module, which is used to encode and align the priority view and the auxiliary view respectively to obtain the embedding representations of nodes in different views;

[0034] A contrast training module, which is used to optimize the node embedding representations by using a contrast loss function;

[0035] A node classification module, which is used to train and evaluate node classification tasks by using the optimized node embedding representations.

[0036] In a third aspect, a computer-readable storage medium is provided, which stores a computer program; when the computer program runs on a computer, it causes the computer to execute the graph contrast learning method for improving the classification performance of nodes in homogeneous and heterogeneous networks based on macro and micro message passing according to any one of the first aspect.

[0037] Compared with the prior art, the present invention has the following beneficial effects:

[0038] (1) By integrating macro and micro message passing strategies, the present invention proposes a new graph contrast learning framework, which significantly improves the performance of graph contrast learning in homogeneous and heterogeneous networks and enhances the performance and generalization ability of the model in node classification tasks;

[0039] (2) At the macro level, by adopting the optimal auxiliary view alignment encoding strategy combining the structural view and the feature view, the present invention effectively overcomes the problem of insufficient message passing in heterogeneous networks in the prior art and enhances the adaptability of the model to networks with different homogeneity levels;

[0040] (3) At the micro level, the present invention optimizes the encoder design through an adaptive self-propagation strategy, flexibly handles the role of node self-loops in feature propagation, and makes node features more detailed and accurate during the propagation process;

[0041] (4) While reducing the computational complexity, the present invention improves the quality of node representations, especially showing excellent performance when dealing with heterogeneous networks. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 is a schematic flow chart of a method for classifying nodes in homogeneous and heterogeneous networks by graph contrast learning based on macro and micro message passing provided by an embodiment of the present invention;

[0043] Figure 2 is a schematic diagram of an adaptive self-propagation strategy for optimizing an encoder;

[0044] Figure 3 is a schematic diagram of a framework for graph contrast learning based on macro and micro messages;

[0045] Figure 4 is a schematic structural diagram of a system for classifying nodes in homogeneous and heterogeneous networks by graph contrast learning based on macro and micro message passing. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0046] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings; all other embodiments obtained by those of ordinary skill in the art without creative efforts based on the embodiments of the present invention belong to the scope of protection of the present invention.

[0047] Example 1

[0048] As Figure 1 shown, Example 1 of the present invention provides a method for classifying nodes of a homogeneous and heterogeneous matching network based on macro-micro message passing for graph contrast learning, including the following steps:

[0049] S1: Based on the original graph where A is the adjacency matrix and X is the node feature matrix, calculate the cosine distance between node features, and construct a k-nearest neighbor graph based on node feature similarity.

[0050] In the present invention, first calculate the cosine distance using node features, and its calculation formula is:

[0051]

[0052] where x i and x j are the feature vectors between nodes v i and v j respectively. After calculating the cosine distance between each node and other nodes according to this formula, select k nearest neighbor nodes for each node and add corresponding edges to construct based on node feature similarity. Here, the value range of k is {5, 10, 30, 50, 70}. Usually, the original graph is a sparse graph, and the k-nearest neighbor graph is a dense graph.

[0053] S2: Perform view enhancement operations of randomly removing edges on the original graph and the k-nearest neighbor graph respectively to generate corresponding structural views v str and feature views v att .

[0054] In the present invention, the edge types of the original graph and the k-nearest neighbor graph are different. The edges of the original graph are based on structural information, while the edges of the k-nearest neighbor graph are based on node feature similarity. After randomly removing edges from these two graphs, the original graph generates a structural view v str , while the k-nearest neighbor graph generates a feature view v att . Since the edge types of these two views are different, they belong to views of different scales. This multi-scale view enhancement operation helps graph contrast learning to capture both local structural information and global feature information simultaneously, providing richer semantic expressions.

[0055] S3: Determine the network homogeneous and heterogeneous matching type according to the edge homogeneity ratio h edge of the original graph, and then define that the preferred view v p of the homogeneous matching network is the structural view v str , and the auxiliary view v s is the feature view v att; Preferred view v of the disassortative network p is the feature view v att , and the auxiliary view v s is the structural view v str .

[0056] In the present invention, the edge homogeneity ratio h edge is used to measure the homogeneity level of the network, and its calculation formula is:

[0057]

[0058] Based on the value of h edge , we define that if then is a disassortative network, and if then is an assortative network.

[0059] After generating the structural view v str and the feature view v att , we introduce the concepts of the preferred view v p and the auxiliary view v s to clarify the different roles of these two views in the graph contrast learning process. For the assortative network, the structural view v str serves as the preferred view, responsible for the main feature extraction task, leading the propagation and learning of node features; the feature view v att serves as the auxiliary view, providing supplementary information. In the disassortative network, the situation is reversed, where the feature view v att becomes the preferred view, and the structural view v str serves as the auxiliary view. This way of defining the roles of the preferred view and the auxiliary view helps to improve the generalization ability of the model and give full play to the performance advantages of graph contrast learning in assortative and disassortative networks.

[0060] S4: Use two independent ASP-SGC encoders to perform alignment encoding on the preferred view v p and the auxiliary view v s respectively, to obtain the node representation H p after encoding the preferred view and the node representation H sa after encoding the auxiliary view.

[0061] In the present invention, the view encoding process introduces innovative improvements at both the macro and micro levels. The macro level refers to the direction of message passing, that is, the structural views and feature views at two different scales. The micro level refers to the way of message passing, that is, the role played by the node self-loop in the feature propagation process.

[0062] At the micro level, the present invention adopts a more flexible ASP-SGC encoder. Based on the SGC, this encoder decomposes the propagation of node self-loop features into two parts, namely neighbor assimilation propagation and self-independent propagation, through the adaptive self-propagation (ASP) strategy. The specific form is as follows:

[0063]

[0064] Among them, the first term (1 - ω)H (k) represents the self-independent propagation part. In this part, the self-loop does not act as a neighbor but independently conducts feature propagation, emphasizing the independence of self-loop feature propagation without relying on neighbor node features; the second term represents the neighbor assimilation propagation part. In this part, the self-loop acts as a neighbor to conduct feature propagation. Here, k represents the node representation H (k) at the k-th layer, ω is the self-loop role trade-off factor, and Θ is the trainable weight matrix.

[0065] At the macro level, the present invention adopts a method of auxiliary view alignment encoding for view encoding. This encoding method is different from other ordinary techniques that directly perform contrast training after encoding views. Instead, it introduces an alignment mechanism. Specifically, first, the priority view v p and the auxiliary view v s are respectively encoded by their respective ASP-SGC encoders for the corresponding views to obtain the node representations H p and H s ; then, the ASP-SGC encoder of the auxiliary view is used to encode the priority view v p from a global perspective and add it to the initial node representation v s of the auxiliary view to generate the final node representation H sa of the aligned auxiliary view:

[0066]

[0067] Traditional graph contrast learning relies on view comparison at the same scale. However, in a multi-scale scenario, the embedding distributions at different scales are often inconsistent, resulting in poor contrast learning effects. Through the alignment encoding operation, this strategy effectively solves the problem of mismatched embedding representations in multi-scale views, ensuring that the node embeddings in multi-scale views are consistent, thereby improving the overall effect of contrast learning at multiple scales.

[0068] S5: Based on the node representations H p and H sa , define the positive and negative sample pairs of the anchor node v i , construct the InfoNCE contrast loss function, and optimize and train the node embedding representation of the model through this loss function.

[0069] In the present invention, an anchor node v is defined i The positive sample pairs are The negative sample pairs include and The InfoNCE contrastive loss is constructed as follows:

[0070]

[0071] where τ is the temperature parameter and s(·) is the cosine similarity. This contrastive loss function effectively enhances the discriminability of node representations by maximizing the representational similarity of the same node in the preferred view H p and the auxiliary view H sa while minimizing the representational similarity between different nodes.

[0072] S6: Input the optimized node embedding representation into a logistic regression node classifier for training and evaluation.

[0073] In the present invention, in order to evaluate the quality of the node embedding representation generated by the graph contrastive learning method that enhances the node classification performance of assortative and disassortative networks based on macro-micro message passing, we first perform unsupervised training on the graph data (A, X) to generate the embedding representation of the nodes. Subsequently, these embedding representations are input into an L2-regularized logistic regression classifier for training and evaluation of the node classification task.

[0074] To ensure the reliability of the results, the node classification task was conducted 5 times. The classification accuracy was recorded for each experiment, and finally, the performance of the model was evaluated by calculating the average and standard deviation of these accuracies.

[0075] Experimental verification:

[0076] During the experiment, seven publicly available datasets with different levels of homogeneity were used: Cora, CiteSeer, PubMed (assortative network datasets) and Cornell, Texas, Wisconsin, Actor (disassortative network datasets). All datasets adopted the fixed partition proposed in the original work.

[0077] To ensure the fairness of performance comparison between different methods, all comparison algorithms used the same dataset partition, training scheme, and classifier, and uniformly adopted a consistent evaluation criterion.

[0078] The performance of the model of the present invention in node classification on 7 real datasets was compared with 6 supervised algorithms including MLP, GCN, SGC, H2GCN, UGCN, and FAGCN and 6 self-supervised algorithms including NCLA, HSAN, CSGCL, HomoGCL, GREET, and ASP. The results are shown in Table 1, and the bold content indicates the optimal result.

[0079] Table 1 Results of Node Classification Task (%)

[0080]

[0081] The experimental results show that the method of the present invention is significantly superior to the existing baseline methods in the node classification tasks on assortative and disassortative networks. Especially in the disassortative network, the model performs excellently, demonstrating strong robustness and generalization ability.

[0082] Example 2

[0083] As Figure 4 shown, on the basis of Example 1, Example 2 of the present invention provides a homogeneous and heterogeneous network node classification system for graph contrast learning based on macro-micro message passing, including the following modules:

[0084] Neighborhood Expansion Module, used to generate a k-nearest neighbor graph to enrich the directions of message passing between nodes;

[0085] Enhanced View Generation Module, used to generate enhanced views required for contrast learning;

[0086] View Role Definition Module, used to determine the primary or auxiliary roles of the structural view and the feature view according to the homogeneous and heterogeneous nature of the network;

[0087] Primary and Auxiliary View Alignment Encoding Module, used to encode and align the primary view and the auxiliary view respectively to obtain the embedding representations of nodes under different views;

[0088] Contrast Training Module, used to optimize the node embedding representations using a contrast loss function;

[0089] Node Classification Module, used to train and evaluate node classification tasks using the optimized node embedding representations.

[0090] Specifically, the system provided in Example 2 of the present invention is the system corresponding to the method provided in Example 1. Therefore, for the parts that are the same or similar in Example 2 and Example 1, they can be referred to each other and will not be elaborated in the present invention.

[0091] Example 3

[0092] On the basis of Examples 1 and 2, Example 3 of the present invention provides a computer-readable storage medium, and the computer-readable storage medium stores a computer program; when the computer program runs on a computer, it causes the computer to execute the graph contrast learning method for improving the node classification performance of homogeneous and heterogeneous networks based on macro-micro message passing described in Example 1 of the present invention.

[0093] Finally, it should be noted that the above-described embodiments are only specific embodiments of the present invention, used to illustrate the technical solutions of the present invention, rather than limiting it. The protection scope of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that any person skilled in the art within the technical scope disclosed by the present invention can still modify the technical solutions described in the foregoing embodiments or can easily think of changes, or make equivalent replacements for some of the technical features; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.

Claims

1. A method for node classification of a homophily and heterophily network based on macro-micro message passing for graph contrastive learning, characterized in that, Including the following steps: S1: Based on the original graph Where A is the adjacency matrix and X is the node feature matrix, calculate the cosine distance between node features, and construct a k-nearest neighbor graph based on node feature similarity; S2: Perform view enhancement operations of randomly removing connected edges on the original graph and the k-nearest neighbor graph respectively to generate corresponding structural views v str and feature views v att ; S3: Determine the type of network assortativity or disassortativity based on the edge homogeneity ratio h of the original graph, and then define the preferred view v of the assortative network edge as the structural view v p and the auxiliary view v str as the feature view v s ; for the disassortative network, the preferred view v att is the feature view v p and the auxiliary view v att is the structural view v s ; str ​ S4: Use two independent ASP-SGC encoders to perform macro and micro alignment encoding of the priority view v p and the auxiliary view v s to obtain the node representation H p of the priority view after encoding and the node representation H sa of the auxiliary view after alignment encoding; specifically: Microscopically, the ASP-SGC encoder uses an adaptive self-propagation strategy to decompose the node self-loop feature propagation into neighbor assimilation propagation and self-independent propagation: Among them, the first term \((1 - \omega)H\) (k) represents the self - independent propagation part, which emphasizes the independence of self - loop feature propagation without relying on neighbor node features; The second item represents the neighbor assimilation propagation part, where self-loops act as neighbors for feature propagation; k represents the node representation H at the k-th layer (k) , ω is the weight coefficient for self-independent propagation, and Θ is a trainable weight matrix; Macroscopically, first use the priority view v p and the auxiliary view v s to encode the corresponding views with their respective ASP-SGC encoders, obtaining the node representations H p and H s ; Then, the ASP-SGC encoder of the auxiliary view encodes the priority view v from a global perspective p , and adds it to the initial node representation v s of the auxiliary view to generate the final node representation H sa of the aligned auxiliary view: S5: Based on the node representation H p and H sa , define the positive and negative sample pairs of the anchor node v i , construct the InfoNCE contrastive loss function, and optimize and train the node embedding representation of the model through this loss function; S6: Input the optimized node embedding representation into the logistic regression node classifier for training and evaluation.

2. The method for classifying nodes of a same-different matching network based on macro-micro message passing for graph contrast learning according to claim 1, characterized in that, In S1, the cosine distance calculation formula between node features is: where x i and x j are the feature vectors between nodes v i and v j respectively. According to the calculation results of the cosine distance, k nearest neighbor nodes are selected for each node and the corresponding edges are added to construct a k-nearest neighbor graph based on the node feature similarity.

3. The method for classifying nodes of a same-different matching network based on macro-micro message passing for graph contrast learning according to claim 1, wherein In S3, the edge homogeneity ratio h for measuring the network homogeneity level edge The calculation formula is as follows: If then is a disassortative network, if then is an assortative network.

4. The method for classifying nodes of the same and different matching network based on macro-micro message passing for graph contrast learning according to claim 1, characterized in that, In S5, define the positive sample pairs of the anchor node v i as The negative sample pairs include and Construct the InfoNCE contrastive loss as follows: where τ is the temperature parameter and s(·) is the cosine similarity.

5. A same - different matching network node classification system for graph contrastive learning based on macro - micro message passing, characterized in that, A method for classifying nodes of a homogeneous and heterogeneous matching network for graph contrast learning based on macro-micro message passing according to any one of claims 1 to 4, comprising: A neighborhood expansion module for generating a k-nearest neighbor graph to enrich the direction of message passing between nodes; An enhanced view generation module for generating enhanced views required for contrast learning; A view role definition module for determining the primary or auxiliary role of the structural view and the feature view according to the homogeneous and heterogeneous matching nature of the network; A primary and auxiliary view alignment encoding module for encoding and aligning the primary view and the auxiliary view respectively to obtain the embedding representation of the nodes under different views; A contrast training module for optimizing the node embedding representation using a contrast loss function; A node classification module for training and evaluating node classification tasks using the optimized node embedding representation.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and the computer program is loaded and executed by a processor to implement the method for classifying nodes of a homogeneous and heterogeneous matching network for graph contrast learning based on macro-micro message passing according to any one of claims 1 to 4.