High-efficiency computing method and system suitable for homomorphic encryption privacy computing

By configuring a homomorphic encryption library and a privacy computing acceleration card in the server, encapsulating and sending a acceleration computing request packet, and using parallel processing to improve the efficiency of homomorphic encryption privacy computing, the large communication overhead and parallel advantages in FPGA acceleration cards are solved. The problem has achieved efficient computing efficiency.

CN118426974BActive Publication Date: 2024-11-08WUXI INST OF INTERCONNECT TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410885749.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-03
Publication Date
2024-11-08
Estimated Expiration
2044-07-03

AI Technical Summary

Technical Problem

The existing homomorphic encryption privacy computing has problems such as large communication overhead and parallel processing advantages on FPGA accelerator cards, resulting in low computing efficiency.

Method used

By configuring a homomorphic encryption library and a privacy computing acceleration card in the server, encapsulating and sending accelerated computing request packets, the parallel processing of accelerated computing request packets is used to improve computing efficiency, reduce the number of triggers of DMA processing units, and increase the bandwidth of PCIe interface usage.

Benefits of technology

It effectively improves the efficiency of homomorphic encryption privacy computing, maximizes computing efficiency, and reduces communication delay and data delay.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118426974B_ABST
    Figure CN118426974B_ABST
Patent Text Reader

Abstract

The present invention relates to a high-efficiency computing method and system suitable for homomorphic encryption privacy computing. It provides a server with a homomorphic encryption library, and is configured with a privacy computing acceleration card adapted to the server. When performing accelerated computing, the server encapsulates the accelerated computing request data to be accelerated, and sends the accelerated computing request data packet generated by the data encapsulation to the privacy computing acceleration card. For any received accelerated computing request data packet, the privacy computing acceleration card parses the accelerated computing request data packet to obtain the accelerated computing request data to be accelerated after parsing; when the number of accelerated computing request data to be accelerated is not less than 2, the privacy computing acceleration card performs target operator acceleration operations on the parsed accelerated computing request data in parallel. The present invention can effectively improve the efficiency of homomorphic encryption privacy computing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a high-efficiency computing method and system, and in particular to a high-efficiency computing method and system suitable for homomorphic encryption privacy computing. Background Art

[0002] After data became a production factor, the security of data (especially privacy data) has become an urgent problem to be solved in today's society. Privacy computing (Privacy compute or Privacy computing) is to study the calculation of data under the premise of protecting the data itself from external leakage, so as to achieve the purpose of "available but invisible" data; under the premise of fully protecting data and privacy security, it also realizes the transformation and release of data value.

[0003] Homomorphic encryption (HE) is a technical route for privacy computing. It is an algorithm that supports the execution of basic computing operations (such as addition and multiplication) in an encrypted state, and can complete the task of processing ciphertext without leaking sensitive information. Homomorphic encryption includes full homomorphic encryption and semi-homomorphic encryption. Fully homomorphic encryption (FHE): supports arbitrary forms of calculation on ciphertext; semi-homomorphic encryption (SWHE, Somewhat Homomorphic Encryption): supports partial forms of calculation on ciphertext, such as only adding, only multiplying, or supporting a limited number of additions and multiplications.

[0004] Fully homomorphic encryption allows calculations to be performed on encrypted data without having to decrypt the encrypted data to obtain plaintext, thereby ensuring that sensitive information is not leaked. However, there are some challenges and limitations, such as low computational efficiency and increased encrypted data size.

[0005] In actual projects, in order to effectively solve the problems existing in the above-mentioned fully homomorphic encryption, FPGA acceleration cards are usually used for acceleration. FPGA acceleration cards are high-performance algorithm acceleration cards based on a specific bus architecture, which use high-performance FPGAs as computing nodes. FPGA (Field Programmable Gate Array) is a field programmable gate array that can be programmed in real time according to user needs and program instructions to achieve various computing and acceleration functions.

[0006] At present, when using FPGA to accelerate homomorphic encryption computing, there are still the following performance-related issues:

[0007] 1) When running a single time, there is a large communication overhead, and the communication delay may be much larger than the computation delay.

[0008] 2) Hardware FPGA processing has the advantage of parallel processing, but the parallel advantage of hardware is not fully reflected in single and scattered processing.

[0009] Therefore, improving the capability of homomorphic encryption privacy computing based on FPGA accelerator cards is a difficult problem that needs to be solved urgently. Summary of the invention

[0010] The purpose of the present invention is to overcome the deficiencies in the prior art and provide a high-efficiency computing method and system suitable for homomorphic encryption privacy computing, which can effectively improve the efficiency of homomorphic encryption privacy computing.

[0011] According to the technical solution provided by the present invention, a high-efficiency computing method suitable for homomorphic encryption privacy computing, the high-efficiency computing method includes:

[0012] Provide a server with a homomorphic encryption library and configure a privacy computing accelerator card that is compatible with the server.

[0013] In the server, respond to one or more homomorphic encryption library call requests initiated by the APP application, where:

[0014] When at least one homomorphic encryption library call request includes an acceleration operator API call request, when the server responds to the acceleration operator API call request, it generates acceleration operator API call response information corresponding to the acceleration operator API call request, and deploys a privacy computing acceleration card to perform computing acceleration, wherein:

[0015] When performing accelerated computing, the server encapsulates the accelerated computing request data to be accelerated, and sends the accelerated computing request data packet generated by the data encapsulation to the privacy computing acceleration card, wherein the accelerated computing request data is generated based on the accelerated operator API call request and the accelerated operator API call response information;

[0016] For any accelerated computing request data packet received, the privacy computing acceleration card parses the accelerated computing request data packet to obtain the accelerated computing request data to be accelerated after parsing;

[0017] When the number of accelerated computing request data to be accelerated is not less than 2, the privacy computing acceleration card performs target operator acceleration operations on the parsed accelerated computing request data in parallel, and transmits the target operation result data generated by the target operator accelerated operation to the corresponding APP application in the server, wherein the target operation result data corresponds one-to-one to the accelerated computing request data.

[0018] A homomorphic encryption library in the server, wherein the homomorphic encryption library stores a plurality of acceleration operator APIs;

[0019] When the homomorphic encryption library call request includes an acceleration operator API call request, the corresponding acceleration operator API in the homomorphic encryption library is called, and the corresponding acceleration operator API call response information is generated, where:

[0020] The request for calling the acceleration operator API includes at least the request data, request source ID, request destination ID, request message sequence number, and request command type;

[0021] When the server responds to an acceleration operator API call request, based on the request command type in the acceleration operator API call request, the server extracts the acceleration operator API corresponding to the request command type in the homomorphic encryption library, and generates acceleration operator API call response information, wherein the acceleration operator API call response information includes the homomorphic encryption operation parameters corresponding to the acceleration operator API call request;

[0022] Generate accelerated computing request data based on the acceleration operator API call request and acceleration operator API call response information,

[0023] When data encapsulation is performed on any accelerated computing request data, the accelerated computing request data corresponding to the accelerated computing request data are assembled with the accelerated computing operator API call request and the accelerated computing operator API call response information, so that the accelerated computing request data is encapsulated in the corresponding accelerated computing request data packet after assembly.

[0024] Any accelerated computing request data packet includes a data packet header area, a data packet parameter area, and a data packet data area, wherein:

[0025] Encapsulate the request source ID, request destination ID and request message sequence number in the acceleration operator API call request in the data packet header area, encapsulate the homomorphic encryption operation parameters in the acceleration operator API call response information in the data packet parameter area, and encapsulate the calculation data to be accelerated based on the acceleration calculation request data in the data packet data area;

[0026] When the accelerated computing request data packet includes multiple accelerated computing request data, the homomorphic encryption operation parameters corresponding to all the accelerated computing request data belong to the same category.

[0027] A message processing thread is configured in the server, and the configured message processing thread is used to perform message queuing operation on the accelerated computing request data before data encapsulation, wherein:

[0028] When executing the message queuing operation, the message processing thread will parse and queue the accelerated computing request data in sequence, so as to obtain the accelerated computing request queue after the queueing process;

[0029] For the accelerated computing request data in the accelerated computing request queue, the accelerated computing request data is sequentially dequeued before data encapsulation.

[0030] An interface processing thread is also configured in the server, wherein:

[0031] The interface processing thread is used to perform a dequeue operation on the accelerated computing request data in the accelerated computing request queue, wherein the accelerated computing request data after the dequeue operation is encapsulated according to a preset encapsulation configuration, and an accelerated computing request data packet is generated after the data is encapsulated;

[0032] The interface processing thread is used to send the accelerated computing request data packet to the privacy computing acceleration card.

[0033] In the server, the accelerated computing request data is transmitted to the interface processing thread based on the memory sharing configuration, where:

[0034] For the acceleration operator API call request entering the message processing thread and the corresponding acceleration operator API call response information, configure the corresponding global variables;

[0035] When executing a message queuing operation on the accelerated computing request data, marking the accelerated computing request data using an entry marking element in the empty linked list;

[0036] When encapsulating data in the interface processing thread, the accelerated computing request data in the accelerated computing request queue are first dequeued one by one, where:

[0037] When dequeuing an accelerated computing request data, the corresponding global variable is indexed based on the queue mark element corresponding to the accelerated computing request data, and after the global variable is obtained by indexing, the corresponding queue mark element is released;

[0038] Based on the global variable of the index, the acceleration operator API call request and the acceleration operator API call response information corresponding to the current acceleration calculation request data are determined, and the determined acceleration operator API call request and the corresponding acceleration operator API call response information are assembled.

[0039] The privacy computing accelerator card encapsulates the generated one or more target computing result data to generate a target computing result data packet;

[0040] The privacy computing accelerator card sends the target computing result data packet to the server;

[0041] The server receives the target operation result data set for analysis to obtain corresponding target operation result data after analysis, and transmits the analyzed target operation result data to the corresponding APP application in the server.

[0042] The privacy computing acceleration card is an FPGA card, wherein:

[0043] The privacy computing acceleration card includes a DMA processing unit, a cache pool, a scheduling center and an acceleration engine pool.

[0044] The accelerated computing request data packet received by the privacy computing accelerator card is transmitted to the DMA processing unit, and the accelerated computing request data parsed by the DMA processing unit is stored in the cache pool;

[0045] The acceleration engine pool includes several independent acceleration engines. The dispatch center selects and configures the corresponding acceleration engine to perform target operator acceleration operation on the acceleration computing request data, so as to generate target operation result data after the target operator acceleration operation.

[0046] The target operation result data is stored in the buffer pool and sent to the server through the DMA processing unit.

[0047] An accelerated computing state machine is set up in the dispatch center, where:

[0048] The dispatch center configures the working status of the acceleration engines in the acceleration engine pool based on the acceleration computing state machine, so as to perform corresponding target operator acceleration operations on the acceleration computing request data through the corresponding acceleration engines.

[0049] A high-efficiency computing system suitable for homomorphic encryption privacy computing, comprising:

[0050] A server having a homomorphic encryption library responds to homomorphic encryption library call requests initiated by one or more APP applications, wherein:

[0051] When at least one homomorphic encryption library call request includes an acceleration operator API call request, when responding to the acceleration operator API call request, an acceleration operator API call response message corresponding to the acceleration operator API call request is generated, and the acceleration computing request data to be accelerated is data-encapsulated, and the acceleration computing request data packet generated by the data encapsulation is sent to the privacy computing acceleration card, wherein the acceleration computing request data is generated based on the acceleration operator API call request and the acceleration operator API call response message;

[0052] A privacy computing accelerator card, for any received accelerated computing request data packet, the privacy computing accelerator card parses the accelerated computing request data packet to generate a number of accelerated computing request data after parsing;

[0053] When the number of accelerated computing request data generated by the analysis is not less than 2, the privacy computing acceleration card performs target operator acceleration operations on the analyzed accelerated computing request data in parallel, and transmits the target operation result data generated by the target operator accelerated operation to the server, wherein the target operation result data corresponds one-to-one to the accelerated computing request data.

[0054] The advantages of the present invention are as follows: a homomorphic encryption library is configured in the server, which can allow homomorphic encryption library call requests initiated by one or more APP applications. When at least one homomorphic encryption library call request includes an acceleration operator API call request, the server deploys a privacy computing acceleration card to perform calculation acceleration. When performing accelerated calculation, the server encapsulates the accelerated calculation request data to be accelerated, and sends the accelerated calculation request data packet generated by the data encapsulation to the privacy computing acceleration card, which can reduce the number of triggering the DMA processing unit in the privacy computing acceleration card and reduce data delay, thereby increasing the actual usage bandwidth of the PCIe interface and concealing the communication delay between the server and the privacy computing acceleration card.

[0055] For any accelerated computing request data packet received, the privacy computing accelerator card parses the accelerated computing request data packet to generate a number of accelerated computing request data after parsing; when the number of accelerated computing request data generated by the parsing is not less than 2, the privacy computing accelerator card performs target operator acceleration operations on the parsed accelerated computing request data in parallel, which can maximize the efficiency of the calculation. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 A flow chart of an embodiment of homomorphic encryption privacy computing for the present invention.

[0057] Figure 2 This is a system architecture diagram of an embodiment of the homomorphic encryption privacy computing system of the present invention.

[0058] Figure 3 The figure is a schematic diagram of an embodiment of the present invention using Freelist for index marking.

[0059] Figure 4 This is a structural block diagram of an embodiment of the privacy computing acceleration card of the present invention.

[0060] Figure 5 A schematic diagram of an embodiment of the invention for accelerating the calculation of request data packets. DETAILED DESCRIPTION

[0061] The present invention will be further described below in conjunction with specific drawings and embodiments.

[0062] In order to effectively improve the efficiency of homomorphic encryption privacy computing, the present invention provides a high-efficiency computing method suitable for homomorphic encryption privacy computing. Specifically, the high-efficiency computing method includes:

[0063] Step S1: provide a server with a homomorphic encryption library, and configure a privacy computing accelerator card that is adapted to connect to the server.

[0064] Step S2: In the server, respond to one or more homomorphic encryption library call requests initiated by the APP application, where:

[0065] Step S3: When at least one homomorphic encryption library call request includes an acceleration operator API call request, the server generates acceleration operator API call response information corresponding to the acceleration operator API call request when responding to the acceleration operator API call request, and deploys a privacy computing acceleration card to perform computing acceleration, wherein:

[0066] Step S4: When performing accelerated computing, the server encapsulates the accelerated computing request data to be accelerated, and sends the accelerated computing request data packet generated by the data encapsulation to the privacy computing acceleration card, wherein the accelerated computing request data is generated based on the accelerated operator API call request and the accelerated operator API call response information;

[0067] Step S5: For any received accelerated computing request data packet, the privacy computing acceleration card parses the accelerated computing request data packet to obtain accelerated computing request data to be accelerated after parsing;

[0068] Step S6: When the number of accelerated computing request data to be accelerated is not less than 2, the privacy computing acceleration card performs target operator acceleration operations on the parsed accelerated computing request data in parallel, and transmits the target operation result data generated by the target operator accelerated operation to the corresponding APP application in the server, wherein the target operation result data corresponds one-to-one to the accelerated computing request data.

[0069] Figure 1 A schematic diagram of an embodiment of the present invention for performing efficient calculations is shown in FIG. Figure 2 A system block diagram of an embodiment of the high-efficiency computing system of the present invention is shown in FIG. Figure 1 and Figure 2It can be seen that when implementing the homomorphic encryption privacy computing of the present invention, it is generally necessary to configure a server and a privacy computing acceleration card that is adapted and connected to the server, wherein a homomorphic encryption library can be set up in the server, and the privacy computing accelerator card is adapted and connected to the server, which specifically means that data interaction can be carried out between the server and the privacy computing accelerator card after the connection, and the data interaction specifically refers to meeting the data transmission and computing requirements between the server and the privacy computing accelerator card. The data interaction method between the server and the privacy computing accelerator card can refer to the following process description.

[0070] One or more APP applications can be run in the server. Figure 2 An embodiment of running n APP applications in a server is shown in the figure. In the figure, APP1~APPn correspond to n APP applications running in the server, and APP applications are computer programs or functions in the usual sense. In specific implementation, one or more APP applications can initiate a homomorphic encryption library call request, wherein the homomorphic encryption library call request includes source data that needs to be accelerated. The server can respond to each homomorphic encryption library call request, so that after responding to the homomorphic encryption library call request, the corresponding homomorphic encryption library call response information can be obtained.

[0071] When the homomorphic encryption library call request includes an acceleration operator API call request, when the server responds to the acceleration operator API call request, it generates acceleration operator API call response information corresponding to the acceleration operator API call request, that is, when the homomorphic encryption library call request is an acceleration operator API call request, the generated homomorphic encryption library call request response information is the acceleration operator API call response information. Generally, the acceleration operator API call request may include ciphertext data of the source data after homomorphic encryption calculation, so it can be known that based on the acceleration operator API call request and the acceleration operator API call response information, the acceleration calculation request data to be calculated and accelerated can be formed; wherein, the acceleration operator API call response information corresponds one-to-one to the acceleration operator API call request, that is, when the server responds to an acceleration operator API call request, it will generate an acceleration operator API call response information.

[0072] It is understandable that the server can adopt existing commonly used equipment and set up a homomorphic encryption library in the server using existing commonly used means, wherein a number of acceleration operator APIs can be stored in the homomorphic encryption library, and the acceleration operator API can be an NTT (Number Theoretic Transforms) operator, an INNT (Inverse-NTT) operator or other homomorphic encryption operator forms. The number and type of acceleration operator APIs in the homomorphic encryption library can be selected according to actual needs, so as to meet the actual needs of homomorphic encryption privacy computing.

[0073] It should be noted that when responding to a homomorphic encryption library call request, the server can perform necessary computational processing based on the type of the homomorphic encryption library call request. When the homomorphic encryption library call request includes an acceleration operator API call request, the necessary computational processing performed by the server can be consistent with the existing one, such as data format conversion, encryption of source data, and other processing. The specific computational processing method can be selected as needed, subject to the ability to respond to the acceleration operator API call request.

[0074] When the type of homomorphic encryption library call request is an acceleration operator API call request, the server can deploy a privacy computing acceleration card to accelerate the corresponding computing process, so that the privacy computing acceleration card can be used to perform computing acceleration. In order to further improve the efficiency of computing processing, in one embodiment of the present invention, the server encapsulates the accelerated computing request data to be accelerated, and sends the accelerated computing request data packet generated by the data encapsulation to the privacy computing acceleration card, wherein the accelerated computing request data to be accelerated is the data that needs to be accelerated using the privacy computing acceleration card. It can be seen from the above description that, in general, the accelerated computing request data can be generated at least together with the acceleration operator API call response information, that is, when the acceleration operator API call response information is obtained, the corresponding accelerated computing request data can be generated based on the acceleration operator API call request and the acceleration operator API call response information.

[0075] In one embodiment of the present invention, under normal circumstances, at least two accelerated computing request data should be encapsulated. Of course, under special circumstances, one accelerated computing request data can also be encapsulated so that an accelerated computing request data packet can be obtained after data encapsulation. It can be seen that the accelerated computing request data packet can correspond to one or more accelerated computing request data, and the quantity relationship of the accelerated computing request data corresponding to the accelerated computing request data packet is related to the preset encapsulation configuration.

[0076] It should be noted that the preset encapsulation configuration may include an encapsulation quantity threshold and / or an encapsulation time threshold, wherein the encapsulation quantity threshold is the maximum number of accelerated computing request data during one data encapsulation, and the time threshold is the maximum time range during one data encapsulation, such as the encapsulation quantity threshold can be set to 4, and the encapsulation time threshold can be 20μs; at this time, during one data encapsulation, within the time threshold, each data encapsulation will encapsulate at most 4 accelerated computing request data, and when within the time threshold, the number of accelerated computing request data is less than 4, then all current accelerated computing request data will be encapsulated. The encapsulation quantity threshold and encapsulation time threshold can also be selected according to actual needs, so as to meet the actual homomorphic encryption privacy computing needs.

[0077] After the data is encapsulated to obtain an accelerated computing request data packet, the accelerated computing request data packet needs to be sent to the privacy computing acceleration card so that the privacy computing acceleration card can be used for corresponding computing acceleration. Among them, the accelerated computing request data packet can be sent to the privacy computing acceleration card in a manner commonly used in the technical field. The specific sending interaction method will be described in detail below.

[0078] After the accelerated computing request data packet is sent to the privacy computing acceleration card, the privacy computing acceleration card will parse the accelerated computing request data packet. The specific method of parsing the accelerated computing request data packet can be selected according to needs, such as corresponding decapsulation according to the data encapsulation method of generating the accelerated computing request data packet. After parsing the accelerated computing request data packet, a number of corresponding accelerated computing request data can be generated. It can be understood that the number of accelerated computing request data after parsing is generally the same as the number of accelerated computing request data in the accelerated computing request data packet, that is, the accelerated computing request data obtained by parsing and the accelerated computing request data in the accelerated computing request data packet formed by data encapsulation are in one-to-one correspondence.

[0079] In specific implementation, when the number of accelerated computing request data obtained through analysis is not less than 2, the privacy computing acceleration card performs target operator acceleration operations on the accelerated computing request data generated through analysis in parallel. Specifically, the method for performing target operator acceleration operations in parallel can be: multiple acceleration engines that can perform target operator acceleration operations are set on the privacy computing acceleration card, and multiple acceleration engines can perform target operator acceleration operations in parallel. Therefore, when it is necessary to perform target operator acceleration operations on multiple accelerated computing request data respectively, an acceleration engine is allocated to each accelerated computing request data, and thereafter, each acceleration engine can perform target operator acceleration operations on the allocated accelerated computing request data. Of course, the privacy computing acceleration card can also use other methods to implement target operator acceleration operations on accelerated computing request data in parallel, and the method for performing target operator acceleration operations in parallel can be selected according to needs.

[0080] When the privacy computing accelerator card uses multiple acceleration engines to execute the target operator acceleration operation in parallel, an engine pool containing multiple acceleration engines needs to be configured in the privacy computing accelerator card. The method of configuring multiple acceleration engines to execute the target operator acceleration operation in parallel can be referred to Figure 2 and the following instructions.

[0081] It can be understood that the type of target operator acceleration operation is related to the above-mentioned acceleration operator API call request. For example, when the acceleration operator API call request is a request to call the NTT operator, the target operator acceleration operation is a butterfly operation corresponding to the NTT operator. When the acceleration operator API call request is a request to call other operators, the privacy computing acceleration card performs the corresponding target operator acceleration operation. The execution of the target operator acceleration operation is no longer illustrated here one by one. After the target operator acceleration operation, the corresponding target operation result data can be generated. It can be seen that the target operation result data is one-to-one corresponding to the acceleration calculation request data, that is, after an acceleration calculation request data is operated by the target acceleration operator, a target operation result data can be generated.

[0082] During specific implementation, according to different acceleration operator API call requests, the target operator acceleration operation may include a first operator acceleration operation and a second operator acceleration operation. The form of the target operator acceleration operation is related to the acceleration operator API call request contained in the homomorphic encryption library call request. The types of the first operator acceleration operation and the second operator calculation operation can be specifically determined according to the acceleration operator API call request, such as the first operator acceleration operation and the second operator acceleration operation can be the above-mentioned butterfly operation corresponding to the NTT operator, etc., which is based on the actual needs of the homomorphic encryption library call request. In one embodiment of the present invention, the first operator acceleration operation and the second operator acceleration operation are the same as an example for detailed explanation. Of course, this is only for the convenience of description, and it is not a specific limitation that the first operator acceleration operation and the second operator acceleration operation must be the same.

[0083] After the acceleration engine calculates the target operation result data, the privacy computing acceleration card will transmit the target operation result data to the server, which will parse it and send the parsed target operation result data to the corresponding APP application. After that, the corresponding APP application can continue to call the algorithm in the homomorphic encryption library to perform corresponding calculation processing; when the calculated result data is returned to the corresponding APP application, the corresponding homomorphic encryption privacy computing request is completed; and when calling the algorithm in the homomorphic encryption library to perform calculation processing on the target operation result data, the type of calculation processing may be polynomial multiplication or polynomial addition, etc., which can be determined according to implementation needs.

[0084] From the above description, it can be seen that the server of the present invention will encapsulate the accelerated computing request data, and send the accelerated computing request data packet formed by the data encapsulation to the privacy computing acceleration card. The privacy computing accelerator card can perform target operator acceleration operations on the accelerated computing request data in parallel, thereby improving the efficiency of homomorphic encryption privacy computing.

[0085] In one embodiment of the present invention, for a homomorphic encryption library in a server, the homomorphic encryption library stores a plurality of acceleration operator APIs;

[0086] When the homomorphic encryption library call request includes an acceleration operator API call request, the corresponding acceleration operator API in the homomorphic encryption library is called, and the acceleration operator API call response information is generated, where:

[0087] The request for calling the acceleration operator API includes at least the request data, request source ID, request destination ID, request message sequence number, and request command type;

[0088] When the server responds to an acceleration operator API call request, based on the request command type in the acceleration operator API call request, the server extracts the acceleration operator API corresponding to the request command type in the homomorphic encryption library, and generates acceleration operator API call response information, wherein the acceleration operator API call response information includes the homomorphic encryption operation parameters corresponding to the acceleration operator API call request;

[0089] Generate accelerated computing request data based on the acceleration operator API call request and acceleration operator API call response information,

[0090] When data encapsulation is performed on any accelerated computing request data, the accelerated computing request data corresponding to the accelerated computing request data are assembled with the accelerated computing operator API call request and the accelerated computing operator API call response information, so that the accelerated computing request data is encapsulated in the corresponding accelerated computing request data packet after assembly.

[0091] It can be seen from the above description that the source data of the accelerated computing request data can be based on the homomorphic encryption library call request and included in the accelerated operator API call request; specifically, when the homomorphic encryption library call request includes the accelerated operator API call request, the corresponding accelerated operator API in the homomorphic encryption library is called, and the accelerated operator API call response information is generated. At this time, the accelerated computing request data can be generated based on the accelerated operator API call request and the accelerated operator API call response information.

[0092] In specific implementation, when the homomorphic encryption library call request includes an acceleration operator API call request, the corresponding acceleration operator API in the homomorphic encryption library will be called, and the privacy computing acceleration card will be deployed to perform the acceleration calculation. Otherwise, the privacy computing acceleration card does not need to be deployed to perform the acceleration calculation. When responding to the acceleration operator API call request, the server can generate acceleration operator API call response information, wherein the generated acceleration operator API call response information may include the homomorphic encryption operation parameters determined in response to the acceleration operator API call request.

[0093] As can be seen from the above description, the homomorphic encryption library call request is a request initiated by the APP application. For the acceleration operator API call request, it generally includes at least request data, request source ID, request destination ID, request message sequence number and request command type. Specifically, when the APP application initiates a homomorphic encryption library call request to the server, the request data can be configured by data pointer. The request data can be the above-mentioned source data, or data after the source data is processed accordingly; the request source ID mainly represents the ID information of the APP application, which can also represent the identity information of the APP application. The request destination ID mainly represents the destination address of the current homomorphic encryption library call request. According to the request destination ID, the server can configure the transmission direction of the current acceleration operator API call request. As can be seen from the following description, according to the request destination ID, the entire acceleration operator API call request and the acceleration operator API call response information can be transmitted to the thread 1 and / or thread 2 mentioned below; the request message sequence number can represent the sequence position of the homomorphic encryption library call request received by the server, and the request command type can represent the acceleration operator API requested by the acceleration operator API call request.

[0094] It can be seen from the above description that when the homomorphic encryption library call request includes an acceleration operator API call request, in addition to extracting the above information, it can also include necessary data processing, such as the necessary data conversion mentioned above, etc. The necessary data processing can be consistent with the existing ones, so as to meet the needs of homomorphic encryption privacy computing. It can be understood that the above request data can be a polynomial array formed by encryption or encoding, and the method of encrypting and encoding the request data can be consistent with the existing ones, which will not be repeated here.

[0095] The homomorphic encryption operation parameters determined in response to the acceleration operator API call request specifically refer to the homomorphic encryption operation parameters determined based on the request command, that is, the homomorphic encryption operation parameters are related to the type of the acceleration operator API. The homomorphic encryption operation parameters are generally necessary operator parameters of the acceleration operator API. For example, when the acceleration operator API is the NTT operator / INNT operator, the homomorphic encryption operation parameters may include the number of polynomial coefficients N, the modulus Q, the number of butterfly calculation units PE, the number of bits of the coefficient K, the primitive root PSI and the parameter W. When the acceleration operator API is of other types, the homomorphic encryption operation parameters can be determined accordingly, and examples will not be given one by one here.

[0096] During specific implementation, the number of polynomial coefficients N in the homomorphic encryption operation parameters generally remains fixed, and the modulus Q corresponding to different homomorphic encryption call requests will be different, that is, the specific situation of the homomorphic encryption operation parameters is related to the homomorphic encryption call request. Therefore, the homomorphic encryption operation parameters can be specifically determined according to the request data and request command type in the homomorphic encryption library call request, and the specific method and process for determining the homomorphic encryption operation parameters are consistent with the existing ones.

[0097] In one embodiment of the present invention, since the acceleration operator API call request and the acceleration operator API call response information are in one-to-one correspondence, when generating the acceleration computing request data, in addition to associating the acceleration operator API call request information with the acceleration operator API call response information, the acceleration computing request data may include the acceleration operator API call response information and part of the acceleration operator API call request information. It can be seen from the following description that the acceleration computing request clear data includes the acceleration operator API call request information, which may be all other information except the request command type. It can be seen that in one embodiment of the present invention, the acceleration computing request data may include the request data, request source ID, request destination ID, request message sequence number, and homomorphic encryption operation parameters in the acceleration operator API call request information.

[0098] It should be noted that, since an accelerated computing request data includes an accelerated operator API call request and an accelerated operator API call response information determined in response to the accelerated operator API call request, when encapsulating the data, at least the accelerated operator API call request and the corresponding accelerated operator API call response information are assembled, so that the accelerated computing request data is encapsulated in the corresponding accelerated computing request data packet after assembly. When encapsulating multiple accelerated computing request data, each accelerated computing request data is assembled in the same way. The situation of the accelerated computing request data packet can be referred to. Figure 5 and the corresponding instructions below.

[0099] In one embodiment of the present invention, any accelerated computing request data packet includes a data packet header area, a data packet parameter area, and a data packet data area, wherein:

[0100] Encapsulate the request source ID, request destination ID and request message sequence number in the acceleration operator API call request in the data packet header area, encapsulate the homomorphic encryption operation parameters in the acceleration operator API call response information in the data packet parameter area, and encapsulate the calculation data to be accelerated based on the acceleration calculation request data in the data packet data area;

[0101] When the accelerated computing request data packet includes multiple accelerated computing request data, the homomorphic encryption operation parameters corresponding to all the accelerated computing request data belong to the same category.

[0102] Figure 5 An embodiment of an accelerated computing request data packet is shown in the figure. In the figure, an embodiment of simultaneously encapsulating 4 accelerated computing request data and forming an accelerated computing request data packet is shown. The accelerated computing request data packet includes three parts, namely, a data packet header area, a data packet parameter area, and a data packet data area. In the figure, the data packet header area includes multiple data headers, and the data packet data area includes multiple computing data to be accelerated, wherein the number of data headers is consistent with the number of computing data to be accelerated, and they are one-to-one corresponding. Figure 5 In the figure, the data packet header area includes 4 data headers, which are data 1 header to data 4 header respectively. The data packet data area includes 4 computing data to be accelerated, which are computing data 1 to computing data 4. Among them, data 1 header and data 1 belong to the same accelerated computing request data. For other situations, please refer to the description here and will not be repeated here.

[0103] Figure 5 In the example, the arrangement order of the four data headers is consistent with the arrangement order of the four calculation data to be accelerated, so that the data headers and the calculation data to be accelerated are in one-to-one correspondence. From the above description, it can be seen that the calculation data to be accelerated can be directly generated from the request data, or generated after necessary processing of the request data.

[0104] In specific implementation, Figure 5 The accelerated computing request data packet in the example can be restored into corresponding accelerated computing request data by parsing according to the encapsulation form of the data packet header area, the data packet parameter area and the data packet data area, so as to perform subsequent target operator acceleration operations.

[0105] Furthermore, the data packet parameter area has only one set of homomorphic encryption operation parameters. Therefore, when performing data encapsulation, for all acceleration operator API call requests in an acceleration computing request data packet, the corresponding homomorphic encryption operation parameters should belong to the same category. For example, the above-mentioned NTT operator and INNT operator are of the same category and can use the same homomorphic encryption operation parameters. Therefore, when encapsulating data, if the homomorphic encryption operation parameters of two responses to the acceleration computing request data are different, each response to the acceleration computing request data needs to be encapsulated separately, so that two independent acceleration computing request data packets can be obtained.

[0106] In specific implementation, when encapsulating data, it is possible to determine whether the current accelerated computing request data can be encapsulated in the same accelerated computing request data packet based on the type of homomorphic encryption operation parameters in each accelerated computing request data. When the homomorphic encryption operation parameters in the accelerated computing request data are of the same type, data encapsulation is performed according to the above-mentioned preset encapsulation configuration.

[0107] It can be seen from the above description that for each accelerated computing request data, the request command type may not be included. Therefore, when the accelerated computing request data is encapsulated to generate an accelerated computing request data packet, the request command type may not be included in the accelerated computing request data packet, that is, the request command type of the accelerated operator API call request, which is mainly used to determine the accelerated operator API, and determine the homomorphic encryption operation parameters corresponding to the accelerated operator API call request based on the determined accelerated operator API. Since it will not participate in the subsequent target operator acceleration operation, it does not need to be included in the accelerated computing request data packet.

[0108] In one embodiment of the present invention, a message processing thread is configured in the server, and the configured message processing thread is used to perform a message queuing operation on the accelerated computing request data before data encapsulation, wherein:

[0109] When executing the message queuing operation, the message processing thread will parse and queue the accelerated computing request data in sequence, so as to obtain the accelerated computing request queue after the queueing process;

[0110] For the accelerated computing request data in the accelerated computing request queue, the accelerated computing request data is sequentially dequeued before data encapsulation.

[0111] Figure 2 In the example, a message processing module is set in the server, and thread 1 is configured in the message processing module, that is, thread 1 is the message processing thread. Figure 2 In the figure, the message processing thread can be used to process the homomorphic encryption library call request initiated by the APP application. In the figure, the message processing thread includes a message receiving sub-module, a parameter pool and an entry sub-module. Among them, the message receiving sub-module can receive the homomorphic encryption library call request initiated by the APP application including the acceleration operator API call request, and parse the homomorphic encryption library call request to obtain the acceleration operator API call response information after the parsing process.

[0112] From the above description, it can be seen that when the homomorphic encryption library call request includes an acceleration operator API call request, the homomorphic encryption library call request is parsed and processed to obtain the request data, request command type and other information in the acceleration operator API call request, and the acceleration operator API can be determined; at the same time, after parsing, the corresponding homomorphic encryption operation parameters can also be extracted from the parameter pool, that is, the parameter pool mainly stores the homomorphic encryption operation parameters corresponding to the acceleration operator API.

[0113] Furthermore, the accelerated computing request queue can be obtained through the queue entry submodule, and the accelerated computing request queue is Figure 2 The output queue in which the generated accelerated computing request queue can be used to facilitate subsequent data encapsulation processing. The accelerated computing request queue includes at least a number of accelerated computing request data, and each accelerated computing request data is formed based on at least an accelerated operator API call request and a corresponding accelerated operator API call response information, wherein the accelerated computing request data is sorted in the order of entering the queue; in addition, the queue entry submodule can also realize the maintenance of the request data information queue.

[0114] It can be seen from the above description that for the accelerated computing request data in the accelerated computing request queue, the acceleration operator API call information in the accelerated computing request data may not include the request command type. In order to perform subsequent data encapsulation, before data encapsulation, it is necessary to perform a dequeue operation on the accelerated computing request data in the accelerated computing request queue. Specifically, when performing a dequeue operation, a feasible dequeue method is: perform dequeue operations in the order in which the accelerated computing request data enter the queue. For example, the first accelerated computing request data to enter the queue will be the first to be dequeued when the dequeue operation is performed. Dequeue means leaving the accelerated computing request queue. Other situations of performing dequeue operations can refer to the description here, and will not be listed here one by one.

[0115] In one embodiment of the present invention, an interface processing thread is further configured in the server, wherein:

[0116] The interface processing thread is used to perform a dequeue operation on the accelerated computing request data in the accelerated computing request queue, wherein the accelerated computing request data after the dequeue operation is encapsulated according to a preset encapsulation configuration, and an accelerated computing request data packet is generated after the data is encapsulated;

[0117] The interface processing thread is used to send the accelerated computing request data packet to the privacy computing acceleration card.

[0118] Figure 2In the figure, an interface processing module is set in the server, and thread 2 is configured in the interface processing module, that is, thread 2 is the interface processing thread. In the figure, the interface processing thread includes a dequeue submodule, an encapsulation submodule, a sending submodule, an interface receiving submodule, an interface decomposition submodule and an interface message sending submodule, wherein,

[0119] The dequeue submodule is connected to the message processing thread and is used to dequeue the accelerated computing request data in the request data information queue one by one; the encapsulation submodule is used to perform data encapsulation operations, that is, to encapsulate one or more accelerated computing request data in a data encapsulation format. The way in which the encapsulation submodule performs data encapsulation operations can refer to the above description. The sending submodule is used to send the accelerated computing request data packet generated by the encapsulation submodule to the privacy computing accelerator card.

[0120] According to the above description, before data encapsulation, the accelerated computing request data in the accelerated computing request queue will be dequeued. In one embodiment of the present invention, the dequeuing submodule in the interface processing thread is used to perform the dequeuing operation of the accelerated computing request data, that is, the dequeuing of the accelerated computing request data is completed in the interface processing module. For the accelerated computing request data after dequeuing, the encapsulation submodule can be used to perform corresponding data encapsulation.

[0121] From the above description, it can be seen that the dequeue sub-module, encapsulation sub-module and sending sub-module work together to send the accelerated computing request data packet to the privacy computing accelerator card; the interface receiving sub-module, interface decomposition sub-module and interface message sending sub-module can realize the reception and processing of homomorphic encrypted calculation result data, which will be explained in detail below.

[0122] In one embodiment of the present invention, in a server, accelerated computing request data is transmitted to an interface processing thread based on a memory sharing configuration, wherein:

[0123] For the acceleration operator API call request entering the message processing thread and the corresponding homomorphic encryption operation parameters, configure the corresponding global variables;

[0124] When executing a message queuing operation on the accelerated computing request data, marking the accelerated computing request data using an entry marking element in the empty linked list;

[0125] When encapsulating data in the interface processing thread, the accelerated computing request data in the accelerated computing request queue are first dequeued one by one, where:

[0126] When dequeuing an accelerated computing request data, the corresponding global variable is indexed based on the queue mark element corresponding to the accelerated computing request data, and after the global variable is obtained by indexing, the corresponding queue mark element is released;

[0127] Based on the global variable of the index, the acceleration operator API call request and the acceleration operator API call response information corresponding to the current acceleration calculation request data are determined, and the determined acceleration operator API call request and the corresponding acceleration operator API call response information are assembled.

[0128] Specifically, for the homomorphic encryption library call request initiated by the APP application, the homomorphic encryption library call request can store the corresponding request variable in the form of a global variable. After that, the request variable stored in the form of a global variable can be passed to the interface processing thread based on the shared memory method. Of course, the homomorphic encryption operation parameters determined above can also be passed to the interface physical thread in the form of a shared memory. It can be understood that the global variables of the present invention are variables that can be read in a global manner, and can be configured to be stored in the form of global variables using the technical means commonly used in the field of this technology. When the acceleration operator API call request and the homomorphic encryption operation parameters are transmitted from thread 1 to thread 2, the pointer of the global variable and other information can be transmitted to thread 2. At this time, thread 2 can obtain the data corresponding to the global variable based on the pointer information, etc. It can be seen that the shared memory method can shorten the call path of the message mechanism, reduce the number of memory copies, and effectively improve efficiency.

[0129] In order to ensure the reliability of transmitting accelerated computing request data, in one embodiment of the present invention, each accelerated computing request data can be marked and indexed by the elements in the empty linked list so that the accelerated computing request data can be accurately transmitted and encapsulated.

[0130] Figure 2 and Figure 3 In the figure, Free List is an empty linked list, which is composed of a series of structures (i.e., elements). During initialization, all pointers are cleared and connected head to tail to form a circular chain (list); when the accelerated computing request data is enqueued, a free element in the empty linked list is read, and the free element is used as the mark index of the accelerated computing request data, that is, the request data message queue also includes a free element in the empty linked list corresponding to the accelerated computing request data, wherein the free element in the empty linked list corresponding to the accelerated computing request data is the above-mentioned enqueuing mark element.

[0131] In one embodiment of the present invention, when data encapsulation is performed in an interface processing thread, the accelerated computing request data in the accelerated computing request queue are first dequeued one by one in sequence, that is, the accelerated computing request data must first be dequeued from the accelerated computing request queue using a dequeuing submodule, and thereafter, the dequeued accelerated computing request data is subjected to data encapsulation using an encapsulation submodule.

[0132] Specifically, during data encapsulation, each accelerated computing request data can be indexed using the queue marker element to ensure that the request variable stored in the global variable can be correctly read and encapsulated, so that the required accelerated computing request data packet can be obtained after data encapsulation. During specific implementation, based on the indexed global variable, the accelerated operator API call request and the accelerated operator API call response information corresponding to the current accelerated computing request data can be determined, and the determined accelerated operator API call request and the corresponding accelerated operator API call response information can be assembled. The data assembly here can mainly Figure 5 And the form of the accelerated computing request data packet in the above description.

[0133] In specific implementation, when an accelerated computing request data in the accelerated computing request queue is dequeued, the queue entry mark element corresponding to the dequeued accelerated computing request data needs to be released to ensure the recycling of elements in the empty linked list. Figure 3 An embodiment of using an empty linked list for marking indexing is shown in FIG.

[0134] Figure 3 A schematic diagram of an implementation scheme based on memory sharing is shown in the figure. In the figure, the message processing thread and the interface processing thread realize data transmission based on memory sharing. The digital sequence on the left is the entry index element of the empty linked list. The Data pointer is the pointer information pointing to the data variable, and the parameter is the pointer information pointing to the homomorphic encryption operation parameter mentioned above. Among them, it can be seen from the above description that the Data pointer information includes pointing to the global variable corresponding to the request data, the global variable corresponding to the request destination ID, the global variable corresponding to the request destination ID, and the global variable corresponding to the request message sequence number. Similarly, the pointer information of the corresponding parameters can be determined. No examples are given here, which is based on the transmission of the homomorphic encryption operation parameters and the corresponding data encapsulation.

[0135] In one embodiment of the present invention, the privacy computing acceleration card is an FPGA card, wherein:

[0136] The privacy computing acceleration card includes a DMA processing unit, a cache pool, a scheduling center and an acceleration engine pool.

[0137] The accelerated computing request data packet received by the privacy computing accelerator card is transmitted to the DMA processing unit, and the accelerated computing request data parsed by the DMA processing unit is stored in the cache pool;

[0138] The acceleration engine pool includes several independent acceleration engines. The dispatch center selects and configures the corresponding acceleration engine to perform target operator acceleration operation on the acceleration computing request data, so as to generate target operation result data after the target operator acceleration operation.

[0139] The target operation result data is stored in the buffer pool and sent to the server through the DMA processing unit.

[0140] From the above description, it can be seen that the privacy computing acceleration card can preferably be an FPGA card. Figure 2 An embodiment of a privacy computing acceleration card is shown in the figure. In the figure, the privacy computing acceleration card includes a DMA (Direct Memory Access) processing unit, a cache pool, a scheduling center and an acceleration engine pool. The DMA processing unit can receive an accelerated computing request data packet sent by a server and parse the received accelerated computing request data packet. Since the accelerated computing request data packet includes at least one accelerated computing request data, after parsing, at least one accelerated computing request data can be obtained, that is, the number of accelerated computing request data is consistent with the number of accelerated computing request data in the accelerated computing request data packet.

[0141] In one embodiment of the present invention, when the privacy computing acceleration card adopts an FPGA card, the privacy computing acceleration card is connected to the server through a PCIe interface; Figure 4 An exploded diagram of a privacy computing accelerator card is shown in FIG. The privacy computing accelerator card is configured with an interface module, and the interface module adopts a PCIe interface, so that the privacy computing accelerator card can be connected to the server through the PCIe interface. The PCIe interface is connected to the DMA processing unit, and the DMA processing unit is connected to the cache pool.

[0142] In a specific implementation, the cache pool includes BRAM memory and / or DDR memory; since the storage capacity of DDR memory is larger than that of BRAM memory, when the cache pool includes DDR memory, the cache capacity can be improved; when the cache pool includes both BRAM memory and DDR memory, BRAM memory can be preferentially used for caching. Figure 4 An embodiment in which the cache pool includes only a BRAM memory is shown. In the figure, the BRAM memory of the cache pool may include a BRAM storage unit for caching parameters, a BRAM storage unit for caching data, and a BRAM storage unit for caching results, wherein the cached parameters are the homomorphic encryption operation parameters mentioned above, the cached data are the target operation result data mentioned above, and the cached result is the result obtained by the target operator acceleration operation, that is, the target operation result data.

[0143] It can be understood that the parsing process of the accelerated computing request data packet is completely opposite to the process of data encapsulation to form the accelerated computing request data packet. In specific implementation, the accelerated computing request data packet can be parsed according to the method and description of data encapsulation to form the accelerated computing request data packet, and the accelerated computing request data can be obtained; from the above description, it can be seen that the accelerated computing request data obtained by parsing includes the parameters of the BRAM storage unit and the data cached by the BRAM storage unit.

[0144] In order to execute the target operator acceleration operation in parallel, the acceleration engine pool needs to have multiple acceleration engines. Figure 2 and Figure 4 The figure shows an acceleration engine pool including four independent acceleration engine embodiments. The number of acceleration engine pools can generally be selected according to actual needs, such as the ability of the FPGA card to provide parallel execution of target operator acceleration operations. When the privacy computing acceleration card adopts FPGA, multiple acceleration engines can be configured in a manner commonly used in the technical field, and each acceleration engine can be used to perform target operator acceleration operations. It can be understood that when the acceleration engine performs the target operator acceleration operation, it is necessary to use the parameters and data cached in the cache pool, that is, the parameters and data cached in the cache pool must be able to meet the acceleration engine's ability to perform the target operator acceleration operation.

[0145] During specific implementation, when the dispatch center chooses to configure the corresponding acceleration engine to perform target operator acceleration operations on the accelerated computing request data, the above-mentioned method can be used to perform target operator acceleration operations in parallel. For example, according to the number of accelerated computing request data, the corresponding acceleration engine is configured to perform target operator acceleration operations on the accelerated computing request data. The specific method of selecting the acceleration engine to perform target operator acceleration operations on the accelerated computing request data can be selected according to needs, so as to meet the demand for performing target operator acceleration operations on the accelerated computing request data.

[0146] In one embodiment of the present invention, an accelerated computing state machine is provided in the dispatch center, wherein:

[0147] The dispatch center configures the working status of the acceleration engines in the acceleration engine pool based on the acceleration computing state machine, so as to perform corresponding target operator acceleration operations on the acceleration computing request data through the corresponding acceleration engines.

[0148] In order to effectively configure the working state of the acceleration engine, an acceleration computing state machine can be configured in the scheduling center, and the acceleration computing state machine can be used to configure the working state of each acceleration engine respectively. For example, initially, the acceleration engines can be configured to perform target operator acceleration operations in sequence. It can be understood that when the scheduling center configures the acceleration engine to perform the target operator acceleration operation, it is necessary to obtain the target operator acceleration operation state of each acceleration engine, so that after an acceleration engine completes the target operator acceleration operation, the scheduling center can arrange the next target operator acceleration operation. After each acceleration engine completes a target operator acceleration operation, it can generate a target operation result data.

[0149] It can be seen from this that when allocating accelerated computing request data to each acceleration engine, it can be determined based on the order of the accelerated computing request data, so as to ensure that each accelerated computing request data has an acceleration engine to perform the target operator acceleration operation.

[0150] It can be understood that for each acceleration engine, the target operator operation can be completed based on the commonly used methods in the technical field for accelerating the computing request data, and the completed target operator operation can be the butterfly operation corresponding to the NTT operator as described above.

[0151] During specific implementation, the dispatch center can adopt technical means commonly used in this technical field to obtain the target operator acceleration operation status of each acceleration engine. The configured acceleration computing state machine can also be selected according to actual needs, so that multiple acceleration engines can execute the target operator acceleration operation in parallel.

[0152] From the above description, it can be seen that the target operation result data is cached in the cache pool, and the server can read the target operation result data in the privacy computing accelerator card through interruption or polling. When the reading determines that the target operation result data exists, the target operation result data can be read and received by the receiving submodule in the server.

[0153] Generally, the target operation result data read and received by the receiving submodule in the server may be one or more. When the target operation result data read and received is multiple, the multiple target operation result data generally also exist in the form of data packets, that is, the privacy computing accelerator card sends the multiple target operation result data to the server in the form of data packets. The target operation result data packet can have the same encapsulation form as the above-mentioned accelerated computing request data packet, except that the encapsulation of the homomorphic encryption operation parameters can be omitted.

[0154] From the above description, it can be seen that when multiple target operation result data are sent to the server in the form of data packets, the number of triggering times of the DMA processor in the FPGA card can be reduced, thereby improving the efficiency of data interaction between the server and the FPGA card.

[0155] When the target operation result data is sent to the server in the form of a data packet, the server needs to decompose the data packet. When decomposing, the interface decomposition submodule in the interface processing module can be used to perform the decomposition processing. When decomposing, the target operation result data can be identified based on the request source ID, and the corresponding homomorphic encryption library of the server that needs to be transmitted back is determined according to the request source ID, or returned to the corresponding APP application via the homomorphic encryption library; specifically, the decomposed and identified target operation result data can be Figure 2 The message sending module sends the message to the corresponding APP application. It can be seen that the target operation result data generally needs to include the request source ID, and the request source ID can be used to identify the APP application so that the target operation result data can be accurately returned to the corresponding APP application.

[0156] From the above description, a high-efficiency computing system suitable for homomorphic encryption privacy computing can be obtained. In one embodiment of the present invention, the system includes:

[0157] A server having a homomorphic encryption library responds to homomorphic encryption library call requests initiated by one or more APP applications, wherein:

[0158] When at least one homomorphic encryption library call request includes an acceleration operator API call request, when responding to the acceleration operator API call request, an acceleration operator API call response message corresponding to the acceleration operator API call request is generated, and the acceleration computing request data to be accelerated is data-encapsulated, and the acceleration computing request data packet generated by the data encapsulation is sent to the privacy computing acceleration card, wherein the acceleration computing request data is generated based on the acceleration operator API call request and the acceleration operator API call response message;

[0159] A privacy computing accelerator card, for any received accelerated computing request data packet, the privacy computing accelerator card parses the accelerated computing request data packet to generate a number of accelerated computing request data after parsing;

[0160] When the number of accelerated computing request data generated by the analysis is not less than 2, the privacy computing acceleration card performs target operator acceleration operations on the analyzed accelerated computing request data in parallel, and transmits the target operation result data generated by the target operator accelerated operation to the server, wherein the target operation result data corresponds one-to-one to the accelerated computing request data.

[0161] Specifically, the specific forms of the server, privacy computing acceleration card, and the process of performing homomorphic encryption privacy computing can all be referred to the above description and will not be repeated here.

[0162] From the above description, it can be seen that the homomorphic encryption library is configured in the server, which can allow homomorphic encryption library call requests initiated by one or more APP applications. When at least one homomorphic encryption library call request includes an acceleration operator API call request, the server deploys the privacy computing acceleration card to perform calculation acceleration. When performing accelerated calculation, the server will encapsulate the accelerated calculation request data to be accelerated, and send the accelerated calculation request data packet generated by the data encapsulation to the privacy computing acceleration card, which can reduce the number of triggering the DMA processing unit in the privacy computing acceleration card and reduce data delay, thereby increasing the actual usage bandwidth of the PCIe interface and concealing the communication delay between the server and the privacy computing acceleration card.

[0163] For any accelerated computing request data packet received, the privacy computing accelerator card parses the accelerated computing request data packet to generate a number of accelerated computing request data after parsing; when the number of accelerated computing request data generated by the parsing is not less than 2, the privacy computing accelerator card performs target operator acceleration operations on the parsed accelerated computing request data in parallel, which can maximize the efficiency of the calculation.

Claims

1. A high-efficiency computing method suitable for homomorphic encryption privacy computing, characterized in that: The high-efficiency calculation method comprises: Provide a server with a homomorphic encryption library and configure a privacy computing accelerator card that is compatible with the server. In the server, respond to one or more homomorphic encryption library call requests initiated by the APP application, where: When at least one homomorphic encryption library call request includes an acceleration operator API call request, when the server responds to the acceleration operator API call request, it generates acceleration operator API call response information corresponding to the acceleration operator API call request, and deploys a privacy computing acceleration card to perform computing acceleration, wherein: When performing accelerated computing, the server encapsulates the accelerated computing request data to be accelerated, and sends the accelerated computing request data packet generated by the data encapsulation to the privacy computing acceleration card, wherein the accelerated computing request data is generated based on the accelerated operator API call request and the accelerated operator API call response information; For any accelerated computing request data packet received, the privacy computing acceleration card parses the accelerated computing request data packet to obtain the accelerated computing request data to be accelerated after parsing; When the number of accelerated computing request data to be accelerated is not less than 2, the privacy computing acceleration card performs target operator acceleration operations on the parsed accelerated computing request data in parallel, and transmits the target operation result data generated by the target operator accelerated operation to the corresponding APP application in the server, wherein the target operation result data corresponds one-to-one to the accelerated computing request data.

2. The high-efficiency computing method suitable for homomorphic encryption privacy computing according to claim 1 is characterized in that: A homomorphic encryption library in the server, wherein the homomorphic encryption library stores a plurality of acceleration operator APIs; When the homomorphic encryption library call request includes an acceleration operator API call request, the corresponding acceleration operator API in the homomorphic encryption library is called, and the corresponding acceleration operator API call response information is generated, where: The request for calling the acceleration operator API includes at least the request data, request source ID, request destination ID, request message sequence number, and request command type; When the server responds to an acceleration operator API call request, based on the request command type in the acceleration operator API call request, the server extracts the acceleration operator API corresponding to the request command type in the homomorphic encryption library, and generates acceleration operator API call response information, wherein the acceleration operator API call response information includes the homomorphic encryption operation parameters corresponding to the acceleration operator API call request; Generate accelerated computing request data based on the acceleration operator API call request and acceleration operator API call response information, When data encapsulation is performed on any accelerated computing request data, the accelerated computing request data corresponding to the accelerated computing request data are assembled with the accelerated computing operator API call request and the accelerated computing operator API call response information, so that the accelerated computing request data is encapsulated in the corresponding accelerated computing request data packet after assembly.

3. The high-efficiency computing method suitable for homomorphic encryption privacy computing according to claim 2 is characterized in that: Any accelerated computing request data packet includes a data packet header area, a data packet parameter area, and a data packet data area, wherein: Encapsulate the request source ID, request destination ID and request message sequence number in the acceleration operator API call request in the data packet header area, encapsulate the homomorphic encryption operation parameters in the acceleration operator API call response information in the data packet parameter area, and encapsulate the calculation data to be accelerated based on the acceleration calculation request data in the data packet data area; When the accelerated computing request data packet includes multiple accelerated computing request data, the homomorphic encryption operation parameters corresponding to all the accelerated computing request data belong to the same category.

4. The high-efficiency computing method suitable for homomorphic encryption privacy computing according to claim 2 is characterized in that: A message processing thread is configured in the server, and the configured message processing thread is used to perform message queuing operation on the accelerated computing request data before data encapsulation, wherein: When executing the message queuing operation, the message processing thread will parse and queue the accelerated computing request data in sequence, so as to obtain the accelerated computing request queue after the queueing process; For the accelerated computing request data in the accelerated computing request queue, the accelerated computing request data is sequentially dequeued before data encapsulation.

5. The high-efficiency computing method suitable for homomorphic encryption privacy computing according to claim 4 is characterized in that: An interface processing thread is also configured in the server, wherein: The interface processing thread is used to perform a dequeue operation on the accelerated computing request data in the accelerated computing request queue, wherein the accelerated computing request data after the dequeue operation is encapsulated according to a preset encapsulation configuration, and an accelerated computing request data packet is generated after the data is encapsulated; The interface processing thread is used to send the accelerated computing request data packet to the privacy computing acceleration card.

6. The high-efficiency computing method suitable for homomorphic encryption privacy computing according to claim 5 is characterized in that: In the server, the accelerated computing request data is transmitted to the interface processing thread based on the memory sharing configuration, where: For the acceleration operator API call request entering the message processing thread and the corresponding acceleration operator API call response information, configure the corresponding global variables; When executing a message queuing operation on the accelerated computing request data, marking the accelerated computing request data using an entry marking element in the empty linked list; When encapsulating data in the interface processing thread, the accelerated computing request data in the accelerated computing request queue are first dequeued one by one, where: When dequeuing an accelerated computing request data, the corresponding global variable is indexed based on the queue mark element corresponding to the accelerated computing request data, and after the global variable is obtained by indexing, the corresponding queue mark element is released; Based on the global variable of the index, the acceleration operator API call request and the acceleration operator API call response information corresponding to the current acceleration calculation request data are determined, and the determined acceleration operator API call request and the corresponding acceleration operator API call response information are assembled.

7. The high-efficiency computing method suitable for homomorphic encryption privacy computing according to claim 1 is characterized in that: The privacy computing accelerator card encapsulates the generated one or more target computing result data to generate a target computing result data packet; The privacy computing accelerator card sends the target computing result data packet to the server; The server receives the target operation result data set for analysis to obtain corresponding target operation result data after analysis, and transmits the analyzed target operation result data to the corresponding APP application in the server.

8. The high-efficiency computing method suitable for homomorphic encryption privacy computing according to any one of claims 1 to 7, characterized in that: The privacy computing acceleration card is an FPGA card, wherein: The privacy computing acceleration card includes a DMA processing unit, a cache pool, a scheduling center and an acceleration engine pool. The accelerated computing request data packet received by the privacy computing accelerator card is transmitted to the DMA processing unit, and the accelerated computing request data parsed by the DMA processing unit is stored in the cache pool; The acceleration engine pool includes several independent acceleration engines. The dispatch center selects and configures the corresponding acceleration engine to perform target operator acceleration operation on the acceleration computing request data, so as to generate target operation result data after the target operator acceleration operation. The target operation result data is stored in the buffer pool and sent to the server through the DMA processing unit.

9. The high-efficiency computing method suitable for homomorphic encryption privacy computing according to claim 8 is characterized in that: An accelerated computing state machine is set up in the dispatch center, where: The dispatch center configures the working status of the acceleration engines in the acceleration engine pool based on the acceleration computing state machine, so as to perform corresponding target operator acceleration operations on the acceleration computing request data through the corresponding acceleration engines.

10. A high-efficiency computing system suitable for homomorphic encryption privacy computing, characterized in that: include: A server having a homomorphic encryption library responds to homomorphic encryption library call requests initiated by one or more APP applications, wherein: When at least one homomorphic encryption library call request includes an acceleration operator API call request, when responding to the acceleration operator API call request, an acceleration operator API call response message corresponding to the acceleration operator API call request is generated, and the acceleration computing request data to be accelerated is data-encapsulated, and the acceleration computing request data packet generated by the data encapsulation is sent to the privacy computing acceleration card, wherein the acceleration computing request data is generated based on the acceleration operator API call request and the acceleration operator API call response message; A privacy computing accelerator card, for any received accelerated computing request data packet, the privacy computing accelerator card parses the accelerated computing request data packet to generate a number of accelerated computing request data after parsing; When the number of accelerated computing request data generated by the analysis is not less than 2, the privacy computing acceleration card performs target operator acceleration operations on the analyzed accelerated computing request data in parallel, and transmits the target operation result data generated by the target operator accelerated operation to the server, wherein the target operation result data corresponds one-to-one to the accelerated computing request data.