Medical data security reasoning method and system based on hardware collaboration
Through the collaborative work of the encryption card, GPU and CPU, the DMA engine and encryption and decryption module of the encryption card are used for data encryption and decryption, and the inference calculation of the deep learning model is carried out through the GPU, which solves the problem of security risks in the transmission and processing of medical data, and realizes efficient and secure data transmission and processing.
Patent Information
- Application Number
- CN202510221593.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2025-03-28
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
There are security risks in the transmission and processing of medical data, especially plain text data is easily leaked or tampered during CPU processing. The existing encryption technology encrypts and decrypts on the CPU, increasing the CPU burden and may lead to data exposure.
The medical data security reasoning method based on hardware collaboration is adopted, through the collaborative work of the encryption card, GPU and CPU, the data is encrypted and decrypted using the DMA engine and encryption and decryption module of the encryption card, and the inference calculation of the deep learning model is carried out through the GPU to ensure that the data is transmitted and processed in ciphertext throughout the process.
It effectively protects the security of medical data during transmission and processing, avoids data transmission through the CPU, reduces the risk of privacy leakage, and improves the efficiency of data transmission and processing.
Smart Images

Figure CN119721260A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of deep learning technology, and specifically to a medical data security reasoning method and system based on hardware collaboration. Background Art
[0002] In recent years, deep learning technology has made significant progress in the medical field, providing powerful tools for disease diagnosis, medical image analysis, etc. However, medical data often contains sensitive information of patients, such as personal health status, medical records, etc., and the security and privacy of data are of vital importance. In traditional deep learning reasoning systems, data is often stored and transmitted in plain text, which is easy to be leaked or tampered with during transmission and processing. Especially when the data is processed by the CPU, the plain text data may be accessed by malware or unauthorized users, thereby causing the risk of privacy leakage. In addition, although existing encryption technology can protect data to a certain extent, it usually requires encryption and decryption operations on the CPU, which not only increases the burden on the CPU, but also may cause data exposure risks during the encryption and decryption process.
[0003] The security of medical data during data transmission and data processing is a technical issue that needs to be solved. Summary of the invention
[0004] The technical task of the present invention is to address the above deficiencies and provide a medical data security reasoning method and system based on hardware collaboration to solve the technical problem of the security of medical data during data transmission and data processing.
[0005] In a first aspect, the present invention provides a medical data security reasoning method based on hardware collaboration, which is applied between an encryption card, a GPU and a CPU, wherein the GPU is connected to the encryption card via PCIE, and the encryption card and the GPU are both connected to the CPU via a bus, comprising the following steps: Initialization: The administrator generates a digital certificate through the encryption card user management system, writes the digital certificate and the corresponding key into a new Ukey, and sends the Ukey to the user; Data encryption: Based on the encryption algorithm selected by the user, the original plaintext data is encrypted through the encryption and decryption module of the encryption card to obtain the ciphertext; Data transmission processing: The user logs in to the encryption card user system through Ukey, starts the application, and performs the following through the application: read the ciphertext through the encryption card's DMA engine, decrypt the read ciphertext through the encryption card's encryption and decryption module, transfer the decrypted data to the GPU memory through the encryption card's DMA engine, perform inference calculations on the decrypted data based on the GPU's parallel computing capability and the deep learning model built into the GPU memory to obtain the inference calculation results, read the inference calculation results in the GPU memory through the encryption card's DMA engine, encrypt the inference calculation results through the encryption card's encryption and decryption module, and send the encrypted inference calculation results to the user through the encryption card's DMA engine.
[0006] Preferably, the encryption algorithms selected by the user include national encryption algorithms and international standard encryption algorithms. National encryption algorithms include SM1, SM2, SM3 and SM4, and international standard encryption algorithms include DES, 3DES, AES, RSA and SHA.
[0007] Preferably, the application program includes a user program for memory management and computing scheduling control and a driver responsible for data transmission and encryption and decryption processes; The user program is used to perform the following operations: Load the deep learning model into GPU memory; Apply for two GPU memories, one of which is used to store the model input data of the deep learning model, and the other is used to store the inference calculation results of the deep learning model, and set the memory pointer to the CU_POINTER_ATTRIBUTE_SYNC_MEMOPS type so that the DMA engine of the encryption card can safely and synchronously transfer data between the encryption card and the GPU memory; The driver is called, and the DMA engine of the encryption card reads the ciphertext, decrypts the ciphertext through the encryption card encryption and decryption module, and transmits the decrypted data to the address of the model input data in the GPU video memory through the DMA engine of the encryption card; Start the calculation process of the deep learning model, which runs in the GPU memory; After the deep learning model performs inference calculation based on the decrypted data, the user program calls the driver again, and the DMA engine of the encryption card reads the inference calculation result in the GPU video memory, encrypts the inference calculation result through the encryption and decryption module of the DMA, and returns the encrypted inference calculation result to the user through the DMA engine of the encryption card; Correspondingly, the driver is used to perform the following operations: A Ring buffer is allocated in the encryption card memory. The Ring buffer is used to decouple the data transmission of the DMA engine and the calculation of the encryption and decryption module, so that data transmission and encryption and decryption do not need to be performed synchronously. After receiving the GPU memory virtual address passed in by the user program, the driver uses the nvidia_p2p_get_pages and nvidia_p2p_dma_mapping interfaces provided in the NVIDIA kernel driver to map the address to a physical address accessible by DMA; After the user program initiates the transfer command, DMA data transmission and encryption and decryption start running synchronously. DMA data transmission is realized by triggering an interrupt by enabling the corresponding flag bit of the register, which includes: transferring the ciphertext data to the Ring buffer, transferring the decrypted data from the Ring buffer to the GPU memory, transferring the inference calculation results from the GPU memory to the Ring buffer, and transferring the encrypted inference calculation results from the Ring buffer to the user. The encryption and decryption process runs in another thread. The thread used to run encryption and decryption polls the Ring buffer data block, determines the processing stage by querying the corresponding flag of the data, and then triggers an interrupt to start the encryption and decryption calculation by enabling the corresponding flag bit of the encryption and decryption module register.
[0008] Preferably, the deep learning model is a model built based on the ONNX framework, Pytorch framework, TensorFlow framework or other frameworks.
[0009] In a second aspect, the present invention provides a medical data security reasoning system based on hardware collaboration, which is used to implement medical data security reasoning through a medical data security reasoning method based on hardware collaboration as described in any one of the first aspects, wherein the system includes an encryption card, a GPU, and an encryption card user management system, wherein the GPU is connected to the encryption card via PCIE, and the encryption card and the GPU are both connected to the CPU via a bus; The user management system is used to support administrators to generate digital certificates, write digital certificates and corresponding keys into a new Ukey, and send the Ukey to users; The encryption and decryption module of the encryption card is used to encrypt the original plaintext data based on the encryption algorithm selected by the user to obtain the ciphertext; The user logs in to the encryption card user system through Ukey, starts the application, and performs the following through the application: read the ciphertext through the encryption card's DMA engine, decrypt the read ciphertext through the encryption card's encryption and decryption module, transfer the decrypted data to the GPU memory through the encryption card's DMA engine, perform inference calculations on the decrypted data based on the GPU's parallel computing capability and through the deep learning model built into the GPU memory to obtain the inference calculation results, read the inference calculation results in the GPU memory through the encryption card's DMA engine, encrypt the inference calculation results through the encryption card's encryption and decryption module, and send the encrypted inference calculation results to the user through the encryption card's DMA engine.
[0010] Preferably, the encryption algorithms selected by the user include national encryption algorithms and international standard encryption algorithms. National encryption algorithms include SM1, SM2, SM3 and SM4, and international standard encryption algorithms include DES, 3DES, AES, RSA and SHA.
[0011] Preferably, the application program includes a user program for memory management and computing scheduling control and a driver responsible for data transmission and encryption and decryption processes; The user program is used to perform the following operations: Load the deep learning model into GPU memory; Apply for two GPU memories, one of which is used to store the model input data of the deep learning model, and the other is used to store the inference calculation results of the deep learning model, and set the memory pointer to the CU_POINTER_ATTRIBUTE_SYNC_MEMOPS type so that the DMA engine of the encryption card can safely and synchronously transfer data between the encryption card and the GPU memory; The driver is called, and the DMA engine of the encryption card reads the ciphertext, decrypts the ciphertext through the encryption card encryption and decryption module, and transmits the decrypted data to the address of the model input data in the GPU video memory through the DMA engine of the encryption card; Start the calculation process of the deep learning model, which runs in the GPU memory; After the deep learning model performs inference calculation based on the decrypted data, the user program calls the driver again, and the DMA engine of the encryption card reads the inference calculation result in the GPU video memory, encrypts the inference calculation result through the encryption and decryption module of the DMA, and returns the encrypted inference calculation result to the user through the DMA engine of the encryption card; Correspondingly, the driver is used to perform the following operations: A Ring buffer is allocated in the encryption card memory. The Ring buffer is used to decouple the data transmission of the DMA engine and the calculation of the encryption and decryption module, so that data transmission and encryption and decryption do not need to be performed synchronously. After receiving the GPU memory virtual address passed in by the user program, the driver uses the nvidia_p2p_get_pages and nvidia_p2p_dma_mapping interfaces provided in the NVIDIA kernel driver to map the address to a physical address accessible by DMA; After the user program initiates the transfer command, DMA data transmission and encryption and decryption start running synchronously. DMA data transmission is realized by triggering an interrupt by enabling the corresponding flag bit of the register, which includes: transferring the ciphertext data to the Ring buffer, transferring the decrypted data from the Ring buffer to the GPU memory, transferring the inference calculation results from the GPU memory to the Ring buffer, and transferring the encrypted inference calculation results from the Ring buffer to the user. The encryption and decryption process runs in another thread. The thread used to run encryption and decryption polls the Ring buffer data block, determines the processing stage by querying the corresponding flag of the data, and then triggers an interrupt to start the encryption and decryption calculation by enabling the corresponding flag bit of the encryption and decryption module register.
[0012] Preferably, the deep learning model is a model built based on the ONNX framework, Pytorch framework, TensorFlow framework or other frameworks.
[0013] The medical data security reasoning method and system based on hardware collaboration of the present invention have the following advantages: 1. The ciphertext data input by the user is directly read through the DMA engine of the encryption card, and the hardware decryption function of the encryption card is used to decrypt the data. The decrypted data is directly transmitted to the GPU memory through the DMA engine, avoiding the data passing through the CPU or other potential attack surfaces during the transmission process, thus ensuring the security of the data; 2. The inference calculation is completed by the parallel computing capability of the GPU, supporting a variety of deep learning frameworks (such as ONNX, Pytorch, TensorFlow, etc.). The calculation results are read and encrypted by the DMA engine of the encryption card and returned to the user, protecting the user's privacy in ciphertext throughout the process; 3. User identity authentication and key management are performed through Ukey, supporting multiple encryption algorithms (such as national encryption SM1-SM4, international standard DES, 3DES, AES, RSA, SHA, etc.), and using Ring buffer to optimize data transmission efficiency and ensure the security of data transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0015] The present invention is further described below in conjunction with the accompanying drawings.
[0016] Figure 1 This is a flowchart of a medical data security reasoning method based on hardware collaboration in Example 1. DETAILED DESCRIPTION
[0017] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it. However, the embodiments are not intended to limit the present invention. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments may be combined with each other.
[0018] The embodiments of the present invention provide a medical data security reasoning method and system based on hardware collaboration, which are used to solve the technical problem of the security of medical data during data transmission and data processing.
[0019] Embodiment 1:
[0020] The present invention discloses a medical data security reasoning method based on hardware collaboration, which is applied between an encryption card, a GPU and a CPU. The GPU is connected to the encryption card via PCIE, and both the encryption card and the GPU are connected to the CPU via a bus. The method includes three steps: initialization, data encryption and data transmission processing.
[0021] Step S100 initialization: The administrator generates a digital certificate through the encryption card user management system, writes the digital certificate and the corresponding key into a new Ukey, and sends the Ukey to the user.
[0022] In this embodiment, the administrator logs in to the encryption card user management system, generates a digital certificate according to user needs, writes the digital certificate and the corresponding key pair into a new Ukey, and then issues the Ukey to the user. The Ukey is used for user identity authentication and key management to ensure that the user has legal authorization for data encryption and decryption operations.
[0023] Step S200 Data encryption: Based on the encryption algorithm selected by the user, the original plaintext data is encrypted by the encryption and decryption module of the encryption card to obtain ciphertext.
[0024] In this embodiment, the encryption algorithms selected by the user include national encryption algorithms and international standard encryption algorithms. National encryption algorithms include SM1, SM2, SM3 and SM4, and international standard encryption algorithms include DES, 3DES, AES, RSA and SHA. Users select appropriate encryption algorithms based on data security requirements to ensure data security during storage and transmission.
[0025] Step S300 data transmission processing: the user logs in to the encryption card user system through Ukey, starts the application, and executes the following through the application: read the ciphertext through the DMA engine of the encryption card, decrypt the read ciphertext through the encryption card's encryption and decryption module, transfer the decrypted data to the GPU memory through the DMA engine of the encryption card, perform inference calculation on the decrypted data based on the parallel computing capability of the GPU and the deep learning model built into the GPU memory to obtain the inference calculation result, read the inference calculation result in the GPU memory through the DMA engine of the encryption card, encrypt the inference calculation result through the encryption and decryption module of the encryption card, and send the encrypted inference calculation result to the user through the DMA engine of the encryption card.
[0026] In this embodiment, the application program includes a user program for memory management and computing scheduling control and a driver program responsible for data transmission and encryption and decryption processes.
[0027] As a specific implementation, the user program is used to perform the following operations: (1) Load the deep learning model into GPU memory; (2) Apply for two GPU memories, one of which is used to store the model input data of the deep learning model, and the other is used to store the inference calculation results of the deep learning model, and set the memory pointer to the CU_POINTER_ATTRIBUTE_SYNC_MEMOPS type so that the DMA engine of the encryption card can safely and synchronously transfer data between the encryption card and the GPU memory; (3) Call the driver, the DMA engine of the encryption card reads the ciphertext, decrypts the ciphertext through the encryption card encryption and decryption module, and transmits the decrypted data to the address of the model input data in the GPU video memory through the DMA engine of the encryption card; (4) Start the calculation process of the deep learning model, and the deep learning model runs in the GPU memory; (5) After the deep learning model performs inference calculations based on the decrypted data, the user program calls the driver again, and the DMA engine of the encryption card reads the inference calculation results in the GPU video memory. After the inference calculation results are encrypted by the DMA encryption and decryption module, the encrypted inference calculation results are returned to the user through the DMA engine of the encryption card.
[0028] Correspondingly, the driver is used to perform the following operations: (1) Allocate a Ring buffer in the encryption card memory. The Ring buffer is used to decouple the data transmission of the DMA engine and the calculation of the encryption and decryption module, so that data transmission and encryption and decryption do not need to be performed synchronously; (2) After the driver receives the GPU memory virtual address passed in by the user program, it uses the nvidia_p2p_get_pages and nvidia_p2p_dma_mapping interfaces provided in the NVIDIA kernel driver to map the address to a physical address accessible by DMA; (3) After the user program initiates the transfer command, DMA data transfer and encryption and decryption are started synchronously. DMA data transfer is achieved by triggering an interrupt through the corresponding flag bit of the enable register, which includes: transferring ciphertext data to the Ring buffer, transferring decrypted data from the Ring buffer to the GPU memory, transferring the inference calculation results from the GPU memory to the Ring buffer, and transferring the encrypted inference calculation results from the Ring buffer to the user. The encryption and decryption process is run in another thread. The thread used to run encryption and decryption polls the Ring buffer data block, determines the processing stage by querying the corresponding flag of the data, and then triggers an interrupt to start the encryption and decryption calculation by enabling the corresponding flag bit of the encryption and decryption module register.
[0029] Embodiment 2:
[0030] The present invention discloses a medical data security reasoning system based on hardware collaboration, comprising an encryption card, a GPU and an encryption card user management system. The GPU is connected to the encryption card via PCIE, and both the encryption card and the GPU are connected to the CPU via a bus.
[0031] The user management system is used to support administrators to generate digital certificates, write digital certificates and corresponding keys into a new Ukey, and send the Ukey to the user.
[0032] In this embodiment, the administrator logs in to the encryption card user management system, generates a digital certificate according to user needs, writes the digital certificate and the corresponding key pair into a new Ukey, and then issues the Ukey to the user. The Ukey is used for user identity authentication and key management to ensure that the user has legal authorization for data encryption and decryption operations.
[0033] The encryption and decryption module of the encryption card is used to encrypt the original plaintext data based on the encryption algorithm selected by the user to obtain the ciphertext.
[0034] In this embodiment, the encryption algorithms selected by the user include national encryption algorithms and international standard encryption algorithms. National encryption algorithms include SM1, SM2, SM3 and SM4, and international standard encryption algorithms include DES, 3DES, AES, RSA and SHA. Users select appropriate encryption algorithms based on data security requirements to ensure data security during storage and transmission.
[0035] The user logs in to the encryption card user system through Ukey, starts the application, and performs the following through the application: read the ciphertext through the encryption card's DMA engine, decrypt the read ciphertext through the encryption card's encryption and decryption module, transfer the decrypted data to the GPU memory through the encryption card's DMA engine, perform inference calculations on the decrypted data based on the GPU's parallel computing capability and through the deep learning model built into the GPU memory to obtain the inference calculation results, read the inference calculation results in the GPU memory through the encryption card's DMA engine, encrypt the inference calculation results through the encryption card's encryption and decryption module, and send the encrypted inference calculation results to the user through the encryption card's DMA engine.
[0036] In this embodiment, the application program includes a user program for memory management and computing scheduling control and a driver program responsible for data transmission and encryption and decryption processes.
[0037] As a specific implementation, the user program is used to perform the following operations: (1) Load the deep learning model into GPU memory; (2) Apply for two GPU memories, one of which is used to store the model input data of the deep learning model, and the other is used to store the inference calculation results of the deep learning model, and set the memory pointer to the CU_POINTER_ATTRIBUTE_SYNC_MEMOPS type so that the DMA engine of the encryption card can safely and synchronously transfer data between the encryption card and the GPU memory; (3) Call the driver, the DMA engine of the encryption card reads the ciphertext, decrypts the ciphertext through the encryption card encryption and decryption module, and transmits the decrypted data to the address of the model input data in the GPU video memory through the DMA engine of the encryption card; (4) Start the calculation process of the deep learning model, and the deep learning model runs in the GPU memory; (5) After the deep learning model performs inference calculations based on the decrypted data, the user program calls the driver again, and the DMA engine of the encryption card reads the inference calculation results in the GPU video memory. After the inference calculation results are encrypted by the DMA encryption and decryption module, the encrypted inference calculation results are returned to the user through the DMA engine of the encryption card.
[0038] Correspondingly, the driver is used to perform the following operations: (1) Allocate a Ring buffer in the encryption card memory. The Ring buffer is used to decouple the data transmission of the DMA engine and the calculation of the encryption and decryption module, so that data transmission and encryption and decryption do not need to be performed synchronously; (2) After the driver receives the GPU memory virtual address passed in by the user program, it uses the nvidia_p2p_get_pages and nvidia_p2p_dma_mapping interfaces provided in the NVIDIA kernel driver to map the address to a physical address accessible by DMA; (3) After the user program initiates the transfer command, DMA data transfer and encryption and decryption are started synchronously. DMA data transfer is achieved by triggering an interrupt through the corresponding flag bit of the enable register, which includes: transferring ciphertext data to the Ring buffer, transferring decrypted data from the Ring buffer to the GPU memory, transferring the inference calculation results from the GPU memory to the Ring buffer, and transferring the encrypted inference calculation results from the Ring buffer to the user. The encryption and decryption process is run in another thread. The thread used to run encryption and decryption polls the Ring buffer data block, determines the processing stage by querying the corresponding flag of the data, and then triggers an interrupt to start the encryption and decryption calculation by enabling the corresponding flag bit of the encryption and decryption module register.
[0039] The above is a detailed introduction to the medical data security reasoning method and system based on hardware collaboration provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the ideas of the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A medical data security reasoning method based on hardware collaboration, characterized in that: Applied between the encryption card, GPU and CPU, the GPU is connected to the encryption card through PCIE, and the encryption card and GPU are connected to the CPU through the bus, including the following steps: Initialization: The administrator generates a digital certificate through the encryption card user management system, writes the digital certificate and the corresponding key into a new Ukey, and sends the Ukey to the user; Data encryption: Based on the encryption algorithm selected by the user, the original plaintext data is encrypted through the encryption and decryption module of the encryption card to obtain the ciphertext; Data transmission processing: The user logs in to the encryption card user system through Ukey, starts the application, and performs the following through the application: read the ciphertext through the encryption card's DMA engine, decrypt the read ciphertext through the encryption card's encryption and decryption module, transfer the decrypted data to the GPU memory through the encryption card's DMA engine, perform inference calculations on the decrypted data based on the GPU's parallel computing capability and the deep learning model built into the GPU memory to obtain the inference calculation results, read the inference calculation results in the GPU memory through the encryption card's DMA engine, encrypt the inference calculation results through the encryption card's encryption and decryption module, and send the encrypted inference calculation results to the user through the encryption card's DMA engine.
2. The medical data security reasoning method based on hardware collaboration according to claim 1 is characterized in that: The encryption algorithms selected by users include national encryption algorithms and international standard encryption algorithms. National encryption algorithms include SM1, SM2, SM3 and SM4, and international standard encryption algorithms include DES, 3DES, AES, RSA and SHA.
3. The medical data security reasoning method based on hardware collaboration according to claim 1 is characterized in that: The application includes user programs for memory management and computing scheduling control, as well as drivers responsible for data transmission and encryption and decryption processes; The user program is used to perform the following operations: Load the deep learning model into GPU memory; Apply for two GPU memories, one of which is used to store the model input data of the deep learning model, and the other is used to store the inference calculation results of the deep learning model, and set the memory pointer to the CU_POINTER_ATTRIBUTE_SYNC_MEMOPS type so that the DMA engine of the encryption card can safely and synchronously transfer data between the encryption card and the GPU memory; The driver is called, and the DMA engine of the encryption card reads the ciphertext, decrypts the ciphertext through the encryption card encryption and decryption module, and transmits the decrypted data to the address of the model input data in the GPU video memory through the DMA engine of the encryption card; Start the calculation process of the deep learning model, which runs in the GPU memory; After the deep learning model performs inference calculation based on the decrypted data, the user program calls the driver again, and the DMA engine of the encryption card reads the inference calculation result in the GPU video memory, encrypts the inference calculation result through the encryption and decryption module of the DMA, and returns the encrypted inference calculation result to the user through the DMA engine of the encryption card; Correspondingly, the driver is used to perform the following operations: A Ring buffer is allocated in the encryption card memory. The Ring buffer is used to decouple the data transmission of the DMA engine and the calculation of the encryption and decryption module, so that data transmission and encryption and decryption do not need to be performed synchronously. After receiving the GPU memory virtual address passed in by the user program, the driver uses the nvidia_p2p_get_pages and nvidia_p2p_dma_mapping interfaces provided in the NVIDIA kernel driver to map the address to a physical address accessible by DMA; After the user program initiates the transfer command, DMA data transmission and encryption and decryption start running synchronously. DMA data transmission is realized by triggering an interrupt by enabling the corresponding flag bit of the register, which includes: transferring the ciphertext data to the Ring buffer, transferring the decrypted data from the Ring buffer to the GPU memory, transferring the inference calculation results from the GPU memory to the Ring buffer, and transferring the encrypted inference calculation results from the Ring buffer to the user. The encryption and decryption process runs in another thread. The thread used to run encryption and decryption polls the Ring buffer data block, determines the processing stage by querying the corresponding flag of the data, and then triggers an interrupt to start the encryption and decryption calculation by enabling the corresponding flag bit of the encryption and decryption module register.
4. The medical data security reasoning method based on hardware collaboration according to claim 3 is characterized in that: The deep learning model is a model built based on the ONNX framework, Pytorch framework, TensorFlow framework, or other frameworks.
5. A medical data security reasoning system based on hardware collaboration, characterized in that: Used to realize secure reasoning of medical data through a medical data security reasoning method based on hardware collaboration as described in any one of claims 1 to 4, the system includes an encryption card, a GPU and an encryption card user management system, the GPU is connected to the encryption card through PCIE, and the encryption card and the GPU are both connected to the CPU through a bus; The user management system is used to support administrators to generate digital certificates, write digital certificates and corresponding keys into new Ukeys, and send Ukeys to users; The encryption and decryption module of the encryption card is used to encrypt the original plaintext data based on the encryption algorithm selected by the user to obtain the ciphertext; The user logs in to the encryption card user system through Ukey, starts the application, and performs the following through the application: read the ciphertext through the encryption card's DMA engine, decrypt the read ciphertext through the encryption card's encryption and decryption module, transfer the decrypted data to the GPU memory through the encryption card's DMA engine, perform inference calculations on the decrypted data based on the GPU's parallel computing capability and through the deep learning model built into the GPU memory to obtain the inference calculation results, read the inference calculation results in the GPU memory through the encryption card's DMA engine, encrypt the inference calculation results through the encryption card's encryption and decryption module, and send the encrypted inference calculation results to the user through the encryption card's DMA engine.
6. The medical data security reasoning system based on hardware collaboration according to claim 5 is characterized in that: The encryption algorithms selected by users include national encryption algorithms and international standard encryption algorithms. National encryption algorithms include SM1, SM2, SM3 and SM4, and international standard encryption algorithms include DES, 3DES, AES, RSA and SHA.
7. The medical data security reasoning system based on hardware collaboration according to claim 5 or 6, characterized in that: The application includes user programs for memory management and computing scheduling control, as well as drivers responsible for data transmission and encryption and decryption processes; The user program is used to perform the following operations: Load the deep learning model into GPU memory; Apply for two GPU memories, one of which is used to store the model input data of the deep learning model, and the other is used to store the inference calculation results of the deep learning model, and set the memory pointer to the CU_POINTER_ATTRIBUTE_SYNC_MEMOPS type so that the DMA engine of the encryption card can safely and synchronously transfer data between the encryption card and the GPU memory; The driver is called, and the DMA engine of the encryption card reads the ciphertext, decrypts the ciphertext through the encryption card encryption and decryption module, and transmits the decrypted data to the address of the model input data in the GPU video memory through the DMA engine of the encryption card; Start the calculation process of the deep learning model, which runs in the GPU memory; After the deep learning model performs inference calculation based on the decrypted data, the user program calls the driver again, and the DMA engine of the encryption card reads the inference calculation result in the GPU video memory, encrypts the inference calculation result through the encryption and decryption module of the DMA, and returns the encrypted inference calculation result to the user through the DMA engine of the encryption card; Correspondingly, the driver is used to perform the following operations: A Ring buffer is allocated in the encryption card memory. The Ring buffer is used to decouple the data transmission of the DMA engine and the calculation of the encryption and decryption module, so that data transmission and encryption and decryption do not need to be performed synchronously. After receiving the GPU memory virtual address passed in by the user program, the driver uses the nvidia_p2p_get_pages and nvidia_p2p_dma_mapping interfaces provided in the NVIDIA kernel driver to map the address to a physical address accessible by DMA; After the user program initiates the transfer command, DMA data transmission and encryption and decryption start running synchronously. DMA data transmission is realized by triggering an interrupt by enabling the corresponding flag bit of the register, which includes: transferring the ciphertext data to the Ring buffer, transferring the decrypted data from the Ring buffer to the GPU memory, transferring the inference calculation results from the GPU memory to the Ring buffer, and transferring the encrypted inference calculation results from the Ring buffer to the user. The encryption and decryption process runs in another thread. The thread used to run encryption and decryption polls the Ring buffer data block, determines the processing stage by querying the corresponding flag of the data, and then triggers an interrupt to start the encryption and decryption calculation by enabling the corresponding flag bit of the encryption and decryption module register.
8. The medical data security reasoning system based on hardware collaboration according to claim 7 is characterized in that: The deep learning model is a model built based on the ONNX framework, Pytorch framework, TensorFlow framework, or other frameworks.
Citation Information
Patent Citations
Method for designing memory controller DMA (direct memory access)
CN113342721A
Multi-algorithm IP core high-speed encryption and decryption system and method based on PCIE channel
CN114662136A
System and method for realizing sharing of DMA linked list by multiple PCIE devices
CN115617722A
Automatic deployment method based on TensorRT-LLM model reasoning acceleration service
CN117992078A
Chip-based data encryption transmission system
CN118133326A