A graph neural network inference method for cloud intelligent services

By combining homomorphic encryption and secure multi-party computation, we optimize cloud-based graph neural network inference, solving the problem of high computational and communication overhead. This achieves efficient and secure GNN inference, reduces latency, and protects the privacy of users and model owners.

CN123180337APending Publication Date: 2026-11-27XIDIAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611296930.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-25
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

In existing technologies, cloud-based inference solutions for graph neural networks (GNNs) suffer from high computational overhead, high communication costs, and privacy risks. In particular, the computational overhead is enormous when processing nonlinear activation functions, and solutions based on secure multi-party computation require frequent communication during large-scale graph matrix operations, making it difficult to control inference latency.

Method used

A method combining homomorphic encryption and secure multi-party computation is adopted. Two sets of homomorphic encryption key pairs are generated, and public and private keys are distributed to the cloud server. The model parameters are split and the graph structure and node features are encrypted. The cloud server collaboratively performs multi-layer secure inference. Additive secret sharing and function secret sharing techniques are used to optimize nonlinear activation operations and reduce communication and computation overhead.

Benefits of technology

This approach achieves reduced computational and communication overhead for GNN inference, improved inference efficiency, reduced latency, and ensured data security while protecting privacy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123180337A_ABST
    Figure CN123180337A_ABST
Patent Text Reader

Abstract

The application discloses a kind of graph neural network inference methods for cloud intelligent service, including model owner generates two groups of homomorphic encryption key pairs, the public key in two groups of homomorphic encryption key pairs is distributed outside, and the two private keys in two groups of homomorphic encryption key pairs are respectively distributed to first cloud server, second cloud server;Model owner splits the model parameter of the graph neural network of training completion into two groups of model parameter shares, and respectively sent to first cloud server and second cloud server;The preset graph structure and the preset node feature matrix are respectively encrypted using the public key corresponding to first cloud server, second cloud server and obtain encrypted graph structure and encrypted node feature, and first cloud server and second cloud server based on the received data cooperatively execute graph neural network multilayer security inference, obtain final inference result.The application effectively reduces the calculation and communication overhead of GNN model inference while protecting the data privacy of users and model owners.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of artificial intelligence technology, specifically relating to a graph neural network reasoning method for cloud-based intelligent services. Background Technology

[0002] With the rapid development of the Internet of Things and cloud computing, massive amounts of data with graph structure characteristics are constantly emerging. Graph Neural Networks (GNNs) are widely used in recommendation systems, financial risk control, and other scenarios due to their ability to mine topological information. Currently, GNN intelligent services generally adopt a cloud-hosted inference model. However, on the one hand, graph convolution involves massive graph computation operations, resulting in high overhead for inference computation and communication; on the other hand, graph structures, node features, and model parameters contain sensitive information, making the cloud inference process highly susceptible to privacy leaks.

[0003] To achieve privacy-preserving cloud-based GNN inference, existing research mainly relies on two types of cryptographic techniques—homomorphic encryption and secure multi-party computation (SMPC)—to construct secure inference schemes. Homomorphic encryption-based schemes achieve encrypted inference through ciphertext optimization, model modification, and graph pruning; SMPC-based schemes utilize secret sharing and function secret sharing protocols to build a secure multi-party computation framework, achieving privacy protection for graph structure, node features, and model parameters. However, existing technologies still have significant drawbacks. For example, homomorphic encryption schemes incur huge computational overhead and suffer from significant accuracy loss when processing nonlinear activation functions; SMPC-based schemes experience frequent interactions and high communication costs in large-scale graph matrix operation scenarios, making inference latency difficult to control.

[0004] Therefore, there is an urgent need for a cloud-based GNN privacy inference solution that balances security, computational efficiency, and communication efficiency. Summary of the Invention

[0005] To address the aforementioned problems in the existing technology, this invention provides a graph neural network inference method for cloud-based intelligent services.

[0006] The technical problem to be solved by this invention is achieved through the following technical solution: A graph neural network inference method for cloud-based intelligent services, the method comprising: System initialization phase: The model owner generates two sets of homomorphic encryption key pairs, distributes the public key from the two sets of homomorphic encryption key pairs to the outside world, and cross-distributes the two private keys from the two sets of homomorphic encryption key pairs to the first cloud server and the second cloud server respectively; Model parameter encryption and outsourcing stage: The model owner splits the model parameters of the trained graph neural network into two sets of shared model parameter shares, and sends the two sets of shared model parameter shares to the first cloud server and the second cloud server respectively; Inference request processing stage: The user obtains the public key, uses the public keys corresponding to the first cloud server and the second cloud server to encrypt the preset graph structure and the preset node feature matrix respectively to obtain the encrypted graph structure and encrypted node features, and sends the encrypted graph structure and encrypted node features to the first cloud server and the second cloud server respectively. Secure graph neural network inference stage: The first cloud server and the second cloud server collaboratively execute multi-layer secure inference of the graph neural network based on the received private key, encrypted graph structure, encrypted node characteristics, and shared share of model parameters to obtain the final inference result.

[0007] Optionally, the secure graph neural network inference stage includes: The first and second cloud servers perform feature linear transformation based on the received encrypted node features and model parameter shared shares, perform secure weighted message passing on the encrypted graph structure and superimpose bias shares to obtain the first-layer linear output ciphertext. The first-level linear output ciphertext is transformed to obtain the corresponding first additive secret shared value; A nonlinear activation operation is performed based on the first addition secret shared value to generate the activated addition secret shared value; Based on the activated additive secret shared value, a characteristic linear transformation is performed, secure weighted message passing is performed again, and a bias share is added to generate a high-level linear output ciphertext. The high-level linear output ciphertext is converted into the corresponding second additive secret shared value, and the secure Softmax protocol is executed collaboratively to calculate the secret shared share. The final inference result is obtained by reconstructing based on the secret shared share.

[0008] Optionally, the process of generating the encrypted graph structure includes: Encode the weighted neighborhood information of each node in the preset graph structure into a neighborhood polynomial; The public key is used to encrypt the polynomials in each neighborhood to obtain the encrypted graph structure.

[0009] Optionally, the process of generating encrypted node features includes: The feature matrix of the preset node is packaged and encoded column by column according to the feature dimension to form a feature polynomial; The feature polynomial is encrypted using a public key to obtain the encrypted node feature.

[0010] Optionally, the process of security-weighted message passing includes: For each feature dimension, the encrypted node feature is homomorphically multiplied with the neighborhood polynomial corresponding to each node to obtain the product result; where the constant term of the product result is the sum of the weighted features of the neighboring nodes after aggregation of that dimension and the node's own features. Extract the constant term from the product result to obtain the aggregated feature ciphertext of each node; The aggregated feature ciphertext of each node is repackaged according to the feature dimension to form an aggregated encrypted feature matrix.

[0011] Optionally, the first-level linear output ciphertext is transformed to obtain the corresponding first additive secret shared value, including: Random mask matrices are generated by the first cloud server and the second cloud server respectively. After processing the ciphertext mask of the linear output, it is sent to the second cloud server and the first cloud server. The first cloud server decrypts the ciphertext using the private key of the second cloud server, and the second cloud server decrypts the ciphertext using the private key of the first cloud server. Combined with its own local random share, the two cloud servers together generate the first addition secret shared value corresponding to the linear output.

[0012] Optionally, the nonlinear activation operation includes an offline preprocessing stage and an online execution stage. In the offline preprocessing stage, the model owner generates the function and secretly shares the required evaluation key and mask value. In the online execution stage, the first cloud server and the second cloud server collaboratively determine the input symbol based on the narrowed finite bit width, and select the output zero or the original input value based on the symbol.

[0013] This invention also provides a graph neural network inference system for cloud-based intelligent services, comprising a model owner terminal, a user terminal, a first cloud server, and a second cloud server, wherein: The model owner's side is used to generate two sets of homomorphic encryption key pairs, distribute the public key of the two sets of homomorphic encryption key pairs to the outside world, and cross-distribute the two private keys of the two sets of homomorphic encryption key pairs to the first cloud server and the second cloud server respectively. On the model owner's side, it is also used to split the model parameters of the trained graph neural network into two sets of shared model parameter shares, and send the two sets of shared model parameter shares to the first cloud server and the second cloud server respectively. The user terminal is used to obtain the public key, and uses the public keys of the first cloud server and the second cloud server to encrypt the preset graph structure and the preset node feature matrix respectively to obtain the encrypted graph structure and encrypted node features, and sends the encrypted graph structure and encrypted node features to the first cloud server and the second cloud server respectively. The first and second cloud servers are used to collaboratively execute multi-layer secure inference of the graph neural network based on the received private key, encrypted graph structure, encrypted node characteristics, and shared share of model parameters to obtain the final inference result.

[0014] The present invention also provides an electronic device, the electronic device including a processor and a memory, wherein the memory stores at least one instruction, at least one program, code set or instruction set, the at least one instruction, the at least one program, the code set or instruction set being loaded and executed by the processor to implement the above-described graph neural network inference method for cloud-based intelligent services.

[0015] The present invention also provides a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the above-described graph neural network inference method for cloud-based intelligent services.

[0016] This invention provides a graph neural network inference method for cloud-based intelligent services. The method includes: a model owner generating two sets of homomorphic encryption key pairs; distributing the public key from each set of homomorphic encryption key pairs externally; and cross-distributing the two private keys from each set of homomorphic encryption key pairs to a first cloud server and a second cloud server, respectively; the model owner splitting the model parameters of the trained graph neural network into two sets of shared model parameter shares, and sending these two sets of shared model parameter shares to the first cloud server and the second cloud server, respectively; a user obtaining a public key, using the corresponding public keys of the first and second cloud servers to encrypt a preset graph structure and a preset node feature matrix to obtain an encrypted graph structure and encrypted node features, and sending the encrypted graph structure and encrypted node features to the first and second cloud servers, respectively; and the first and second cloud servers collaboratively executing multi-layer secure inference of the graph neural network based on the received private key, encrypted graph structure, encrypted node features, and shared model parameter shares to obtain the final inference result. This invention solves the problems of high computational overhead and severe accuracy loss of nonlinear activation functions in GNN inference schemes based on homomorphic encryption, as well as the problem of extensive communication between parties in GNN inference based on secure multi-party computation during large-scale matrix operations. It reduces communication overhead and overall inference latency during the inference process, and correctly completes the computation while protecting the data privacy of users and model owners.

[0017] The present invention will now be described in further detail with reference to the accompanying drawings. Attached Figure Description

[0018] Figure 1 This is a flowchart illustrating a graph neural network inference method for cloud-based intelligent services provided in an embodiment of the present invention. Figure 2 This is a flowchart illustrating the generation process of an encrypted graph structure provided in an embodiment of the present invention; Figure 3This is a flowchart illustrating the generation process of encrypted node features according to an embodiment of the present invention; Figure 4 This is a flowchart illustrating the inference stage of a secure graph neural network according to an embodiment of the present invention; Figure 5 This is a framework diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0019] The present invention will be further described in detail below with reference to specific embodiments, but the implementation of the present invention is not limited thereto.

[0020] The rapid development of IoT and cloud computing technologies has driven the generation of massive amounts of data, much of which exhibit graph structure characteristics, such as social relationships, road network data, and knowledge graphs. Graph data structures are complex, and graph neural networks (GNNs) can capture complex structural information through the topological relationships between nodes and learn node representations using the information propagation mechanism of neighboring nodes. They have gradually become the main technology for processing graph data and are widely used in intelligent services such as recommendation systems and financial risk control. With the development of cloud computing technology, GNN-based intelligent services are increasingly adopting cloud deployment models. Model owners host their GNN models on powerful cloud servers and entrust cloud service providers to provide intelligent services such as model inference to users based on the GNN model. However, the cloud-based inference model based on GNNs has two main problems: First, GNN inference involves large-scale graph computation and non-linear activation operations, resulting in significant computational and communication overhead; second, graph structures typically contain information about relationships between users, node features may contain sensitive attributes such as user identity and behavioral records, and GNN model parameters may also contain important knowledge information, potentially leading to data privacy leaks during the inference process.

[0021] To achieve secure GNN inference, existing work has designed a series of schemes based on cryptographic primitives such as homomorphic encryption and secure multi-party computation. Although existing schemes have effectively achieved secure GNN inference, the nonlinear activation function of the homomorphic encryption-based GNN inference scheme faces limitations such as high computational overhead and severe accuracy loss. Inference based on secure multi-party computation requires a large amount of communication between parties during large-scale matrix operations, resulting in high latency for GNN inference.

[0022] To address these issues, this invention proposes a graph neural network inference method for cloud-based intelligent services. This method is based on homomorphic encryption and secure multi-party computation, and designs linear and nonlinear operation algorithms with high communication and computational efficiency, promoting the application and implementation of secure and efficient cloud-based GNN inference in fields such as finance and healthcare.

[0023] To achieve a cloud-based GNN privacy inference scheme that balances security, computational efficiency, and communication efficiency, this invention provides a graph neural network inference method for cloud-based intelligent services.

[0024] The method provided in this invention can be applied to electronic devices. Specifically, the electronic device can be a desktop computer, a portable computer, a smart mobile terminal, a server, etc. No limitation is made herein; any electronic device that can implement this invention falls within the protection scope of this invention.

[0025] like Figure 1 As shown, Figure 1 This is a flowchart illustrating a graph neural network inference method for cloud-based intelligent services provided in an embodiment of the present invention, including: Step 101, System Initialization Phase: The model owner generates two sets of homomorphic encryption key pairs, distributes the public key from the two sets of homomorphic encryption key pairs to the outside world, and cross-distributes the two private keys from the two sets of homomorphic encryption key pairs to the first cloud server and the second cloud server respectively.

[0026] In this process, the model owner initializes two sets of homomorphic encryption key pairs based on the homomorphic encryption key generation algorithm, denoted as follows: and ,in, It is a public key. It is the private key.

[0027] Next, the model owner will The private key of the second server is publicly released to every user and each cloud server. The private key of the first cloud server is secretly sent to it. It was secretly sent to the second cloud server.

[0028] Step 102, Model Parameter Encryption and Outsourcing Stage: The model owner splits the trained graph neural network model parameters into two sets of shared model parameter shares, and sends the two sets of shared model parameter shares to the first cloud server and the second cloud server respectively.

[0029] The model owner possesses a trained graph neural network model with two sets of model parameters. and ,in, This indicates the number of layers in the graph neural network model; and Representing the first The weight matrix and bias matrix of the layer, .

[0030] Next, the model owner first sets the model parameters. and Convert to two sets of shared model parameters and ,in .

[0031] Then share the corresponding two sets of model parameters. , They were sent to two cloud servers respectively, denoted as... and .

[0032] Step 103, Reasoning Request Processing Stage: The user obtains the public key, uses the public keys corresponding to the first cloud server and the second cloud server to encrypt the preset graph structure and the preset node feature matrix respectively to obtain the encrypted graph structure and encrypted node features, and sends the encrypted graph structure and encrypted node features to the first cloud server and the second cloud server respectively.

[0033] Among them, users hold weighted directed graphs. ,in It is a set of vertices, each vertex All through its index Unique identifier; Let represent the set of directed edges, where each edge is denoted as . ,in and These represent the source node and the target node, respectively. Represents the set of edge weights, where each weight Corresponding directed edges ; It is a preset node feature matrix, the first... OK Represents a node eigenvectors; Indicates the number of nodes. Indicates the number of edges. For feature dimensions. Users will send information about the preset graph structure by following these steps. The reasoning request to and .

[0034] The user first uses the public key. Preset graph structure for request reasoning Encryption is performed, among which , Specifically, the preset graph structure is encrypted as follows: The preset node feature matrix is ​​then encrypted. .in, This is the initial preset node feature matrix corresponding to the input layer of the graph neural network.

[0035] Step 2: Encrypt the graph structure and encryption node features in this form: , Send to each and .

[0036] In some alternative embodiments, such as Figure 2 As shown, Figure 2 This is a flowchart illustrating the generation process of an encrypted graph structure according to an embodiment of the present invention, including: Step 201: Encode the weighted neighborhood information of each node in the preset graph structure into a neighborhood polynomial.

[0037] Step 202: Encrypt each neighborhood polynomial using the public key to obtain the encrypted graph structure.

[0038] For a given graph structure, given a set of nodes Edge set Edge weight set and public key This algorithm generates an encrypted graph structure. The encryption process is as follows: Step 1: Neighborhood Multinomial Encoding. To facilitate homomorphic computation on the predefined graph structure, the weighted neighborhood of each node is first encoded into a multinomial ring.

[0039] (1) For each node ,make express The set of neighboring nodes, containing The corresponding edge weight set is defined as follows: The self-loop weight is set to 1.

[0040] (2) Each neighbor identifier Mapping to monomials And the corresponding edge weight Then it is embedded as its coefficient.

[0041] Therefore, node Weighted neighborhood It can be represented by the following neighborhood polynomial: ; In the generated polynomials, the exponent of each monomial uniquely identifies a neighboring node, and its coefficients store the corresponding edge weights. Therefore, each polynomial can compactly represent the weighted neighborhood information of a node in the graph.

[0042] Step 2: Encryption using the fully homomorphic encryption scheme (Brakerski-Fan-Vercauteren, BFV for short). After polynomial encoding, each neighborhood polynomial is encrypted using the public key via the BFV scheme. The encrypted graph topology is represented as follows: The fully homomorphic encryption scheme is an integer fully homomorphic encryption scheme based on on-ring error learning, which supports homomorphic addition and homomorphic multiplication operations. For specific implementation details, please refer to existing technologies.

[0043] In some alternative embodiments, such as Figure 3 As shown, Figure 3 This is a flowchart illustrating the generation process of encrypted node features according to an embodiment of the present invention, including: Step 301: Pack and encode the preset node feature matrix column by column according to the feature dimension to form a feature polynomial.

[0044] Step 302: Encrypt the feature polynomial using the public key to obtain the encrypted node feature.

[0045] Among them, for the preset node feature matrix The encryption process is as follows: Step 1: Pack by column. The preset node feature matrix is ​​represented as follows: .in, ... These are the elements in the predefined node feature matrix. To achieve efficient homomorphic computation, a column-wise packing strategy is used to encrypt the feature matrix.

[0046] Specifically, feature values ​​belonging to the same feature dimension are encoded as a polynomial. , No. The column is coded as follows: , Therefore, the feature matrix is ​​packaged into Characteristic polynomials .

[0047] Step 2: Matrix encryption. The packaged characteristic polynomial. Encryption is performed using the BFV scheme to generate a set of ciphertext. ,in, Represents the preset node feature matrix The Column features.

[0048] In this embodiment, a graph structure encrypted using the BFV encryption scheme is proposed, in which each neighbor identifier is mapped to a monomial, and the corresponding edge weight is embedded as its coefficient. The weighted neighborhood of each node is represented by a neighborhood polynomial. The feature matrix adopts an encoding method of packing into polynomial coefficients column by column. The combination of the two encoding strategies achieves efficient and secure message transmission.

[0049] Step 104, Secure Graph Neural Network Inference Stage: The first cloud server and the second cloud server collaboratively execute multi-layer secure inference of the graph neural network based on the received private key, encrypted graph structure, encrypted node features, and shared share of model parameters to obtain the final inference result.

[0050] Among them, when and After receiving the inference request, the encrypted graph structure, encrypted node features, and corresponding model parameter sharing shares, secure GNN inference is performed based on this data according to the following steps.

[0051] In some alternative embodiments, such as Figure 4 As shown, Figure 4 This is a flowchart illustrating the inference stage of a secure graph neural network according to an embodiment of the present invention, including: Step 401: The first cloud server and the second cloud server perform feature linear transformation based on the received encrypted node features and model parameter sharing shares, perform secure weighted message passing on the encrypted graph structure and superimpose the bias shares to obtain the first-layer linear output ciphertext.

[0052] Step 402: Convert the first-layer linear output ciphertext to obtain the corresponding first addition secret shared value.

[0053] Step 403: Perform a non-linear activation operation based on the first addition secret shared value to generate the activated addition secret shared value.

[0054] Step 404: Perform a feature linear transformation based on the activated additive secret shared value, perform secure weighted message passing again and add bias shares to generate a high-level linear output ciphertext.

[0055] Step 405: Convert the high-level linear output ciphertext into the corresponding second additive secret shared value, and collaboratively execute the secure Softmax protocol to calculate the secret shared share. Based on the secret shared share, reconstruct the final inference result.

[0056] The first step is the first linear layer. Specifically, the first cloud server and the second cloud server multiply the received encrypted node features and model parameter sharing shares, perform a linear transformation of the encrypted features, and obtain the result of the linear transformation of the encrypted features. ,Right now Then the weighted security message passing algorithm is invoked, i.e. The algorithm performs secure weighted message passing and homomorphically adds its bias share. Finally, the first-layer linear output ciphertext is obtained. .

[0057] Step 2: Convert homomorphic ciphertext to secret sharing. Each first-level linear output ciphertext... It will be converted into its corresponding first addition secret shared value, where .

[0058] In some optional embodiments, the first-layer linear output ciphertext is transformed to obtain the corresponding first addition secret shared value, including: generating random mask matrices through the first cloud server and the second cloud server respectively; masking the linear output ciphertext and sending it to the second cloud server and the first cloud server; the first cloud server decrypts the ciphertext using the private key of the second cloud server, the second cloud server decrypts the ciphertext using the private key of the first cloud server, and combines it with its own local random share; the first cloud server and the second cloud server jointly generate the first addition secret shared value corresponding to the linear output.

[0059] Among them, cloud servers Sampling random mask matrix The encrypted linear output is then masked, and the resulting ciphertext is sent to another cloud server. .

[0060] After receiving the encrypted message, another cloud server use private key Decrypt the ciphertext to obtain Subsequently, the cloud server combines the decrypted value with its own local random share. Combining them, we get .therefore, ,but and It is the first additive secret shared value of the linear output. The local random share is a random matrix pre-sampled locally.

[0061] It should be noted that the cloud server here... It can be a first cloud server, and another cloud server. It can be a second cloud server. Or, a cloud server. It can be a second cloud server, another cloud server It can be the first cloud server, but this application embodiment does not specifically limit it.

[0062] Step 3: Secure ReLU Assessment. The first addition secret shared value obtained in Step 2 above... and and parameters This serves as the input to the Narrowed Function SecretSharing ReLU (Narrowed FSS-ReLU) algorithm. During the training phase, the model owner pre-selects the parameters. The data is then sent to the cloud server. Subsequently, the cloud server and the model owner collaboratively execute the Narrowed FSS Secret Shared Sign Decision Sub-algorithm (NFR.DReLU) and the Narrowed FSS Secret Shared Secure Multiplexing Sub-algorithm (NFR.MUX) to securely compute the ReLU activation function, ultimately generating the activated additive shares. and The specific implementation process of the above algorithm can be found in existing technologies.

[0063] Step 4: Subsequent linear layers. After a safe ReLU evaluation, the activation output is an additive share. and To complete the subsequent linear layer calculations on the additive share, follow these steps: (1) The model owner, acting as a trusted third party, generates the required multiplication triples and distributes them to two cloud servers. Using these pre-processed triples, and The safe multiplication algorithm is invoked together to calculate the result of the characteristic linear transformation. Shared share and .

[0064] (2) Each cloud server Call Algorithm, using its shared share Perform secure weighted message passing on the graph structure, then add its bias share to obtain the final result. .

[0065] Step 5: Subsequent nonlinear layers. After completing step 4, the graph convolutional layer generates encrypted logits values. ,in Following the same procedure as in step two, the encrypted linear output is converted into an additive secret share. and Subsequently, the two cloud servers use these shares as input to collaboratively invoke the secure Softmax protocol. Ultimately, the protocol outputs a secret share. and The final inference result is then sent to the user for reconstruction.

[0066] For example, a semi-supervised node classification task using a two-layer graph convolutional neural network (GCN) model is used to illustrate secure GNN inference. In this task, only some nodes have label information, while the remaining nodes are classified by jointly utilizing graph structure information and node attributes. Let... Represents the GCN model, where The weight and bias matrices represent the learnable weights and biases; the hidden layers use ReLU as the activation function, while the output layer applies the Softmax function to generate normalized class probabilities.

[0067] The specific two-layer architecture, with the hidden layer's computational representation as follows: The original classification score vector output by the second layer for: Then, the prediction result is obtained by normalization using the Softmax function. , , Indicates the number of categories. Representing the The original classification score of the category. Security-weighted messaging, step one of phase four. , and All of these are completed locally, among which have , have .

[0068] In this embodiment, different calculation methods are used for the linear feature transformation parts of the first layer and subsequent layers. The first layer is a multiplication of homomorphic ciphertext and plaintext, and the subsequent layers call a secure multiplication that is secretly shared by both parties. This avoids the problems of low computational efficiency or high communication volume in pure homomorphic or pure secure multi-party computation schemes, and avoids the frequent ciphertext transformations in traditional hybrid homomorphic encryption and secure multi-party computation schemes, thereby improving the computational and communication efficiency of inference.

[0069] In some optional embodiments, the process of security-weighted message passing includes: For each feature dimension, the encrypted node feature is homomorphically multiplied with the neighborhood polynomial corresponding to each node to obtain the product result. The constant term of the product result is the sum of the weighted features of the neighboring nodes after aggregation in that dimension and the node's own features. The constant term in the product result is extracted to obtain the aggregated feature ciphertext of each node in the corresponding dimension. The aggregated feature ciphertext of each node is repackaged according to the feature dimension to form the aggregated encrypted feature matrix.

[0070] Among them, the secure weighted message passing algorithm uses a graph structure encrypted with BFV. and characteristic operands As input, where Output the encrypted and aggregated feature matrix .by For example, the specific steps are as follows: Step 1: Homomorphic weighted aggregation. For each feature dimension... The algorithm will encrypt the ciphertext of the encrypted features. With each node encrypted neighborhood polynomial Performing homomorphic multiplication ensures that the weighted aggregation result is encoded in the constant term of the product. The first term represents the weighted features aggregated from neighboring nodes, and the second term represents the node's... The algorithm then re-linearizes the generated ciphertext, taking into account its inherent characteristics.

[0071] Step 2: Constant term extraction. The constant term in each product term is extracted as ciphertext (Learning With Errors, LWE) constructed based on the error-tolerant learning problem: , Represents a node The One aggregated feature value.

[0072] Step 3: Encryption packaging. This is done for each feature dimension. encrypt all LWE ciphertexts of all nodes Packaged into a BFV ciphertext based on RLWE. Finally, the aggregated encryption feature matrix is: .

[0073] In some optional embodiments, the nonlinear activation operation includes an offline preprocessing stage and an online execution stage. In the offline preprocessing stage, the model owner generates a function that secretly shares the required evaluation key and mask value. In the online execution stage, the first cloud server and the second cloud server collaboratively determine the input symbol based on the narrowed finite bit width and select either zero or the original input value based on the symbol.

[0074] Among them, the safe computation of the ReLU function is handled by the model owner, and The proposed Narrowed FSS-ReLU protocol was developed collaboratively, and it consists of two FSS functions: and . Function in narrowing Accurately determine the sign of the input within the bit field; and Then the original input is selected based on the calculated sign bit. or To improve efficiency, both functions use the same random parameter during the offline phase. Joint generation. During the online phase, the two cloud servers first call DReLU to obtain the sign bit, and then use this sign bit to call the MUX function to generate the final ReLU output. The specific steps are as follows: Given ring bit width Narrowed comparison bit width and secret shared input Two cloud servers collaborate on computing. Mask symbol shared value .

[0075] This invention discards Each redundant high-order bit retains the sign information, reducing the input bit width from... Bit reduction to Specifically, let's assume... for Bit input, Indicate its Bit-simplified representation; respectively using and Indicates action on Position ring and Corresponding on the bit ring Function. When When this is the case, the equivalent relation can be obtained: ,in, .

[0076] The offset function can be expressed as:

[0077]

[0078] in, , , .

[0079] The above formula divides the calculation process into three parts: the boxed indicator function is the only non-linear part, which is calculated using the DCF protocol; while the terms in square brackets depend only on the input / output mask, so they can be pre-calculated offline.

[0080] Step 1: Offline Phase. The model owner first samples the shared values ​​of the input mask. and output mask These masks are used to generate an evaluation offset function. Evaluation key Then calculate to satisfy Offline constant shared value Subsequently, these tuples (in They were assigned to two cloud servers.

[0081] Step Two: Online Phase. Each cloud server... First calculate and exchange with another server To reconstruct mask values Subsequently, it computes locally. Reduce the input data to On the bit ring, calculation and use the evaluation key Calculate the share of the indicator function in equation (1) Finally, Combined with offline constant shares, the mask output shares are obtained. ,in .

[0082] Given a secret shared input and its mask symbol shared value The two cloud servers jointly calculated Secret shared value .

[0083] For selection bit enter The MUX function selects 0 or ,Right now To ensure secure computation, the input is first masked. The selection bit is masked as ,in express Arithmetic mask, This represents the Boolean mask generated by the preceding DReLU operation. Therefore, the resulting mask input to the MUX function is expressed as:

[0084] For each possible mask bit Model owner generates shares , , making , Subsequently, each server locally calculates the common mask input. linear function values: .

[0085] Step 1: Offline Stage. Since the model owner knows the arithmetic mask... Boolean mask It generates the MUX evaluation key. ,in Then distribute Give cloud server .

[0086] Step Two: Online Phase. Each cloud server... Select bits using a mask To determine the corresponding key component and compute locally. The obtained shared value satisfies .

[0087] In this embodiment, by employing secret sharing and function secret sharing techniques in the calculation of the nonlinear function ReLU, the number of online communication rounds is reduced. Combined with the strategy of reducing the input data bit width, the communication in the offline stage is reduced, thereby achieving ReLU evaluation with lower communication overhead.

[0088] This invention proposes a graph neural network inference method for cloud-based intelligent services. The method includes: a model owner generating two sets of homomorphic encryption key pairs; distributing the public key from each set to external entities; and cross-distributing the two private keys from each set to a first cloud server and a second cloud server, respectively; the model owner splitting the trained graph neural network model parameters into two sets of shared model parameter shares, and sending these shares to the first and second cloud servers, respectively; a user obtaining a public key and using the public keys corresponding to the first and second cloud servers to encrypt a preset graph structure and a preset node feature matrix, respectively, to obtain an encrypted graph structure and encrypted node features, which are then sent to the first and second cloud servers, respectively; and the first and second cloud servers collaboratively executing multi-layer secure inference of the graph neural network based on the received private key, encrypted graph structure, encrypted node features, and shared model parameter shares to obtain the final inference result. This invention employs homomorphic encryption in the first layer of linear computation to aggregate neighbor node information, while subsequent layers combine homomorphic encryption and additive secret sharing to aggregate neighbor node information without communication. In each layer, the feature linear transformation is calculated before weighted message passing. This, combined with the encryption strategy of this invention and the small dimensionality of GNN hidden layers, reduces the dimensionality of intermediate ciphertext, significantly reducing the number of homomorphic ciphertext multiplication operations and improving overall inference efficiency. Furthermore, by employing additive secret sharing, function secret sharing, and input data bit width reduction strategies when calculating the ReLU function in the nonlinear layers, the online computation of the DReLU function is achieved. The number of rounds is reduced, and offline communication is also reduced with the reduction of input bit width. Furthermore, by maintaining the secret sharing state of intermediate activation values ​​after completing nonlinear calculations during secure GNN inference, subsequent linear layers can be directly executed in the addition secret sharing domain, thereby avoiding frequent secret state transitions in traditional hybrid homomorphic encryption and secure multi-party computation schemes. It also reduces the cost of ciphertext-ciphertext multiplication and relinearization by multiplying the secret-shared share with the homomorphic ciphertext in the linear part of subsequent layers. The model inference process not only achieves strong privacy protection for model parameters, user graph structure, and graph node features, but also effectively reduces the computation and communication overhead of GNN model inference.

[0089] Based on the same inventive concept, embodiments of the present invention also provide a graph neural network inference system for cloud-based intelligent services. This system includes a model owner terminal, a user terminal, a first cloud server, and a second cloud server, wherein: The model owner's side is used to generate two sets of homomorphic encryption key pairs, distribute the public key of the two sets of homomorphic encryption key pairs to the outside world, and cross-distribute the two private keys of the two sets of homomorphic encryption key pairs to the first cloud server and the second cloud server respectively. On the model owner's side, it is also used to split the model parameters of the trained graph neural network into two sets of shared model parameter shares, and send the two sets of shared model parameter shares to the first cloud server and the second cloud server respectively. The user terminal is used to obtain the public key, and uses the public keys corresponding to the first cloud server and the second cloud server to encrypt the preset graph structure and the preset node feature matrix respectively to obtain the encrypted graph structure and encrypted node features, and sends the encrypted graph structure and encrypted node features to the first cloud server and the second cloud server respectively. The first and second cloud servers are used to collaboratively execute multi-layer secure inference of the graph neural network based on the received private key, encrypted graph structure, encrypted node characteristics, and shared share of model parameters to obtain the final inference result.

[0090] This invention also provides an electronic device, such as... Figure 5 As shown, it includes a processor 501, a communication interface 502, a memory 503, and a communication bus 504, wherein the processor 501, the communication interface 502, and the memory 503 communicate with each other through the communication bus 504. Memory 503 is used to store computer programs; When the processor 501 executes the program stored in the memory 503, it implements the steps of the graph neural network inference method for cloud-based intelligent services described above.

[0091] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of representation, only one thick line is used in the diagram, but this does not indicate that there is only one bus or one type of bus.

[0092] The communication interface is used for communication between the aforementioned electronic devices and other devices.

[0093] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage system located remotely from the aforementioned processor.

[0094] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0095] The present invention also provides a computer-readable storage medium. A computer program is stored in this computer-readable storage medium, and when executed by a processor, the computer program implements the steps of the graph neural network inference method for cloud-based intelligent services described above.

[0096] Optionally, the computer-readable storage medium may be non-volatile memory (NVM), such as at least one disk storage device.

[0097] Optionally, the computer-readable storage medium may also be at least one storage system located remotely from the aforementioned processor.

[0098] It should be noted that, for the system / electronic device / storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple. For relevant parts, please refer to the description of the method embodiments. All embodiments of the above-described graph neural network inference method for cloud-based intelligent services are applicable to the system, electronic device and storage medium, and can achieve the same or similar beneficial effects.

[0099] The above description, in conjunction with specific preferred embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various simple deductions or substitutions can be made without departing from the concept of the present invention, and all such modifications and substitutions should be considered within the scope of protection of the present invention.

Claims

1. A graph neural network inference method for cloud-based intelligent services, characterized in that, The method includes: System initialization phase: The model owner generates two sets of homomorphic encryption key pairs, distributes the public key of the two sets of homomorphic encryption key pairs to the outside world, and cross-distributes the two private keys of the two sets of homomorphic encryption key pairs to the first cloud server and the second cloud server respectively; Model parameter encryption and outsourcing stage: The model owner splits the model parameters of the trained graph neural network into two sets of shared model parameter shares, and sends the two sets of shared model parameter shares to the first cloud server and the second cloud server respectively; Inference request processing stage: The user obtains the public key, uses the public keys corresponding to the first cloud server and the second cloud server to encrypt the preset graph structure and the preset node feature matrix respectively to obtain the encrypted graph structure and the encrypted node features, and sends the encrypted graph structure and the encrypted node features to the first cloud server and the second cloud server respectively. Secure graph neural network inference stage: The first cloud server and the second cloud server collaboratively execute multi-layer secure inference of the graph neural network based on the received private key, the encrypted graph structure, the encrypted node features, and the shared share of model parameters to obtain the final inference result.

2. The method according to claim 1, characterized in that, The secure graph neural network inference stage includes: The first cloud server and the second cloud server perform feature linear transformation based on the received encrypted node features and the shared share of the model parameters, perform secure weighted message passing on the encrypted graph structure and superimpose the bias share to obtain the first-layer linear output ciphertext; The first-layer linear output ciphertext is transformed to obtain the corresponding first additive secret shared value; A nonlinear activation operation is performed based on the first addition secret shared value to generate an activated addition secret shared value; Based on the activated additive secret shared value, a feature linear transformation is performed, and secure weighted message passing is performed again with the bias share added to generate a high-level linear output ciphertext. The high-level linear output ciphertext is converted into the corresponding second additive secret shared value, and the secure Softmax protocol is collaboratively executed to calculate the secret shared share. The final inference result is then obtained by reconstructing the secret shared share.

3. The method according to claim 1 or 2, characterized in that, The process of generating the encrypted graph structure includes: The weighted neighborhood information of each node in the preset graph structure is encoded into a neighborhood polynomial; The public key is used to encrypt each of the neighborhood polynomials to obtain the encrypted graph structure.

4. The method according to claim 1 or 2, characterized in that, The process of generating the encrypted node features includes: The preset node feature matrix is ​​packaged and encoded column-wise according to the feature dimension to form a feature polynomial; The feature polynomial is encrypted using the public key to obtain the encrypted node feature.

5. The method according to claim 2, characterized in that, The process of secure weighted message passing includes: For each feature dimension, the encrypted node feature is homomorphically multiplied with the neighborhood polynomial corresponding to each node to obtain the product result; wherein, the constant term of the product result is the sum of the weighted features of the neighboring nodes after aggregation of that dimension and the node's own features; Extract the constant term from the product result to obtain the aggregated feature ciphertext of each node; The aggregated feature ciphertext of each node is repackaged according to the feature dimension to form an aggregated encrypted feature matrix.

6. The method according to claim 2, characterized in that, The step of converting the first-layer linear output ciphertext to obtain the corresponding first additive secret shared value includes: Random mask matrices are generated by the first cloud server and the second cloud server respectively. After processing the linear output ciphertext mask, the ciphertext is sent to the second cloud server and the first cloud server. The first cloud server decrypts the ciphertext using the private key of the second cloud server, and the second cloud server decrypts the ciphertext using the private key of the first cloud server. Combined with its own local random share, the two cloud servers together generate the first addition secret shared value corresponding to the linear output.

7. The method according to claim 2, characterized in that, The nonlinear activation operation includes an offline preprocessing stage and an online execution stage. In the offline preprocessing stage, the model owner generates a function that secretly shares the required evaluation key and mask value. In the online execution stage, the first cloud server and the second cloud server collaboratively determine the input symbol based on the narrowed finite bit width, and select either zero or the original input value based on the symbol.

8. A graph neural network inference system for cloud-based intelligent services, characterized in that, The system includes a model owner's terminal, a user terminal, a first cloud server, and a second cloud server, wherein: The model owner terminal is used to generate two sets of homomorphic encryption key pairs, distribute the public key of the two sets of homomorphic encryption key pairs to the outside world, and cross-distribute the two private keys of the two sets of homomorphic encryption key pairs to the first cloud server and the second cloud server respectively. The model owner terminal is also used to split the model parameters of the trained graph neural network into two sets of shared model parameter shares, and send the two sets of shared model parameter shares to the first cloud server and the second cloud server respectively. The user terminal is used to obtain the public key, encrypt the preset graph structure and the preset node feature matrix using the public keys corresponding to the first cloud server and the second cloud server respectively to obtain the encrypted graph structure and the encrypted node features, and send the encrypted graph structure and the encrypted node features to the first cloud server and the second cloud server respectively. The first cloud server and the second cloud server are used to collaboratively execute multi-layer secure inference of the graph neural network based on the received encrypted graph structure, encrypted node features, and model parameter sharing shares to obtain the final inference result.

9. An electronic device, characterized in that, The electronic device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set, or an instruction set, and the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the graph neural network inference method for cloud-based intelligent services as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The storage medium stores at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the graph neural network inference method for cloud-based intelligent services as described in any one of claims 1-7.