A graph neural network homomorphic computing method based on a hybrid homomorphic encryption scheme
Patent Information
- Application Number
- CN202410791552.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-19
- Publication Date
- 2026-11-03
- Estimated Expiration
- 2044-06-19
AI Technical Summary
In existing technologies, when using error-oriented learning ciphertext to perform linear operations on graph data of graph neural networks, multi-bit multiplication needs to be converted into complex logic circuits, resulting in low processing efficiency.
A hybrid fully homomorphic encryption scheme is adopted, which uses ciphertext learned from loop errors for encryption when performing linear operations on graph data in graph neural networks, and uses ciphertext learned from errors for encryption when performing nonlinear operations, thus avoiding the conversion of multi-bit multiplication into complex logic circuits.
It improves the processing efficiency of graph neural networks, reduces computational overhead, and enhances the efficiency of encryption processing.
Smart Images

Figure CN119011110B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of data processing technology, specifically relating to a graph neural network-based dense state computation method based on a hybrid fully homomorphic encryption scheme. Background Technology
[0002] Graph Neural Networks (GNNs) are deep learning models for processing graph data. Entities in graph data are represented as nodes, and relationships between entities are represented as edges.
[0003] To ensure that graph data is encrypted during processing by graph neural networks, fully homomorphic encryption (FHE) is required. It's important to note that FHE allows computation on encrypted data without prior decryption. Under FHE, operations such as addition and multiplication can be performed on the data, and the results remain encrypted.
[0004] In prior art, a scheme using Learning with Errors (LWE) ciphertext was used to achieve fully homomorphic encryption of graph data during graph neural network processing.
[0005] In the process of developing this application, the inventors discovered that the prior art has at least the following problems: In the scheme for learning ciphertext for error, the encryption processing of graph data of graph neural networks (such as graph neural network aggregation, graph neural network merging) requires converting multi-bit multiplication into complex logic circuits, resulting in low processing efficiency. Summary of the Invention
[0006] This application aims to provide a graph neural network encrypted computation method based on a hybrid fully homomorphic encryption scheme, which at least solves the problem of low processing efficiency in prior art where the encryption processing of graph data in graph neural networks for linear operations in error-oriented ciphertext learning schemes requires converting multi-bit multiplications into complex logic circuits.
[0007] To solve the above-mentioned technical problems, this application is implemented as follows:
[0008] This application provides a graph neural network-based dense state computation method based on a hybrid fully homomorphic encryption scheme, the method comprising:
[0009] In the case of performing linear operations on graph data of a graph neural network, the first ciphertext of the graph data is obtained, and the first ciphertext is subjected to a first process to obtain a first result, so as to realize the linear operation; the first ciphertext is the ciphertext of error learning on the ring.
[0010] When performing nonlinear operations on the graph data, a second ciphertext of the graph data is obtained, and the second ciphertext is subjected to a second processing to obtain a second result, thereby realizing the nonlinear operation; the second ciphertext is the ciphertext of error learning.
[0011] In this embodiment, by performing linear operations on the graph data of a graph neural network, a first ciphertext of the graph data is obtained, and the first ciphertext is processed to obtain a first result to achieve linear operations. The first ciphertext is ciphertext learned from error learning on the ring. Conversely, by performing nonlinear operations on the graph data, a second ciphertext of the graph data is obtained, and the second ciphertext is processed to obtain a second result to achieve nonlinear operations. The second ciphertext is ciphertext learned from error learning. This achieves fully homomorphic encryption of the graph data during graph neural network processing, eliminating the need for a scheme that converts multi-bit multiplication into complex logic circuits for encrypting the graph data of the graph neural network through linear operations. This improves processing efficiency and solves the problem of low processing efficiency in prior art schemes where multi-bit multiplication needs to be converted into complex logic circuits for encrypting the graph data of the graph neural network through linear operations in error-learning ciphertext schemes. Attached Figure Description
[0012] Figure 1 This is a flowchart illustrating the steps of a graph neural network-based encrypted state calculation method based on a hybrid fully homomorphic encryption scheme, as provided in an embodiment of this application.
[0013] Figure 2 This is a flowchart illustrating the specific steps of a graph neural network-based encrypted state calculation method based on a hybrid fully homomorphic encryption scheme, as provided in an embodiment of this application.
[0014] Figure 3 This is a schematic diagram of the fully homomorphic encryption process provided in the embodiments of this application; Detailed Implementation
[0015] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0016] The graph neural network-based dense state calculation method based on a hybrid fully homomorphic encryption scheme, provided in this application, will be described in detail below with reference to the accompanying drawings and through specific embodiments and application scenarios.
[0017] Figure 1This is a flowchart illustrating the steps of a graph neural network-based encrypted state calculation method using a hybrid fully homomorphic encryption scheme, as provided in an embodiment of this application. Figure 1 As shown, the method may include:
[0018] Step 101: When performing linear operations on the graph data of the graph neural network, obtain the first ciphertext of the graph data, and perform a first processing on the first ciphertext to obtain a first result, so as to realize the linear operation; the first ciphertext is the ciphertext of error learning on the ring.
[0019] In this embodiment of the application, by performing linear operations on the graph data of the graph neural network, obtaining the first ciphertext of the graph data, and performing a first processing on the first ciphertext to obtain a first result, the linear operation is realized. The first ciphertext is the ciphertext of error learning on the ring, thereby realizing the encryption processing of linear operations on the graph data of the graph neural network.
[0020] It should be noted that the ciphertext can be organized as an algebraic ring with high dimension and large coefficients. Compared to traditional error learning, Ring Learning with Errors (RLWE) is a typical choice for algebraic rings. Error learning ciphertext is obtained by encrypting based on an error learning problem, where the error learning problem is a problem of solving noisy linear equations. Ring Learning with Errors ciphertext is obtained by encrypting based on a ring learning with error problem. In the ring learning with error problem, the operations on the ring are polynomial operations.
[0021] Step 102: When performing nonlinear operations on the graph data, obtain the second ciphertext of the graph data, and perform a second processing on the second ciphertext to obtain a second result, so as to realize the nonlinear operation; the second ciphertext is the ciphertext of error learning.
[0022] In related technologies, schemes using Ring Learning with Errors (RLWE) ciphertext are employed to achieve fully homomorphic encryption. While linear operations on graph data in graph neural networks can be performed relatively directly, nonlinear computations on graph data (such as calculations of the Linear Rectification Function (ReLU)) require highly polynomial approximations (e.g., polynomials of order 343). This results in larger FHE parameters; even for the simplest three-layer graph neural network, the ring dimension increases from 8192 to 65536. The increased FHE parameters significantly increase the computational cost of aggregation operations, equivalent to a five-fold increase in computational cost.
[0023] In this embodiment of the application, by obtaining a second ciphertext of the graph data when performing nonlinear operations on the graph data, and performing a second processing on the second ciphertext to obtain a second result, nonlinear operations are achieved. The second ciphertext is the ciphertext of error learning, thereby realizing the encryption processing of nonlinear operations on the graph data of the graph neural network. Moreover, it is not necessary to use the scheme of error learning ciphertext on the ring to perform nonlinear calculations on the graph data through a high polynomial approximation. The FHE parameter is small, thereby reducing the computational overhead.
[0024] In summary, in the embodiments of this application, by performing linear operations on the graph data of the graph neural network, obtaining the first ciphertext of the graph data, and performing a first processing on the first ciphertext to obtain a first result, linear operations are achieved. The first ciphertext is the ciphertext learned from error learning on the ring. Furthermore, by performing nonlinear operations on the graph data, obtaining the second ciphertext of the graph data, and performing a second processing on the second ciphertext to obtain a second result, nonlinear operations are achieved. The second ciphertext is the ciphertext learned from error learning. This achieves fully homomorphic encryption of the graph data during graph neural network processing, and eliminates the need for a scheme that converts multi-bit multiplication into complex logic circuits for encrypting the graph data of the graph neural network through linear operations. This improves processing efficiency and solves the problem of low processing efficiency in prior art where the scheme for encrypting the graph data of the graph neural network through linear operations requires converting multi-bit multiplication into complex logic circuits.
[0025] Figure 2 This is a flowchart illustrating specific steps of a graph neural network-based encrypted state computation method based on a hybrid fully homomorphic encryption scheme provided in this application embodiment. Figure 2 As shown, the method may include:
[0026] Step 201: When performing linear operations on the graph data of the graph neural network, obtain the first ciphertext of the graph data, and perform a first processing on the first ciphertext to obtain a first result, so as to realize the linear operation; the first ciphertext is the ciphertext of error learning on the ring.
[0027] The implementation method of this step is similar to that of sub-step 101 above, and will not be repeated here.
[0028] It should be noted that the processing of graph data on the graph neural network platform includes linear and nonlinear operations. When performing linear operations on the graph data of the graph neural network, the graph data is transformed into the first ciphertext (ciphertext learned from errors on the ring) and then encrypted to achieve linear operation. When performing nonlinear operations on the graph data, the graph data is transformed into the second ciphertext (ciphertext learned from errors) and then encrypted to achieve nonlinear operation.
[0029] The graph data is transformed into ciphertext learned from errors on the ring, and then encrypted using linear operations.
[0030] Optionally, in some embodiments, the graph data includes multiple nodes, the graph data corresponds to a matrix, and the rows of the matrix correspond one-to-one with the nodes in the graph data; the first ciphertext is a polynomial, the polynomial is arranged in ascending or descending order of powers, and the powers of any two adjacent monomials in the polynomial differ by one; the polynomial includes multiple sub-polynomials, the sub-polynomials correspond one-to-one with the rows; the arrangement order of the sub-polynomials is the same as the arrangement order of the rows; the coefficients of the monomials in the sub-polynomials correspond one-to-one with the elements in the rows; the arrangement order of the monomials in the sub-polynomials is the same as the arrangement order of the elements in the rows.
[0031] In this embodiment, each node has a feature vector, and each feature vector includes multiple feature elements. The feature elements are encrypted to obtain the elements corresponding to the feature elements in the matrix of graph data, thereby obtaining the coefficients of the monomials in the polynomial, realizing the transformation of graph data into ciphertext for error learning on the ring, i.e., the polynomial.
[0032] For example, if the graph data includes four nodes, namely node V1, node V2, node V3, and node V4, and each node corresponds to a feature vector, and each feature vector includes two feature elements, and the feature elements are encrypted to obtain the elements corresponding to the feature elements in the graph data matrix, then the matrix corresponding to the graph data can be represented as:
[0033]
[0034] Among them, v st Let v represent the element in the s-th row and t-th column of the matrix, where s and t are both positive integers. st This corresponds to the t-th feature element in the feature vector of node Vs, for example, v 11 v represents the element in the first row and first column of the matrix. 11 It corresponds to the first feature element in the feature vector of node V1.
[0035] The first ciphertext (polynomial) f(x) can be expressed as:
[0036] f(x) = v 11 +v 12 x+v 21 x 2 +v 22 x 3 +v 31 x 4 +v 32 x 5 +v41 x 6 +v 42 x 7
[0037] Here, x represents the letter of the monomial, and the subpolynomial corresponding to node Vs is all the elements v corresponding to node Vs in the polynomial f(x). st The polynomial formed by the monomials, for example, the subpolynomial corresponding to node V1 is v 11 +v 12 x.
[0038] Optionally, in some embodiments, the linear operation includes graph neural network aggregation and graph neural network merging.
[0039] In this embodiment of the application, by performing linear operations (including graph neural network aggregation and graph neural network merging) on the graph data of the graph neural network, the first ciphertext of the graph data (ciphertext of error learning on the ring) is obtained, and the first ciphertext is processed to obtain the first result, so as to realize the linear operation.
[0040] It's important to note that the graph data processing in graph neural networks includes graph neural network aggregation and graph neural network combination. Graph neural network aggregation traverses all nodes in the graph data and aggregates the feature vector information of neighboring nodes (nodes directly connected to the current node via edges) into the traversed current node. Graph neural network combination further transforms the feature vector of each node into a new feature vector using a neural network based on a multi-layered perceptron (MLP). Because the size of each node's neighboring nodes is different, the computation graph of graph neural network aggregation is dynamic and irregular; conversely, the computation graph of neural network combination is static and regular. During the execution of a graph neural network, graph neural network aggregation behaves similarly to graph computation, while graph neural network combination behaves similarly to neural network computation. Both graph neural network aggregation and combination are performed iteratively based on the number of layers.
[0041] Since real numbers are represented as scaled fixed-point numbers, multiplication operations in graph neural network merging introduce additional scaling factors, requiring truncation. This truncation is avoided by directly integrating the truncation into a homomorphic look-up table (HLUT, detailed below) function and combining it with the ReLU operation.
[0042] Optionally, in some embodiments, the linear operation includes graph neural network aggregation; the first processing of the first ciphertext to obtain the first result includes the following sub-steps (sub-step 2011, sub-step 2012, sub-step 2013, sub-step 2014):
[0043] Sub-step 2011: Transform the polynomial according to the preset control code corresponding to the row to obtain the transformed polynomial.
[0044] In this embodiment, the polynomial is transformed according to the preset control code corresponding to the row to obtain the transformed polynomial. Then, the coefficient of the i-th first monomial in the sub-polynomial corresponding to the row is added to the coefficient of the i-th second monomial in the first sub-polynomial of the transformed polynomial to obtain the first new coefficient of the i-th first monomial.
[0045] It should be noted that the preset control code is a binary code sequence obtained by decrypting the encrypted control code. The binary code within the preset control code is then encrypted to obtain the encrypted value corresponding to the binary code in the encrypted control code. During the encryption process of linear operations on graph data in the graph neural network, the encrypted control code is used to achieve graph neural network aggregation.
[0046] The transformed polynomial has the same number of terms as the original polynomial, the letters in the terms of the transformed polynomial are the same as those in the original polynomial, the power of the transformed polynomial is the same as that of the original polynomial, and the power of the r-th monomial in the transformed polynomial is the same as that of the r-th monomial in the original polynomial.
[0047] Optionally, in some embodiments, the number of the sub-polynomials is 2^n, where n is a positive integer; the preset control code includes m-bit binary code, where m is a positive integer less than or equal to n; sub-step 2011 includes the following numerator steps (numerator step 2011a, numerator step 2011b):
[0048] Step 2011a: Transform the polynomial according to the binary code in the preset control code to obtain the intermediate polynomial corresponding to the p-th binary code in the preset control code; where p is a positive integer less than or equal to m.
[0049] In this embodiment, the polynomial is transformed according to the binary code in the preset control code to obtain the intermediate polynomial corresponding to the p-th binary code in the preset control code, and then the intermediate polynomial corresponding to the m-th binary code in the preset control code is determined as the transformed polynomial.
[0050] It should be noted that 2^n represents 2 raised to the power of n.
[0051] When p is greater than 1, the polynomial is transformed according to the first p-1 bits of the binary code in the preset control code to obtain the intermediate polynomial corresponding to the p-th binary code in the preset control code; when p is equal to 1, the polynomial is transformed according to the p-th binary code in the preset control code to obtain the intermediate polynomial corresponding to the p-th binary code in the preset control code.
[0052] Optionally, in some embodiments, molecular step 2011a includes the following sub-step (sub-step 2011a-1):
[0053] Step 2011a-1: When the p-th binary code in the preset control code is binary 0, the intermediate polynomial at this time is taken as the intermediate polynomial corresponding to the p-th binary code; wherein, when p equals 1, the intermediate polynomial at this time is the polynomial, and when p is greater than 1, the intermediate polynomial at this time is the intermediate polynomial corresponding to the (p-1)-th binary code in the preset control code.
[0054] In this embodiment, when the p-th binary code in the preset control code is binary 0, the intermediate polynomial at this time is taken as the intermediate polynomial corresponding to the p-th binary code. When p equals 1, the intermediate polynomial at this time is a polynomial, and when p is greater than 1, the intermediate polynomial at this time is the intermediate polynomial corresponding to the (p-1)-th binary code in the preset control code. This achieves the determination of the intermediate polynomial corresponding to the m-th binary code in the preset control code as the transformed polynomial.
[0055] Optionally, in some embodiments, molecular step 2011a includes the following sub-steps (sub-steps 2011a-2, 2011a-3, and 2011a-4):
[0056] Step 2011a-2: When the p-th binary code in the preset control code is binary 1, the first 2^(n-p+1) sub-polynomials of the intermediate polynomial at this time are determined as the first group, and the last 2^(np) sub-polynomials of the first 2^(n-p+1) sub-polynomials of the polynomial are determined as the second group.
[0057] It should be noted that 2^(n-p+1) represents 2 to the power of (n-p+1), and 2^(np) represents 2 to the power of (np).
[0058] In this embodiment of the application, when the p-th bit of the preset control code is binary 1, the first 2^(np) sub-polynomials of the first 2^(n-p+1) sub-polynomials of the intermediate polynomial are determined as the first group, and the last 2^(np) sub-polynomials of the first 2^(n-p+1) sub-polynomials of the polynomial are determined as the second group. Then, the coefficient of the k-th third monomial in the j-th sub-polynomial of the first group is exchanged with the coefficient of the k-th fourth monomial in the j-th sub-polynomial of the second group to obtain the third new coefficient of the k-th third monomial and the fourth new coefficient of the k-th fourth monomial.
[0059] Step 2011a-3: Swap the coefficient of the kth third monomial in the jth sub-polynomial of the first group with the coefficient of the kth fourth monomial in the jth sub-polynomial of the second group to obtain the third new coefficient of the kth third monomial and the fourth new coefficient of the kth fourth monomial; where j and k are both positive integers.
[0060] In this embodiment of the application, by exchanging the coefficient of the kth third monomial in the jth sub-polynomial of the first group with the coefficient of the kth fourth monomial in the jth sub-polynomial of the second group, the third new coefficient of the kth third monomial and the fourth new coefficient of the kth fourth monomial are obtained. Then, based on all the third new coefficients and all the fourth new coefficients, the intermediate polynomial corresponding to the pth binary code is obtained.
[0061] Step 2011a-4: Based on all the third new coefficients and all the fourth new coefficients, obtain the intermediate polynomial corresponding to the p-th binary code.
[0062] In this embodiment, by obtaining the intermediate polynomial corresponding to the p-th binary code based on all the third new coefficients and all the fourth new coefficients, the intermediate polynomial corresponding to the m-th binary code in the preset control code is determined as the transformed polynomial.
[0063] This can be achieved by executing sub-steps 2011a-2 to 2011a-4, obtaining the intermediate polynomial corresponding to the p-th bit binary code.
[0064] Molecular step 2011b: Determine the intermediate polynomial corresponding to the m-th binary code in the preset control code as the transformed polynomial.
[0065] In this embodiment, by determining the intermediate polynomial corresponding to the m-th binary code in the preset control code as the transformed polynomial, the coefficient of the i-th first monomial in the sub-polynomial corresponding to the row is added to the coefficient of the i-th second monomial in the first sub-polynomial of the transformed polynomial to obtain the first new coefficient of the i-th first monomial.
[0066] This can be achieved by performing molecular steps 2011a to 2011b, thus obtaining the transformed polynomial.
[0067] Sub-step 2012: Add the coefficient of the i-th first monomial in the sub-polynomial corresponding to the row to the coefficient of the i-th second monomial in the first sub-polynomial of the transformed polynomial to obtain the first new coefficient of the i-th first monomial; where i is a positive integer.
[0068] In this embodiment of the application, the first new coefficient of the i-th first monomial is obtained by adding the coefficient of the i-th second monomial in the first subpolynomial of the transformed polynomial, and then the new subpolynomial corresponding to the row is obtained based on all the first new coefficients corresponding to the row.
[0069] Sub-step 2013: Obtain the new sub-polynomial corresponding to the row based on all the first new coefficients corresponding to the row.
[0070] In this embodiment of the application, a new sub-polynomial corresponding to a row is obtained based on all the first new coefficients corresponding to the row, and then a new polynomial is obtained based on all the new sub-polynomials, so as to realize graph neural network aggregation.
[0071] Taking sub-steps 2011 to 2013 as an example, for instance, the preset control code corresponding to the first row of the matrix is "10", and the number of sub-polynomials of the first ciphertext (polynomial) f(x) is 8 (i.e., 2^3). The polynomial f(x) can be expressed as:
[0072] f(x) = v 11 +v 12 x+v 21 x 2 +v 22 x 3 +v 31 x 4 +v 32 x 5 +v 41 x 6 +v 42 x 7
[0073] Since the first bit of the preset control code is binary 1, the first 4 (2^(3-1)) sub-polynomials of the first 8 (2^(3-1+1)) sub-polynomials of the intermediate polynomial (i.e., polynomial f(x)) are determined as the first group a1, and the last 4 sub-polynomials of the first 8 sub-polynomials of the polynomial are determined as the second group b1.
[0074] v in the first group a1 11 v in the second group b1 31 To perform an exchange, i.e., v 31 x is the constant term in f(x) 0 The third new coefficient, v 11 x in f(x) 4 The fourth new coefficient will be v in the first group a1. 12 v in the second group b1 32 By performing the swaps and repeating this process, based on all the third and fourth new coefficients, the intermediate polynomial f1(x) corresponding to the first binary code can be expressed as:
[0075] f1(x)=v 31 +v 32 x+v 41 x 2 +v 42 x 3 +v 11 x 4 +v 12 x 5 +v 21 x 6 +v 22 x 7
[0076] Since the first binary code in the preset control code is binary 0, the intermediate polynomial f1(x) at this time is taken as the intermediate polynomial corresponding to the second binary code.
[0077] Since the second binary code is the last (m-th) binary code in the preset control code, the intermediate polynomial f1(x) corresponding to the second binary code in the preset control code is determined as the transformed polynomial corresponding to the first sub-polynomial in f(x), where the first row in the matrix corresponds to the first sub-polynomial of f(x).
[0078] v 11 With v 31 Adding them together, we get the first monomial x in the first subpolynomial. 0 The first new coefficient (v) 11 +v 31 ), v 12 With v 32Adding them together, we obtain the first new coefficient (v) of the second first monomial x in the first subpolynomial. 12 +v 32 If ), then the first new subpolynomial corresponding to the first row of the matrix is v. 11 +v 31 +(v 12 +v 32 )x.
[0079] Sub-step 2014: Obtain a new polynomial based on all the new sub-polynomials to achieve the graph neural network aggregation.
[0080] In this embodiment of the application, a new polynomial is obtained based on all the new sub-polynomials to achieve graph neural network aggregation, and then further encryption processing of the graph neural network is completed based on the new polynomial.
[0081] By executing sub-steps 2011 to 2014, a new polynomial can be obtained, and then further encryption processing of the graph neural network can be completed based on the new polynomial.
[0082] Step 202: When performing nonlinear operations on the graph data, obtain the second ciphertext of the graph data, and perform a programmable bootstrap operation on the second ciphertext to obtain a second result, so as to realize the nonlinear operation; the second ciphertext is the ciphertext of error learning.
[0083] In this embodiment of the application, by performing nonlinear operations on graph data, obtaining a second ciphertext of the graph data, and performing a programmable bootstrap operation on the second ciphertext to obtain a second result, nonlinear operations are achieved. The second ciphertext is error-learned ciphertext, thereby achieving encryption processing for nonlinear operations on graph data.
[0084] It should be noted that bootstrapping is a ciphertext refresh technique that uses homomorphic decryption to reduce ciphertext noise. Programmable bootstrapping, or homomorphic look-up table (HLUT), refers to look-up table (LUT) operations under homomorphic encryption. It is a method for implementing nonlinear computation in logical FHE schemes; specifically, it evaluates a lookup table function on the ciphertext. For a given function f(x), the LUT in FHE consists of a polynomial... This is represented as follows: Given a function input i, to evaluate this LUT function y = f(i), we homomorphically compute x^{-i}*p(x). The value of the constant term in the resulting polynomial is the y we are computing. This polynomial p(x) is called the test vector.
[0085] Optional, refer to Figure 3In some embodiments, the fully homomorphic encryption process for each layer iteration includes: X1, graph neural network merging, i.e., performing graph neural network merging encryption on the graph data of the graph neural network; X2, extraction and ciphertext packaging, i.e., converting the ciphertext learned from the loop error learning process; X3, graph neural network aggregation, i.e., performing graph neural network aggregation encryption on the graph data of the graph neural network; X4, extraction and key switching, i.e., converting the ciphertext learned from the loop error learning process and switching the key of the ciphertext; X5, programmable bootstrapping, i.e., when performing nonlinear operations on the graph data, obtaining the second ciphertext of the graph data, and performing a programmable bootstrapping operation on the second ciphertext to obtain a second result to achieve nonlinear operations; X6, ciphertext repackaging, i.e., converting the ciphertext learned from the loop error learning process, the specific implementation process is similar to the aforementioned method, and will not be repeated here.
[0086] In summary, in the embodiments of this application, by performing linear operations on the graph data of the graph neural network, obtaining the first ciphertext of the graph data, and performing a first processing on the first ciphertext to obtain a first result, linear operations are achieved. The first ciphertext is the ciphertext learned from error learning on the ring. Furthermore, by performing nonlinear operations on the graph data, obtaining the second ciphertext of the graph data, and performing a second processing on the second ciphertext to obtain a second result, nonlinear operations are achieved. The second ciphertext is the ciphertext learned from error learning. This achieves fully homomorphic encryption of the graph data during graph neural network processing, and eliminates the need for a scheme that converts multi-bit multiplication into complex logic circuits for encrypting the graph data of the graph neural network through linear operations. This improves processing efficiency and solves the problem of low processing efficiency in prior art where the scheme for encrypting the graph data of the graph neural network through linear operations requires converting multi-bit multiplication into complex logic circuits.
[0087] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0088] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A graph neural network-based dense state computation method based on a hybrid fully homomorphic encryption scheme, characterized in that, The method includes: In the case of performing linear operations on graph data of a graph neural network, a first ciphertext of the graph data is obtained, and the first ciphertext is subjected to a first processing to obtain a first result, thereby realizing the linear operation; the first ciphertext is the ciphertext of error learning on the ring; the linear operation includes graph neural network aggregation; When performing nonlinear operations on the graph data, a second ciphertext of the graph data is obtained, and the second ciphertext is subjected to a second processing to obtain a second result, thereby realizing the nonlinear operation; the second ciphertext is the ciphertext of error learning; The graph data includes multiple nodes, and the graph data corresponds to a matrix, with each row of the matrix corresponding to a node in the graph data. The first ciphertext is a polynomial, which is arranged in ascending or descending order of power, and the powers of any two adjacent monomials in the polynomial differ by one. The polynomial includes multiple sub-polynomials, and each sub-polynomial corresponds one-to-one with a row; the order of the sub-polynomials is the same as the order of the rows. The coefficients of the monomials in the subpolynomial correspond one-to-one with the elements in the row; the order of the monomials in the subpolynomial is the same as the order of the elements in the row. The first processing of the first ciphertext to obtain the first result includes: The polynomial is transformed according to the preset control code corresponding to the row to obtain the transformed polynomial; the preset control code is the binary code sequence after decryption of the encrypted control code; the transformed polynomial has the same number of terms as the original polynomial, the letters in the terms of the transformed polynomial are the same as the letters in the terms of the original polynomial, the power of the transformed polynomial is the same as the power of the original polynomial, and the power of the r-th monomial in the transformed polynomial is the same as the power of the r-th monomial in the original polynomial. The coefficient of the i-th first monomial in the sub-polynomial corresponding to the row is added to the coefficient of the i-th second monomial in the first sub-polynomial of the transformed polynomial to obtain the first new coefficient of the i-th first monomial; where i is a positive integer; Based on all the first new coefficients corresponding to the row, obtain the new subpolynomial corresponding to the row; Based on all the new sub-polynomials, obtain a new polynomial to achieve the graph neural network aggregation; Specifically, obtaining the new sub-polynomial corresponding to the row based on all the first new coefficients corresponding to the row includes: The new subpolynomial corresponding to the row is determined by summing the first new coefficients of each first monomial in the subpolynomial corresponding to the row with the products of each first monomial. Wherein, the number of the sub-polynomials is 2^n, where n is a positive integer; the preset control code includes m-bit binary code, where m is a positive integer less than or equal to n; The step of transforming the polynomial according to the preset control code corresponding to the row to obtain the transformed polynomial includes: The polynomial is transformed according to the binary code in the preset control code to obtain the intermediate polynomial corresponding to the p-th binary code in the preset control code; where p is a positive integer less than or equal to m. The intermediate polynomial corresponding to the m-th binary code in the preset control code is determined as the transformed polynomial. The step of transforming the polynomial according to the binary code in the preset control code to obtain the intermediate polynomial corresponding to the p-th binary code in the preset control code includes: When the p-th binary code in the preset control code is binary 0, the intermediate polynomial at this time is taken as the intermediate polynomial corresponding to the p-th binary code; wherein, when p equals 1, the intermediate polynomial at this time is the polynomial, and when p is greater than 1, the intermediate polynomial at this time is the intermediate polynomial corresponding to the (p-1)-th binary code in the preset control code. The step of transforming the polynomial according to the binary code in the preset control code to obtain the intermediate polynomial corresponding to the p-th binary code in the preset control code further includes: When the p-th binary code in the preset control code is binary 1, the first 2^(n-p+1) sub-polynomials of the intermediate polynomial at this time are determined as the first group, and the last 2^(np) sub-polynomials of the first 2^(n-p+1) sub-polynomials of the intermediate polynomial are determined as the second group. The coefficient of the kth third monomial in the jth sub-polynomial of the first group is swapped with the coefficient of the kth fourth monomial in the jth sub-polynomial of the second group to obtain the third new coefficient of the kth third monomial and the fourth new coefficient of the kth fourth monomial; where j and k are both positive integers, and j is not greater than 2^(np); Based on all the third new coefficients and all the fourth new coefficients, an intermediate polynomial corresponding to the p-th binary code is obtained.
2. The method according to claim 1, characterized in that, The step of obtaining the second ciphertext of the graph data and performing a second processing on the second ciphertext to obtain a second result includes: Perform a programmable bootstrap operation on the second ciphertext to obtain the second result.
3. The method according to claim 1, characterized in that, The linear operations include graph neural network aggregation and graph neural network merging.
