A data processing method, apparatus, system
By processing segmented linear regression tasks in parallel on edge servers, the communication latency problem when outsourcing cloud servers is solved, resulting in faster response and higher computational efficiency.
Patent Information
- Application Number
- CN202111555243.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-17
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2041-12-17
AI Technical Summary
When linear regression calculation tasks are outsourced to cloud servers, communication latency issues arise, making it difficult to meet the real-time requirements of IoT environments.
The linear regression task is encrypted and divided into multiple sub-tasks, which are then distributed to multiple edge servers for parallel computation. This leverages the computing power of the edge servers and the shorter communication distance to improve computational efficiency.
This reduces data transmission latency, improves the responsiveness and processing speed of linear regression tasks, and ensures high efficiency in remote processing.
Smart Images

Figure CN115248927B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, in particular to a data processing method, device and system. BACKGROUND
[0002] Linear regression is a classic statistical model, which has very wide applications in science and engineering. Linear regression involves complex matrix multiplication and matrix inverse operation, so the amount of computation for completing the linear regression task is relatively large. For users with limited resources, the linear regression calculation task can be outsourced to a resource-rich server for completion. Currently, linear regression tasks are mainly outsourced to remote cloud servers with strong computing power.
[0003] However, the cloud server is generally far away from the user device, and the user usually generates a large communication delay when outsourcing the calculation to the cloud server, which is difficult to meet the real-time response demand in the Internet of Things environment. SUMMARY
[0004] The purpose of the present application is to provide a data processing method, device and system, which can improve the operation efficiency of the user's linear regression operation task to a certain extent.
[0005] To solve the above technical problems, the present application provides a data processing method, comprising:
[0006] encrypting an operation task to be operated on two groups of data for linear regression, to obtain an encrypted operation task;
[0007] segmenting the encrypted operation task into a plurality of sub-operation tasks, and distributing each sub-operation task to a plurality of edge servers, so that each edge server completes the corresponding sub-operation task and obtains a corresponding sub-operation result;
[0008] receiving the sub-operation results uploaded by each edge server respectively, and combining the sub-operation results to obtain an encrypted operation result;
[0009] decrypting the encrypted operation result to obtain a processing result of linear regression operation on the data groups.
[0010] Optionally, the step of segmenting the encrypted operation task into a plurality of sub-operation tasks and distributing each sub-operation task to a plurality of edge servers comprises:
[0011] segmenting an encrypted data matrix in the encrypted operation task into a plurality of sub-data matrices with a number of rows equal to the number of rows of the encrypted data matrix;
[0012] forming each sub-operation task according to each sub-data matrix.
[0013] Optionally, each of the sub-operation tasks is formed according to each of the sub-data matrices, comprising:
[0014] According to each of the sub-data matrices, the encryption operation task is divided into a transposed multiplication task corresponding to each of the sub-data matrices, a matrix inverse task, a first matrix multiplication task corresponding to each of the sub-data matrices, and a second matrix multiplication task;
[0015] Each of the transposed multiplication tasks, each of the first matrix multiplication tasks, and each of the second matrix multiplication tasks are respectively assigned to each of the edge servers, and the matrix inverse task is assigned to a master edge server in the edge servers;
[0016] The transposed multiplication task is a multiplication operation between a transpose of the sub-data matrix and the encryption data matrix;
[0017] The matrix inverse task is an inverse matrix of a multiplication operation result between a transpose of the encryption data matrix and the encryption data matrix, which is obtained according to an operation result of each of the transposed multiplication tasks;
[0018] The first matrix multiplication task is a multiplication operation between a transpose matrix corresponding to each of the sub-data matrices and an encryption data vector in the encryption operation task;
[0019] The second matrix multiplication task is a matrix-vector multiplication operation between a result of the matrix inverse task and a result of the first matrix multiplication task corresponding to each of the sub-data matrices.
[0020] Optionally, the master edge server comprises a first master edge server and a second master edge server;
[0021] The operation process of the matrix inverse task comprises:
[0022] Each of the edge servers other than the master edge server sends a half number of operation results obtained by completing the transposed multiplication task to the first master edge server, and sends another half number of operation results to the second master edge server;
[0023] The first master edge server combines the half number of operation results corresponding to the transposed multiplication task to form a matrix block X 11 and a matrix block X 12 , wherein, The second master edge server combines the other half number of operation results corresponding to the transposed multiplication task to form a matrix block X 21 and a matrix block X 22 , wherein, and k and p are positive integers, and X1 to X pThe operation results of the transpose multiplication tasks corresponding to the first sub-data matrix to the pth sub-data matrix, respectively;
[0024] The first master edge server performs an inverse operation on the matrix block X 11 to obtain a matrix block X 11 -1 and performs a matrix multiplication operation on the matrix block X 11 -1 and the matrix block X 12 to obtain a matrix block X 11 -1 X 12 , and sends the matrix block X 11 -1 and the matrix block X 11 - 1 X 12 to the second master edge server;
[0025] The second master edge server performs a matrix multiplication operation on the matrix block X 21 and the matrix block X 11 -1 to obtain the matrix block X 21 X 11 -1 , obtains a matrix block Y 21 X 11 -1 according to the matrix block X 22 =(X 22 -X 21 X 11 -1 X 12 ) -1 , and obtains a matrix block Y 22 =(X 22 -X 21 X 11 -1 X 12 ) -1 according to the matrix block Y 21 =-Y 22 X 21 X 11 -1 , and sends the matrix block X 21 X 11 -1 , the matrix block Y 22 =(X 22 -X 21 X 11 -1 X 12 ) -1 , and the matrix block Y 21= -Y 22 X 21 X 11 -1 sending to the first primary edge server;
[0026] the first primary edge server obtains a matrix block Y 22 = (X 22 - X 21 X 11 -1 X 12 ) -1 a matrix block Y 12 = -X 11 -1 X 12 Y 22 , according to the matrix block Y 12 = -X 11 -1 X 12 Y 22 a matrix block Y 11 = X 11 -1 - Y 12 X 21 X 11 -1 , the matrix block Y 22 = (X 22 - X 21 X 11 -1 X 12 ) -1 , the matrix block Y 12 = -X 11 -1 X 12 Y 22 , the matrix block Y 11 = X 11 -1 - Y 12 X 21 X 11 -1 and the matrix block Y 21 = -Y 22 X 21 X 11 -1 are combined to form a result matrix of the matrix inverse task
[0027] Optionally, the operation process of performing the second matrix multiplication task comprises:
[0028] the first primary edge server divides the result matrix into p matrix blocks Y j(1≤j≤p), and each of the sub-matrix blocks Y j are respectively distributed to each of the edge servers; wherein,
[0029] Each of the edge servers respectively performs matrix multiplication operation on the sub-matrix blocks Y j and the operation result of the first matrix multiplication task corresponding to the jth sub-data matrix to obtain the sub-operation result.
[0030] Optionally, the operation task to be operated by linear regression between the two groups of data sets is encrypted to obtain an encrypted operation task, including:
[0031] According to the key, a random sparse matrix and a random vector are generated; wherein, the random sparse matrix is a lower triangular matrix, and each column has only two non-zero elements except that the last column has only one non-zero element;
[0032] The data matrix in the operation task is encrypted by using the random sparse matrix to obtain an encrypted data matrix;
[0033] The data vector in the operation task is encrypted by using the random vector to obtain an encrypted data vector;
[0034] The encrypted operation task is obtained according to the encrypted data matrix and the encrypted data vector.
[0035] A data processing device, comprising:
[0036] A data encryption module is configured to encrypt an operation task to be operated by linear regression between two groups of data sets to obtain an encrypted operation task;
[0037] A task distribution module is configured to divide the encrypted operation task into a plurality of sub-operation tasks, and distribute each of the sub-operation tasks to a plurality of edge servers and to each of the edge servers, so that each of the edge servers respectively completes a corresponding sub-operation task and obtains a corresponding sub-operation result;
[0038] A result combination module is configured to receive the sub-operation results respectively uploaded by each of the edge servers, and combine the sub-operation results to obtain an encrypted operation result;
[0039] A data decryption module is configured to decrypt the encrypted operation result to obtain a processing result of linear regression operation of the data sets.
[0040] Optionally, the task distribution module is specifically configured to divide an encrypted data matrix in the encrypted operation task into a plurality of sub-data matrices; and form each of the sub-operation tasks according to each of the sub-data matrices.
[0041] Optionally, the data encryption module specifically comprises:
[0042] a matrix generating unit, configured to generate a random sparse matrix and a random vector according to a key; wherein the random sparse matrix is a lower triangular matrix, and each column of the random sparse matrix has only two non-zero elements except that the last column has only one non-zero element;
[0043] a first encryption unit, configured to encrypt a data matrix in the operation task by using the random sparse matrix to obtain an encrypted data matrix;
[0044] a second encryption unit, configured to encrypt a data vector in the operation task by using the random vector to obtain an encrypted data vector;
[0045] a third encryption unit, configured to obtain the encrypted operation task according to the encrypted data matrix and the encrypted data vector.
[0046] A data processing system comprises a client and a plurality of edge servers;
[0047] The edge servers are configured to receive and execute sub-operation tasks distributed by the client, and send obtained sub-operation results to the client;
[0048] The client is configured to execute steps of the data processing method according to the sub-operation results.
[0049] The data processing method provided by the application comprises the following steps: encrypting an operation task to be operated by linear regression between two groups of data sets to obtain an encrypted operation task; dividing the encrypted operation task into a plurality of sub-operation tasks, and distributing each sub-operation task to a plurality of edge servers and to each edge server, so that each edge server respectively completes a corresponding sub-operation task and obtains a corresponding sub-operation result; receiving the sub-operation results respectively uploaded by each edge server, and combining the sub-operation results to obtain an encrypted operation result; and decrypting the encrypted operation result to obtain a processing result of linear regression operation of the data sets.
[0050] In the application, when performing linear regression tasks between two groups of data sets, the encrypted operation task is divided into multiple sub-operation tasks on the basis of completing operation task encryption, and each sub-operation task is assigned to multiple edge servers. Relative to the cloud server, the edge server is closer to the data source, which can reduce the delay of data transmission to a certain extent and improve the timeliness of linear regression operation task response. On this basis, the linear regression task is decomposed into multiple sub-operation tasks and outsourced to multiple edge servers in parallel, so that multiple edge servers can simultaneously and in parallel complete the linear regression operation task, which reduces the operation pressure of each edge server to a certain extent, and further improves the operation speed of linear regression operation. Therefore, the method in the application can ensure the timeliness of response and the efficiency of operation task to a certain extent in the process of completing the linear regression task of data in different places, which is beneficial to the wide application of linear regression.
[0051] The application also provides a data processing device and system, which have the above beneficial effects. BRIEF DESCRIPTION OF DRAWINGS
[0052] In order to more clearly illustrate the technical solutions of the embodiments of the application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiment or prior art description. Obviously, the drawings in the following description are only some embodiments of the application, and for those skilled in the art, other drawings can also be obtained without creative labor based on these drawings.
[0053] Figure 1 A flowchart of a data processing method provided by an embodiment of the application;
[0054] Figure 2 A structural block diagram of a data processing device provided by an embodiment of the application. DETAILED DESCRIPTION
[0055] The edge server processes data at the network edge close to the data source. Relative to the cloud server, the communication network between the edge server and the user end is more stable and efficient, and is not prone to network delay or network interruption and other problems. Therefore, the application considers using the edge server to replace the cloud server to complete the linear regression operation of the user end.
[0056] However, further considering that the cloud server has stronger operation capability than the edge server, and the operation amount of the linear regression task is relatively large, obviously, a single edge server may not meet the operation requirement. Therefore, the application further considers using multiple edge servers to jointly and in parallel complete the linear regression operation, which not only enables the operation capability of the edge server to meet the operation requirement, but also improves the operation speed to a certain extent.
[0057] For those skilled in the technical field, the present application will be further described in detail below in combination with the drawings and specific embodiments. Obviously, the described embodiments are only part of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0058] As Figure 1 shown, Figure 1 A flowchart of a data processing method provided by an embodiment of the present application is shown. The data processing method can include:
[0059] S11: encrypting an operation task to be operated on two groups of data sets for linear regression operation to obtain an encrypted operation task.
[0060] It should be noted that linear regression operation is essentially an operation to determine the mapping relationship coefficient between two groups of data sets; in general, in order to facilitate operation, two groups of data sets can be represented by a data matrix and a data vector, respectively.
[0061] And encrypting the operation task is also to encrypt the data matrix and data vector contained in the operation task, so as to avoid leaking user data to the edge server when subsequent linear regression operation is performed by the edge server, and to ensure the security of user data.
[0062] Because the encryption of the operation task is mainly to avoid data leakage to the edge server, therefore, only the data needs to be encrypted in the actual encryption process, and the operation process in the operation task is not changed.
[0063] S12: dividing the encrypted operation task into multiple sub-operation tasks, and distributing each sub-operation task to multiple edge servers, so that each edge server respectively completes the corresponding sub-operation task and obtains the corresponding sub-operation result.
[0064] As mentioned earlier, the encryption of the operation task is essentially the encryption of the data matrix and the data vector. The current conventional encryption method is to first generate a random matrix and a random vector, and then perform matrix multiplication on the random matrix and the data matrix to obtain an encrypted data matrix; at the same time, the data vector can be encrypted by the random vector.
[0065] Based on the matrix operation rule, it can be determined that the matrix operation between the encrypted data of each column in the encrypted data matrix and the encrypted data vector is independent of each other to a certain extent, and does not interfere with each other. Therefore, based on this, the encrypted operation task can be divided into multiple sub-operation tasks in the present application.
[0066] For example, the encrypted data matrix can be divided into multiple sub-encrypted data matrices column by column, so that the number of rows of each sub-encrypted data matrix is equal to the number of rows of the encrypted data matrix, that is, each several columns of sub-encrypted data in the encrypted data matrix form a sub-encrypted data matrix.
[0067] Then, the linear regression operation tasks between each sub-encrypted data matrix and the encrypted data vector are respectively allocated to each edge server as sub-operation tasks, and the parallel operation of the linear regression operation tasks can be realized by respectively operating each sub-allocated sub-operation task by each edge server, thereby improving the operation efficiency of the linear regression operation task as a whole.
[0068] S13: receiving the sub-operation results uploaded by each edge server respectively, and combining the sub-operation results to obtain an encrypted operation result.
[0069] S14: decrypting the encrypted operation result to obtain a processing result of the linear regression operation of the data set.
[0070] After obtaining the sub-operation results obtained by each edge server, the sub-operation results are combined in the same way as the sub-encrypted data matrices are split, that is, the encrypted operation result can be obtained, and the final processing result can be obtained by decrypting the encrypted operation result.
[0071] In summary, in the present application, the linear regression operation between the two data sets is encrypted and split into multiple sub-operation tasks, so that each edge server can simultaneously and in parallel complete part of the linear regression operation, thereby improving the operation efficiency of the linear regression operation on the basis of ensuring that the operation capability of the edge server can complete the operation task, and ensuring the fast response of the linear regression operation task to the user.
[0072] As mentioned above, the process of encrypting the operation task mainly encrypts the data matrix and the data vector in the operation task, and in an optional embodiment of the present application, the encryption process can include:
[0073] S112: generating a random sparse matrix and a random vector according to the key; wherein the random sparse matrix is a lower triangular matrix, and each column has only two non-zero elements except that the last column has only one non-zero element.
[0074] Taking the data matrix in the operation task as M ∈ R n×m (n ≥ m), and the data vector as b ∈ R n×1 For example, the operation task can be represented as Φ = (M, b). Correspondingly, the process of generating the random coefficient matrix and the random vector can include:
[0075] Based on the security parameter λ, the key space K is initializedα , K β , K r ; select three sets of non-zero random real numbers in three key spaces such that {α1, α2, …, α m ,}←K α , {β1, β2, …, β m ,}←K β , {r1, r2, …, r m ,}←K r ; wherein the security parameter λ can be a random parameter input by the user on the client side, or a parameter randomly selected from a series of constant parameters pre-stored on the client side, which is not limited in the embodiment.
[0076] First, generate an m x m unit matrix Q, and let the diagonal data Q(j, i) = α i when the column number i is equal to the row number j; and randomly select a row number j in each column of the matrix Q that satisfies i < j ≤ m, and let Q(j, i) = β i , which can change the unit matrix Q into a random sparse matrix. Obviously, the random sparse matrix is a lower triangular matrix, and each column has only two non-zero elements except the last column which has only one non-zero element, which ensures that the random sparse matrix is sparse.
[0077] Then generate a random vector r = [r1, r2, …, r m ] according to the set of non-zero random real numbers {r1, r2, …, r m} T , and save the key K = {Q, r}.
[0078] S112: encrypt the data matrix in the operation task using the random sparse matrix to obtain an encrypted data matrix.
[0079] According to the encryption formula A = MQ, determine the encrypted data matrix A ∈ R n×m .
[0080] S113: encrypt the data vector in the operation task using the random vector to obtain an encrypted data vector.
[0081] According to the encryption formula b' = b + Mr, determine the encrypted data vector b' ∈ R n×1 .
[0082] S114: obtain the encrypted operation task according to the encrypted data matrix and the encrypted data vector.
[0083] Based on the encrypted data matrix and the encrypted data vector, the encrypted operation task can be determined as: Φ' = (A, b').
[0084] It should be noted that generally, outsourcing linear regression tasks to remote servers requires encryption of data; the difference is that in the present embodiment, the random sparse matrix used to encrypt the data matrix is a lower triangular matrix, which ensures that the encrypted data matrix formed after encryption of the data matrix is reversible. In addition, each column of the constructed random sparse matrix has only two non-zero elements, except for the last column which has only one non-zero element, ensuring that the random sparse matrix is sparse; using the random sparse matrix to blind the data matrix in the original linear regression calculation task enables the elements in the data matrix to be hidden. Using a random vector to blind the data vector in the original linear regression calculation task can hide the values of the elements in the constant vector, thereby protecting the input and output privacy of the user and achieving lightweight calculation on the user side.
[0085] Based on any of the above embodiments, when performing linear regression tasks, each encryption operation task needs to be divided into several sub-operation tasks and distributed to each edge server. In an optional embodiment of the present application, the process of dividing each sub-task can include:
[0086] According to each sub-data matrix, the encryption operation task is divided into a transpose multiplication task corresponding to each sub-data matrix, a matrix inverse task, a first matrix multiplication task corresponding to each sub-data matrix, and a second matrix multiplication task;
[0087] Each transpose multiplication task, each first matrix multiplication task, and each second matrix multiplication task are respectively distributed to each edge server; and the matrix inverse task is distributed to the master edge server in the edge servers;
[0088] The transpose multiplication task is a multiplication operation between the transpose of the sub-data matrix and the encrypted data matrix.
[0089] The matrix inverse task is to obtain the inverse matrix of the multiplication operation result between the transpose of the encrypted data matrix and the encrypted data matrix according to the operation result of each transpose multiplication task.
[0090] The first matrix multiplication task is a multiplication operation between the transpose matrix corresponding to each sub-data matrix and the encrypted data vector in the encryption operation task.
[0091] The second matrix multiplication task is a matrix-vector multiplication operation between the result of the matrix inverse task and the result of the first matrix multiplication task corresponding to each sub-data matrix.
[0092] Suppose that the encrypted data matrix A and the encrypted data vector b' satisfy Ax = b', then the final operation result of the encryption operation task can be determined by matrix conversion and can be expressed as x = (A T A) -1 A T b'; for this purpose, the encryption operation task can be first divided into Y = (A TA) -1 and c = A T b' consists of two parts; obviously, as long as Y = (A) is completed separately... T A) -1 and c = A T The operation of b' can determine x = (A) T A) -1 A T b'. And Y = (A T A) -1 It can be further decomposed into A T Operations on A and operations on A T The inverse operation of A; therefore, A T The operation on A is the transpose multiplication task; for A T The inverse operation of A is the matrix inverse task; c = A T The result of the operation b' is obtained by combining the results of the first matrix multiplication tasks; while the result of the operation x = Yc is obtained by combining the results of the second matrix multiplication tasks.
[0093] When performing the transpose multiplication task, the encrypted data matrix A can be divided into p smaller sub-matrix blocks A by columns. j (1≤j≤p) such that A=[A1|A2|…|A p It should be noted that p can be set based on the number of edge servers. p can be no less than the data of the edge servers, thus efficiently utilizing the edge servers for computation. In this case, each edge server must be assigned at least one sub-computation task corresponding to a sub-data matrix. Of course, p can also be less than the number of edge servers, ensuring that all sub-computation tasks can be assigned to one edge server. p can also be equal to the number of edge servers; this embodiment uses p equal to the number of edge servers as an example for explanation. In subsequent embodiments, p equal to the number of edge servers will also be used as an example for explanation, and this will not be explained further.
[0094] Set the number of data columns for the 1st to p-1th submatrix blocks to be... (where the symbol) (For the floor operation), the number of data columns in the p-th submatrix block is d1 = m - (p-1)d; that is, A j ∈R n×d (1≤j<p),
[0095] For the transpose multiplication task, it can be viewed as obtaining A T The task of calculating the result of operation A; after splitting the encrypted data matrix A into multiple sub-matrix blocks, A can also be... T The operation of A is broken down into p calculations. Let AT A=X; then the operation task of can be assigned to each edge server, and each edge server completes the operation in parallel.
[0096] After completing , it is obvious that A T can be determined by the operation results of each edge server, which is equivalent to completing the transpose multiplication task.
[0097] After completing the transpose multiplication task, further operations on A T are required to complete the matrix inverse task, because the operation of each data in the matrix is difficult to be independent of multiple single operations in the operation process of the matrix inverse task. Therefore, in practical applications, one edge server can be selected as a master edge server to independently complete the operation of the matrix inverse task.
[0098] Of course, in practical applications, the matrix inverse task can not be limited to being assigned to only one master edge server. In an alternative embodiment of the present application, two edge servers are selected as master edge servers, including a first master edge server and a second master edge server. The process of executing the matrix inverse task can include:
[0099] Step one: each edge server other than the master edge server sends half of the operation results obtained by completing the transpose multiplication task to the first master edge server and the other half to the second master edge server.
[0100] Let k be equal to p / 2 rounded; for each edge server S j (1≤j<p), calculate X j = A j T After A, if j≤k, the edge server S j sends X j to the first master edge server S1; otherwise, the edge server S j sends X j to the second master edge server S2.
[0101] Step two: the first master edge server combines half of the operation results corresponding to the transpose multiplication task to form the matrix block X 11 and the matrix block X 12 , where The second master edge server combines the other half of the operation results corresponding to the transpose multiplication task to form the matrix block X 21 and the matrix block X 22 , where And both k and p are positive integers, and X1 to X p These are the results of the transpose multiplication tasks corresponding to the 1st to pth sub-data matrices, respectively.
[0102] Clearly, for matrix X, it should satisfy... Wherein, matrix block X 11 and matrix block X 12 The number of data rows in the matrix should be equal, while the number of matrix blocks X should be equal. 21 and matrix block X 22 The number of data rows in the matrix block X should also be equal. 11 and matrix block X 12 The number of columns should be equal or differ by 1. Similarly, the number of columns in matrix block X should be equal. 21 and matrix block X 22 The number of columns should also be equal or differ by 1; and the matrix block X 11 and matrix block X 21 The number of columns, matrix block X 12 and matrix block X 22 The number of columns should also be equal.
[0103] Step 3: The first primary edge server processes matrix block X. 11 Perform the inversion operation to obtain matrix block X 11 -1 and for matrix block X 11 -1 and matrix block X 12 Perform matrix multiplication to obtain matrix block X. 11 -1 X 12 , matrix block X 11 -1 and matrix block X 11 -1 X 12 Send to the second primary edge server.
[0104] Step 4: The second primary edge server processes matrix block X. 21 and matrix block X 11 -1 Perform matrix multiplication to obtain matrix block X. 21 X 11 -1 According to matrix block X 21 X 11 -1 Obtain matrix block Y 22 =(X 22 -X 21 X 11 -1 X 12 ) -1 And according to matrix block Y22 =(X 22 -X 21 X 11 -1 X 12 ) -1 Obtain matrix block Y 21 =-Y 22 X 21 X 11 -1 , matrix block X 21 X 11 -1 Matrix block Y 22 =(X 22 -X 21 X 11 -1 X 12 ) -1 and matrix block Y 21 =-Y 22 X 21 X 11 -1 Send to the first primary edge server;
[0105] Step 5: The first primary edge server, based on matrix block Y... 22 =(X 22 -X 21 X 11 -1 X 12 ) -1 Obtain matrix block Y 12 =-X 11 -1 X 12 Y 22 According to matrix block Y 12 =-X 11 -1 X 12 Y 22 Obtain matrix block Y 11 =X 11 -1 -Y 12 X 21 X 11 -1 , matrix block Y 22 =(X 22 -X 21 X 11 -1 X 12 ) -1 Matrix block Y 12 =-X 11 -1 X 12 Y 22 Matrix block Y11 = X 11 -1 = -Y 12 X 21 X 11 -1 and matrix block Y 21 = -Y 22 X 21 X 11 -1 combined to form the operation result matrix of the matrix inverse task
[0106] In the present application, the matrix inverse task is mainly assigned to two edge servers, and the operation of the matrix inverse task is finally realized through mutual communication between the two edge servers and operation of partial data by the two edge servers respectively, so as to reduce the operation amount of the matrix inverse task completed by a single edge server alone to a certain extent, and further to ensure the operation efficiency.
[0107] Of course, it can be understood that in actual application, the operation tasks of matrix block Y 11 , Y 12 , Y 21 , Y 22 may also be respectively assigned to four or even more edge servers, so as to further reduce the operation amount of the edge server, and the present application will not be described in detail.
[0108] After the operation of the matrix inverse task is completed, the operation of Y = (A T A) -1 is completed; and the process of completing c = A T b' can also utilize that the encrypted data matrix A is divided into p smaller scale sub-matrix blocks A j (1≤j≤p), and then the operation task of c = A T b' is divided into p first matrix multiplication tasks of c j = A j T b' and is assigned to each edge server to perform operation respectively, and each edge server can respectively obtain the operation result of c j = A j T b' based on the operation result of c j = A j T b' of each edge server, and the operation result of c = A T b' can be obtained by combining, and the operation process is similar to the operation process of X j = A j T A above, which will not be described in detail.
[0109] After the operations of Y=(A T A) -1 and c=A T b' are completed, the operation of x=Yc can be performed, and the operation of x=Yc can be further divided into a plurality of second matrix multiplication tasks.
[0110] In an optional embodiment of the present application, the division and operation of the second matrix multiplication task can include:
[0111] The first master edge server divides the operation result matrix x into p sub-matrix blocks Y j (1≤j≤p), and distributes each sub-matrix block Y j to each edge server respectively; wherein,
[0112] Each edge server respectively performs matrix multiplication operation on the operation result of the first matrix multiplication task corresponding to the sub-matrix block Y j and the jth sub-data matrix, to obtain a sub-operation result.
[0113] Obviously, when the matrix Y is divided into sub-matrix blocks Y j , the number of columns of each sub-matrix block Y j should be the same, and the number of rows is different, and after each edge server completes the operation of x j =Y j c, the corresponding sub-operation result can be obtained, each edge server sends the sub-operation result obtained by the respective operation to the client, and the client can obtain the operation result of the encryption operation task based on the received sub-operation result, and then decrypt the operation result based on the encryption key, to obtain the operation result corresponding to the operation task.
[0114] The data processing device provided by the embodiment of the present application will be described below. The data processing device described below can be referred to the data processing method described above.
[0115] Figure 2 The structure block diagram of the data processing device provided by the embodiment of the present application can include: Figure 2
[0116] The data encryption module 100 is configured to encrypt the operation task to be operated by linear regression between the two groups of data groups, to obtain an encrypted operation task.
[0117] The task distribution module 200 is configured to split the encryption operation task into a plurality of sub-operation tasks, and distribute each of the sub-operation tasks to an edge server, so that each edge server completes a corresponding sub-operation task and obtains a corresponding sub-operation result.
[0118] The result combination module 300 is configured to receive the sub-operation results uploaded by each edge server respectively, and combine the sub-operation results to obtain an encryption operation result.
[0119] The data decryption module 400 is configured to decrypt the encryption operation result to obtain a processing result of linear regression operation on the data group.
[0120] In an optional embodiment of the present application, the task distribution module 200 is specifically configured to split an encryption data matrix in the encryption operation task into a plurality of sub-data matrices with a number of rows equal to a number of rows of the encryption data matrix; and form each of the sub-operation tasks according to each of the sub-data matrices.
[0121] In an optional embodiment of the present application, the task distribution module 200 is specifically configured to split the encryption operation task into a transpose multiplication task corresponding to each of the sub-data matrices, a matrix inverse task, a first matrix multiplication task corresponding to each of the sub-data matrices, and a second matrix multiplication task according to each of the sub-data matrices; distribute each of the transpose multiplication tasks, each of the first matrix multiplication tasks, and each of the second matrix multiplication tasks to each of the edge servers respectively; and distribute the matrix inverse task to a master edge server in the edge servers.
[0122] The transpose multiplication task is a multiplication operation between a transpose of the sub-data matrix and the encryption data matrix; the matrix inverse task is an inverse matrix of a multiplication operation result between a transpose of the encryption data matrix and the encryption data matrix according to an operation result of each of the transpose multiplication tasks; the first matrix multiplication task is a multiplication operation of a transpose matrix corresponding to each of the sub-data matrices and an encryption data vector in the encryption operation task; and the second matrix multiplication task is a matrix-vector multiplication operation between a result of the matrix inverse task and a result of the first matrix multiplication task corresponding to each of the sub-data matrices.
[0123] In an optional embodiment of the present application, the data encryption module 100 specifically includes:
[0124] A matrix generation unit is configured to generate a random sparse matrix and a random vector according to a key; wherein the random sparse matrix is a lower triangular matrix, and each column has only two non-zero elements except that the last column has only one non-zero element.
[0125] a first encryption unit configured to encrypt a data matrix in the operation task using the random sparse matrix to obtain an encrypted data matrix;
[0126] a second encryption unit configured to encrypt a data vector in the operation task using the random vector to obtain an encrypted data vector;
[0127] a third encryption unit configured to obtain the encrypted operation task according to the encrypted data matrix and the encrypted data vector.
[0128] The data processing apparatus of the embodiment is used to implement the data processing method described above, and the specific implementation of the data processing apparatus can be seen from the embodiment part of the data processing method described above. For example, the data encryption module 100, the task allocation module 200, the result combination module 300, and the data decryption module 400 are respectively used to implement steps S11, S12, S13, and S14 in the data processing method described above. Therefore, the specific implementation can be referred to the description of the corresponding embodiment part, and will not be described here again.
[0129] The application also provides an embodiment of a data processing system, which can include:
[0130] a client and a plurality of edge servers;
[0131] The edge servers are configured to receive and execute the sub-operation tasks allocated by the client and send the obtained sub-operation results to the client.
[0132] The client is configured to execute the steps of the data processing method according to the sub-operation results.
[0133] The client in the application can be a mobile phone, a pad, a computer, or various devices of a user. The data processing required by the client can be a linear programming task generated by processing various operation programs in actual work operation. In the application, the linear regression task of the client is completed by the plurality of edge servers in common and in parallel, which to some extent ensures the response speed of the edge servers to the linear regression task of the client and improves the efficiency of completing the data processing of the client.
[0134] It should be noted that, in the present document, relational terms such as first and second and the like can be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. Furthermore, the article "a" or "an" is intended to include one or more items, and can be used interchangeably with the article "one or more". Where only one item is intended, the term "one" or "only one" is used. Also, the use of "or" is also intended to cover all possible combinations, such that, for example, a condition A or B is satisfied by any one of the following: A is true (or present) and B is false (or not present), A is false (or not present) and B is true (or present), and both A and B are true (or present).
[0135] The principles and implementations of the present application have been described in the specific examples above, the above examples are only used to help understand the method of the present application and its core idea. It should be pointed out that, for those skilled in the art, without departing from the principles of the present application, some improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A data processing method, characterized by, The application comprises the following steps: encrypting the operation task to be operated on the two groups of data sets to obtain an encrypted operation task; segmenting the encrypted operation task into multiple sub-operation tasks, and distributing each sub-operation task to multiple edge servers so that each edge server completes the corresponding sub-operation task and obtains a corresponding sub-operation result; receiving the sub-operation results uploaded by each edge server respectively, and combining the sub-operation results to obtain an encrypted operation result; decrypting the encrypted operation result to obtain the processing result of the linear regression operation on the data sets; segmenting the encrypted operation task into multiple sub-operation tasks comprises the following steps: segmenting the encrypted data matrix in the encrypted operation task into multiple sub-data matrices with the number of rows equal to the number of rows of the encrypted data matrix; forming each sub-operation task according to each sub-data matrix; forming each sub-operation task according to each sub-data matrix comprises the following steps: segmenting the encrypted operation task into a transpose multiplication task corresponding to each sub-data matrix, a matrix inverse task, a first matrix multiplication task corresponding to each sub-data matrix, and a second matrix multiplication task corresponding to each sub-data matrix according to each sub-data matrix; distributing each transpose multiplication task, each first matrix multiplication task, and each second matrix multiplication task to each edge server respectively, and distributing the matrix inverse task to a master edge server in the edge servers; wherein the transpose multiplication task is a multiplication operation between the transpose of the sub-data matrix and the encrypted data matrix; the matrix inverse task is an inverse matrix of the multiplication operation result between the transpose of the encrypted data matrix and the encrypted data matrix according to the operation result of each transpose multiplication task; the first matrix multiplication task is a multiplication operation between the transpose matrix corresponding to each sub-data matrix and the encrypted data vector in the encrypted operation task; the second matrix multiplication task is a matrix-vector multiplication operation between the result of the matrix inverse task and the result of the first matrix multiplication task corresponding to each sub-data matrix; the master edge server comprises a first master edge server and a second master edge server; wherein the operation process of the matrix inverse task comprises the following steps: each edge server other than the master edge server sends half of the operation results obtained by completing the transpose multiplication task to the first master edge server, and sends the other half of the operation results to the second master edge server; The first master edge server combines the operation results corresponding to the half number of the transpose multiplication tasks to form a matrix block and a matrix block wherein, The second master edge server combines the operation results corresponding to the other half number of the transpose multiplication tasks to form a matrix block and a matrix block wherein, , and and are positive integers, and to are operation results of the transpose multiplication tasks corresponding to the 1st to the th sub-data matrix, respectively. The first master edge server performs an inverse operation on the matrix block to obtain a matrix block , performs a matrix multiplication operation on the matrix block and the matrix block to obtain a matrix block , and transmits the matrix block and the matrix block to the second master edge server. The second master edge server performs matrix multiplication operation on the matrix block and the matrix block to obtain the matrix block , obtains the matrix block according to the matrix block , obtains the matrix block according to the matrix block , and sends the matrix block , the matrix block and the matrix block to the first master edge server. The first master edge server obtains the matrix block obtains a matrix block , obtains a matrix block obtains a matrix block combines the matrix block , the matrix block , the matrix block , and the matrix block to form a result matrix of the matrix inverse task .
2. The data processing method of claim 1, wherein, the operation process of the second matrix multiplication task comprises the following steps: The first master edge server divides the operation result matrix into p sub-matrix blocks and respectively distributes and transmits each of the sub-matrix blocks to each of the edge servers; wherein ; Each of the edge servers respectively performs matrix multiplication operation on the sub-matrix block and the operation result of the first matrix multiplication task corresponding to the corresponding first sub-data matrix to obtain the sub-operation result.
3. The data processing method according to claim 1 or 2, characterized in that, encrypting the operation task to be operated on the two groups of data sets to obtain an encrypted operation task comprises the following steps: generating a random sparse matrix and a random vector according to a key; wherein the random sparse matrix is a lower triangular matrix, and each column has only two non-zero elements except that the last column has only one non-zero element; encrypting the data matrix in the operation task by using the random sparse matrix to obtain an encrypted data matrix; encrypting the data vector in the operation task by using the random vector to obtain an encrypted data vector; The encryption operation task is obtained according to the encrypted data matrix and the encrypted data vector.
4. A data processing apparatus, characterized by, Comprise: A data encryption module is configured to encrypt an operation task to be operated on two groups of data for linear regression to obtain an encrypted operation task; A task allocation module is configured to divide the encrypted operation task into a plurality of sub-operation tasks, and allocate each of the sub-operation tasks to a plurality of edge servers, so that each of the edge servers respectively completes a corresponding sub-operation task and obtains a corresponding sub-operation result; A result combination module is configured to receive the sub-operation results respectively uploaded by each of the edge servers, and combine the sub-operation results to obtain an encrypted operation result; A data decryption module is configured to decrypt the encrypted operation result to obtain a processing result of linear regression operation on the data groups; The task allocation module is specifically configured to divide an encrypted data matrix in the encrypted operation task into a plurality of sub-data matrices; and form each of the sub-operation tasks according to each of the sub-data matrices; The task allocation module is specifically used to divide the encryption operation task into a transpose multiplication task, a matrix inverse task, a first matrix multiplication task, and a second matrix multiplication task corresponding to each of the sub-data matrices, based on each of the sub-data matrices; to allocate each of the transpose multiplication tasks, the first matrix multiplication tasks, and the second matrix multiplication tasks to each of the edge servers; and to allocate the matrix inverse task to the main edge server among the edge servers; wherein, the transpose multiplication task is a multiplication operation between the transpose of the sub-data matrix and the encrypted data matrix; the matrix inverse task is to obtain the inverse of the result of the multiplication operation between the transpose of the encrypted data matrix and the encrypted data matrix based on the operation results of each of the transpose multiplication tasks. The matrix multiplication task is a multiplication operation between the transpose matrix corresponding to each of the sub-data matrices and the encrypted data vector in the encryption operation task; the second matrix multiplication task is a matrix-vector multiplication operation between the result of the matrix inversion task and the result of the first matrix multiplication task corresponding to each of the sub-data matrices; the main edge server includes a first main edge server and a second main edge server; wherein, each edge server other than the main edge server sends half of the operation results obtained from completing the transpose multiplication task to the first main edge server, and the other half of the operation results to the second main edge server; the first main edge server combines the half of the operation results corresponding to the transpose multiplication task to form a matrix block. and matrix blocks ,in, The second primary edge server combines the results of the other half of the transpose multiplication tasks to form matrix blocks. and matrix blocks ,in, ,and and All are positive integers, and to The first sub-data matrix to the second sub-data matrix are respectively The results of the transpose multiplication task corresponding to each sub-data matrix; the first main edge server for matrix blocks Perform the inversion operation to obtain the matrix block. and for matrix blocks and matrix blocks Perform matrix multiplication to obtain a matrix block. , the matrix block and the matrix block Send to the second primary edge server; the second primary edge server processes the matrix block. and the matrix block Perform matrix multiplication to obtain the matrix block. obtaining a matrix block obtaining a matrix block obtaining a matrix block obtaining a matrix block combining the matrix block , the matrix block , and the matrix block to form a result matrix of the matrix inverse task obtaining a matrix block obtaining a matrix block obtaining a matrix block combining the matrix block , the matrix block , the matrix block , and the matrix block to form a result matrix of the matrix inverse task .
5. The data processing apparatus of claim 4, wherein, The data encryption module specifically comprises: A matrix generation unit is configured to generate a random sparse matrix and a random vector according to a key; wherein the random sparse matrix is a lower triangular matrix, and each column has only two non-zero elements except that the last column has only one non-zero element; A first encryption unit is configured to encrypt a data matrix in the operation task by using the random sparse matrix to obtain an encrypted data matrix; A second encryption unit is configured to encrypt a data vector in the operation task by using the random vector to obtain an encrypted data vector; A third encryption unit is configured to obtain the encrypted operation task according to the encrypted data matrix and the encrypted data vector.
6. A data processing system, characterized by Comprise a client and a plurality of edge servers; The edge servers are configured to receive and execute the sub-operation tasks allocated by the client, and send the obtained sub-operation results to the client; The client is configured to execute the steps of the data processing method according to any one of claims 1 to 3 according to the sub-operation results.
Citation Information
Patent Citations
Distributed outsourcing calculation processing method based on edge calculation and related components
CN112182488A