A GPU-accelerated fully homomorphic encryption database query processing system

By introducing GPU optimization technology into the fully homomorphic encrypted database, the problems of high computational latency and low GPU utilization are solved, achieving high security and high performance in low-latency query processing, which is suitable for large-scale data analysis.

CN121902198BActive Publication Date: 2026-07-03RENMIN UNIVERSITY OF CHINA

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
RENMIN UNIVERSITY OF CHINA
Filing Date
2025-12-26
Publication Date
2026-07-03

Smart Images

  • Figure CN121902198B_ABST
    Figure CN121902198B_ABST
Patent Text Reader

Abstract

This invention relates to a GPU-accelerated fully homomorphic encrypted database query processing system, comprising: a client configured to encrypt plaintext data and upload it to an encrypted database on a cloud server, and to receive and decrypt the encrypted query results returned by the cloud server to obtain the plaintext results; a cloud server configured to perform query operations on ciphertext data according to query requests sent by the client, and return encrypted query results; the encrypted database internally includes a fully homomorphic encryption layer and a database layer; the fully homomorphic encryption layer is configured to provide GPU-optimized homomorphic operator operations to support polynomial transformations, ciphertext outer products, or bootstrapping operations on the ciphertext data; the database layer is configured to provide optimized homomorphic filtering operations and a CUDA-based concurrent execution model to support homomorphic filtering and aggregation operations on the ciphertext data. This invention can be applied to the field of big data processing technology where data privacy requirements are high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of big data processing technology, specifically relating to a GPU-accelerated fully homomorphic encrypted database query processing system. Background Technology

[0002] In recent years, the significant advantages of cloud services in storage and computing power have continued to unfold. Core data and analytical tasks in industries such as government, finance, healthcare, and manufacturing are gradually migrating to the cloud to reduce costs, simplify operations and maintenance, and obtain elastic computing power and high-performance computing resources. However, data outsourcing removes sensitive information from the local trusted domain, leading to data breaches caused by hacker intrusions, unauthorized access by cloud personnel, increased exposure due to cloud resource misconfiguration, and data compliance challenges arising from cross-border deployments. Increasing privacy compliance requirements, exemplified by the EU's GDPR, the US HIPAA, and China's Personal Information Protection Law, are forcing industries to complete analytical calculations under the constraint of "data availability, plaintext invisibility," forming a triple constraint of "cloud availability—compliance and security—cost controllability."

[0003] To address these constraints, the industry has developed several technical approaches: First, traditional encryption (static encryption + transmission encryption) emphasizes the security of "storage and transmission," but decryption is required once the computation phase begins, leading to plaintext exposure on the cloud side and potential data leaks. Second, Trusted Execution Environments (TEEs, such as SGX-based secure memory zones) achieve near-native performance through hardware isolation and plaintext computation, but face engineering uncertainties such as reliance on trusted roots, limited available memory, and side-channel and patch maintenance in cloud multi-tenant environments. Third, Secure Multi-Party Computation (MPC) ensures that parties do not expose their original inputs through sharding and protocol interaction, making it suitable for cross-domain joint analysis scenarios. However, it involves multiple protocol rounds, is sensitive to network jitter, and struggles to balance performance and engineering complexity in large-scale database queries and complex aggregations. Fourth, Differential Privacy (DP) emphasizes output perturbation and statistical security, but it is difficult to cover precise queries and strong consistency scenarios. Compared to the above approaches, Fully Homomorphic Encryption (FHE) can be directly computed on the ciphertext, theoretically supporting "no decryption throughout the entire process" on the cloud side. In terms of security assumptions, deployment models, and auditability, it is more in line with the reality of cloud computing of "strong compliance + weak trust".

[0004] Introducing Fully Homomorphic Encryption (FHE) into encrypted databases allows for the execution of core SQL operators such as equality / range filtering, joins, and aggregations without decrypting the ciphertext. It also enables the construction of higher-level logic such as selection projection, grouping statistics, sorting, and joins. However, the fully homomorphic encryption database, determined by both the cryptographic computation layer and the database execution layer, is "usable but computationally expensive." On one hand, while FHE supports direct computation on the ciphertext, ciphertext inflation significantly increases operator-level computational complexity. More importantly, homomorphic computation accumulates noise during continuous operations; when this noise exceeds a security threshold, decryption fails. Therefore, periodic, computationally complex bootstrapping operations must be performed to refresh the noise, resulting in extremely high computational and memory access overhead. On the other hand, at the database query level, SQL filtering operations typically require comparisons and logical judgments on large-scale data tables. In a fully homomorphic environment, these operations require Boolean logic functionality implemented through gate bootstrapping. This further increases end-to-end query latency, often reaching several minutes or even hours, making it difficult to support the engineering deployment and real-time analysis needs under massive data and complex predicate conditions.

[0005] Optimizing fully homomorphic encrypted databases using GPUs offers three main advantages. First, by parallelizing complex homomorphic operations, the multi-core parallel capabilities of GPUs can be fully utilized, efficiently supporting ciphertext comparison and logic gate computation. Second, offloading computationally intensive SQL analysis tasks to GPUs allows full utilization of cloud-based GPU computing power, enabling high-concurrency encrypted data analysis. Finally, GPU acceleration significantly improves the overall performance of encrypted databases, making fully homomorphic encrypted databases more practical in real-world applications.

[0006] At the homomorphic encryption database level, existing research focuses on improving the query support range of fully homomorphic encrypted SQL at the algorithm level and reducing computational overhead by decreasing the number of gate bootstrapping involved in homomorphic comparison algorithms. However, these methods still face significant end-to-end latency issues, making it difficult to support low-latency queries of large-scale encrypted data. At the fully homomorphic encryption computation level, some works have attempted to accelerate homomorphic operations and gate bootstrapping processes using GPUs, but these solutions generally have three shortcomings: First, they do not implement further parallel scheduling and task decomposition at the database execution layer, resulting in limited overall system concurrency; second, they directly port encryption operators with low parallelism to GPUs, failing to fully utilize the parallel computing potential of GPUs; and third, they use hard-coded low security parameters (e.g., 80-bit) in their implementation, lacking support for the adjustable high-security configuration (≥128 bits) required by mainstream encryption databases, thus limiting their application in fully homomorphic encryption database acceleration scenarios.

[0007] Designing a fully homomorphic encrypted database system on GPUs that combines high performance and high security still faces multiple challenges. First, the numerous small-scale polynomial ring operations based on number-theoretic transformations (NTT / FFT) in FHE introduce extremely high computational and memory access overhead, complicating operator-level parallelization design and limiting the execution efficiency of core database operators. Second, while existing parallel strategies for ciphertext outer products can improve performance through inter-polynomial parallelism, performance degradation often occurs under higher security parameters due to limited GPU shared memory and register resources. Third, the inherent sequential dependency of the bootstrapping process makes efficient parallelization on GPUs difficult, leading to reduced utilization of computational units. Finally, simultaneously processing massive amounts of encrypted data and accelerating underlying homomorphic operators during database queries requires systematic design and deep optimization in architecture, scheduling mechanisms, and data layout. Therefore, there is an urgent need for a GPU-accelerated fully homomorphic encrypted database system that balances the parallelization of underlying homomorphic operators with the execution efficiency of the upper-level database, to simultaneously meet the application requirements of high security and high performance. Summary of the Invention

[0008] To address the aforementioned problems, the purpose of this invention is to provide a GPU-accelerated fully homomorphic encrypted database query processing system that can achieve efficient query processing without decryption in large-scale data environments while ensuring a high level of data security.

[0009] To achieve the above objectives, the present invention adopts the following technical solution: a GPU-accelerated fully homomorphic encrypted database query processing system, comprising:

[0010] The client is configured to encrypt plaintext data, upload it to the encrypted database on the cloud server, and simultaneously receive the encrypted query results returned by the cloud server and decrypt them to obtain the plaintext results.

[0011] The cloud server is configured to perform query operations on the encrypted data in the encrypted database based on the query request sent by the client, and return the final encrypted query result;

[0012] The encrypted database includes a fully homomorphic encryption layer and a database layer. The fully homomorphic encryption layer is configured to provide GPU-optimized homomorphic operator operations to support polynomial transformations, ciphertext outer products, or bootstrapping operations on ciphertext data. The database layer is configured to provide GPU-optimized homomorphic filtering operations and a CUDA-based parallel execution model to support homomorphic filtering or homomorphic aggregation operations on ciphertext data.

[0013] Furthermore, the client includes a key generation module, a data encryption module, a data upload module, and a data decryption module;

[0014] The key generation module is configured to generate a secret key via a dedicated SDK, and the secret key is stored only on the client side;

[0015] The data encryption module is configured to encrypt plaintext data using a secret key, including encoding non-integer elements into integers using a preset encoding method and encrypting the columns of each table;

[0016] The data upload module is configured to store encrypted data in columnar format and upload it to an encrypted database on the cloud server side;

[0017] The data decryption module is used to decrypt the encrypted query results returned by the cloud server using a secret key and return the final plaintext results to the user.

[0018] Furthermore, the fully homomorphic encryption layer includes a GPU-customized folded FFT parallel optimization module, a cross-thread block outer product parallel optimization module, and a GPU-friendly bootstrap unrolling optimization module;

[0019] The GPU-customized folded FFT parallel optimization module is configured to process ciphertext data using folded FFT, while simultaneously optimizing the folded FFT operation process in parallel using GPU memory hierarchy strategy, FFT unfolding strategy and butterfly unit fusion strategy.

[0020] The cross-thread block outer product parallel optimization module is configured to perform parallel optimization of the outer product operation in the query process using a cross-thread block outer product parallel strategy and a kernel fusion strategy.

[0021] The GPU-friendly bootstrap unrolling optimization module is configured to use a GPU-friendly bootstrap unrolling strategy to perform parallel optimization of the bootstrap operation during the query process.

[0022] Furthermore, the GPU-customized folded FFT parallel optimization module includes a folded FFT optimization module, a GPU memory optimization module, an FFT unfolding module, and a butterfly unit fusion module;

[0023] The folded FFT optimization module is configured to "fold" the input polynomial to obtain a complex polynomial and multiply it by a distortion factor to reduce the computational cost of the FFT.

[0024] The GPU memory optimization module is configured to perform hierarchical design of GPU memory to improve memory access and data stream reading efficiency.

[0025] The FFT unrolling module is configured to unroll all stages of the FFT iteration process to reduce overall synchronization overhead.

[0026] The butterfly unit fusion module is configured to fuse consecutive butterfly units and process them in a single thread by using vectorized memory types, thereby reducing thread synchronization and memory access overhead.

[0027] Furthermore, the folded FFT optimization module "folds" the input polynomial to obtain a complex polynomial, which means:

[0028] The original polynomial of length N Fold into a complex polynomial of length N / 2 Its coefficient is expressed as: ,in, express middle Term coefficient, The imaginary unit, and They represent middle and Term coefficient.

[0029] Furthermore, the GPU memory optimization module's hierarchical design of GPU memory refers to:

[0030] The input polynomials are stored in global memory as contiguous and aligned arrays to match the order of the FFT inputs;

[0031] At the same time, all distortion factor tables and rotation factor tables are pre-calculated and stored as contiguous arrays in global memory before calculation.

[0032] Furthermore, the cross-thread block outer product parallel optimization module includes a cross-thread block FFT parallel module and a kernel fusion module;

[0033] The cross-thread block FFT parallel module is configured to allow each thread block to perform one FFT, and all thread blocks operate independently and have their own shared memory.

[0034] The kernel fusion module is configured to use lock-free thread block synchronization technology to merge the entire outer product calculation into a single kernel through kernel fusion, so as to achieve inter-thread block collaboration and data consistency, thereby merging the outer product calculation into a single kernel.

[0035] Furthermore, the GPU-friendly bootstrap unpacking optimization module includes a bootstrap unpacking optimization module and a memory-to-computation tradeoff module;

[0036] The bootstrap expansion optimization module is configured to simultaneously pre-calculate several items in the bootstrap computation and store them as intermediate results and corresponding key packets.

[0037] The memory and computation trade-off module is configured to find the optimal balance between computational complexity, memory usage, and throughput based on pre-calculated complexity and key packet memory usage.

[0038] Furthermore, the database layer includes an operator-level parallel module and a record-level parallel module;

[0039] The operator-level parallel module is configured to integrate the optimized bootstrap kernel in the fully homomorphic encryption layer into homomorphic logic gates and homomorphic comparison operations;

[0040] The record-level parallel module is configured to divide different records in the data table into multiple non-overlapping blocks, and utilize the GPU's streaming multiprocessor to process the homomorphic filtering operations of different record blocks in parallel, thereby improving the utilization of GPU resources.

[0041] Furthermore, the cloud server also includes a homomorphic filtering module and a homomorphic aggregation module;

[0042] The homomorphic filtering module is configured to use an evaluation key to process the filtering columns in the ciphertext database through parallel computation, perform comparison operations on multiple encryption conditions, and generate filtering results.

[0043] The homomorphic aggregation module is configured to perform homomorphic aggregation on the filtered rows based on the filtering results, and calculate the final encrypted query result.

[0044] The present invention has the following advantages due to the adoption of the above technical solutions:

[0045] 1. Balancing high performance and high security: While maintaining a high security level of ≥128 bits, this invention significantly reduces the latency of homomorphic operations, especially achieving orders-of-magnitude acceleration in the bootstrap process, and supporting low-latency queries of large-scale encrypted data.

[0046] 2. Fully utilize GPU parallel computing power: Through multi-level operator fusion, outer product parallelism and multi-stream concurrency mechanism, this invention maximizes the computing potential of GPU, solves the problem of low GPU utilization in existing implementations, and achieves an execution mode that balances high parallelism and low latency.

[0047] 3. Strong versatility and scalability: The system architecture can flexibly adjust security parameters, batch size and concurrency strategies, and is suitable for various "cloud-side non-decryption" scenarios such as medical, financial, government, and Internet of Things, providing a feasible path for the engineering deployment of privacy computing databases.

[0048] Therefore, this invention can be widely applied in the field of big data processing technology. Attached Figure Description

[0049] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts. In the drawings:

[0050] Figure 1 This is a schematic diagram of the overall architecture and acceleration framework of the GPU-accelerated fully homomorphic encrypted database query processing system proposed in this invention;

[0051] Figure 2 A schematic diagram of the overall workflow of the GPU-accelerated fully homomorphic encrypted database query processing system provided by the present invention;

[0052] Figure 3 This is a schematic diagram of the structure of the homomorphic operator layer folding FFT parallel optimization technique proposed in this invention;

[0053] Figure 4 This is a schematic diagram illustrating the implementation of the cross-thread block ciphertext outer product parallel computation technique proposed in this invention;

[0054] Figure 5 This is a schematic diagram of the design of the two-level parallel execution framework for the database layer proposed in this invention. Detailed Implementation

[0055] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the described embodiments of the present invention are within the scope of protection of the present invention.

[0056] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.

[0057] In some embodiments of the present invention, a GPU-accelerated fully homomorphic encrypted database query processing system is provided. This system includes a client and a cloud server. The cloud server houses an encrypted database, which is divided into two main parts from bottom to top: a fully homomorphic encryption layer and a database layer. These layers are interconnected, forming a complete acceleration system. In the fully homomorphic encryption layer, the present invention addresses the bottleneck in FHE computation by optimizing homomorphic operator operations. In the database layer, the main optimization is of homomorphic filtering operations, improving query concurrency and processing efficiency. By combining these two optimizations, the system significantly improves GPU utilization and query execution speed.

[0058] like Figure 1 As shown, for GPU optimization of the homomorphic operator layer (FHE level), this invention mainly focuses on designing and optimizing the low-level FHE operators that constrain the efficiency of homomorphic comparisons and logic gate operations, especially computationally intensive operations such as polynomial transformations, ciphertext outer products, and bootstrapping. For these computationally intensive tasks, this invention designs several GPU optimization techniques to reduce computation and memory access overhead and improve execution efficiency. First, for the low-level small-scale polynomial computation in the most basic fully homomorphic encryption algorithm, this invention designs a GPU-customized folded FFT / IFFT parallel optimization method, significantly improving the efficiency of polynomial computation in the encryption algorithm. Addressing the issue of limited GPU shared memory under high security levels, this invention proposes a cross-thread block outer product parallel strategy and reuses the optimized FFT / IFFT parallel module, thereby ensuring that outer product computation can still maximize parallel execution under high security parameters. Regarding the sequential dependency of the bootstrapping process, this invention designs a GPU-friendly bootstrapping unrolling mechanism to unroll the bootstrapping algorithm to improve parallelism, while reusing the optimized outer product parallel module, significantly improving the execution efficiency of the bootstrapping process, thereby reducing the overall query latency.

[0059] For GPU optimization at the database level, since the main performance bottleneck in FHE-based SQL evaluation comes from homomorphic filtering operations, which involve a large number of ciphertext comparisons and logic gate operations, this invention proposes a two-level parallel execution framework that performs parallel optimization at both the operator and record levels, making full use of GPU resources. First, regarding operator-level parallelism, we designed a GPU-accelerated homomorphic comparison (… ) and logic gates ( The first step, through the integration of an optimized bootstrap acceleration module, significantly reduces the execution latency of these basic database operators. Secondly, regarding record-level parallelism, this invention proposes a CUDA-based concurrent execution model that distributes the predicate evaluation tasks of different encrypted records to multiple streams for parallel processing within a GPU streaming multiprocessor. This two-level parallel strategy fully utilizes the parallel computing power of the GPU, significantly improving GPU resource utilization and effectively reducing query processing time.

[0060] like Figure 2 As shown, this invention provides a GPU-accelerated fully homomorphic encrypted database query processing system. By combining fully homomorphic encryption (FHE) operations with database query execution, it significantly improves query processing efficiency while ensuring data privacy. Its working principle mainly consists of three stages: data preparation, query evaluation, and result processing. This process ensures that cloud data remains encrypted throughout the entire query process, thereby avoiding the risk of data leakage.

[0061] Specifically, the system includes:

[0062] The client is configured to encrypt plaintext data, upload it to the encrypted database on the cloud server, and simultaneously receive the encrypted query results returned by the cloud server and decrypt them to obtain the plaintext results.

[0063] The cloud server is configured to perform query operations on encrypted data in the encrypted database based on query requests sent by clients, and return the final encrypted query results. The encrypted database includes a fully homomorphic encryption layer and a database layer. The fully homomorphic encryption layer is configured to provide GPU-optimized homomorphic operator operations to support computationally intensive operations such as polynomial transformations, ciphertext outer products, or bootstrapping on the ciphertext data. The database layer is configured to provide GPU-optimized homomorphic filtering operations and a CUDA-based parallel execution model to support homomorphic filtering or homomorphic aggregation operations on the ciphertext data.

[0064] Furthermore, the client includes a key generation module, a data encryption module, a data upload module, and a data decryption module. The key generation module is configured to generate an FHE key, i.e., a secret key, using a dedicated SDK. The system is used to encrypt and decrypt data, with the key remaining only on the client side. The data encryption module is configured to encrypt plaintext data using the secret key, including encoding non-integer elements as integers (e.g., through hash / mapping encoding) and encrypting columns of each table. The data upload module is configured to store the encrypted data (ciphertext) in columnar format and upload it to an encrypted database on the cloud server. The data decryption module is used to decrypt the data after receiving the encrypted query results from the cloud server, using a secret key ( Decrypt the result and obtain the final plaintext. Return it to the user.

[0065] Furthermore, the fully homomorphic encryption layer includes a GPU-customized folded FFT (Fast Fourier Transform) parallel optimization module, a cross-thread block outer product parallel optimization module, and a GPU-friendly bootstrap expansion optimization module. Specifically, the GPU-customized folded FFT parallel optimization module is configured to process the ciphertext data using folded FFT, while simultaneously optimizing the folded FFT operation process in parallel using GPU memory hierarchy strategies, FFT expansion strategies, and butterfly unit fusion strategies. The cross-thread block outer product parallel optimization module is configured to optimize the outer product operation in parallel during the query process using cross-thread block outer product parallel strategies and kernel fusion strategies. The GPU-friendly bootstrap expansion optimization module is configured to optimize the bootstrap operation in parallel during the query process using a GPU-friendly bootstrap expansion strategy, while simultaneously balancing memory and computation.

[0066] Furthermore, the GPU-customized folded FFT parallel optimization module aims to address the bottleneck of polynomial operations in fully homomorphic encrypted databases. FFT, a fundamental operation frequently used in FHE database queries, plays a crucial role in polynomial multiplication and bootstrapping. To address this, this invention designs a GPU-customized folded FFT optimization strategy, thereby improving computational efficiency and reducing resource consumption.

[0067] Specifically, the GPU-customized folded FFT parallel optimization module includes a folded FFT optimization module, a GPU memory optimization module, an FFT unrolling module, and a butterfly unit fusion module. The folded FFT optimization module is configured to "fold" the input polynomial to obtain a complex polynomial and multiply it by a distortion factor to reduce the computational cost of the FFT. The GPU memory optimization module is configured to design a hierarchical structure for GPU memory to improve memory access and data stream reading efficiency. The FFT unrolling module is configured to unroll all stages of the FFT iteration process to reduce overall synchronization overhead. The butterfly unit fusion module is configured to fuse consecutive butterfly units and process them in a single thread by using vectorized memory types (e.g., uint4), reducing thread synchronization and memory access overhead.

[0068] Furthermore, the folded FFT optimization module is designed to improve the efficiency of FFT computation and reduce resource consumption.

[0069] Traditional FFT methods use an N-degree polynomial as input. Extended to a polynomial of degree 2N ( Then, a 2N-point iterative FFT calculation is performed. However, each iteration stage still involves complex floating-point operations and a large number of memory accesses, and each stage depends on the calculation results of the previous stage. This dependency leads to synchronization overhead and memory write-back, which greatly affects the overall performance. The calculation of each FFT stage must depend on two values ​​generated in the previous stage. These values ​​must be written back to memory and synchronized before the current stage's calculation thread uses them. Since registers are private, this write-back and synchronization pattern introduces significant overhead in each FFT stage, affecting the overall performance.

[0070] In this invention, a polynomial / vector of length N is "folded" to achieve this. Fold into a complex polynomial of length N / 2 , is represented as: ,in, express middle The real part coefficients, express middle The imaginary part coefficient, It is the imaginary unit.

[0071] By folding operations, the scale of FFT calculations is reduced, from the original N-point FFT calculation to N / 2 points, thereby effectively reducing the workload and hardware resource requirements.

[0072] After folding, the invention further employs a "twisting" step to transform the folded complex polynomial. Multiplying by a twist factor further optimizes computational performance. Through the "folding" and "twisting" steps, the computational cost of the FFT is reduced by half, effectively reducing computational workload and memory requirements.

[0073] Furthermore, the GPU memory optimization module is designed to further improve the efficiency of FFT calculations.

[0074] In this invention, the hierarchical design of GPU memory refers to storing the input polynomial in global memory as a contiguous and aligned array to match the order of FFT inputs. At the start of FFT computation, relevant data blocks are loaded into shared memory, thereby reducing latency. This layout makes memory access and data flow more efficient, enabling fast data reading and storage, and significantly reducing memory access latency.

[0075] Meanwhile, to further reduce memory access overhead, all twisting and twiddle tables are pre-computed and stored as contiguous arrays in global memory before computation. This allows for efficient lookup and reuse of these pre-computed values ​​across different thread blocks of the GPU.

[0076] Furthermore, since the FFT size in TFHE is relatively small (e.g., 1024 points), this invention expands all stages of the FFT iteration process through the FFT expansion module and applies a more fine-grained thread synchronization strategy.

[0077] During FFT computation, the span between the two inputs of each butterfly unit doubles in each stage. This means that the operation in the current stage depends on two values ​​calculated by different threads in the previous stage. For early stages (such as the Discrete Fourier Transform from 16 to 128 points), the distance between these two inputs is small enough to be exchanged within a warp. Therefore, this invention employs unfolding all FFT stages in the early stages and applying warp-level synchronization while the data exchange is still within the warp. In this way, the 1024-point FFT computation, which originally required nine block-level synchronizations, can be compressed into one block-level synchronization and five warp-level synchronization operations, thereby significantly reducing the overall synchronization overhead.

[0078] Furthermore, the butterfly unit fusion module is designed to further address the issues of low thread synchronization and memory access efficiency.

[0079] In the butterfly unit fusion module, by using vectorized memory types, consecutive butterfly units are combined and processed in a single thread, thereby reducing the overhead of thread synchronization and memory access. Specifically, by allocating four butterfly units to each thread, the initial stages of the FFT iteration process (2-point to 8-point DFT) can be computed directly in registers, thus avoiding the overhead of writing intermediate results back to shared memory and cross-stage synchronization. Figure 3 As shown, four consecutive butterfly units are processed within the same thread, eliminating two time-consuming synchronization steps, significantly reducing synchronization overhead and improving computational efficiency.

[0080] Furthermore, the cross-thread block outer product parallel optimization module addresses the bottleneck of homomorphic outer product operations in fully homomorphic encrypted databases by employing a cross-thread block outer product parallel strategy and kernel fusion technology to solve the resource limitation problem caused by the high-security parameter set in fully homomorphic encrypted databases.

[0081] The outer product operation is crucial in the bootstrapping process; it's used to perform homomorphic multiplication between RLWE and RGSW ciphertexts. An RGSW ciphertext can be viewed as a... A polynomial matrix, and an RLWE ciphertext can be decomposed into a polynomial matrix containing A vector of polynomials. The outer product is similar to matrix-vector multiplication, multiplying and summing the polynomials in the ciphertext to produce a new RLWE ciphertext. FFT is widely used to accelerate polynomial multiplication. The outer product operation involves a total of [number missing] polynomials. The computational latency is high due to the use of first-order IFFT, second-order FFT, and convolution and accumulation between multiple polynomials.

[0082] Based on this, in this embodiment, the cross-thread block outer product parallel optimization module includes a cross-thread block FFT parallel module and a kernel fusion module. The cross-thread block FFT parallel module is configured to allow each thread block to perform one FFT, with all thread blocks operating independently and having their own shared memory. The kernel fusion module is configured to employ lock-free inter-thread block synchronization technology, merging the entire outer product calculation into a single kernel through kernel fusion to achieve inter-thread block collaboration and data consistency, thereby fusing the outer product calculation into a single kernel.

[0083] Existing GPU-accelerated fully homomorphic encryption work improves the efficiency of outer product operations by executing multiple FFTs in parallel within a single thread block (i.e., cross-thread batch FFT). However, as security parameters increase, the use of a single thread block leads to performance degradation due to shared memory limitations and register overflows. To overcome the resource limitations of single-thread blocks, this invention proposes a cross-thread block FFT parallelism. In this method, each thread block executes one FFT, and all thread blocks operate independently and have their own shared memory, thus enabling the parallel execution of multiple FFTs without efficiency loss. Figure 4 As shown, we first start Each thread block decomposes the RLWE ciphertext and performs an IFFT in parallel within each block. Next, it calculates a pointwise product with the RGSW ciphertext to generate intermediate results. Finally, these intermediate results are summed across the two thread blocks and ultimately converted back to the RLWE ciphertext using an FFT.

[0084] This cross-thread block batch FFT method eliminates the performance bottleneck in traditional methods. By allowing multiple thread blocks to process FFT calculations in parallel, it solves the limitations of memory access and resource allocation, and can efficiently perform outer product operations at a high level of security.

[0085] While cross-thread block batch FFT offers significant performance advantages, CUDA does not support native inter-thread block synchronization, meaning the scheduling and execution order between thread blocks are not guaranteed. Therefore, synchronization is required before polynomial accumulation. To avoid this problem, the traditional approach is to split the outer product operation into two kernels. The first kernel writes the intermediate convolution results back to global memory, and the second kernel loads these results for accumulation. This method requires multiple kernel startups and data transfers, resulting in unnecessary global memory round trips.

[0086] To address this issue, this invention employs lock-free inter-thread block synchronization technology, merging the entire outer product calculation into a single kernel through kernel fusion. By using lock-free primitives, thread blocks can coordinate their work on the device, preserving intermediate results in shared memory or registers as much as possible, thereby eliminating additional write-back and reload operations. This not only avoids redundant data transmission but also improves computational efficiency, significantly reducing kernel startup times and global memory access frequency.

[0087] Furthermore, a GPU-friendly bootstrap expansion optimization module is included to address the computational bottleneck of bootstrap operations in fully homomorphic encrypted databases.

[0088] As in the formula As shown, during the bootstrapping process, n homomorphic outer product operations with strict serial dependencies are required to compute homomorphic operations. Because the inputs and outputs of each outer product operation have data dependencies, they cannot be executed in parallel, resulting in underutilization of GPU resources and severely limiting the efficiency of parallel computing.

[0089] (1)

[0090] Therefore, in this embodiment, the GPU-friendly bootstrap unpacking optimization module includes a bootstrap unpacking optimization module and a memory and computation trade-off module. The bootstrap unpacking optimization module is configured to simultaneously pre-compute several items in the bootstrap computation and store them as intermediate results and corresponding key bundles to reduce the number of iterations. The memory and computation trade-off module is configured to balance pre-compute and key bundles to find the optimal balance between computational complexity, memory usage, and throughput.

[0091] Specifically, to alleviate the inefficiency caused by the sequential nature of the bootstrapping process, this invention explores bootstrapping expansion techniques on GPUs. By processing multiple terms (e.g., m terms) simultaneously in each computation, the number of iterations is reduced to [missing information]. For example, the present invention can calculate multiple terms in the i-th iteration using the following formula:

[0092]

[0093] (2)

[0094] These encryption combinations are pre-computed and stored as intermediate results:

[0095] (3)

[0096] (4)

[0097] (5)

[0098] (6)

[0099] This invention can reduce the sequential outer product operation to n / 2 times ( (Time). In this way, the bootstrap process, which originally required numerous iterations, can be significantly reduced in computation, improving the parallel computing efficiency of the GPU:

[0100] (7)

[0101] Effectively deploying bootstrap unrolling techniques on GPUs requires precise management of their inherent overhead. When applying this technique ( This requires pre-compiling and storing key packets, which are 1.5 times the size of the original bootstrap key. Furthermore, GPU memory must be allocated for each bootstrap kernel to store the corresponding... Although a more radical self-bootstrapping development ( Theoretically, the sequential outer product can be reduced to... However, it will exponentially increase the number of items in each key packet. This increase in complexity leads to... The computational overhead increases significantly, and GPU memory consumption also rises sharply, thus offsetting the runtime improvements. In one implementation, select... It can achieve the best balance between computational complexity, memory usage and throughput.

[0102] Furthermore, addressing the bottleneck in the fully homomorphic encrypted database query process, this invention aims to perform parallel processing at both the operator and record levels through two-level parallelism and scheduling optimization at the database layer, thereby fully utilizing GPU resources and significantly improving the overall efficiency of query processing.

[0103] In this embodiment, the database layer includes an operator-level parallel module and a record-level parallel module. The operator-level parallel module is configured to integrate the optimized bootstrap kernel from the fully homomorphic encryption layer into homomorphic logic gates and homomorphic comparison operations. By leveraging the powerful computing capabilities of the GPU, the execution latency of homomorphic comparisons and logic gates is significantly reduced, resulting in a substantial improvement in query response speed. The record-level parallel module is configured to divide different records in the data table into multiple non-overlapping blocks. It utilizes the GPU's streaming multiprocessor to process the homomorphic filtering operations of different record blocks in parallel, thereby improving the utilization of GPU resources.

[0104] Operator-level parallelism focuses on accelerating individual operations, but because these operators have small kernel functions, much of the GPU's streaming multiprocessor may be idle. In contrast, homomorphic filtering and logical aggregation operations (e.g.) , , Homomorphic filtering operations are well-suited for parallel execution because they can apply the same predicate to independent rows. To this end, we divide the records in the data table into multiple non-overlapping blocks, each assigned to an independent CUDA stream for execution. Each stream processes different record blocks in parallel, and the hardware scheduler automatically overlaps global memory transfers and computations, effectively hiding memory access latency. This parallel execution model allows each GPU's streaming processor to process homomorphic filtering operations on different record blocks in parallel, avoiding idle computing resources and improving GPU resource utilization.

[0105] Figure 5 This workflow demonstrates how predicates for different record blocks are evaluated in parallel across multiple streaming processors, achieving parallel processing at both the operator and record levels. In this way, GPUs can perform parallel computations at both the operator and record levels when processing large-scale encrypted data, significantly improving query processing efficiency and reducing query execution time.

[0106] Furthermore, in this embodiment, the cloud server evaluates the key ( Query operations are performed on the encrypted data, and all computations are completed on the ciphertext. The evaluation key is held only on the cloud server, and it includes the bootstrap key (…). ) and key switching key ( ).

[0107] Specifically, the cloud server includes a homomorphic filtering module and a homomorphic aggregation module. The homomorphic filtering module is configured to use an evaluation key (…). The filtering columns in the ciphertext database are processed through parallel computing, and multiple encryption condition comparison operations are performed to generate the filtering results. The homomorphic aggregation module is configured to be based on the filtering results. Homomorphic aggregation is performed on the selected rows to calculate the final encryption result. The homomorphic filtering phase utilizes CUDA streaming to concurrently perform predicate evaluation, thereby significantly improving query execution speed.

[0108] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A GPU-accelerated fully homomorphic encrypted database query processing system, characterized in that, include: The client is configured to encrypt plaintext data and upload it to an encrypted database on the cloud server side, while receiving encrypted query results returned by the cloud server and decrypting them to obtain plaintext results; The cloud server is configured to perform query operations on the encrypted data in the encrypted database based on the query request sent by the client, and return the final encrypted query result; The encrypted database includes a fully homomorphic encryption layer and a database layer. The fully homomorphic encryption layer is configured to provide GPU-optimized homomorphic operator operations to support polynomial transformations, ciphertext outer products, or bootstrapping operations on ciphertext data. The database layer is configured to provide GPU-optimized homomorphic filtering operations and a CUDA-based parallel execution model to support homomorphic filtering or homomorphic aggregation operations on ciphertext data. The fully homomorphic encryption layer includes a GPU-customized folded FFT parallel optimization module, a cross-thread block outer product parallel optimization module, and a GPU-friendly bootstrap expansion optimization module. The GPU-customized folded FFT parallel optimization module is configured to process ciphertext data using folded FFT, while simultaneously optimizing the folded FFT operation process in parallel using GPU memory hierarchy strategy, FFT unfolding strategy and butterfly unit fusion strategy. The cross-thread block outer product parallel optimization module is configured to perform parallel optimization of the outer product operation in the query process using a cross-thread block outer product parallel strategy and a kernel fusion strategy. The GPU-friendly bootstrap unrolling optimization module is configured to use a GPU-friendly bootstrap unrolling strategy to perform parallel optimization of the bootstrap operation during the query process. The GPU-customized folded FFT parallel optimization module includes a folded FFT optimization module, a GPU memory optimization module, an FFT unfolding module, and a butterfly unit fusion module. The folded FFT optimization module is configured to "fold" the input polynomial to obtain a complex polynomial and multiply it by a distortion factor to reduce the computational cost of the FFT. The GPU memory optimization module is configured to perform hierarchical design of GPU memory to improve memory access and data stream reading efficiency. The FFT unrolling module is configured to unroll all stages of the FFT iteration process to reduce overall synchronization overhead. The butterfly unit fusion module is configured to fuse consecutive butterfly units and process them in a single thread by using vectorized memory types, thereby reducing thread synchronization and memory access overhead.

2. The GPU-accelerated fully homomorphic encrypted database query processing system as described in claim 1, characterized in that, The client includes a key generation module, a data encryption module, a data upload module, and a data decryption module; The key generation module is configured to generate a secret key via a dedicated SDK, and the secret key is stored only on the client side; The data encryption module is configured to encrypt plaintext data using a secret key, including encoding non-integer elements into integers using a preset encoding method and encrypting the columns of each table; The data upload module is configured to store encrypted data in columnar format and upload it to an encrypted database on the cloud server side; The data decryption module is used to decrypt the encrypted query results returned by the cloud server using a secret key, and then return the final plaintext result to the user.

3. The GPU-accelerated fully homomorphic encrypted database query processing system as described in claim 1, characterized in that, The folded FFT optimization module "folds" the input polynomial to obtain a complex polynomial, meaning: The original polynomial of length N Fold into a complex polynomial of length N / 2 Its coefficient is expressed as: ,in, express middle Term coefficient, The imaginary unit, and They represent middle and Term coefficient.

4. The GPU-accelerated fully homomorphic encrypted database query processing system as described in claim 1, characterized in that, The GPU memory optimization module performs a hierarchical structure design for GPU memory, which means: The input polynomials are stored in global memory as contiguous and aligned arrays to match the order of the FFT inputs; At the same time, all distortion factor tables and rotation factor tables are pre-calculated and stored as contiguous arrays in global memory before calculation.

5. The GPU-accelerated fully homomorphic encrypted database query processing system as described in claim 1, characterized in that, The cross-thread block outer product parallel optimization module includes a cross-thread block FFT parallel module and a kernel fusion module; The cross-thread block FFT parallel module is configured to allow each thread block to perform one FFT, and all thread blocks operate independently and have their own shared memory. The kernel fusion module is configured to use lock-free thread block synchronization technology to merge the entire outer product calculation into a single kernel through kernel fusion, so as to achieve inter-thread block collaboration and data consistency, thereby merging the outer product calculation into a single kernel.

6. The GPU-accelerated fully homomorphic encrypted database query processing system as described in claim 1, characterized in that, The GPU-friendly bootstrap unpacking optimization module includes a bootstrap unpacking optimization module and a memory and computation tradeoff module; The bootstrap expansion optimization module is configured to simultaneously pre-calculate several items in the bootstrap computation and store them as intermediate results and corresponding key packets. The memory and computation trade-off module is configured to find the optimal balance between computational complexity, memory usage, and throughput based on pre-calculated complexity and key packet memory usage.

7. The GPU-accelerated fully homomorphic encrypted database query processing system as described in claim 1, characterized in that, The database layer includes an operator-level parallel module and a record-level parallel module; The operator-level parallel module is configured to integrate the optimized bootstrap kernel in the fully homomorphic encryption layer into homomorphic logic gates and homomorphic comparison operations; The record-level parallel module is configured to divide different records in the data table into multiple non-overlapping blocks, and utilize the GPU's streaming multiprocessor to process the homomorphic filtering operations of different record blocks in parallel, thereby improving the utilization of GPU resources.

8. The GPU-accelerated fully homomorphic encrypted database query processing system as described in claim 1, characterized in that, The cloud server also includes a homomorphic filtering module and a homomorphic aggregation module; The homomorphic filtering module is configured to use an evaluation key to process the filtering columns in the ciphertext database through parallel computation, perform comparison operations on multiple encryption conditions, and generate filtering results. The homomorphic aggregation module is configured to perform homomorphic aggregation on the filtered rows based on the filtering results, and calculate the final encrypted query result.