A data batch processing method and device

By fitting the activation function to a polynomial function and constructing a sequence of matrix operations, and utilizing the tensor cores of the GPU for parallel acceleration, the problem of low computational efficiency of the activation function is solved, thereby improving the inference performance and system throughput of the neural network.

CN121122603BActive Publication Date: 2026-01-27LANGCHAO ELECTRONIC INFORMATION IND CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511658138.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-13
Publication Date
2026-01-27
Estimated Expiration
2045-11-13

AI Technical Summary

Technical Problem

In existing technologies, activation functions are computationally inefficient and cannot fully utilize the massively parallel architecture of GPUs, resulting in insufficient batch processing efficiency of neural networks and failing to meet the real-time requirements of medical image analysis.

Method used

The activation function is fitted to the target polynomial function, and matrix operations are performed by constructing the coefficient matrix, the first matrix, and the second matrix to reconstruct a batch matrix operation sequence, which is then accelerated in parallel using the tensor cores of the GPU.

Benefits of technology

It significantly improves the computation speed of activation functions and the inference efficiency of neural networks, solves the problem of insufficient parallelism of traditional computing models on GPUs, and improves the batch inference throughput of models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121122603B_ABST
    Figure CN121122603B_ABST
Patent Text Reader

Abstract

The application discloses a data batch processing method and device, and relates to the technical field of artificial intelligence, which comprises the following steps: fitting an activation function as a target polynomial function, taking an intermediate value set obtained by processing medical image data through a linear layer in a preset image analysis model as a to-be-sought evaluation point set of the target polynomial function, then constructing a coefficient matrix based on coefficients of the target polynomial function and a preset parameter, constructing a first matrix and a second matrix based on the to-be-sought evaluation point set, reconstructing a nonlinear activation function which originally needs to be calculated element by element and in series into a batch matrix operation sequence composed of the coefficient matrix, the first matrix and the second matrix through polynomial approximation and tensor decomposition, and then obtaining function values of the to-be-sought evaluation point set through matrix operation and approximating the function values to the calculation results of the activation function. Since matrix operation can be directly accelerated in parallel by using the tensor core of a GPU, the processing speed of batch data is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence security, and in particular to a method and device for batch data processing. Background Technology

[0002] With the deepening application of artificial intelligence technology in the medical field, deep learning-based medical image analysis has become an important tool to assist doctors in diagnosis. These applications typically rely on complex convolutional neural network models, which contain a large number of nonlinear activation functions. The purpose of these functions is to introduce nonlinearity so that the network can learn and fit complex medical feature patterns. The computational efficiency of these activation functions directly affects the real-time performance of the model.

[0003] In traditional approaches, activation function computation often employs an element-wise serial processing mode, where intermediate values ​​from the linear layer outputs are substituted one by one into the activation function for calculation. However, with the increase in medical image resolution and model depth, the size of the intermediate value set expands dramatically, leading to a severe performance bottleneck in the serial computation mode. This makes it difficult to meet batch processing requirements, and the serial computation mode struggles to fully utilize the massively parallel architecture of modern GPUs (Graphics Processing Units). To improve efficiency, polynomial functions are typically used to approximate complex activation functions. While polynomial evaluation is efficient in serial computation, its inherent data dependency limits its parallel computing potential. Therefore, this approach still falls short in terms of batch processing efficiency and fully utilizing the high parallelism of GPU tensor cores and other hardware features.

[0004] In summary, how can we improve the efficiency of batch computation of activation functions to enhance the inference performance of neural networks? Summary of the Invention

[0005] This application provides a data batch processing method and apparatus to at least solve the problem of low efficiency in activation function calculation during neural network inference in related technologies.

[0006] This application provides a data batch processing method, applied on a server side, including:

[0007] The intermediate value set obtained after processing medical image data through the linear layer in a preset image analysis model is used as the set of points to be calculated for the objective polynomial function. The preset image analysis model is a model built based on a neural network, and the objective polynomial function is obtained by fitting the activation function in the preset image analysis model.

[0008] Construct a coefficient matrix based on the coefficients of the objective polynomial function and preset parameters;

[0009] A first matrix is ​​constructed based on the set of points to be evaluated and the first type of vectors; the first type of vectors are a sequence of powers of each point to be evaluated, with a step size of a preset parameter.

[0010] A second matrix is ​​constructed based on the set of points to be evaluated and the second type of vectors; the second type of vectors are a sequence of powers that increase by a step size of 1 with respect to the powers of each point to be evaluated.

[0011] Perform matrix operations on the coefficient matrix, the first matrix, and the second matrix to obtain the function value of the target polynomial function with respect to the set of points to be evaluated;

[0012] The function value is used as the calculation result of the activation function of the preset image analysis model, and the processing result of the medical image data is determined based on the calculation result.

[0013] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of any of the above-described data batch processing methods.

[0014] This application also provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of any of the above-described data batch processing methods.

[0015] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described data batch processing methods.

[0016] Beneficial Effects: This application fits the activation function to a target polynomial function and uses the set of intermediate values ​​obtained after processing medical image data through a linear layer in a preset image analysis model as the set of points to be evaluated for the target polynomial function. Then, a coefficient matrix is ​​constructed based on the coefficients of the target polynomial function and preset parameters, and a first matrix and a second matrix are constructed based on the set of points to be evaluated. The nonlinear activation function, which originally required element-by-element, sequential calculation, is reconstructed into a batch matrix operation sequence consisting of the coefficient matrix, the first matrix, and the second matrix through polynomial approximation and tensor decomposition. The function value of the target polynomial function with respect to the set of points to be evaluated is then obtained through matrix operations, approximating the calculation result of the activation function. Since matrix operations can be directly accelerated in parallel using the tensor cores of the GPU, the processing speed of batch intermediate values ​​can be significantly improved, and the processing results of medical image data can be obtained quickly. This solves the technical problem of insufficient parallelism and inability to fully utilize hardware performance in traditional activation function calculation modes on GPUs, resulting in low batch inference throughput of image analysis models, and achieves the technical effect of significantly improving model inference efficiency and system throughput. Attached Figure Description

[0017] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 A flowchart of a data batch processing method provided in this application embodiment;

[0019] Figure 2 An example diagram of a tensor representation of a polynomial function provided in an embodiment of this application;

[0020] Figure 3 An example diagram of secure multi-party computation of Hadamard multiplication is provided for embodiments of this application;

[0021] Figure 4 This is a schematic diagram of a data batch processing device provided in an embodiment of this application. Detailed Implementation

[0022] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0023] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0024] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0025] First, some terms and concepts involved in the data batch processing method provided in the embodiments of this application will be explained.

[0026] Linear layers, also called fully connected layers, are one of the most basic and commonly used components of neural networks. Their core function is to linearly combine input features to create new, more advanced, or more discriminative features. Stacking multiple linear layers with non-linear activation functions allows the neural network to approximate any complex function. The input to the activation function usually comes from the output of the linear layers.

[0027] Hadamard multiplication: Also known as element-wise multiplication, Hadamard multiplication is an element-wise multiplication operation for two matrices (or vectors) with identical dimensions. The rule is to multiply corresponding elements of the two matrices directly, resulting in a new matrix with the same dimensions as the original matrix. It is usually represented by the symbol "." The term "Hadamard matrix multiplication" refers to the multiplication of two matrices with the same number of rows and columns, where the product matrix has the same number of rows and columns, and each element of the product matrix is ​​equal to the product of the corresponding elements of the two factor matrices. In this scheme, this operation is used to achieve batch evaluation of polynomial functions. By performing element-wise multiplication of the first matrix with the coefficient matrix using classical multiplication, multiple parallel computations of the desired values ​​are efficiently completed. Furthermore, due to its simple operational rules and high parallelism, it is very suitable for acceleration using GPU tensor cores.

[0028] Secure multi-party computation: Secure multi-party computation is a cryptographic technique that allows multiple participants to collaboratively complete the computation of a function without revealing their own private data. Ultimately, they only obtain the computation result and cannot access the original data of other participants.

[0029] Its core objective is to solve the problem of data availability without visibility, with common implementation methods including secret sharing and homomorphic encryption. In this solution, multiple servers each hold a secret share (rather than the complete data) of intermediate values ​​of medical images. By collaboratively performing operations such as matrix operations and Hadamard multiplication, they jointly complete the batch calculation of activation functions. This ensures the accuracy of the calculations while preventing a single server from stealing sensitive medical data, making it suitable for scenarios with extremely high data privacy requirements, such as those in the medical and financial industries.

[0030] See Figure 1 As shown, an embodiment of this application provides a data batch processing method applied to a server. The method includes:

[0031] Step S11: Obtain the intermediate value set obtained after the medical image data is processed by the linear layer in the preset image analysis model, and use the intermediate value set as the set of points to be calculated for the objective polynomial function; the preset image analysis model is a model built based on a neural network, and the objective polynomial function is obtained by fitting the activation function in the preset image analysis model.

[0032] In this embodiment, deep learning-based medical image analysis has become an important tool to assist doctors in diagnosis. This process primarily utilizes a pre-defined image analysis model built on neural networks. This pre-defined image analysis model can be an image classification model used to determine the category of the entire image, an image segmentation model used to classify each pixel in the image to delineate the precise contours of lesions, or a target detection model used to locate and identify multiple lesions in the image, labeling them with bounding boxes and assigning categories, etc. This embodiment does not impose any limitations on this. Furthermore, this embodiment does not limit the neural network architecture used in the pre-defined image analysis model; for example, it can be ResNet (Deep Residual Network), DenseNet (Dense Connection Network), etc.

[0033] This embodiment of the application fits the activation function in a preset image analysis model into a target polynomial function, and uses the intermediate value set obtained after processing medical image data through the linear layer of the preset image analysis model as the set of points to be calculated for the target polynomial function. It is understood that medical images, such as CT scans, MRI images, and pathological slide images, are pixel matrices and cannot be directly used as input to the activation function. They require feature extraction through pre-processing layers of a neural network (such as convolutional layers, pooling layers, and fully connected layers) to transform the spatial information, texture information, and lesion features of the image into low-dimensional numerical features. These feature values ​​are the direct source of the points to be calculated. In neural network inference, the activation function introduces non-linearity into the model, enhancing its ability to express complex features. The points to be calculated serve as input to the activation function, and the output value obtained after calculation by the activation function serves as input to the next layer of the network, ultimately participating in the inference process of core tasks such as lesion identification, disease grading, and image diagnosis.

[0034] Step S12: Construct a coefficient matrix based on the coefficients of the objective polynomial function and preset parameters.

[0035] In this embodiment, after performing polynomial fitting on the activation function, the server constructs a target polynomial function of the following form:

[0036] ;

[0037] Where x is the independent variable of the objective polynomial function, and a0 to a... n denoted as the coefficients of the polynomial, and n is the degree of the objective polynomial function.

[0038] Furthermore, the server will select a preset parameter k, and then construct a matrix, namely the coefficient matrix, based on the coefficients of the target polynomial function and the preset parameter k to perform tensor quantization transformation on the polynomial function.

[0039] In a specific implementation, the above-mentioned construction of a coefficient matrix based on the coefficients of the target polynomial function and preset parameters includes: expanding the target polynomial function based on the preset parameters and the current degree of the target polynomial function to obtain an expanded polynomial function; wherein the degree of the expanded polynomial function is an integer multiple of the preset parameters, and the coefficients of monomials in the expanded polynomial function with degrees higher than the current degree are 0; constructing a coefficient matrix based on the coefficients of the expanded polynomial function; the coefficient matrix is ​​used to perform tensor quantization transformation on the expanded polynomial function.

[0040] In this embodiment, the server needs to expand the target polynomial function based on the selected preset parameter k and the current degree n of the target polynomial function. Specifically, this is done by adding several higher-degree terms with coefficients of 0, so that the degree N of the expanded polynomial function is divisible by the preset parameter k, i.e., N is an integer multiple of k. The expression of the expanded polynomial function is as follows:

[0041] ;

[0042] Among them, for ,have ;for ,have N is a positive integer not less than n.

[0043] Specifically, constructing a coefficient matrix based on the coefficients of the extended polynomial function includes: starting from the first non-constant term, grouping the coefficients of the extended polynomial function sequentially to obtain groups; each group includes a target number of coefficients arranged in ascending order of their corresponding exponents, with the target number being the same as the preset parameter value; arranging the groups in descending order to obtain the coefficient matrix. In other words, the server constructs the coefficient matrix subsequently used for tensor quantization transformation of the polynomial function based on the coefficients of the extended polynomial function.

[0044] That is, the server starts with the coefficient of the first non-constant term (i.e., the 1st term) of the expanded polynomial function, and then groups the coefficients of the expanded polynomial function sequentially to obtain the groups. The number of groups is r. Each group contains k consecutive coefficients arranged in ascending order of their corresponding frequencies. That is, starting with the coefficient of the first term on the server side, the coefficients of every k adjacent terms form a group, resulting in a total of r groups. These r groups of coefficients are then arranged in the existing order from top to bottom to obtain the coefficient matrix. The coefficient matrix is ​​specifically a matrix of the following form:

[0045] .

[0046] Step S13: Construct a first matrix based on the set of points to be evaluated and the first type of vectors; the first type of vectors are a sequence of powers of each point to be evaluated, with a step size of a preset parameter.

[0047] This embodiment discloses a method for constructing a first type of vector, which specifically involves increasing the power sequence of each point to be evaluated by a preset parameter k, and then constructing a first matrix based on the set of points to be evaluated and the first type of vector.

[0048] The first type of vector is a row vector that starts with the zeroth power of the independent variable and is arranged with a preset step size for increasing the power. That is, the server arranges the independent variable from the zeroth power to the next power with a step size of k. The powers are arranged into row vectors according to a pre-defined order to obtain the first type of vector, which has the following specific form: .

[0049] Furthermore, the above-mentioned construction of the first matrix based on the set of points to be evaluated and the first type of vectors includes: substituting each point to be evaluated in the set of points to be evaluated into the independent variable of the first type of vector, and arranging them in a top-to-bottom order to obtain the first matrix. That is, the server constructs the first matrix for calculating the polynomial function vector based on the form of the first type of vector. Specifically, assuming the number of values ​​to be evaluated in the set of points to be evaluated is m, respectively... The server then substitutes the m points to be evaluated into the independent variables of the first type of vector, and arranges them in the existing order from top to bottom to obtain the first matrix. The first matrix The specific form is as follows:

[0050] .

[0051] Step S14: Construct a second matrix based on the set of points to be evaluated and the second type of vectors; the second type of vectors are a sequence of powers with a step size of 1 that increase with respect to the powers of each point to be evaluated.

[0052] This embodiment also discloses a method for constructing a second type of vector, which is to increase the power sequence of each point to be evaluated by a step size of 1, and then construct a second matrix based on the set of points to be evaluated and the second type of vector.

[0053] The second type of vector is a column vector that starts with the first power of the independent variable and is arranged in increments of 1 power. That is, the server arranges the first to k powers of the independent variable into a column vector in a pre-defined order, with increments of 1 power, to obtain the second type of vector. Its specific form is as follows: .

[0054] Furthermore, the above-mentioned construction of the second matrix based on the set of points to be evaluated and the second type of vectors includes: substituting each point to be evaluated in the set of points to be evaluated into the independent variable of the second type of vector, and taking the transpose of each column vector before arranging them in top-to-bottom order to obtain the second matrix. That is, the server constructs the second matrix for calculating the polynomial function vector based on the form of the second type of vectors. Specifically, assuming the number of points to be evaluated in the set of points to be evaluated is m, respectively... The server then substitutes the m points to be evaluated into the independent variables of the second-type vector, transposes the m column vectors, and arranges them in the existing order from top to bottom to obtain the second matrix. The second matrix The specific form is as follows:

[0055] .

[0056] Step S15: Perform matrix operations on the coefficient matrix, the first matrix, and the second matrix to obtain the function value of the target polynomial function with respect to the set of points to be evaluated.

[0057] In this embodiment, by performing matrix operations on the constructed coefficient matrix, the first matrix, and the second matrix, the function value of the target polynomial function with respect to the set of points to be evaluated can be obtained. In other words, this application reconstructs the nonlinear activation function, which originally required element-by-element, serial computation, into a batch matrix operation sequence consisting of a coefficient matrix, a first matrix, and a second matrix, through polynomial approximation and tensor decomposition. Then, the function value of the target polynomial function with respect to the set of points to be evaluated is obtained through matrix operations.

[0058] In a specific implementation, matrix operations are performed on the coefficient matrix, the first matrix, and the second matrix to obtain the function value of the target polynomial function with respect to the set of points to be evaluated. This includes: performing matrix multiplication on the first matrix and the coefficient matrix to obtain a first operation result; performing Hadamard multiplication on the first operation result and the second matrix to obtain a Hadamard product result; performing matrix multiplication on the Hadamard product result and a column vector of all 1s to obtain a second operation result; and obtaining a constant term vector constructed from the constant terms in the target polynomial function; and obtaining the function value of the target polynomial function with respect to the set of points to be evaluated based on the sum of the second operation result and the constant term vector.

[0059] In other words, the server converts the polynomial function vector into a tensor product based on the coefficient matrix, the first matrix, and the second matrix. Specifically, matrix multiplication is performed on the first matrix and the coefficient matrix to obtain the first result. Here, matrix multiplication refers to classical multiplication, which involves multiplying the corresponding row and column elements of the two matrices and then summing them to obtain a new matrix. Next, Hadamard multiplication is performed on the first result and the second matrix to obtain the Hadamard product. Then, matrix multiplication is performed on the Hadamard product and a column vector of all 1s to obtain the second result. Here, a column vector of all 1s refers to a column vector where every element is 1. Finally, a constant term vector is constructed from the constant terms of the target polynomial function, and the second result is added to the constant term vector to obtain the function values ​​of the target polynomial function at the m unknown values. The detailed process of matrix operations is as follows:

[0060] ;

[0061] The symbol " " represents matrix multiplication operation, symbol " " " indicates the Hadama multiplication operation.

[0062] It should be noted that the above process essentially relies on the tensor operation of the polynomial function. Assuming there is only one point to be evaluated, the server performs the following calculations when calculating the function value of the target polynomial function at that point:

[0063] Stepwise calculate the power from the second to the kth power of the point to be determined (with a step size of 1 for each power), and the power from the second to the kth power. The exponentiation is increased by a step size of k. The target polynomial function is expanded to obtain an expanded polynomial function. Then, the coefficient sequence of the expanded polynomial function is arranged into a matrix, starting from the 1st degree term, with each group of k consecutive coefficients forming a row-matrix. Rows with fewer than k coefficients are padded with zeros to obtain the coefficient matrix. The zeroth power, kth power, and so on of the points to be evaluated are then processed. The powers are represented as row vectors in the existing order to obtain the first type of vectors. The powers from 1 to k at the desired point are represented as column vectors in the existing order to obtain the second type of vectors. The server then multiplies the first type of vectors with the coefficient matrix, and performs an inner product operation with the second type of vectors to obtain the last N terms of the expanded polynomial function. Finally, the constant term is added to the inner product result to obtain the function value of the target polynomial function at the desired point. Figure 2 This is an example of a tensor quantization representation of a polynomial function disclosed in an embodiment of this application. In this figure, the preset parameter k is 4, where the extended polynomial function... The tensor form is as follows:

[0064] .

[0065] Furthermore, this application also provides an equivalent form of the extended polynomial function, namely, the first type of vector can be a row vector that arranges the 1st to kth powers of the independent variable (with a step size of 1) in a pre-existing order; the second type of vector can be: a row vector that arranges the 0th to kth powers of the independent variable in a row vector. The powers (increasing by a step size of k) are arranged into column vectors according to the existing order; the coefficient matrix can be obtained by starting with the coefficient of the first term (the first non-constant term) of the extended polynomial function, grouping the coefficients of every k adjacent terms into r groups, and then arranging the r groups of coefficients from left to right according to the existing order. The equivalent form of the extended polynomial function is:

[0066] .

[0067] Step S16: Use the function value as the calculation result of the activation function of the preset image analysis model, and determine the processing result of the medical image data based on the calculation result.

[0068] In this embodiment, the function value of the target polynomial function obtained through matrix operations with respect to the set of points to be evaluated is approximated as the calculation result of the activation function. It is understood that since matrix operations can be directly accelerated in parallel using the GPU's tensor cores, the processing speed of batch intermediate values ​​can be significantly improved, and the processing results of medical image data can be obtained quickly. This solves the technical problem of insufficient parallelism and inability to fully utilize hardware performance in traditional activation function calculation modes on GPUs, resulting in low batch inference throughput of image analysis models, and achieves the technical effect of significantly improving model inference efficiency and system throughput.

[0069] It is important to note that the solution presented in this application is merely an example of neural network inference in medical imaging. In reality, this method of reconstructing a batch matrix operation sequence consisting of a coefficient matrix, a first matrix, and a second matrix through polynomial approximation and tensor decomposition can be applied to any neural network inference application scenario. It can be used to perform batch calculations of activation functions, thereby improving the inference performance of the neural network. For example, in the field of financial risk control, in neural network-based credit risk assessment, it is necessary to perform nonlinear feature transformation on the user's multidimensional financial data (such as income, debt, credit records, etc.) to use the user's financial feature values ​​as input to the activation function, and then output a risk score through the activation function. Another example is in the field of autonomous driving, where the neural network of an autonomous driving system needs to process multidimensional perception data (such as obstacle distance, speed, lane position, etc.) from LiDAR, cameras, and millimeter-wave radar in real time. After preprocessing and feature extraction of this multidimensional perception data, it is used as input to the activation function, which then performs nonlinear feature mapping to assist vehicle decision-making (such as braking and steering).

[0070] As can be seen, this application fits the activation function to a target polynomial function and uses the set of intermediate values ​​obtained after processing medical image data through the linear layer of a preset image analysis model as the set of points to be evaluated for the target polynomial function. Then, a coefficient matrix is ​​constructed based on the coefficients of the target polynomial function and preset parameters, and a first matrix and a second matrix are constructed based on the set of points to be evaluated. This transforms the nonlinear activation function, which originally required element-by-element, sequential calculation, into a batch matrix operation sequence composed of the coefficient matrix, the first matrix, and the second matrix through polynomial approximation and tensor decomposition. The matrix operations then yield the function value of the target polynomial function with respect to the set of points to be evaluated, approximating the calculation result of the activation function. Since matrix operations can be directly accelerated in parallel using the tensor cores of the GPU, the processing speed of batch intermediate values ​​can be significantly improved, and the processing results of medical image data can be obtained quickly. This solves the technical problem of insufficient parallelism and inability to fully utilize hardware performance in traditional activation function calculation modes on GPUs, resulting in low batch inference throughput of image analysis models, and achieves the technical effect of significantly improving model inference efficiency and system throughput.

[0071] It should also be noted that privacy protection is often required in sensitive fields such as healthcare and finance, where it is essential to ensure the invisibility of input data during computation. In scenarios where the privacy of inference data needs to be protected, privacy-preserving computation protocols based on secret sharing are commonly used techniques for data privacy protection. Traditional solutions can securely compute basic arithmetic operations such as addition and multiplication, as well as comparison operations. However, for activation functions in neural network inference, directly computing complex activation functions or their exact polynomial approximations on the secretly shared data is usually very inefficient. Although methods such as piecewise polynomials or lookup tables can be used to approximate activation functions under MPC (Secure Multi-Party Computation), these methods often lack deep optimization for GPU architectures. Therefore, how to efficiently and with high data parallelism compute polynomial functions in batches under secret sharing, while maintaining protocol security and minimizing communication rounds, is a significant challenge currently faced.

[0072] Therefore, based on the content disclosed in the foregoing embodiments, in a secure multi-party computation environment, each server in this application holds a secret share of each value to be evaluated in the set of valued points. Assuming there are t servers, then the t servers jointly hold m valued points. Sharing the secrets of addition Understandably, each value to be requested is divided into t parts (called shares) using a specific algorithm, and then distributed to t servers. The whole process is a secret sharing, and each server holds one of the data, that is, it holds a secret share of each value to be requested.

[0073] Accordingly, the data batch processing method of this application further includes: determining the first power information in the first type of vector, determining the second power information in the second type of vector, and calculating the secret share of each point to be evaluated with respect to the first power information and the second power information based on the secret share of each point to be evaluated. It can be understood that, as can be seen from the foregoing, the first power information in the first type of vector is the independent variable raised to the power of 0. The second power, the second power information in the second type of vector, the 1st to kth powers of the independent variable; therefore, in this embodiment, each server needs to calculate the secret share of each to-be-valued point with respect to the first and second power information based on the secret share of each to-be-valued point. That is, for Each server is composed of Sharing the secrets of addition Collaborative calculation of each power Sharing the secrets of addition.

[0074] In a secure multi-party computation scenario, a first matrix is ​​constructed based on a set of points to be evaluated and a first type of vector. This includes: substituting the secret share of each point to be evaluated with respect to the first power information and the second power information into the independent variables of the first type of vector, and arranging them in a top-to-bottom order to obtain the secret share of the first matrix; correspondingly, a second matrix is ​​constructed based on the set of points to be evaluated and the second type of vector. This includes: substituting the secret share of each point to be evaluated with respect to the first power information and the second power information into the independent variables of the second type of vector, and taking the transpose of each column vector and arranging them in a top-to-bottom order to obtain the secret share of the second matrix.

[0075] Understandably, each server will construct the secret shares of the first and second matrices locally based on the secret shares of each power of the value to be evaluated. Specifically, the server sequentially substitutes the secret shares of each value to be evaluated with respect to the first and second power information into the independent variables of the first type of vector, and arranges them in top-down order to obtain the secret shares of the first matrix. Furthermore, the server sequentially substitutes the secret shares of each value to be evaluated with respect to the first and second power information into the independent variables of the second type of vector, and after transposing each column vector, arranges them in top-down order to obtain the secret shares of the second matrix. Alternatively, the secret shares of each value to be evaluated with respect to the first and second power information can be directly used to replace the value to be evaluated in the first and second matrices.

[0076] In terms of form, for server The secret shares of the first and second matrices constructed locally are as follows:

[0077] ;

[0078] ;

[0079] It should be noted that the addition secret of 1 can be distributed by any designated server. For example, a simple distribution method is: server... The server holds 1 share, while other servers hold 0 shares.

[0080] Furthermore, in a secure multi-party computation scenario, matrix operations are performed on the coefficient matrix, the first matrix, and the second matrix to obtain the function value of the target polynomial function with respect to the set of points to be evaluated. This includes: performing matrix multiplication on the secret share of the first matrix and the coefficient matrix to obtain the secret share of the first operation result; performing Hadamard multiplication on the secret share of the first operation result and the secret share of the second matrix to obtain the secret share of the Hadamard product result; wherein, the secret share of the first operation result is the set of secret shares of the first operation result corresponding to each server; the secret share of the second matrix is ​​the set of secret shares of the second matrix corresponding to each server; performing matrix multiplication on the secret share of the Hadamard product result and a column vector of all 1s to obtain the secret share of the second operation result, and obtaining the secret share of the constant term vector constructed by the preset server for the constant term in the target polynomial function; and obtaining the secret share of the function value of the target polynomial function with respect to the set of points to be evaluated based on the sum of the secret share of the second operation result and the secret share of the constant term vector.

[0081] That is, based on the secret sharing of the coefficient matrix and the first and second matrices, each server transforms the secure multi-party computation task of the polynomial function vector into a secure multi-party computation task oriented towards tensor operations. First, each server performs matrix multiplication locally on the secret share of the first matrix and the coefficient matrix to obtain the secret share of the first operation result. For example, for... server Perform the following calculations locally:

[0082] ;

[0083] After each server obtains its secret share of the first operation result, all secret shares constitute the secret share of the first operation result. Then, all servers collaboratively calculate the Hadamard product of the secret share of the first operation result and the secret share of the second matrix to obtain the secret share of the Hadamard product result.

[0084] Specifically, each server performs Hadamard multiplication on the secret share of the first operation result and the secret share of the second matrix to obtain the secret share of the Hadamard product result. Formally, each server collaboratively performs the following calculations:

[0085] ;

[0086] Next, each server performs matrix multiplication on the secret share of the Hadamard product result and the all-1 column vector to obtain the secret share of the second operation result. Formally, each server collaboratively performs the following calculations:

[0087] ;

[0088] Finally, each component is processed by a specific pre-defined server. The column vectors (i.e., the constant term vectors) are added and secretly shared to obtain the secret share of the constant term vector. Then, each server adds the secret share of the constant term vector to the secret share of the second operation result, thus obtaining the secret share of the function value of the target polynomial function with respect to the set of points to be evaluated. Formally, each server collaboratively performs the following calculations:

[0089] ;

[0090] One simple method for secretly sharing constant term vectors is that a specific server holds a secret sharing share of 1, while other servers hold a secret sharing share of 0.

[0091] In a specific implementation, the process of performing Hadamard multiplication on the secret sharing of the first operation result and the secret sharing of the second matrix to obtain the secret sharing of the Hadamard product result includes: obtaining a secret share of the multiplication triple sent by a preset trusted third party; wherein the multiplication triple includes a first auxiliary matrix, a second auxiliary matrix, and an auxiliary product matrix, the auxiliary product matrix being the Hadamard product between the first auxiliary matrix and the second auxiliary matrix; calculating and interactively recovering the target intermediate matrix based on the secret share of the first operation result, the secret share of the second matrix, and the secret share of the multiplication triple; calculating the secret share of the Hadamard product result based on the target intermediate matrix and the secret share of the multiplication triple; the Hadamard product result is the result obtained by performing Hadamard multiplication on the secret share of the first operation result and the secret share of the second matrix.

[0092] First, it should be noted that this embodiment involves two types of participants: the server and a trusted third party, as explained below:

[0093] Server-side: This involves multiple participants providing computational services. It receives encrypted forms of sensitive or auxiliary data (such as secret shares based on secret sharing technology) from data providers and trusted third parties, and possesses abundant computing and bandwidth resources. Multiple servers interact to complete a series of computational tasks, obtaining encrypted forms of the computation results (such as the final result of model inference or intermediate results of the inference process) for further computation or for the client to recover the final result.

[0094] Trusted Third Party: A neutral entity trusted by all participants, strictly adhering to system execution procedures, rigorously protecting all confidential information it accesses, and ensuring it does not disclose it to any unauthorized third party, thereby facilitating the secure and correct execution of the computation task. In this solution, the primary task of the trusted third party is to distribute auxiliary data to assist the server in completing the secure multi-party computation process.

[0095] Since the computation of polynomial function vectors involves Hadamard multiplication, a secure multi-party computation technique based on addition secret sharing for Hadamard multiplication is proposed. Assume there are t servers. Joint holding 1-th order matrix Sharing the secrets of addition The purpose is to calculate the product of the Hadamard matrix. The secret of addition is shared. Matrix X corresponds to the first operation result in this scheme, matrix Y corresponds to the second matrix in this scheme, and matrix Z corresponds to the Hadamard product result in this scheme.

[0096] like Figure 3 As shown in this embodiment, a pre-defined trusted third party first generates a set of Beaver triples (also known as multiplication triples) of secret shared values ​​for securely performing Hadamard multiplication, and distributes the secret shares of the multiplication triples to different servers. Specifically, each multiplication triple includes a first auxiliary matrix, a second auxiliary matrix, and an auxiliary product matrix, where the auxiliary product matrix is ​​the Hadamard product between the first and second auxiliary matrices. Specifically, the trusted third party randomly generates a first auxiliary matrix and a second auxiliary matrix of the same order as the second matrix. and calculate Then, a trusted third party randomly generates... Sharing the secrets of addition:

[0097] ;

[0098] And Secretly sent to the server .

[0099] Furthermore, the server calculates and interactively reconstructs the target intermediate matrix based on the secret share of the first operation result, the secret share of the second matrix, and the secret share of the multiplication triple. Specifically, each server locally calculates the addition secret share of the differences between the first operation result and the second matrix and the corresponding matrices of the multiplication triple, interactively reconstructs the target intermediate matrix, and then calculates the secret share of the Hadamard product result based on the target intermediate matrix and the secret share of the multiplication triple. As can be seen from the foregoing, the Hadamard product result is the result obtained by performing a Hadamard multiplication operation on the secret share of the first operation result and the secret share of the second matrix.

[0100] The target intermediate matrix includes a first intermediate matrix and a second intermediate matrix. The first intermediate matrix is ​​the difference between the first operation result and the first auxiliary matrix, and the second intermediate matrix is ​​the difference between the second matrix and the second auxiliary matrix. Correspondingly, based on the secret share of the first operation result, the secret share of the second matrix, and the secret share of the multiplication triple, the target intermediate matrix is ​​calculated and interactively recovered. This includes: performing a difference operation on the secret share of the first operation result and the secret share of the first auxiliary matrix to obtain the secret share of the first intermediate matrix, and sending the secret share of the first intermediate matrix to the other servers; performing a difference operation on the secret share of the second matrix and the secret share of the second auxiliary matrix to obtain the secret share of the second intermediate matrix, and sending the secret share of the second intermediate matrix to the other servers; summing the secret shares of each first intermediate matrix held locally to recover the first intermediate matrix, and summing the secret shares of each second intermediate matrix held locally to recover the second intermediate matrix.

[0101] That is, the target intermediate matrix specifically includes the first intermediate matrix E and the second intermediate matrix F. The first intermediate matrix is ​​the difference between the first operation result X and the first auxiliary matrix A, i.e., E=XA; the second intermediate matrix is ​​the difference between the second matrix Y and the second auxiliary matrix B, i.e., F=YB.

[0102] The specific recovery process of the first and second intermediate matrices is as follows:

[0103] The secret share of the first operation result X is subtracted from the secret share of the first auxiliary matrix A to obtain the secret share of the first intermediate matrix XA. Similarly, the secret share of the second matrix Y is subtracted from the secret share of the second auxiliary matrix B to obtain the secret share of the second intermediate matrix YB. Specifically, the server... Perform the following calculations:

[0104] ;

[0105] Then the secret shares of the first intermediate matrix and the secret shares of the second intermediate matrix are sent to the remaining servers, i.e. Send the calculation results to and .

[0106] Next, each server can sum the secret shares of each first intermediate matrix and each second intermediate matrix held locally to recover the first and second intermediate matrices. That is, each server performs the following calculation locally:

[0107] ;

[0108] Furthermore, the above-mentioned calculation of the secret share of the Hadamard product result based on the secret share of the target intermediate matrix and the multiplication triple includes: performing Hadamard multiplication on the secret share of the first intermediate matrix and the second auxiliary matrix to obtain the first Hadamard product; performing Hadamard multiplication on the secret share of the second intermediate matrix and the first auxiliary matrix to obtain the second Hadamard product; and obtaining the secret share of the Hadamard product result based on the secret share of the first Hadamard product, the second Hadamard product and the secret share of the auxiliary product matrix.

[0109] That is, each server locally calculates the Hadamard product of the secret shares of the first intermediate matrix and the second auxiliary matrix to obtain the first Hadamard product, and locally calculates the Hadamard product of the secret shares of the second intermediate matrix and the first auxiliary matrix to obtain the second Hadamard product. Then, the secret shares of the first Hadamard product, the second Hadamard product, and the auxiliary product matrix are summed to obtain the secret share of the Hadamard product result. Specifically, the server... Perform the following calculations:

[0110] ;

[0111] It should be noted that this embodiment also requires the selection of a specific server. , Based on the aforementioned calculation results, a specific server adds the Hadamard product of the first intermediate matrix E and the second intermediate matrix F. That is, the server... Perform the following calculation locally:

[0112] .

[0113] Finally, the summation of the calculation results of all servers (including the specific server) equals the Hadamard product Z.

[0114] It should also be noted that in this embodiment, each server is composed of... Sharing the secrets of addition Collaborative calculation of each power The addition secret sharing is also achieved through secure multi-party computation techniques oriented towards Hadamard multiplication, collaboratively calculating the addition secret sharing of each power of the evaluation point vector. Specifically, the evaluation point vector is defined. And the j-th power of the value point vector, ,in, .

[0115] for Each server then collaborates to perform calculations in sequence:

[0116] ;

[0117] for Each server then collaborates to perform calculations in sequence:

[0118] .

[0119] The specific calculation process for Hadamard multiplication is consistent with the aforementioned principle and will not be repeated here.

[0120] As can be seen, this application addresses the insufficient performance of batch computation of activation functions in neural network inference scenarios and solves the performance bottleneck and data privacy leakage problems in the evaluation process of polynomial functions. This invention transforms polynomial function evaluation into tensor operations with a relatively low computational cost, so as to utilize the high parallelism of tensor operations for GPU heterogeneous acceleration computation, thereby significantly improving computational performance. To protect the privacy of sensitive data during the computation process, a Hadamard multiplication secure multi-party computation scheme based on addition secret sharing is proposed. On this basis, a tensor-based secure multi-party computation scheme for batch evaluation of polynomial functions is proposed, so as to utilize GPU to accelerate the secure multi-party computation process of batch polynomial functions, significantly improving computational performance while protecting data privacy.

[0121] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.

[0122] See Figure 4 As shown, an embodiment of this application provides a data batch processing apparatus applied to a server. The apparatus includes:

[0123] The module 11 for obtaining the values ​​to be calculated is used to obtain the set of intermediate values ​​obtained after the medical image data is processed by the linear layer in the preset image analysis model, and to use the set of intermediate values ​​as the set of points to be calculated for the target polynomial function; the preset image analysis model is a model built based on a neural network, and the target polynomial function is obtained by fitting the activation function in the preset image analysis model.

[0124] The coefficient matrix construction module 12 is used to construct a coefficient matrix based on the coefficients of the target polynomial function and preset parameters.

[0125] The first matrix construction module 13 is used to construct a first matrix based on the set of points to be evaluated and a first type of vector; the first type of vector is a power sequence with a step size of a preset parameter for each power of the points to be evaluated.

[0126] The second matrix construction module 14 is used to construct a second matrix based on the set of points to be evaluated and the second type of vectors; the second type of vectors are a sequence of powers that increase by a step size of 1 with respect to the powers of each point to be evaluated.

[0127] The matrix operation module 15 is used to perform matrix operations on the coefficient matrix, the first matrix, and the second matrix to obtain the function value of the target polynomial function with respect to the set of points to be evaluated.

[0128] The result acquisition module 16 is used to use the function value as the calculation result of the activation function of the preset image analysis model, so as to determine the processing result of the medical image data based on the calculation result.

[0129] As can be seen, this application fits the activation function to a target polynomial function and uses the set of intermediate values ​​obtained after processing medical image data through the linear layer of a preset image analysis model as the set of points to be evaluated for the target polynomial function. Then, a coefficient matrix is ​​constructed based on the coefficients of the target polynomial function and preset parameters, and a first matrix and a second matrix are constructed based on the set of points to be evaluated. This transforms the nonlinear activation function, which originally required element-by-element, sequential calculation, into a batch matrix operation sequence composed of the coefficient matrix, the first matrix, and the second matrix through polynomial approximation and tensor decomposition. The matrix operations then yield the function value of the target polynomial function with respect to the set of points to be evaluated, approximating the calculation result of the activation function. Since matrix operations can be directly accelerated in parallel using the tensor cores of the GPU, the processing speed of batch intermediate values ​​can be significantly improved, and the processing results of medical image data can be obtained quickly. This solves the technical problem of insufficient parallelism and inability to fully utilize hardware performance in traditional activation function calculation modes on GPUs, resulting in low batch inference throughput of image analysis models, and achieves the technical effect of significantly improving model inference efficiency and system throughput.

[0130] For a description of the features in the embodiment corresponding to the data batch processing device, please refer to the relevant description in the embodiment corresponding to the data batch processing method, which will not be repeated here.

[0131] Embodiments of this application also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above-described data batch processing method embodiments.

[0132] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described data batch processing method embodiments when running.

[0133] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0134] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described data batch processing method embodiments.

[0135] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described data batch processing method embodiments.

[0136] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0137] The above provides a detailed description of a data batch processing method and apparatus provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and its core ideas. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.

Claims

1. A method for batch data processing, characterized in that, Applied to the server side, including: An intermediate value set is obtained by processing medical image data through a linear layer in a preset image analysis model, and this intermediate value set is used as the set of points to be calculated for a target polynomial function. The preset image analysis model is a model built based on a neural network, and the target polynomial function is obtained by fitting the activation function in the preset image analysis model. Construct a coefficient matrix based on the coefficients of the target polynomial function and preset parameters; A first matrix is ​​constructed based on the set of points to be evaluated and the first type of vectors; the first type of vectors is a power sequence with respect to the power of each point to be evaluated, increasing by a step size equal to the preset parameter; A second matrix is ​​constructed based on the set of points to be evaluated and the second type of vectors; the second type of vectors is a sequence of powers increasing by a step size of 1 with respect to the powers of each point to be evaluated. Matrix operations are performed on the coefficient matrix, the first matrix, and the second matrix to obtain the function value of the target polynomial function with respect to the set of points to be evaluated; The function value is used as the calculation result of the activation function of the preset image analysis model, and the processing result of the medical image data is determined based on the calculation result.

2. The data batch processing method according to claim 1, characterized in that, The construction of the coefficient matrix based on the coefficients of the target polynomial function and preset parameters includes: The target polynomial function is expanded based on preset parameters and the current degree of the target polynomial function to obtain an expanded polynomial function; wherein the degree of the expanded polynomial function is an integer multiple of the preset parameters, and the coefficients of monomials in the expanded polynomial function with degrees higher than the current degree are 0. A coefficient matrix is ​​constructed based on the coefficients of the extended polynomial function; the coefficient matrix is ​​used to perform tensor quantization transformation on the extended polynomial function. The construction of the coefficient matrix based on the coefficients of the extended polynomial function includes: Starting from the first non-constant term, the coefficients in the expanded polynomial function are grouped sequentially to obtain each group; each group includes a target number of coefficients arranged in ascending order of their corresponding exponents, and the target number is the same as the value of the preset parameter. The groups are arranged in a top-to-bottom order to obtain the coefficient matrix.

3. The data batch processing method according to claim 1, characterized in that, The first type of vector is a row vector that starts from the 0th power of the independent variable and is arranged with the power increase step size being the preset parameter. The second type of vector is a column vector that starts from the 1st power of the independent variable and is arranged with the power increase step size being 1. Accordingly, constructing the first matrix based on the set of points to be evaluated and the first type of vectors includes: Substitute each point to be evaluated in the set of points to be evaluated into the independent variable in the first type of vector, and arrange them in order from top to bottom to obtain the first matrix; Accordingly, constructing the second matrix based on the set of points to be evaluated and the second type of vectors includes: Substitute each point to be evaluated in the set of points to be evaluated into the independent variable in the second type of vector, and after transposing each column vector, arrange them in order from top to bottom to obtain the second matrix.

4. The data batch processing method according to claim 3, characterized in that, The step of performing matrix operations on the coefficient matrix, the first matrix, and the second matrix to obtain the function value of the target polynomial function with respect to the set of points to be evaluated includes: Perform matrix multiplication on the first matrix and the coefficient matrix to obtain a first operation result, and perform Hadamard multiplication on the first operation result and the second matrix to obtain a Hadamard product result; Perform matrix multiplication on the Hadamard product result and the all-1 column vector to obtain the second operation result, and obtain the constant term vector constructed from the constant terms in the target polynomial function; Based on the second operation result and the sum of the constant term vector, the function value of the target polynomial function with respect to the set of points to be evaluated is obtained.

5. The data batch processing method according to claim 3, characterized in that, In a secure multi-party computation environment, each server holds a secret share of each point to be evaluated in the set of points to be evaluated. Accordingly, the data batch processing method further includes: Determine the first power information in the first type of vector and the second power information in the second type of vector, and calculate the secret share of each point to be evaluated with respect to the first power information and the second power information based on the secret share of each point to be evaluated; The construction of the first matrix based on the set of points to be evaluated and the first type of vectors includes: Substitute the secret share of each point to be evaluated with respect to the first power information and the second power information into the independent variable in the first type of vector, and arrange them in order from top to bottom to obtain the secret share of the first matrix. Accordingly, constructing the second matrix based on the set of points to be evaluated and the second type of vectors includes: Substitute the secret share of each point to be evaluated with respect to the first power information and the second power information into the independent variable in the second type vector, and after transposing each column vector, arrange them in order from top to bottom to obtain the secret share of the second matrix.

6. The data batch processing method according to claim 5, characterized in that, The step of performing matrix operations on the coefficient matrix, the first matrix, and the second matrix to obtain the function value of the target polynomial function with respect to the set of points to be evaluated includes: A matrix multiplication operation is performed on the secret share of the first matrix and the coefficient matrix to obtain the secret share of the first operation result. Then, a Hadamard multiplication operation is performed on the secret share of the first operation result and the secret share of the second matrix to obtain the secret share of the Hadamard product result. The secret share of the first operation result is the set of secret shares of the first operation result corresponding to each server. The secret share of the second matrix is ​​the set of secret shares of the second matrix corresponding to each server. The secret share of the Hadamard product result is multiplied by a matrix multiplication operation with an all-1 column vector to obtain the secret share of the second operation result, and the secret share of the constant term vector constructed by the preset server for the constant term in the target polynomial function is obtained. The secret share of the function value of the target polynomial function with respect to the set of points to be evaluated is obtained by summing the secret share of the second operation result and the secret share of the constant term vector.

7. The data batch processing method according to claim 6, characterized in that, The process of performing Hadamard multiplication on the secret share of the first operation result and the secret share of the second matrix to obtain the secret share of the Hadamard product result further includes: Obtain a secret share of a multiplication triple sent by a pre-defined trusted third party; wherein the multiplication triple includes a first auxiliary matrix, a second auxiliary matrix, and an auxiliary product matrix, and the auxiliary product matrix is ​​the Hadamard product between the first auxiliary matrix and the second auxiliary matrix; Based on the secret share of the first operation result, the secret share of the second matrix, and the secret share of the multiplication triple, the target intermediate matrix is ​​calculated and interactively recovered. The secret share of the Hadamard product result is calculated based on the secret share of the target intermediate matrix and the multiplication triple; the Hadamard product result is the result obtained by performing Hadamard multiplication on the first operation result and the second matrix.

8. The data batch processing method according to claim 7, characterized in that, The target intermediate matrix includes a first intermediate matrix and a second intermediate matrix. The first intermediate matrix is ​​the difference between the first operation result and the first auxiliary matrix, and the second intermediate matrix is ​​the difference between the second matrix and the second auxiliary matrix. Accordingly, the calculation and interactive recovery of the target intermediate matrix based on the secret share of the first operation result, the secret share of the second matrix, and the secret share of the multiplication triple includes: Perform a difference operation between the secret share of the first calculation result and the secret share of the first auxiliary matrix to obtain the secret share of the first intermediate matrix, and send the secret share of the first intermediate matrix to the other servers; Perform a difference operation on the secret share of the second matrix and the secret share of the second auxiliary matrix to obtain the secret share of the second intermediate matrix, and send the secret share of the second intermediate matrix to the other servers; The secret shares of each first intermediate matrix held locally are summed to recover the first intermediate matrix, and the secret shares of each second intermediate matrix held locally are summed to recover the second intermediate matrix.

9. The data batch processing method according to claim 8, characterized in that, The secret share of the Hadamard product result calculated based on the secret share of the target intermediate matrix and the multiplicative triple includes: Perform Hadamard multiplication on the secret shares of the first intermediate matrix and the second auxiliary matrix to obtain the first Hadamard product; Perform Hadamard multiplication on the secret share of the second intermediate matrix and the first auxiliary matrix to obtain the second Hadamard product; The secret share of the Hadamard product result is obtained based on the secret share of the first Hadamard product, the second Hadamard product, and the auxiliary product matrix.

10. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the data batch processing method as described in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Privacy protection reasoning method and system for diffusion model sampling

    CN118886506A

  • Neural network privacy reasoning method and device based on winograd sparse convolution and differentiable activation function approximation

    CN119538302A