An encoding computation method and related apparatus

CN122963794APending Publication Date: 2026-10-23UNIV OF SCI & TECH OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611150215.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-30
Publication Date
2026-10-23

AI Technical Summary

Technical Problem

然而,现有分布式计算方案仍存在两个方面的问题:一方面,分布式计算系统中常存在掉队节点,即部分计算节点由于计算能力不足、资源占用较高或通信延迟较大,导致整体任务完成时间受最慢节点限制,从而显著增加任务时延

Benefits of technology

获取待计算的原始数据矩阵和输入向量,并将原始数据矩阵划分为多个原始数据子矩阵,同时生成多个随机矩阵对原始数据矩阵进行安全扰动;进一步地,将多个原始数据子矩阵和多个随机矩阵共同作为源符号,并通过生成矩阵对各源符号进行线性编码,得到多个编码子矩阵,其中,生成矩阵的每一行仅采用部分源符号参与编码,且随机矩阵中任一矩阵元素为非零元素的概率小于有限域中随机取值为非零元素的概率。由此,通过在安全扰动阶段引入稀疏随机矩阵,并在编码阶段利用稀疏生成矩阵限制源符号的混合范围,可以避免传统稠密安全编码方案对原始数据矩阵稀疏性的破坏,使生成的编码子矩阵仍保持较高稀疏性,从而降低计算节点进行矩阵运算时的非零元素处理数量,降低节点计算复杂度,并减少由编码数据稠密化带来的任务时延。进一步地,本申请通过将多个编码子矩阵分别发送至对应的计算节点,并在接收到的计算结果数量达到恢复阈值时恢复原始数据矩阵与输入向量的运算结果,使得主节点无需等待全部计算节点完成计算,即可恢复目标结果。因此,本申请不仅能够通过随机矩阵实现对原始数据的安全保护,还能够通过恢复阈值机制保持对掉队节点的容忍能力。相较于传统稠密安全编码计算方案,在保证恢复阈值和掉队容忍能力的同时,进一步降低了编码数据矩阵的稠密程度,从而兼顾数据安全、掉队容忍、计算复杂度和任务时延等多个性能目标。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122963794A_ABST
    Figure CN122963794A_ABST
Patent Text Reader

Abstract

The application discloses an encoding calculation method, which performs safe disturbance on an original data matrix by generating a random matrix with low probability of non-zero elements, and controls each encoding sub-matrix to participate in linear coding only by part of source symbols by using a generated matrix, so that the encoding sub-matrix has the ability of safe disturbance and redundancy recovery while still maintaining high sparsity. Therefore, when a calculation node performs matrix operation based on the encoding sub-matrix and an input vector, the number of non-zero elements to be processed is smaller, thereby reducing the calculation complexity and task delay; and when the number of calculation results reaches a recovery threshold, the master node can recover the operation results of the original data matrix and the input vector, without waiting for all the calculation nodes to return the results, so as to balance the requirements of data security, tolerance of falling behind and low complexity and low delay in the sparse data calculation scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to an encoding calculation method and related apparatus. Background Technology

[0002] With the increasing demand for large-scale data processing, distributed computing, by breaking down computational tasks and distributing them to multiple computing nodes for parallel execution, has become an important technical means for handling large-scale computational tasks such as matrix operations. However, existing distributed computing solutions still have two problems: First, distributed computing systems often have lagging nodes, meaning that some computing nodes, due to insufficient computing power, high resource consumption, or large communication latency, cause the overall task completion time to be limited by the slowest node, thus significantly increasing task latency. Second, in the process of sending raw data to various computing nodes, if there is a lack of effective data protection mechanisms, the raw data can easily be obtained on the computing node side or inferred by multiple computing nodes in collusion, thus bringing data security risks.

[0003] To address this, related technologies introduce redundant coding and random data perturbation to balance fallback tolerance and data security to some extent.

[0004] However, when using the encoding and computation methods of related technologies, the computational complexity of the computing nodes is high, which leads to increased task latency. Summary of the Invention

[0005] To address the aforementioned issues, this application provides an encoding calculation method and related apparatus to reduce the computational complexity of computing nodes while also ensuring fallback tolerance and data security.

[0006] Based on this, the following technical solution is disclosed in this application: In a first aspect, embodiments of this application provide an encoding calculation method applied to a master node, the method comprising: Obtain the original data matrix and input vector to be calculated; The original data matrix is ​​divided into multiple original data sub-matrices, and multiple random matrices are generated; wherein, the multiple random matrices are used to perform a secure perturbation on the original data matrix, and the probability that any element of the random matrix is ​​a non-zero element is less than the probability that a non-zero element is randomly selected in a finite field; Based on the plurality of original data sub-matrices and the plurality of random matrices, a plurality of source symbols are determined, and a generator matrix is ​​constructed; wherein, the plurality of source symbols include the plurality of original data sub-matrices and the plurality of random matrices, each row of the generator matrix corresponds to a coding sub-matrix, each column of the generator matrix corresponds to a source symbol, and the non-zero elements in any row of the generator matrix are used to indicate the source symbol and its coding coefficients used in the coding sub-matrix corresponding to that row, and the number of non-zero elements in each row of the generator matrix is ​​less than the number of the plurality of source symbols; Based on the generator matrix, the multiple source symbols are linearly encoded to obtain multiple encoding submatrices; The plurality of encoded sub-matrices are sent to the corresponding computing nodes respectively, and the input vector is broadcast to each computing node so that each computing node performs matrix operations based on the received encoded sub-matrices and the input vector; The system receives the calculation results returned by the multiple computing nodes, and when the number of calculation results reaches the recovery threshold, it recovers the operation result of the original data matrix and the input vector based on the calculation results.

[0007] Secondly, embodiments of this application provide an encoding calculation device applied to a master node, the device comprising: The acquisition unit is used to acquire the original data matrix and input vector to be calculated; A generation unit is used to divide the original data matrix into multiple original data sub-matrices and generate multiple random matrices; wherein, the multiple random matrices are used to perform a secure perturbation on the original data matrix, and the probability that any element in the random matrix is ​​a non-zero element is less than the probability that a non-zero element is randomly selected in a finite field. A construction unit is configured to determine multiple source symbols and construct a generator matrix based on the multiple original data sub-matrices and the multiple random matrices; wherein the multiple source symbols include the multiple original data sub-matrices and the multiple random matrices, each row of the generator matrix corresponds to a coding sub-matrix, each column of the generator matrix corresponds to a source symbol, and the non-zero elements in any row of the generator matrix are used to indicate the source symbol and its coding coefficients used in the coding sub-matrix corresponding to that row, and the number of non-zero elements in each row of the generator matrix is ​​less than the number of multiple source symbols; The encoding unit is used to linearly encode the plurality of source symbols based on the generator matrix to obtain a plurality of encoding submatrices; The transmission unit is configured to send the plurality of encoded sub-matrices to the corresponding computing nodes respectively, and broadcast the input vector to each computing node, so that each computing node performs matrix operations based on the received encoded sub-matrices and the input vector; The recovery unit is used to receive the calculation results returned by the multiple computing nodes respectively, and when the number of calculation results reaches the recovery threshold, to recover the operation result of the original data matrix and the input vector based on the calculation results.

[0008] Thirdly, embodiments of this application provide a computer device, the computer device including a processor and a memory: The memory is used to store computer programs and to transfer the computer programs to the processor; The processor is configured to execute the method described in the first aspect above according to the computer program.

[0009] Fourthly, embodiments of this application provide a computer-readable storage medium for storing a computer program for performing the method described in the first aspect above.

[0010] Fifthly, embodiments of this application provide a computer program product including a computer program, which, when run on a computer device, causes the computer device to perform the method described in the first aspect above.

[0011] As can be seen from the above technical solutions, this application has at least the following beneficial effects: The process involves acquiring the original data matrix and input vector to be computed, dividing the original data matrix into multiple original data sub-matrices, and simultaneously generating multiple random matrices to perform a security perturbation on the original data matrix. Further, these multiple original data sub-matrices and multiple random matrices are used together as source symbols, and each source symbol is linearly encoded using a generator matrix to obtain multiple encoded sub-matrices. Each row of the generator matrix uses only a subset of the source symbols for encoding, and the probability of any element in the random matrix being non-zero is less than the probability of randomly selecting a non-zero element in a finite field. Therefore, by introducing sparse random matrices during the security perturbation stage and using sparse generator matrices to limit the mixing range of source symbols during the encoding stage, the sparsity of the original data matrix can be avoided by traditional dense security coding schemes. This ensures that the generated encoded sub-matrices maintain high sparsity, thereby reducing the number of non-zero elements processed during matrix operations by computing nodes, reducing node computational complexity, and minimizing task latency caused by data densification. Furthermore, this application sends multiple encoded sub-matrices to their respective computing nodes, and restores the operation results of the original data matrix and input vector when the number of received computation results reaches a recovery threshold. This allows the master node to recover the target result without waiting for all computing nodes to complete their computations. Therefore, this application not only achieves secure protection of the original data through a random matrix, but also maintains tolerance for lagging nodes through a recovery threshold mechanism. Compared to traditional dense secure encoding computation schemes, this application further reduces the density of the encoded data matrix while ensuring the recovery threshold and lagging tolerance, thus balancing multiple performance objectives such as data security, lagging tolerance, computational complexity, and task latency. Attached Figure Description

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

[0013] Figure 1 A flowchart illustrating an encoding calculation method provided in an embodiment of this application; Figure 2 A schematic diagram of an encoding computation framework provided in an embodiment of this application; Figure 3 This is a schematic diagram illustrating the result of task latency varying with the sparsity of the original data matrix, provided in an embodiment of this application. Figure 4 This is a schematic diagram illustrating the result of task latency varying with the sparsity of a random matrix, provided in an embodiment of this application. Figure 5This is a schematic diagram of the structure of an encoding computing device provided in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0014] Embodiments of this application will now be described in more detail with reference to the accompanying drawings. While some embodiments of this application are shown in the drawings, it should be understood that this application can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this application. It should be understood that the drawings and embodiments of this application are for illustrative purposes only and are not intended to limit the scope of protection of this application.

[0015] In related technologies, for a large number of original data matrices with sparse characteristics, dense random matrices and dense generator matrices are mostly used for encoding, so that the encoded data matrix obtained after encoding is usually a dense linear combination of the original data submatrices and random matrices.

[0016] The inherent sparsity of the original data matrix is ​​destroyed during the encoding process, causing subsequent computing nodes to process more non-zero elements when performing matrix operations. This significantly increases computational complexity and task latency. In other words, while the encoding methods in related technologies can alleviate the problem of lagging nodes and provide data security protection to some extent, they are difficult to balance data security, lagging tolerance, and the computational requirements of low complexity and low latency when facing sparse data computing scenarios.

[0017] Based on this, embodiments of this application provide an encoding calculation method and related apparatus. The method securely perturbs the original data matrix by generating a random matrix with a low probability of non-zero elements, and uses the generator matrix to control that each encoded submatrix is ​​obtained by linear encoding using only a subset of source symbols. This allows the encoded submatrix to maintain high sparsity while possessing secure perturbation and redundancy recovery capabilities. Consequently, when computing nodes perform matrix operations based on the encoded submatrix and input vector, they need to process fewer non-zero elements, thereby reducing computational complexity and task latency. Furthermore, the master node can recover the operation results of the original data matrix and input vector when the number of calculation results reaches the recovery threshold, without waiting for all computing nodes to return results. This balances data security, fallback tolerance, and the low complexity and low latency requirements of sparse data computing scenarios.

[0018] The encoding calculation method provided in this application can be applied to computer devices with encoding calculation capabilities, such as terminal devices and servers. Specifically, terminal devices can be desktop computers, laptops, mobile phones, and tablets; servers can be independent physical servers, server clusters composed of multiple physical servers, or distributed systems. Terminal devices and servers can be directly or indirectly connected via wired or wireless communication, and this application does not impose any restrictions on this connection.

[0019] All data collected in this application (such as raw data matrices and input vectors) were collected with the consent and authorization of the data subject (such as users, organizations, or enterprises), and the collection, use, and processing of the relevant data must comply with the relevant laws, regulations, and standards of the relevant countries and regions.

[0020] See Figure 1 This figure is a schematic flowchart of the encoding calculation method provided in an embodiment of this application. For ease of description, the following embodiments use the execution entity of this encoding calculation method as the main node as an example. Figure 1 As shown, the encoding calculation method includes S101-S106.

[0021] S101: Obtain the original data matrix and input vector to be calculated.

[0022] A master node and multiple compute nodes can form a master-slave distributed computing architecture. The master node is responsible for distributing the encoded computing tasks to the compute nodes, and the compute nodes are responsible for completing the assigned computing tasks and returning the computing results.

[0023] This application does not specifically limit the device form of the master node and computing nodes. For example, the master node can be a computing device in a distributed computing system used for task scheduling, data encoding, data distribution, and result recovery. The server corresponding to the master node can be a standalone server, a control server in a server cluster, or a task management node in a distributed computing platform. The computing node can be a computing device in a distributed computing system used for performing matrix operations, such as a computing server, a graphics processing unit server, an edge computing node, a cloud computing instance, or other devices with matrix operation capabilities.

[0024] The original data matrix is ​​the data matrix that needs to be used in the distributed computing task.

[0025] As an example, the original data matrix can be a user profile data matrix, a feature matrix in a recommender system, an adjacency matrix in graph computing, a coefficient matrix in scientific computing, a sample feature matrix in a machine learning task, or a parameter matrix in a sparse linear system of equations.

[0026] The original data matrix can exhibit sparsity, meaning it contains a large number of zero elements and only a small number of non-zero elements. For example, in user-item interaction data, most users interact with only a small number of items, so most elements in the corresponding matrix can be zero. In graph-structured data, each node is typically connected to only a small number of other nodes, so the adjacency matrix may also exhibit strong sparsity. Therefore, the sparsity of the original data matrix allows matrix operations to focus only on non-zero elements, thus reducing computational complexity.

[0027] The input vector is a vector that participates in matrix operations together with the original data matrix. As an example, the input vector can be a model parameter vector, a query vector, a vector to be projected, an intermediate vector during iterative calculations, or any other vector that needs to be multiplied by the original data matrix. In this embodiment, the result of the operation between the original data matrix and the input vector can be a matrix-vector multiplication result.

[0028] For ease of understanding, the original data matrix can be denoted as... Let the input vector be denoted as The result of the operation that needs to be restored is denoted as Therefore, the calculation result to be recovered in this embodiment of the application can be expressed as the following expression:

[0029] in, Represents the original data matrix. Represents the input vector. This represents the result of the operation between the original data matrix and the input vector. If the original data matrix... The dimension is Input vector The dimension is The result of the operation The dimension can be , can be represented as:

[0030] in, It can represent a finite field with a finite number of elements, and can also be called a Galois field; It can represent the number of elements in a finite field. Finite fields are used to perform addition and multiplication operations on matrix elements and vector elements under a predefined algebraic structure, thereby facilitating subsequent encoding and recovery processing. It should be noted that the above symbols are merely examples for illustrative purposes and do not constitute a limitation on the original data matrix, input vector, or computational scenario.

[0031] S102: Divide the original data matrix into multiple original data sub-matrices and generate multiple random matrices.

[0032] Among them, multiple random matrices are used to perform a safe perturbation on the original data matrix. The probability that any element in the random matrix is ​​a non-zero element is less than the probability that a random element in a finite field is a non-zero element.

[0033] In this embodiment, the original data submatrix is ​​a local data matrix obtained by partitioning the original data matrix. The master node can divide the complete original data matrix into multiple original data submatrixes, so that each original data submatrix carries a portion of the data in the original data matrix.

[0034] This application does not specifically limit the method of dividing the original data matrix. As an example, the master node can divide the original data matrix into multiple original data sub-matrices based on the number of computing nodes, task size, network bandwidth, computing power of a single computing node, or preset task granularity.

[0035] The random matrix is ​​generated by the master node to securely perturb the original data matrix. By having the random matrix and the original data submatrix participate in linear encoding, the encoded submatrix received by the computing node is no longer a single original data submatrix, but rather encoded data after random perturbation. Therefore, even if a computing node obtains the assigned encoded submatrix, it is difficult to directly reconstruct or infer the true data content of the original data matrix from it, thus reducing the risk of leakage of the original data matrix on the computing node side.

[0036] In this embodiment, the probability that any element in the random matrix is ​​non-zero is less than the probability of randomly selecting a non-zero element in a finite field. It is understood that if in a finite field... If an element is randomly selected uniformly from the given elements, the probability that the selected element is zero can be expressed as follows: The probability that this element will be a non-zero element can be... .

[0037] Therefore, the probability that any element in a random matrix is ​​a non-zero element is denoted as... Then the random matrix in the embodiments of this application can satisfy the following relationship: .

[0038] In other words, the random matrix in this embodiment is not a dense random matrix obtained by completely uniformly and randomly selecting values ​​in a finite field, but a random matrix with a lower probability of non-zero elements appearing. Since there are fewer non-zero elements in the random matrix, when this random matrix is ​​introduced into the encoding process, the damage to the sparsity of the original data matrix caused by random perturbation can be reduced, and the encoded data can be avoided from becoming too dense due to the superposition of a large number of non-zero random elements.

[0039] Therefore, the master node, on the one hand, splits the original data matrix into multiple original data sub-matrices, enabling the original data matrix to participate in subsequent encoding and distributed computing on a sub-matrix basis; on the other hand, it generates multiple random matrices for security perturbation, allowing the subsequently obtained encoded sub-matrices to mask the original data. Simultaneously, since the random matrices themselves have a low probability of non-zero elements, it can maintain the sparsity of the encoded data as much as possible while achieving security perturbation, providing a basis for reducing the computational complexity of subsequent computing nodes.

[0040] S103: Based on multiple original data submatrices and multiple random matrices, determine multiple source symbols and construct a generator matrix.

[0041] The multiple source symbols include multiple original data sub-matrices and multiple random matrices. Each row of the generator matrix corresponds to a coding sub-matrix, and each column of the generator matrix corresponds to a source symbol. The non-zero elements in any row of the generator matrix are used to indicate the source symbol and its coding coefficients used in the coding sub-matrix corresponding to that row. The number of non-zero elements in each row of the generator matrix is ​​less than the number of multiple source symbols.

[0042] Source symbols are the basic data units involved in encoding. It should be noted that the source symbols in this embodiment are not limited to single numerical values; they can also be data units in matrix form. For example, each original data submatrix can serve as a source symbol, and each random matrix can also serve as a source symbol. Thus, multiple source symbols include both multiple original data submatrixes carrying the actual data to be computed and multiple random matrices used for security perturbations. By unifying the original data submatrices and random matrices as source symbols, the subsequent encoding process can simultaneously achieve data computation task decomposition and data security perturbation within the same encoding structure.

[0043] The generator matrix is ​​a coefficient matrix used to describe how multiple source symbols are combined to form multiple coding submatrices. Each row of the generator matrix corresponds to a coding submatric, indicating which source symbols participate in the linear combination to obtain the coding submatric. Each column of the generator matrix corresponds to a source symbol, indicating whether the source symbol participates in the generation of a certain coding submatric and the corresponding coding coefficient when it participates. If an element in a row and column of the generator matrix is ​​zero, it means that the source symbol corresponding to that column does not participate in the generation of the coding submatric of that row. If an element in a row and column of the generator matrix is ​​non-zero, it means that the source symbol corresponding to that column participates in the generation of the coding submatric of that row, and the non-zero element can be used as the coding coefficient of that source symbol in the coding submatric.

[0044] In this embodiment, the number of non-zero elements in each row of the generated matrix is ​​less than the number of source symbols. That is, for any given coded submatrix, it is not obtained by linear encoding of all source symbols, but rather by linear encoding of a subset of source symbols. This limits the mixing range of source symbols in each coded submatrix, preventing each submatrix from becoming a dense linear combination of all original data submatrices and all random matrices. Because the number of source symbols involved in generating each coded submatrix is ​​reduced, the probability of increasing non-zero elements in the coded submatrix is ​​also reduced, thus helping to maintain the sparsity of the coded submatrix.

[0045] For ease of explanation, multiple source symbols can be represented as .in, This represents the number of source symbols; multiple source symbols can include multiple original data submatrices and multiple random matrices. The generated matrix is ​​represented as... ,in, Represents the nth element in the generating matrix Line number The elements of the column. If Then it means the first Individual source symbol Not participating in the Generation of coded submatrices; if Then it means the first Individual source symbol Participating in the The generation of each encoded submatrix, and These are the corresponding coding coefficients. Since the number of non-zero elements in each row of the generator matrix is ​​less than the number of source symbols, therefore for the ... For each encoded submatrix, only a portion It will participate in the generation of this encoded submatrix.

[0046] Therefore, the master node organizes the original data submatrices and random matrices into multiple source symbols and constructs a generator matrix to describe the combination relationship of the source symbols. Since each row of the generator matrix selects only a portion of the source symbols for encoding, the mixing range of each encoded submatrix can be limited from the encoding structure, so that the subsequently obtained encoded submatrices have both random perturbation effect and sparsity preservation effect.

[0047] S104: Based on the generator matrix, multiple source symbols are linearly encoded to obtain multiple encoding submatrices.

[0048] Linear coding is a process of obtaining a coded submatrix by weighted summation of multiple source symbols based on the coding coefficients in the generator matrix. Since each source symbol can be either an original data submatrix or a random matrix, the coded submatrix obtained by linear coding is a coded data matrix formed by the original data submatrix and the random matrix according to the coding relationship indicated by the generator matrix.

[0049] As an example, if the first The encoded submatrices are denoted as Then the encoded submatrix can be based on the generation matrix. The coding coefficients indicated by the row are obtained by linearly encoding multiple source symbols, and can be expressed by the following formula:

[0050] in, Indicates the first Each encoded submatrix Indicates the first One source symbol, Represents the nth element in the generating matrix Line number Column elements, Indicates the number of source symbols. Because when At that time, the source symbol It does not participate in the generation of this encoded sub-matrix; therefore, the above linear encoding will actually only affect the generation matrix of the first... The source symbols corresponding to the non-zero elements in the row are weighted and combined.

[0051] In one possible example, multiple source symbols may include several original data submatrices and several random matrices. In this case, an encoded submatrix can be obtained by linearly combining one or more original data submatrices and one or more random matrices. The original data submatrices enable the encoded submatrix to carry effective computational information that can be used to recover the target operation result, while the random matrices enable the encoded submatrix to carry perturbation information, thereby reducing the possibility that computing nodes will directly infer the original data matrix based on a single encoded submatrix. Since the number of non-zero elements in each row of the generator matrix is ​​less than the number of source symbols, the encoded submatrix will not be mixed with all the source symbols, thus reducing the destruction of sparsity during the encoding process.

[0052] As one possible implementation, to maintain the sparsity of the coding submatrix when linearly encoding multiple source symbols using the generator matrix, the master node can construct a generator matrix with a fixed row weight. The row weight of the generator matrix is ​​the number of non-zero elements in each row, which is also the number of source symbols used in each coding submatrix. As an example, if the number of computation nodes is... The number of blocks in the original data matrix is The number of random matrices is Then, provided that the number of non-zero elements in each row of the generated matrix is ​​less than the total number of source symbols, the row weight of the generated matrix is... It can be determined using the following formula:

[0053] in, This indicates rounding up. After determining the row weight, the master node can select a corresponding number of source symbols for each row in the generator matrix, setting the matrix elements in the columns corresponding to the selected source symbols to non-zero encoding coefficients, and setting the matrix elements in the columns corresponding to the unselected source symbols to zero. Thus, each row in the generator matrix selects only a subset of source symbols for encoding, thereby avoiding the coding submatrix being obtained from a dense linear combination of all source symbols.

[0054] As an example, for generating matrices The former Okay, if the first Line satisfaction We can determine that the set of source symbol subscripts corresponding to this line is:

[0055] For the generating matrix After Okay, if the first Line satisfaction The set of source symbol subscripts corresponding to this line can be determined as follows:

[0056] In determining the set Then, for the generating matrix, the first... Line number Column elements ,like Then Set as a non-zero element; if Then Setting it to zero can be represented as:

[0057]

[0058] Among them, non-zero elements can be derived from finite fields. The source symbols are randomly selected from the set of non-zero elements in the matrix. Thus, different rows can use different combinations of source symbols, and the number of non-zero elements in each row is controlled by row weighting, thereby maintaining the sparsity of the generator matrix while ensuring the diversity of encoding relationships.

[0059] As a concrete example, when N=10, K=6, and Z=2, we can obtain ω=5. The generating matrix in this case can be seen in the following example:

[0060] This reduces the diffusion of non-zero elements caused by the superposition of source symbols, making it easier for the encoded submatrix to maintain sparsity.

[0061] Therefore, since the encoded submatrix is ​​obtained by linearly encoding a portion of the source symbols based on the generator matrix, the subsequent computing nodes receive the encoded matrix data, rather than the complete original data matrix or a single original data submatrix. This allows for both data disturbance protection and computational task splitting in the distributed computing process.

[0062] S105: Send multiple encoded sub-matrices to the corresponding computing nodes respectively, and broadcast the input vector to each computing node so that each computing node can perform matrix operations based on the received encoded sub-matrices and input vectors.

[0063] After obtaining multiple encoded sub-matrices, the master node can send them to the corresponding computing nodes. This application does not specifically limit the correspondence between encoded sub-matrices and computing nodes. For example, the master node can assign one encoded sub-matrice to each computing node, or it can assign corresponding encoded sub-matrices to computing nodes based on their computing power, load status, network status, etc. By sending different encoded sub-matrices to different computing nodes, multiple computing nodes can perform matrix operations in parallel, thereby improving overall computing efficiency.

[0064] Broadcasting an input vector is the process by which a master node sends the same input vector to all computing nodes. Since each computing node needs to perform matrix operations based on its received encoded submatrix and input vector, the master node can broadcast the input vector to all computing nodes. Broadcasting methods can include sending the input vector to multiple computing nodes via message queues, remote procedure calls, distributed communication frameworks, parameter server communication interfaces, or other communication methods. This application does not specifically limit the communication implementation method for broadcasting input vectors.

[0065] After receiving the encoded submatrix and the input vector, the computing node can perform matrix operations. As an example, if the... The encoded submatrix received by each computing node is The input vector is Then the first The calculation result corresponding to each computing node can be expressed by the following formula:

[0066] in, Indicates the first The computation results returned by each computing node Indicates the first The encoded submatrix received by each computing node This represents the input vector. Since each computing node performs matrix operations between the encoded submatrix and the input vector, each computing node does not need to obtain the complete original data matrix, nor does it need to directly obtain all the original data submatrixes without encoding perturbation.

[0067] Therefore, the master node distributes the encoded computational task to multiple computing nodes, enabling these nodes to perform matrix operations in parallel based on the input vector. Because the encoded submatrix maintains high sparsity, the number of non-zero elements that each computing node needs to process during matrix operations is relatively small, thus reducing the computational complexity of a single computing node. Simultaneously, the parallel computation across multiple computing nodes shortens the overall task execution time.

[0068] S106: Receive the calculation results returned by multiple computing nodes respectively, and when the number of calculation results reaches the recovery threshold, recover the operation results of the original data matrix and input vector based on the calculation results.

[0069] The calculation result is obtained by the computing nodes through matrix operations based on the received encoded submatrix and input vector. After completing their own matrix operations, each computing node can return the corresponding calculation result to the master node. Due to differences in computing power, current load, communication link status, and resource occupancy among different computing nodes, the time it takes for each computing node to return the calculation result may vary. Some computing nodes may return results slowly, or even fail to return results within the preset time; these computing nodes can be considered lagging nodes.

[0070] The recovery threshold is the number of computational results required for the master node to recover the result of the operation between the original data matrix and the input vector. In other words, the master node does not need to wait for all computational nodes to return their results; instead, it can perform result recovery processing based on these results when the number of received computational results reaches the recovery threshold. The recovery threshold can be related to the construction method of the generated matrix, the number of source symbols, the number of random matrices, the number of encoded submatrices, and the result recovery algorithm. This application does not specifically limit the specific value of the recovery threshold in its embodiments.

[0071] In one possible example, the master node can select a set of computation results that meet the recovery threshold from the computation results returned by multiple computing nodes, and recover the operation result of the original data matrix and input vector based on this set of computation results and the encoding relationship corresponding to the generator matrix. Let the set of selected computing nodes be denoted as... ,in Indicates the number of selected calculation results, then when When the recovery threshold is reached, the master node can determine the appropriate action based on the set. The corresponding multiple calculation results are used to recover the target calculation result y. During the result recovery process, the master node can use the linear encoding relationship represented by the generator matrix to decode the multiple calculation results, so that the random disturbance term is eliminated or does not affect the final target result during the recovery process, and the operation result of the original data matrix and the input vector is obtained.

[0072] For ease of understanding, if the master node performs linear recovery based on multiple calculation results, the recovery process can be abstractly represented by the following formula:

[0073] in, This represents the result of the operation between the original data matrix and the input vector. This represents the set of computing nodes used for recovery. Indicates the first The computation results returned by each computing node Indicates the relationship with the first The above formula describes the recovery coefficient corresponding to each calculation result. It should be noted that the formula is only used to illustrate that the master node can recover the target operation result based on multiple calculation results that have reached the recovery threshold, and does not limit the specific decoding algorithm or the method of determining the recovery coefficient.

[0074] Therefore, the master node can recover the results of the original data matrix and input vector calculations when the number of calculation results reaches the recovery threshold, without waiting for all computing nodes to return their results. Even if some computing nodes become lagging nodes, it will not block the completion of the overall computing task, thereby improving the tolerance of the distributed computing system to lagging nodes and reducing the overall task latency.

[0075] As can be seen from the above technical solution, the original data matrix and input vector to be calculated are obtained, and the original data matrix is ​​divided into multiple original data sub-matrices. Simultaneously, multiple random matrices are generated to perform a security perturbation on the original data matrix. Further, the multiple original data sub-matrices and multiple random matrices are used together as source symbols, and each source symbol is linearly encoded using a generator matrix to obtain multiple encoded sub-matrices. Each row of the generator matrix uses only a portion of the source symbols for encoding, and the probability of any element in the random matrix being non-zero is less than the probability of randomly selecting a non-zero element in a finite field. Therefore, by introducing a sparse random matrix in the security perturbation stage and using a sparse generator matrix to limit the mixing range of source symbols in the encoding stage, the sparsity of the original data matrix can be avoided by traditional dense security coding schemes. This ensures that the generated encoded sub-matrices still maintain high sparsity, thereby reducing the number of non-zero elements processed during matrix operations by computing nodes, reducing node computational complexity, and reducing task latency caused by the densification of encoded data. Furthermore, this application sends multiple encoded sub-matrices to their respective computing nodes, and restores the operation results of the original data matrix and input vector when the number of received computation results reaches a recovery threshold. This allows the master node to recover the target result without waiting for all computing nodes to complete their computations. Therefore, this application not only achieves secure protection of the original data through a random matrix, but also maintains tolerance for lagging nodes through a recovery threshold mechanism. Compared to traditional dense secure encoding computation schemes, this application further reduces the density of the encoded data matrix while ensuring the recovery threshold and lagging tolerance, thus balancing multiple performance objectives such as data security, lagging tolerance, computational complexity, and task latency.

[0076] As one possible implementation, the recovery threshold can be related to the number of blocks the original data matrix is ​​split into and the number of random matrices. Specifically, the more original data sub-matrices the original data matrix is ​​divided into, the more effective computational results the master node typically needs to recover the target computation result; the more random matrices there are, the more security perturbation data is introduced during the encoding process, and the master node also needs to receive more computational results to eliminate or offset the impact of random perturbations on the result recovery. Therefore, the recovery threshold can be determined jointly by the number of original data sub-matrices and the number of random matrices.

[0077] For example, the recovery threshold can be the sum of the number of original data submatrices and the number of random matrices. After receiving the calculation results that have reached this recovery threshold, the master node can recover the calculation results of the original data matrix and the input vector based on these calculation results, without waiting for all calculation nodes to return their calculation results.

[0078] Furthermore, if the total number of compute nodes exceeds the recovery threshold, the master node can tolerate a portion of compute nodes failing to return computation results in a timely manner. The tolerable number of lagging nodes is the difference between the total number of compute nodes and the recovery threshold. Therefore, even if some compute nodes return results slowly due to insufficient computing power, high resource consumption, significant network latency, or temporary failures, it will not affect the master node's ability to recover the final computation results, thus improving its tolerance for lagging nodes.

[0079] One possible implementation is to characterize the sparsity of the encoded submatrix by the probability that any element in the encoded submatrix is ​​non-zero. The sparsity of the encoded submatrix can be related to the proportion of non-zero elements in the original data matrix, the probability that any element in the random matrix is ​​non-zero, the row weight of the generated matrix, and the number of random matrices.

[0080] Specifically, in the generation of a coding submatrix, the more original data submatrices involved in linear encoding, the easier it is for non-zero elements in the original data submatrices to diffuse into the coding submatrix through superposition. Similarly, the more random matrices involved in linear encoding, or the higher the probability that any element in a random matrix is ​​non-zero, the more likely non-zero elements in the random matrices will make the coding submatrix dense. Likewise, the greater the row weight of the generator matrix, the more source symbols are used in each coding submatrix, and the higher the probability of non-zero elements appearing after the superposition of multiple source symbols.

[0081] Therefore, we can first estimate the probability that all source symbols involved in generating the coding submatrix are zero at the same matrix position, and then estimate the probability that the matrix position will form a non-zero element based on this probability. If the probability is high, it indicates that the coding submatrix may be relatively dense; if the probability is low, it indicates that the coding submatrix can maintain sparsity well.

[0082] This shows that the proportion of non-zero elements in the encoded submatrix increases with the increase of the row weight of the generator matrix, and also with the increase of the probability of non-zero elements in the random matrix. In other words, if more source symbols are used in each row of the generator matrix for encoding, or if the probability of non-zero elements in the random matrix is ​​higher, the encoded submatrix is ​​more likely to become dense, and the number of non-zero elements that the computing nodes need to process will also increase.

[0083] When a computing node performs matrix operations between the encoded submatrix and the input vector, the computational complexity primarily depends on the number of non-zero elements in the encoded submatrix. The sparser the encoded submatrix, the fewer efficient multiplication and addition operations the computing node needs to perform; conversely, the denser the encoded submatrix, the more non-zero elements the computing node needs to process, resulting in higher computational complexity. Therefore, by reducing the probability of non-zero elements in the random matrix and limiting the row weight of the generated matrix, the proportion of non-zero elements in the encoded submatrix can be reduced, thereby lowering the computational complexity of the computing node.

[0084] As one possible implementation, before linearly encoding multiple source symbols based on the generator matrix to obtain multiple coding sub-matrices, or after initially obtaining multiple coding sub-matrices, the sparsity of the coding sub-matrices can be predicted, and the random matrix and / or generator matrix can be adjusted according to the prediction results to avoid the coding sub-matrices becoming too dense due to random matrix perturbations and source symbol superposition. See A1-A3 for details.

[0085] A1: Determine the predicted sparsity of the coding submatrix based on the proportion of non-zero elements in the original data matrix, the probability that any element in the random matrix is ​​non-zero, and the number of non-zero elements in each row of the generated matrix.

[0086] The proportion of non-zero elements in the original data matrix is ​​the ratio of the number of non-zero elements to the total number of elements in the matrix. This proportion reflects the sparsity of the original data matrix. For example, if most of the elements in the original data matrix are zero and only a small number are non-zero, then the proportion of non-zero elements in the original data matrix is ​​low; if there are many non-zero elements in the original data matrix, then the proportion of non-zero elements in the original data matrix is ​​high.

[0087] The probability that any element in a random matrix is ​​non-zero is the probability that a single element of the random matrix takes a non-zero value during the generation process. The higher this probability, the more non-zero elements there are in the random matrix, and the easier it is for the random matrix to make the encoded submatrix denser after participating in linear encoding; the lower this probability, the fewer non-zero elements there are in the random matrix, and the less it disrupts the sparsity of the encoded submatrix.

[0088] The number of non-zero elements in each row of the generator matrix represents the number of source symbols used for each coded submatrix. Since each row of the generator matrix corresponds to a coded submatrix, a higher number of non-zero elements in a row indicates that the coded submatrix for that row is obtained by a linear combination of more source symbols; conversely, a lower number of non-zero elements in a row indicates that the coded submatrix for that row is obtained by a linear combination of fewer source symbols. Generally, the greater the number of source symbols superimposed, the higher the probability of non-zero elements appearing in the coded submatrix.

[0089] Predicted sparsity is the probability that any element in the encoded submatrix is ​​non-zero, estimated before actual encoding or when adjusting encoding parameters. It should be noted that the predicted sparsity in this embodiment is used to assess whether the encoded submatrix might be too dense. It can be a theoretical estimate based on probabilistic relationships, or an estimate based on sampling statistics, historical task experience, or simulated encoding. This embodiment does not specifically limit the method for determining predicted sparsity.

[0090] As an example, if the proportion of non-zero elements in the original data matrix is ​​denoted as... The probability that any element in the random matrix is ​​non-zero is denoted as... The number of non-zero elements in each row of the generated matrix is ​​denoted as . Then, the master node can estimate the probability of non-zero elements appearing in the encoded submatrix based on the above parameters. As an example, if a encoded submatrix is ​​obtained by linear encoding of several original data submatrices and several random matrices, the master node can separately count or estimate the number of original data submatrices and the number of random matrices involved in the encoded submatrix, and determine the prediction sparsity based on the following formula:

[0091] in, Indicates the predicted sparsity of the encoded submatrix. This represents the proportion of non-zero elements in the original data matrix. This represents the probability that any element in the random matrix is ​​a non-zero element. This indicates the number of original data submatrices involved in generating this encoded submatrix. This indicates the number of random matrices involved in generating this encoded submatrix, and

[0092] The above formula means that when multiple source symbols are linearly superimposed, as long as at least one of the source symbols involved in the superposition has a non-zero element at the corresponding position, the coding submatrix may form a non-zero element at that position. Therefore, we can first estimate the probability that the corresponding position is zero among all participating source symbols, and then subtract that probability from 1 to obtain the predicted probability that the coding submatrix has a non-zero element at that position. It should be noted that the above formula is only an exemplary prediction method and does not limit the embodiments of this application to using this formula to calculate the prediction sparsity.

[0093] A2: If the predicted sparsity is greater than the preset sparsity threshold, then reduce the probability that any element in the random matrix is ​​a non-zero element, and / or reduce the number of non-zero elements in each row of the generated matrix.

[0094] The preset sparsity threshold is used to determine whether the encoded submatrix is ​​too dense. The preset sparsity threshold can be determined based on factors such as the computing power of the computing nodes, task latency requirements, network transmission pressure, the sparsity of the original data matrix, and the computational efficiency requirements of the business scenario. For example, for scenarios that are sensitive to task latency, such as real-time recommendation, real-time risk control, and online inference, a lower preset sparsity threshold can be set; for scenarios that have more relaxed latency requirements, such as offline batch processing and periodic statistics, a relatively higher preset sparsity threshold can be set.

[0095] If the predicted sparsity exceeds a preset sparsity threshold, it indicates that the resulting encoded submatrix, after encoding using the current random matrix and the generated matrix, may contain too many non-zero elements. This causes the computing nodes to process more non-zero elements during matrix operations, increasing computational complexity and task latency. In this case, the master node can reduce the probability that any element in the random matrix is ​​non-zero, thereby reducing the number of non-zero elements and mitigating the impact of random perturbations on the sparsity of the encoded submatrix. As an example, the probability that any element in the current random matrix is ​​non-zero can be reduced from... Adjusted to and satisfy .

[0096] The master node can also reduce the number of non-zero elements in each row of the generator matrix, thereby reducing the number of source symbols used in each encoded submatrix and reducing the spread of non-zero elements caused by the superposition of multiple source symbols. As an example, the number of non-zero elements in each row of the generator matrix can be reduced from... Adjusted to and satisfy .

[0097] In one possible implementation, the master node can reduce only the probability that any element in the random matrix is ​​non-zero; in another, it can reduce only the number of non-zero elements in each row of the generated matrix; and in yet another, it can reduce both the probability of any element in the random matrix being non-zero and the number of non-zero elements in each row of the generated matrix. The specific adjustment method used depends on the current task's emphasis on data security and task latency.

[0098] A3: Based on the adjusted random matrix and / or the adjusted generator matrix, multiple encoded submatrices are re-obtained.

[0099] After adjusting the random matrix and / or the generator matrix, the master node can re-perform linear encoding based on the adjusted random matrix and / or the adjusted generator matrix to obtain multiple new encoded submatrices. If only the random matrix is ​​adjusted, the master node can regenerate a random matrix with lower probabilities of non-zero elements and use the regenerated random matrix and multiple original data submatrices as source symbols for linear encoding. If only the generator matrix is ​​adjusted, the master node can keep the source symbols unchanged and use the adjusted generator matrix to reselect the source symbols and their encoding coefficients for each encoded submatric. If both the random matrix and the generator matrix are adjusted, the master node can obtain multiple encoded submatrices based on the new random matrix and the new generator matrix.

[0100] Therefore, by using the above method, it is possible to determine in advance whether the encoded submatrix may become too dense due to random matrix perturbation and source symbol superposition before the formal distribution of the encoded submatrix, and to actively adjust the random matrix and / or generator matrix when the predicted sparsity does not meet the requirements. This avoids discovering that the computational complexity is too high only after encoding, thus making the encoded submatrix more in line with the low complexity and low latency requirements of sparse data computing scenarios.

[0101] As one possible implementation, when generating multiple random matrices, the probability of any element in the random matrix being non-zero can be determined by combining the target security requirements and the target task latency requirements, thereby adapting between data security protection and task latency. See B1-B2 for details.

[0102] B1: Obtain the target security requirements and target mission latency requirements.

[0103] The target security requirements define the level of security protection required for the original data in the current coding computation task. These requirements can be configured by the business side or determined by the master node based on factors such as the data type of the original data matrix, the data sensitivity level, the trustworthiness of the computation nodes, and the system deployment environment.

[0104] As an example, for scenarios such as financial risk control, medical data analysis, and enterprise operational data analysis, the target security requirements can be relatively high because the original data matrix may contain sensitive information; for scenarios such as public data analysis and internal test data calculation, the target security requirements can be relatively low.

[0105] The target security requirement can be characterized by the number of collusive computing nodes that can be resisted. The number of collusive computing nodes is the number of computing nodes that might exchange received data and attempt to infer the original data matrix in the worst-case scenario. The higher the number of collusive computing nodes corresponding to the target security requirement, the more computing nodes need to resist jointly inferring the original data matrix, and therefore stronger random perturbations are required.

[0106] The target task latency requirement is the time requirement for the completion of the current coding computation task. The target task latency requirement may include the task latency limit, response time level, real-time level, task deadline, etc.

[0107] As an example, in scenarios such as online recommendation, real-time search, and real-time control, the upper limit of latency corresponding to the target task latency requirement is relatively low, indicating that the system needs to complete the computation task as quickly as possible; in scenarios such as offline training, offline statistics, and batch analysis, the upper limit of latency corresponding to the target task latency requirement can be relatively high, indicating that the system can accept a longer computation time.

[0108] B2: Based on the target security requirements and the target mission delay requirements, determine the probability that any element in the random matrix is ​​a non-zero element.

[0109] Among them, the lower the upper limit of the latency corresponding to the target task latency requirement, the lower the probability that any element in the random matrix is ​​a non-zero element; the higher the number of collusion computing nodes corresponding to the target security requirement, the higher the probability that any element in the random matrix is ​​a non-zero element.

[0110] A higher probability that any element in a random matrix is ​​non-zero indicates a closer approximation to a dense random matrix, resulting in more thorough random perturbation. This increases the difficulty for computing nodes to infer the original data matrix from the encoded submatrix, but also makes the encoded submatrix more likely to become dense, leading to increased matrix operation complexity and task latency. Conversely, a lower probability that any element in a random matrix is ​​non-zero indicates a sparser random matrix, making it easier for the encoded submatrix to maintain sparsity. This helps reduce computational complexity and task latency, but the intensity of random perturbation is relatively lower. Therefore, this probability can be used as a parameter to adjust the balance between security and latency.

[0111] As an example, the master node can determine the upper limit of the probability that any element in the random matrix is ​​a non-zero element based on the latency requirements of the target task. If the latency upper limit corresponding to the latency requirements of the target task is low, it means that the encoded submatrix should be kept as sparse as possible to reduce the number of non-zero elements processed by the computing nodes, so a lower probability upper limit can be set; if the latency upper limit corresponding to the latency requirements of the target task is high, then the random matrix can be allowed to contain more non-zero elements.

[0112] As another example, the master node can determine the lower probability limit of any matrix element in the random matrix being a non-zero element based on the target security requirements. If the number of collusive computing nodes corresponding to the target security requirements is high, it indicates that stronger random perturbations are needed to reduce the likelihood of collusive computing nodes obtaining information from the original data matrix, so a higher probability lower limit can be set; if the number of collusive computing nodes corresponding to the target security requirements is low, a lower probability lower limit can be set to better preserve the sparsity of the encoded submatrix.

[0113] In one possible implementation, the master node can first determine the upper probability limit based on the target task latency requirements, then determine the lower probability limit based on the target security requirements, and finally select the probability of any matrix element in the random matrix being a non-zero element between the lower and upper probability limits. This process can be abstractly represented as:

[0114] in, This represents the probability that any element in the random matrix is ​​a non-zero element. This represents the lower probability limit determined based on the target's security requirements. This represents the upper limit of probability determined based on the target task's latency requirements. The higher the number of collusive computation nodes corresponding to the target security requirements, the higher the probability of collusion. The higher the threshold, the lower the latency limit corresponding to the target task's latency requirement. It can be as low as possible.

[0115] It should be noted that the above formula is only used to illustrate the probability that any element of the random matrix is ​​a non-zero element under the joint constraints of security requirements and latency requirements. It does not limit the linear relationship or fixed mapping relationship between the target security requirements, the target task latency requirements and this probability.

[0116] Therefore, by using the above method, the probability of any matrix element in the random matrix being a non-zero element can be dynamically determined according to the different application scenarios' emphasis on data security and task latency. When the task is more sensitive to latency, this probability can be reduced to maintain the sparsity of the encoded submatrix; when the task has higher security requirements, this probability can be increased to enhance random perturbation, thereby making the random matrix generation process more adaptable to specific business needs.

[0117] In one possible implementation, the source symbols corresponding to different rows in the generator matrix are not completely identical.

[0118] Since each column of the generator matrix corresponds to a source symbol, the set of columns containing non-zero elements in a row can represent the set of source symbols used by the corresponding coded submatrix.

[0119] The fact that different rows in the generated matrix have different source symbols indicates that there are differences in the selection of source symbols among the different rows in the generated matrix.

[0120] As one example, at least two rows may contain different sets of columns containing non-zero elements; as another example, any two rows may contain completely different sets of columns containing non-zero elements. As long as the combinations of source symbols corresponding to different rows in the generator matrix are not identical repetitions, different coding submatrices can have different coding relationships.

[0121] In one possible implementation, the master node can select different combinations of source symbols for different rows when constructing the generator matrix. For example, the first row can use a portion of the original data submatrix and a portion of the random matrix as source symbols, the second row can use another set of original data submatrixes and random matrices as source symbols, and the third row can continue to adjust the combination of source symbols. In this way, the original data information and random perturbation information carried by different coded submatrixes are different, avoiding the use of the exact same combination of source symbols for multiple coded submatrixes.

[0122] Therefore, by ensuring that the source symbols corresponding to different rows in the generator matrix are not completely identical, the diversity of encoding relationships between multiple encoding sub-matrices can be improved, avoiding highly repetitive encoding computation tasks performed by multiple computing nodes. Simultaneously, different combinations of source symbols between different encoding sub-matrices also facilitate subsequent result recovery by the master node based on computation results reaching the recovery threshold, thereby improving the effectiveness of the encoding computation process.

[0123] As one possible implementation, when generating multiple random matrices, the safe number of random matrices can be determined based on the system security level, and a corresponding number of random matrices can be generated. See C1-C3 for details.

[0124] C1: Get the system security level.

[0125] The system security level is used to characterize the number of collusive computing nodes that are allowed to resist.

[0126] The system security level refers to the level of data security protection that a distributed computing system needs to achieve in the current coding computation task. The system security level characterizes the number of collusive computing nodes that can be resisted. Collusive computing nodes are computing nodes that exchange received coded submatrices, computation results, or other intermediate information with each other, and attempt to infer the original data matrix based on this information.

[0127] As an example, a lower system security level means the current task only needs to resist a smaller number of colluding computing nodes; a higher system security level means the current task needs to reduce the risk of the original data matrix being inferred even when more computing nodes collude with each other. The system security level can be configured by the user or determined by the master node based on factors such as data sensitivity, computing node trustworthiness, the business type of the task, and the deployment environment.

[0128] For example, a lower system security level can be set for ordinary statistical tasks executed only within an enterprise's trusted computing cluster; a higher system security level can be set for cross-organizational collaborative computing, cloud-outsourced computing, and matrix operation tasks involving sensitive business data. By obtaining the system security level, the master node can determine how much random disturbance protection the current task requires.

[0129] C2: Determine the number of secure random matrices based on the system security level.

[0130] The number of secure random matrices refers to the number of random matrices required to meet the system's security level. Generally, the higher the system security level, the more collusive computing nodes need to be resisted, and therefore the more random matrices can be introduced to reduce the likelihood of collusive computing nodes inferring the original data matrix through more random perturbation data.

[0131] As an example, if the system security level is represented by the number of complicit computing nodes that can be resisted, and this number is denoted as... The number of safe random matrices is denoted as The number of secure random matrices can then be determined based on the system's security level. For example, the following relationship can be used:

[0132] The above formula indicates that when resistance is needed When there are multiple colluding computing nodes, the master node can generate... A random matrix is ​​used as security perturbation data. It should be noted that the above relationship is only one example. In other implementations, the number of security-grade random matrices can also be determined based on factors such as the system security level, the size of the original data matrix, the probability that any element in the random matrix is ​​non-zero, and the number of encoded sub-matrices.

[0133] C3: Generate a safe number of random matrices.

[0134] After determining the safe number of random matrices, the master node can generate that safe number of random matrices. Each random matrix can have the same or a similar dimension as the original data submatrix, allowing it to participate in subsequent linear coding as source symbols along with the original data submatrix. Matrix elements in the random matrices can take non-zero values ​​according to a preset probability, and this probability is less than the probability of randomly taking a non-zero value in a finite field, in order to reduce the impact of random matrices on the sparsity of the encoded submatrix.

[0135] Therefore, the number of random matrices can be determined based on the number of collusive computing nodes to be resisted, thus matching the number of random matrices with the target security protection capability. This avoids both insufficient security perturbation due to too few random matrices and unnecessarily dense coding submatrices due to an unnecessarily increased number of random matrices, thereby achieving a more reasonable balance between security protection and computational complexity.

[0136] As one possible approach, when dividing the original data matrix into multiple original data submatrices, the division can be carried out uniformly along the row direction of the original data matrix, so that the difference in the number of rows between the multiple original data submatrices is small.

[0137] Specifically, the original data matrix is ​​evenly divided into multiple original data submatrices along the row direction; wherein the difference in the number of rows of any two original data submatrices is less than or equal to a preset difference in the number of rows.

[0138] The row direction of the original data matrix refers to the direction in which the matrix is ​​divided into rows. Dividing the original data matrix along the row direction means splitting the original data matrix into multiple original data submatrices by rows. Each original data submatrix includes a portion of the rows of the original data matrix, and the number of columns in each original data submatrix can be consistent with that of the original data matrix.

[0139] The original data matrix is ​​divided evenly to ensure that multiple sub-matrices have similar data sizes. Since each computing node subsequently needs to perform matrix operations based on the encoded sub-matrices, and these encoded sub-matrices are typically obtained by encoding the original data sub-matrices and a random matrix, large differences in data size between the multiple original data sub-matrices can lead to significant differences in the computational load borne by different computing nodes. By evenly dividing the original data matrix along the row direction, the number of rows in different original data sub-matrices can be made as close as possible, thus facilitating load balancing among the multiple computing nodes.

[0140] The preset row count difference is a threshold used to limit the difference in the number of rows between any two original data sub-matrices. For example, the preset row count difference can be 0, 1, or other small integers. If the preset row count difference is 0, it means that multiple original data sub-matrices have the same number of rows; if the preset row count difference is 1, it means that the number of rows between multiple original data sub-matrices differs by at most 1 row. It should be noted that the preset row count difference can be determined based on the total number of rows in the original data matrix, the number of original data sub-matrices, and the task load balancing requirements.

[0141] Therefore, the difference in data size between different original data submatrices can be reduced during the matrix partitioning stage, which can balance the load among subsequent computing nodes and reduce the possibility that some computing nodes will become lagging nodes due to processing significantly larger amounts of data, thereby further reducing the overall task latency.

[0142] As one possible implementation, when constructing the generator matrix, the row weight of the generator matrix can be determined according to the target sparsity, and the number of source symbols participating in encoding in each row of the generator matrix can be controlled based on the row weight. See D1-D3 for details.

[0143] D1: Obtain the sparsity of the target.

[0144] The target sparsity is used to indicate the proportion of non-zero elements in each row of the generated matrix relative to the total number of source symbols.

[0145] The target sparsity is a target parameter used to control the sparsity of the generator matrix. Each row of the generator matrix corresponds to a coding submatrix, and each column corresponds to a source symbol. Therefore, the proportion of non-zero elements in a row of the generator matrix relative to the total number of source symbols reflects the proportion of source symbols used in the coding submatrix corresponding to that row.

[0146] If the target sparsity is low, it means that the proportion of non-zero elements in each row of the generator matrix to the total number of source symbols is low. Each coding submatrix uses only a few source symbols for encoding, which helps maintain the sparsity of the coding submatrix and reduces computational complexity. If the target sparsity is high, it means that the proportion of non-zero elements in each row of the generator matrix to the total number of source symbols is high. Each coding submatrix uses more source symbols for encoding, which helps improve the richness of the coding relationships, but may increase the density of the coding submatrix.

[0147] As an example, the target sparsity can be pre-configured by the user or business unit, or determined by the master node based on factors such as the proportion of non-zero elements in the original data matrix, the probability that any element in the random matrix is ​​non-zero, the target task latency requirements, and the computing node capabilities. For instance, in scenarios where the original data matrix is ​​highly sparse and the task latency requirements are low, a lower target sparsity can be set; in scenarios requiring richer encoding relationships, the target sparsity can be appropriately increased.

[0148] D2: Determine the row weight of the generated matrix based on the number of multiple source symbols and the sparsity of the target.

[0149] Row weight is used to indicate the number of non-zero elements in each row of the generated matrix.

[0150] The total number of source symbols is the total number of source symbols involved in encoding, including multiple original data submatrices and multiple random matrices. Row weight is the number of non-zero elements in each row of the generator matrix. Since each row of the generator matrix corresponds to a coding submatrix, row weight can also be understood as the number of source symbols involved in linear encoding for each coding submatrix.

[0151] As an example, if the total number of source symbols is represented as The sparsity of the target is represented as The row weights of the generated matrix are represented as Then the master node can determine the row weight based on the total number of source symbols and the sparsity of the target. For example, the row weight can be determined in the following way:

[0152] in, This is used to represent rounding up. It should be noted that the above formula is only one exemplary method of determination. In other implementations, the master node can also round, limit, or correct the row weight based on factors such as the target sparsity, recovery requirements, and the number of computation nodes, as long as the determined row weight can be used to indicate the number of non-zero elements in each row of the generated matrix.

[0153] D3: Based on row weight, controls the number of source symbols involved in encoding in each row of the generator matrix.

[0154] After determining the row weights of the generator matrix, the master node can construct the generator matrix by matching the number of non-zero elements in each row to the row weight. Specifically, for any row in the generator matrix, the master node can select the number of columns corresponding to the row weight from multiple source symbols and set the elements in these columns to non-zero coding coefficients; for unselected columns, the corresponding elements can be set to zero. In this way, the coding submatrix corresponding to that row is obtained only by linearly encoding the source symbols corresponding to the selected columns.

[0155] As an example, if the total number of source symbols is The row weight of the generated matrix is Then for the generation matrix, the first... Okay, you can choose Each source symbol participates in the first The generation of one encoded submatrix, and the others The source symbols are excluded from the generation process of this coding sub-matrix. This process can be expressed as: if the first... The set of source symbol columns for row selection is And satisfy For columns belonging to this set, the generated matrix elements are non-zero; for columns not belonging to this set, the generated matrix elements are zero, which can be represented as:

[0156]

[0157] Therefore, by using the above method, the number of non-zero elements in each row of the generator matrix can be flexibly controlled by utilizing the target sparsity, thereby controlling the number of source symbols participating in encoding in each coding submatrix. This further avoids the generator matrix becoming too dense, causing the coding submatrix to become a dense linear combination of a large number of source symbols, enabling the coding submatrix to maintain high sparsity while possessing encoding recovery capabilities, thereby reducing the number of non-zero elements processed and the task latency when computing nodes perform matrix operations.

[0158] See Figure 2 , Figure 2 This is a schematic diagram of an encoding computation framework provided in an embodiment of this application. Figure 2 As shown, this encoding computation framework can include a master node and multiple computation nodes. The master node obtains the original data matrix. and input vector and the original data matrix Divide into multiple sub-matrices of the original data, for example To safely perturb the original data matrix, the master node can also generate multiple random matrices, for example... Subsequently, the master node uses multiple original data submatrices and multiple random matrices as source symbols, and generates matrices accordingly. Linear encoding of these source symbols yields multiple encoding sub-matrices, for example... .

[0159] As an example, the above encoding process can be represented as:

[0160] See Figure 3 , Figure 3 This is a schematic diagram illustrating the result of task latency varying with the sparsity of the original data matrix, as provided in an embodiment of this application. Figure 3 It can be used to compare the task latency performance of the encoding calculation method provided in the embodiments of this application with that of the traditional dense secure encoding calculation scheme under different sparsity of the original data matrix.

[0161] As an example, in a simulation experiment, the number of computing nodes can be set to... =30, system security level is =2, the number of blocks in the original data matrix is =25, the probability that any element in the random matrix is ​​non-zero is =0.05, the capability parameter of the computing node is =50、 =0.02. This parameter setting changes the probability that any element in the original data matrix is ​​non-zero. The task latency corresponding to the embodiments of this application and the traditional dense secure coding calculation scheme is statistically analyzed.

[0162] from Figure 3 It can be seen that when the original data matrix has strong sparsity, that is... When the latency is relatively low, the task latency corresponding to the embodiments of this application is significantly lower than that of traditional dense secure coding computation schemes. This is because the embodiments of this application use a random matrix with a low probability of non-zero elements and a generator matrix where each row contains only a subset of non-zero elements, enabling the encoded submatrix to maintain high sparsity. This means that the computation node needs to process fewer non-zero elements when performing matrix operations. In contrast, traditional dense secure coding computation schemes use dense random matrices and dense generator matrices, making the encoded data matrix tend to be dense. Even if the original data matrix itself is relatively sparse, encoding still leads to increased computational complexity.

[0163] along with As the original data matrix increases in size, the number of non-zero elements gradually increases, and the encoded submatrix also gradually becomes denser. At this point, the latency advantage of the embodiments of this application compared to traditional dense secure encoding computation schemes gradually diminishes. Therefore, the embodiments of this application are particularly suitable for distributed matrix computation scenarios where the original data matrix has obvious sparsity characteristics.

[0164] See Figure 4 , Figure 4 This is a schematic diagram illustrating the result of task delay varying with the probability of non-zero elements of a random matrix, as provided in an embodiment of this application. Figure 4 This can be used to illustrate the impact of the probability that any element in a random matrix is ​​non-zero on task latency, and further demonstrate the balance between data security and task latency. This application's embodiments continue to use the configuration of the above simulation experiments, and will not be repeated here.

[0165] from Figure 4 It can be seen that when When the size is small, there are fewer non-zero elements in the random matrix, and the random matrix's participation in encoding causes less damage to the sparsity of the encoded submatrix. Therefore, the embodiments of this application can maintain low task latency. With... As the matrix increases, the number of non-zero elements in the random matrix gradually increases, and the probability of non-zero elements in the encoded submatrix also increases. This increases the number of non-zero elements that the computing nodes need to process, and consequently, the task latency rises. When the size is large, the random matrix gradually approaches the dense random matrix, and the gap in task latency between the embodiments of this application and the traditional dense secure coding calculation scheme will gradually narrow.

[0166] also, Figure 4 It can also demonstrate the relationship between the probability of non-zero elements in a random matrix and data security. Generally speaking, The larger the matrix, the more perturbation it provides, making it more difficult for colluding computation nodes to infer the original data matrix based on the encoded submatrix; however, at the same time, The larger the value, the denser the coding submatrix becomes, and the higher the task latency. Therefore, in practical applications, an appropriate value can be selected based on the target security requirements and the target task latency requirements. This achieves a balance between data security protection and low-latency computing.

[0167] One possible approach is to analyze task latency based on the computation latency distribution of computing nodes. When computing nodes perform matrix operations, the computation time is typically related to the computing node's own computing power, current load status, lag effect, and the sparsity of the encoded submatrix being processed.

[0168] The base computation time of a computing node can be used to characterize the minimum time required for the node to complete a basic computation task. The lagging effect can be used to characterize the extent to which the computation time of a computing node increases due to factors such as resource consumption, communication latency, and hardware performance fluctuations. The computational load can be used to characterize the actual amount of data that the computing node needs to process. In this embodiment, the computational load can be related to the proportion of non-zero elements in the encoding submatrix. The more non-zero elements in the encoding submatrix, the more effective multiplication and addition operations the computing node needs to process, resulting in a higher computational load; the fewer non-zero elements in the encoding submatrix, the lower the computational load.

[0169] If the master node can recover the final calculation result after receiving a sufficient number of calculation results to reach the recovery threshold, then the overall task latency does not depend on the return time of the last calculation node, but rather on the time when the recovery threshold is reached among the earlier returning calculation nodes. In other words, the master node does not need to wait for all calculation nodes to complete the calculation; it only needs to wait for a sufficient number of calculation results to return.

[0170] Therefore, it can be seen that the task latency is positively correlated with the proportion of non-zero elements in the encoded submatrix. By reducing the proportion of non-zero elements in the encoded submatrix, the actual computational load on the computing nodes can be reduced, enabling the computing nodes to complete matrix operations and return calculation results faster, thereby reducing the overall task latency. Furthermore, since the recovery threshold mechanism allows some computing nodes to become lagging nodes without affecting result recovery, the embodiments of this application can further reduce the waiting time caused by lagging nodes.

[0171] As a comparative example, traditional dense security coding computation schemes typically employ dense random matrices and dense generator matrices. The elements in a dense random matrix are usually uniformly randomized within a finite field, resulting in a large number of non-zero elements. Similarly, most elements in a dense generator matrix are also non-zero, so each coding submatrix is ​​usually obtained by a linear combination of a large number of original data submatrices and a large number of random matrices.

[0172] In this scenario, even if the original data matrix itself is highly sparsity, the resulting encoded submatrix, after dense random matrix perturbation and dense generator matrix encoding, often approximates a dense matrix. In other words, traditional dense secure encoding schemes destroy the inherent sparsity of the original data matrix, requiring computing nodes to process a large number of non-zero elements when performing matrix operations.

[0173] In contrast, the embodiments of this application, on the one hand, reduce the probability that any element in the random matrix is ​​non-zero, thereby reducing the disruption of the sparsity of the coded submatrix caused by the random matrix; on the other hand, by limiting the number of non-zero elements in each row of the generator matrix, each coded submatrix is ​​obtained by linear encoding of only a portion of the source symbols, rather than by a dense linear combination of all source symbols. Therefore, the coded submatrix obtained by the embodiments of this application can maintain high sparsity.

[0174] From a computational complexity perspective, in traditional dense secure coding schemes, the encoded submatrix processed by computing nodes is close to a dense matrix, thus its computational complexity is close to that of processing a complete dense matrix. However, in this embodiment, the encoded submatrix processed by computing nodes has a lower proportion of non-zero elements, therefore its computational complexity decreases as the proportion of non-zero elements decreases. Thus, compared to traditional dense secure coding schemes, this embodiment reduces the number of non-zero elements processed by computing nodes, thereby reducing computational complexity and task latency.

[0175] One possible approach is to measure data security during the encoding computation process by the correlation between the encoded data obtained by colluding computation nodes and the original data matrix. Colluding computation nodes refer to multiple computation nodes that can exchange received encoded sub-matrices, computation results, or other intermediate information and attempt to infer the original data matrix based on this information.

[0176] In this embodiment, random matrices are used to perform security perturbations on the original data matrix. The more random matrices there are, or the higher the probability that any element in a random matrix is ​​non-zero, the more thorough the random perturbation, and the greater the difficulty for collusive computing nodes to infer the original data matrix based on the encoded submatrix. Correspondingly, for higher data security requirements, the number of random matrices can be appropriately increased, or the probability of non-zero elements appearing in the random matrices can be appropriately increased to enhance the effect of random perturbation.

[0177] However, the more non-zero elements in a random matrix, the denser the encoding submatrix becomes, and the more non-zero elements the computing nodes need to process, thus increasing computational complexity and task latency. Conversely, the fewer non-zero elements in a random matrix, the easier it is for the encoding submatrix to maintain sparsity, which helps reduce computational complexity and task latency, but the intensity of random perturbation is relatively reduced.

[0178] Therefore, under less stringent data security requirements, the embodiments of this application can maintain high sparsity of the encoded submatrix by selecting a lower probability of non-zero elements in the random matrix, thereby reducing computational complexity and task latency. Alternatively, in scenarios with high data security requirements, the probability of non-zero elements in the random matrix can be appropriately increased to enhance the perturbation effect of the random matrix on the original data matrix. In other words, the probability that any element in the random matrix is ​​non-zero can be used as an adjustment parameter between data security and task latency, enabling the embodiments of this application to achieve a balance between data security protection and low-latency computation according to different business scenarios.

[0179] See Figure 5 , Figure 5 An encoding calculation device 500 provided in this application embodiment includes: Acquisition unit 501 is used to acquire the original data matrix and input vector to be calculated; The generation unit 502 is used to divide the original data matrix into multiple original data sub-matrices and generate multiple random matrices; wherein, the multiple random matrices are used to perform a secure perturbation on the original data matrix, and the probability that any element in the random matrix is ​​a non-zero element is less than the probability that a non-zero element is randomly selected in a finite field. Construction unit 503 is used to determine multiple source symbols and construct a generator matrix based on the multiple original data sub-matrices and the multiple random matrices; wherein, the multiple source symbols include the multiple original data sub-matrices and the multiple random matrices, each row of the generator matrix corresponds to a coding sub-matrix, each column of the generator matrix corresponds to a source symbol, and the non-zero elements in any row of the generator matrix are used to indicate the source symbol and its coding coefficient used in the coding sub-matrix corresponding to that row, and the number of non-zero elements in each row of the generator matrix is ​​less than the number of multiple source symbols; The encoding unit 504 is used to linearly encode the plurality of source symbols based on the generator matrix to obtain a plurality of encoding submatrices; The transmission unit 505 is used to send the plurality of encoded sub-matrices to the corresponding computing nodes respectively, and broadcast the input vector to each computing node, so that each computing node performs matrix operations based on the received encoded sub-matrices and the input vector; The recovery unit 506 is used to receive the calculation results returned by the multiple computing nodes respectively, and when the number of calculation results reaches the recovery threshold, to recover the operation result of the original data matrix and the input vector based on the calculation results.

[0180] Optionally, the device 500 further includes a prediction unit for: The prediction sparsity of the encoded submatrix is ​​determined based on the proportion of non-zero elements in the original data matrix, the probability that any element in the random matrix is ​​a non-zero element, and the number of non-zero elements in each row of the generated matrix. If the predicted sparsity is greater than the preset sparsity threshold, then the probability that any element in the random matrix is ​​a non-zero element is reduced, and / or the number of non-zero elements in each row of the generated matrix is ​​reduced. Based on the adjusted random matrix and / or the adjusted generator matrix, the plurality of encoded submatrices are re-obtained.

[0181] Optionally, the generation unit 502 is specifically used for: Obtain the target security requirements and target mission latency requirements; Based on the target security requirements and the target task latency requirements, determine the probability that any element in the random matrix is ​​a non-zero element; The lower the upper limit of the latency requirement corresponding to the target task, the lower the probability that any element in the random matrix is ​​a non-zero element; the higher the number of collusion computing nodes corresponding to the target security requirement, the higher the probability that any element in the random matrix is ​​a non-zero element.

[0182] Optionally, the source symbols corresponding to different rows in the generated matrix are not completely identical.

[0183] Optionally, the generation unit 502 is specifically used for: Obtain the system security level, which characterizes the number of collusive computing nodes that are allowed to resist. The number of secure random matrices is determined based on the system security level. Generate the specified number of safe random matrices.

[0184] Optionally, the generation unit 502 is specifically used for: The original data matrix is ​​evenly divided into multiple original data submatrices along the row direction; wherein the difference in the number of rows of any two original data submatrices is less than or equal to a preset difference in the number of rows.

[0185] Optionally, the construction unit 503 is specifically used for: Obtain the target sparsity, which indicates the proportion of non-zero elements in each row of the generated matrix to the total number of source symbols; The row weight of the generator matrix is ​​determined based on the number of the multiple source symbols and the target sparsity, and the row weight is used to indicate the number of non-zero elements in each row of the generator matrix; Based on the row weight, the number of source symbols participating in encoding in each row of the generated matrix is ​​controlled.

[0186] See Figure 6 This application also provides a computer device, which includes a memory 601 and a processor 602. The memory is used to store computer programs and to transfer the computer programs to the processor; The processor is used to execute the method of the above method embodiment according to the computer program.

[0187] This application also provides a computer-readable storage medium, characterized in that the computer-readable storage medium is used to store a computer program, the computer program being used to execute the method of the above-described method embodiments.

[0188] This application also provides a computer program product including a computer program, which, when run on a computer device, causes the computer device to perform the method described in the above method embodiments.

[0189] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the systems or apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and relevant parts can be referred to the method section.

[0190] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.

[0191] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0192] It should also be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0193] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0194] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A coding calculation method, characterized in that, Applied to the master node, the method includes: Obtain the original data matrix and input vector to be calculated; The original data matrix is ​​divided into multiple original data sub-matrices, and multiple random matrices are generated; wherein, the multiple random matrices are used to perform a secure perturbation on the original data matrix, and the probability that any element of the random matrix is ​​a non-zero element is less than the probability that a non-zero element is randomly selected in a finite field; Based on the plurality of original data sub-matrices and the plurality of random matrices, a plurality of source symbols are determined, and a generator matrix is ​​constructed; wherein, the plurality of source symbols include the plurality of original data sub-matrices and the plurality of random matrices, each row of the generator matrix corresponds to a coding sub-matrix, each column of the generator matrix corresponds to a source symbol, and the non-zero elements in any row of the generator matrix are used to indicate the source symbol and its coding coefficients used in the coding sub-matrix corresponding to that row, and the number of non-zero elements in each row of the generator matrix is ​​less than the number of the plurality of source symbols; Based on the generator matrix, the multiple source symbols are linearly encoded to obtain multiple encoding submatrices; The plurality of encoded sub-matrices are sent to the corresponding computing nodes respectively, and the input vector is broadcast to each computing node so that each computing node performs matrix operations based on the received encoded sub-matrices and the input vector; The system receives the calculation results returned by the multiple computing nodes, and when the number of calculation results reaches the recovery threshold, it recovers the operation result of the original data matrix and the input vector based on the calculation results.

2. The method according to claim 1, characterized in that, The method further includes: The prediction sparsity of the encoded submatrix is ​​determined based on the proportion of non-zero elements in the original data matrix, the probability that any element in the random matrix is ​​a non-zero element, and the number of non-zero elements in each row of the generated matrix. If the predicted sparsity is greater than the preset sparsity threshold, then the probability that any element in the random matrix is ​​a non-zero element is reduced, and / or the number of non-zero elements in each row of the generated matrix is ​​reduced. Based on the adjusted random matrix and / or the adjusted generator matrix, the plurality of encoded submatrices are re-obtained.

3. The method according to claim 1, characterized in that, The generation of multiple random matrices includes: Obtain the target security requirements and target mission latency requirements; Based on the target security requirements and the target task latency requirements, determine the probability that any element in the random matrix is ​​a non-zero element; The lower the upper limit of the latency requirement corresponding to the target task, the lower the probability that any element in the random matrix is ​​a non-zero element; the higher the number of collusion computing nodes corresponding to the target security requirement, the higher the probability that any element in the random matrix is ​​a non-zero element.

4. The method according to claim 1, characterized in that, The source symbols corresponding to different rows in the generated matrix are not completely the same.

5. The method according to claim 1, characterized in that, The generation of multiple random matrices includes: Obtain the system security level, which characterizes the number of collusive computing nodes that are allowed to resist. The number of secure random matrices is determined based on the system security level. Generate the specified number of safe random matrices.

6. The method according to claim 1, characterized in that, The step of dividing the original data matrix into multiple original data sub-matrices includes: The original data matrix is ​​evenly divided into multiple original data submatrices along the row direction; wherein the difference in the number of rows of any two original data submatrices is less than or equal to a preset difference in the number of rows.

7. The method according to claim 1, characterized in that, The construction of the generating matrix includes: Obtain the target sparsity, which indicates the proportion of non-zero elements in each row of the generated matrix to the total number of source symbols; The row weight of the generator matrix is ​​determined based on the number of the multiple source symbols and the target sparsity, and the row weight is used to indicate the number of non-zero elements in each row of the generator matrix; Based on the row weight, the number of source symbols participating in encoding in each row of the generated matrix is ​​controlled.

8. A coding calculation device, characterized in that, Applied to a master node, the device includes: The acquisition unit is used to acquire the original data matrix and input vector to be calculated; A generation unit is used to divide the original data matrix into multiple original data sub-matrices and generate multiple random matrices; wherein, the multiple random matrices are used to perform a secure perturbation on the original data matrix, and the probability that any element in the random matrix is ​​a non-zero element is less than the probability that a non-zero element is randomly selected in a finite field. A construction unit is configured to determine multiple source symbols and construct a generator matrix based on the multiple original data sub-matrices and the multiple random matrices; wherein the multiple source symbols include the multiple original data sub-matrices and the multiple random matrices, each row of the generator matrix corresponds to a coding sub-matrix, each column of the generator matrix corresponds to a source symbol, and the non-zero elements in any row of the generator matrix are used to indicate the source symbol and its coding coefficients used in the coding sub-matrix corresponding to that row, and the number of non-zero elements in each row of the generator matrix is ​​less than the number of multiple source symbols; The encoding unit is used to linearly encode the plurality of source symbols based on the generator matrix to obtain a plurality of encoding submatrices; The transmission unit is configured to send the plurality of encoded sub-matrices to the corresponding computing nodes respectively, and broadcast the input vector to each computing node, so that each computing node performs matrix operations based on the received encoded sub-matrices and the input vector; The recovery unit is used to receive the calculation results returned by the multiple computing nodes respectively, and when the number of calculation results reaches the recovery threshold, to recover the operation result of the original data matrix and the input vector based on the calculation results.

9. A computer device, characterized in that, The computer device includes a processor and memory: The memory is used to store computer programs and to transfer the computer programs to the processor; The processor is configured to perform the method according to any one of claims 1-7 according to the computer program.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program for performing the method according to any one of claims 1-7.