Data dimension reduction method, terminal device, and storage medium

By calculating and sending the projection matrix by the coordinating party, the problem of data leakage in multi-party data dimensionality reduction is solved, and a secure data dimensionality reduction process is achieved.

CN116578899BActive Publication Date: 2025-10-10HANGZHOU QULIAN TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310492971.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-28
Publication Date
2025-10-10
Estimated Expiration
2043-04-28

AI Technical Summary

Technical Problem

When performing dimensionality reduction on multi-party data, there is a risk of data leakage. Existing technologies make it difficult to perform effective data dimensionality reduction while ensuring data security.

Method used

By introducing a coordinator, the encrypted covariance matrix and mean data of the initiator and participants are obtained, the intra-class scatter matrix and the inter-class scatter matrix are calculated, the projection matrix is ​​determined, and sent to the initiator and participants to instruct them to perform data dimensionality reduction.

Benefits of technology

Without leaking the data of the initiator and participants, the secure dimensionality reduction of multi-party data is achieved, ensuring the privacy and security of the data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116578899B_ABST
    Figure CN116578899B_ABST
Patent Text Reader

Abstract

The application provides a data dimension reduction method, a terminal device and a storage medium. The data dimension reduction method comprises the following steps: a coordinator obtains an encrypted first covariance matrix and first mean value data sent by an initiator, and obtains an encrypted second covariance matrix and second mean value data sent by a participant, the first mean value data is obtained by encrypting a first mean vector sum of all types of data in a first data set of the initiator, and the second mean value data is obtained by encrypting a second mean vector sum of all types of data in a second data set of the participant; an intra-class scatter matrix is determined according to the encrypted first covariance matrix and the encrypted second covariance matrix, an inter-class scatter matrix is determined according to the first mean value data and the second mean value data, a projection matrix is determined according to the intra-class scatter matrix and the inter-class scatter matrix, and the projection matrix is sent to the initiator and the participant, so that the data of the initiator and the participant is reduced in dimension while ensuring the security of the data of all parties.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing, and in particular to a data dimensionality reduction method, a terminal device, and a storage medium. Background Art

[0002] By reducing data from high dimensions to low dimensions, redundant and dependent variable features can be removed, facilitating data analysis and statistics. However, when reducing the dimensionality of multiple data sources, it is necessary to combine multiple data sources for data analysis, which can lead to the risk of data leakage. Summary of the Invention

[0003] In view of this, the embodiments of the present application provide a data dimensionality reduction method, a terminal device and a storage medium, which can combine data from multiple parties to achieve dimensionality reduction of data from multiple parties while ensuring data security.

[0004] A first aspect of an embodiment of the present application provides a data dimensionality reduction method, which is executed by a coordinator, and the method includes:

[0005] Obtaining the encrypted first covariance matrix and first mean data sent by the initiator, and obtaining the encrypted second covariance matrix and second mean data sent by the participant, where the first mean data is obtained by preprocessing and encrypting the first mean vector sum of various types of data in the initiator's first data set, and the second mean data is obtained by preprocessing and encrypting the second mean vector sum of various types of data in the participant's second data set;

[0006] Determine an intra-class scatter matrix according to the encrypted first covariance matrix and the encrypted second covariance matrix;

[0007] determining an inter-class scatter matrix according to the first mean data and the second mean data;

[0008] Determining a projection matrix according to the intra-class scatter matrix and the inter-class scatter matrix;

[0009] The projection matrix is ​​sent to the initiator and the participant to instruct the initiator to perform data dimensionality reduction on the first data set according to the projection matrix, and to instruct the participant to perform data dimensionality reduction on the second data set according to the projection matrix.

[0010] In one embodiment, the dimension of the data in the first data set is the same as the dimension of the data in the second data set, the first mean data is obtained by encrypting the first mean vector sum and the number of each type of data in the first data set, and the second mean data is obtained by encrypting the second mean vector sum and the number of each type of data in the second data set.

[0011] In one embodiment, before obtaining the encrypted first covariance matrix sent by the initiator and obtaining the encrypted second covariance matrix sent by the participant, the method further includes:

[0012] Determine a third mean vector based on the first mean data and the second mean data, where the third mean vector is a mean vector of each type of data in the first data set and the second data set;

[0013] The third mean vector is sent to the initiator and the participant to instruct the initiator to determine the encrypted first covariance matrix based on the third mean vector, and to instruct the participant to determine the encrypted second covariance matrix based on the third mean vector.

[0014] In one embodiment, determining the intra-class dispersion matrix according to the encrypted first covariance matrix and the encrypted second covariance matrix includes:

[0015] The encrypted first covariance matrix and the encrypted second covariance matrix are summed to obtain an intra-class scatter matrix.

[0016] In one embodiment, determining the inter-class scatter matrix according to the first mean data and the second mean data includes:

[0017] Determining a third mean vector based on the first mean data and the second mean data, where the third mean vector is a mean vector of each class of samples in the first data set and the second data set;

[0018] If the data category is 2, determine the inter-class scatter matrix according to the difference of the third mean vectors corresponding to the two categories of data;

[0019] If the number of data categories is greater than 2, a fourth mean vector is determined based on the first mean data and the second mean data, where the fourth mean vector is the mean vector of the first data set and the second data set; and an inter-class scatter matrix is ​​determined based on the difference between the third mean vector and the fourth mean vector corresponding to each type of data.

[0020] In one embodiment, the dimension of the initiator's data is different from the dimension of the participant's data, the encrypted first covariance matrix and the first mean data are determined based on a third data set, the encrypted second covariance matrix and the second mean data are determined based on a fourth data set, the third data set is obtained by screening the first data set, and the fourth data set is obtained by screening the second data set, and the order of data identifiers of the third data set and the fourth data set are consistent.

[0021] In one embodiment, determining the intra-class dispersion matrix according to the encrypted first covariance matrix and the encrypted second covariance matrix includes:

[0022] Obtaining first encrypted data sent by the initiator and second encrypted data sent by the participant, where the first encrypted data is determined based on the third data set and the first mean vector sum, and the second encrypted data is determined based on the fourth data set and the second mean vector sum;

[0023] Determine a first sub-matrix of a sample covariance matrix according to the first encrypted data, the second encrypted data, the encrypted first covariance matrix, and the encrypted second covariance matrix;

[0024] The first sub-matrices are summed to obtain a within-class scatter matrix.

[0025] In one embodiment, determining the inter-class scatter matrix according to the first mean data and the second mean data includes:

[0026] If the data category is 2, obtain the second submatrix sent by the initiator and the third submatrix sent by the participant, where the second submatrix is ​​determined based on the difference between the sums of the two first mean vectors, and the third submatrix is ​​determined based on the difference between the sums of the two second mean vectors;

[0027] If the number of data categories is greater than 2, obtain a second submatrix sent by the initiator and a third submatrix sent by the participant, where the second submatrix is ​​determined based on the difference between the sum of the first mean vector and the global mean vector of the third data set, and the third submatrix is ​​determined based on the difference between the sum of the second mean vector and the global mean vector of the fourth data set;

[0028] An inter-class scatter matrix is ​​determined according to the second sub-matrix, the third sub-matrix, the first mean data, and the second mean data.

[0029] A second aspect of an embodiment of the present application provides a data dimensionality reduction device, which is executed by a coordinator, and includes:

[0030] an acquisition module, configured to acquire an encrypted first covariance matrix and first mean data sent by an initiator, and an encrypted second covariance matrix and second mean data sent by a participant, wherein the first mean data is obtained by preprocessing and encrypting the first mean vector sum of various types of data in the initiator's first data set, and the second mean data is obtained by preprocessing and encrypting the second mean vector sum of various types of data in the participant's second data set;

[0031] A first calculation module is used to determine an intra-class scatter matrix according to the encrypted first covariance matrix and the encrypted second covariance matrix;

[0032] a second calculation module, configured to determine an inter-class scatter matrix according to the first mean data and the second mean data;

[0033] A third calculation module is used to determine a projection matrix according to the intra-class scatter matrix and the inter-class scatter matrix;

[0034] A sending module is used to send the projection matrix to the initiator and the participant, so as to instruct the initiator to perform data dimensionality reduction on the first data set according to the projection matrix, and to instruct the participant to perform data dimensionality reduction on the second data set according to the projection matrix.

[0035] A third aspect of an embodiment of the present application provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the data dimensionality reduction method as described in the first aspect above is implemented.

[0036] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the data dimensionality reduction method as described in the first aspect above is implemented.

[0037] A fifth aspect of an embodiment of the present application provides a computer program product. When the computer program product is run on a terminal device, the terminal device executes the data dimensionality reduction method described in any one of the first aspects above.

[0038] Compared with the prior art, the beneficial effect of the embodiments of the present application is that the coordinator obtains the encrypted first covariance matrix and the encrypted first mean data sent by the initiator, and obtains the encrypted second covariance matrix and the encrypted second mean data sent by the participant, determines the intra-class scatter matrix according to the encrypted first covariance matrix and the encrypted second covariance matrix, determines the inter-class scatter matrix according to the first mean data and the second mean data, and then determines the projection matrix according to the intra-class scatter matrix and the inter-class scatter matrix, and sends the projection matrix to the initiator and the participant, thereby reducing the dimensionality of the data of the initiator and the participant without obtaining the data of the initiator and the participant and the initiator and the participant not publishing the data to each other. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art.

[0040] Figure 1 is a schematic diagram of an implementation procedure of a data dimension reduction method provided by an embodiment of the present application;

[0041] Figure 2 is a schematic diagram of a sample covariance matrix provided by an embodiment of the present application;

[0042] Figure 3 is a schematic diagram of an intra-class scatter matrix provided by an embodiment of the present application;

[0043] Figure 4 is a schematic diagram of an inter-class scatter matrix corresponding to data of one of the classes provided by an embodiment of the present application;

[0044] Figure 5 is a schematic diagram of an inter-class scatter matrix provided by an embodiment of the present application;

[0045] Figure 6 is a specific flowchart of a data dimension reduction method in a scenario of the present application;

[0046] Figure 7 is a specific flowchart of a data dimension reduction method in another scenario of the present application;

[0047] Figure 8 is a schematic diagram of a data dimension reduction apparatus provided by an embodiment of the present application;

[0048] Figure 9 is a schematic diagram of a structure of a terminal device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0049] In the following description, specific details are set forth, such as particular system configurations, techniques, etc., in order to provide a thorough understanding of the embodiments of the present application. However, persons skilled in the art will understand that the present application can be practiced without these specific details. In other instances, well-known structures, devices, circuits, and methods have not been described in detail in order to avoid obscuring the description of the present application.

[0050] It should be understood that the term "comprising" as used in the specification and in the claims indicates the presence of the recited features, integers, steps, operations, elements, and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. The term "and / or" as used in the specification and in the claims indicates any combination of one or more of the associated listed items and all possible combinations thereof.

[0051] It should also be understood that the terms used in this specification are for the purpose of describing specific embodiments only and are not intended to limit the present application. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms unless the context clearly indicates otherwise.

[0052] In addition, in the description of the present application, the terms "first", "second", "third", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0053] In order to reduce the dimensionality of data from multiple parties while ensuring data security, the present application provides a data dimensionality reduction method, which introduces a coordinator, and the coordinator obtains the encrypted first covariance matrix and the encrypted first mean data sent by the initiator, and obtains the encrypted second covariance matrix and the encrypted second mean data sent by the participating party. The intra-class scatter matrix is ​​determined based on the encrypted first covariance matrix and the encrypted second covariance matrix, the inter-class scatter matrix is ​​determined based on the first mean data and the second mean data, and then the projection matrix is ​​determined based on the intra-class scatter matrix and the inter-class scatter matrix. The projection matrix is ​​sent to the initiator and the participating party, thereby reducing the dimensionality of the data of the initiator and the participating party while ensuring the data security of the initiator and the participating party.

[0054] The data dimensionality reduction method provided in this application is exemplified below.

[0055] The data dimensionality reduction method provided in this application is used to reduce the dimensionality of the first data set of the initiator and the second data of multiple participants, and is executed on the coordinator. The initiator, participants and coordinator can all be terminals on the blockchain.

[0056] Please see the attached Figure 1 , a data dimensionality reduction method provided in an embodiment of the present application includes:

[0057] S101: Obtain the encrypted first covariance matrix and first mean data sent by the initiator, and obtain the encrypted second covariance matrix and second mean data sent by the participant, wherein the first mean data is obtained by preprocessing and encrypting the first mean vector sum of each type of data in the first data set of the initiator, and the second mean data is obtained by preprocessing and encrypting the second mean vector sum of each type of data in the second data set of the participant.

[0058] The initiator owns the first dataset, and each of the multiple participants owns the second dataset. Each data set includes multiple features, and the number of features in the data is the dimension of the data. For example, the first dataset is the consumption and credit data of users of Bank A. The features of the data include name, gender, age, consumption time, consumption amount, loan time, loan amount, repayment amount, etc. The label of the data can be credit level (level 1, level 2, level 3, etc.). The second dataset is the consumption and credit data of users of Bank B. By performing dimensionality reduction and statistics on the first and second datasets, the overall consumption and credit information of the users can be obtained.

[0059] The initiator and the participant can first encrypt the data in the first dataset and the second dataset, respectively, and then calculate the covariance matrix of the encrypted data, namely the encrypted first covariance matrix and the encrypted second covariance matrix. The initiator and the participant can also first calculate the covariance matrix of the first dataset and the second dataset, respectively, and then encrypt the calculated covariance matrix to obtain the encrypted first covariance matrix and the encrypted second covariance matrix.

[0060] Each data point in the first and second data sets can be represented by a vector, with the features of each data point being the elements in the vector. Each data point has a label, and data with the same label are considered to be of the same class. The vectors corresponding to each class of data in the first data set are summed to obtain the first mean vector sum. The vectors corresponding to each class of data in the second data set are summed to obtain the second mean vector sum.

[0061] The data dimensionality reduction method provided in the embodiments of the present application is applied to the following two scenarios.

[0062] Scenario 1: The dimension of the data in the first dataset is the same as the dimension of the data in the second dataset.

[0063] Scenario 2: The dimension of the data in the first dataset is different from the dimension of the data in the second dataset.

[0064] In one embodiment, the dimension of the data in the first data set is the same as the dimension of the data in the second data set (meeting scenario one), the first mean data is obtained by encrypting the first mean vector sum and the number of each type of data in the first data set, and the second mean data is obtained by encrypting the second mean vector sum and the number of each type of data in the second data set. The initiator and the participants can use masks for encryption respectively. For example, masks are generated between the initiator A and the participants B, C, D...N, and between each participant. Then, N-1 masks corresponding to the initiator and N-1 masks corresponding to each participant are obtained. The initiator uses N-1 masks to encrypt the first mean vector sum and the number of each type of data in the first data set, and each participant uses N-1 masks to encrypt the second mean vector sum and the number of each type of data in the second data set, thereby improving data security.

[0065] In one embodiment, when scenario one is satisfied, after obtaining the first mean data and the second mean data, the coordinator determines a third mean vector based on the first mean data and the second mean data. The third mean vector is the mean vector of each type of data in the first data set and the second data set, thereby determining the third mean vector without disclosing the data of the initiator and the participant. Afterwards, the coordinator sends the third mean vector to the initiator and the participant, instructing the initiator to determine the encrypted first covariance matrix based on the third mean vector, and instructing the participant to determine the encrypted second covariance matrix based on the third mean vector. The initiator determines the first covariance matrix based on the difference between the data in the first data set and the third mean vector of the corresponding category, and the participant determines the second covariance matrix based on the difference between the data in the second data set and the third mean vector of the corresponding category. After determining the first covariance matrix, the initiator uses mask encryption to obtain the encrypted first covariance matrix. After determining the second covariance matrix, the participant uses mask encryption to obtain the encrypted second covariance matrix.

[0066] In one embodiment, the dimension of the data in the first data set is different from the dimension of the data in the second data set (meeting scenario two). The initiator filters the first data set to obtain a third data set, and the participating party filters the second data set to obtain a fourth data set. The order of the data identifiers of the third data set and the fourth data set is consistent. The identifier of the data can be the label of the data or one of its features. The order of the identifiers of the data in the third data set and the fourth data set is consistent, then the data with the same identifier in the third data set and the fourth data set can correspond to multiple dimensions of one data. For example, the third data set is the consumption information of the user at Bank A, and the fourth data set is the consumption information of the user at Bank B. The data with the same identifier in the third data set and the fourth data set corresponds to the consumption information of the same user. After determining the third data set, the initiator determines the first covariance matrix and the first mean data based on the third data set. After determining the fourth data set, the participating party determines the second covariance matrix and the second mean data based on the fourth data set.

[0067] S102: Determine an intra-class scatter matrix according to the encrypted first covariance matrix and the encrypted second covariance matrix.

[0068] In one embodiment, when scenario 1 is satisfied, the coordinator sums the encrypted first covariance matrix and the encrypted second covariance matrix to obtain an intra-class divergence matrix.

[0069] In another embodiment, if scenario 2 is satisfied, after determining the third data set, the initiator determines first encrypted data based on the third data set and the first mean vector sum. After determining the fourth data set, the participating party determines second encrypted data based on the fourth data set and the second mean vector sum. The coordinator obtains the first encrypted data from the initiator and the second encrypted data from the participating party. Based on the first encrypted data, the second encrypted data, the encrypted first covariance matrix, and the encrypted second covariance matrix, the coordinator determines a first submatrix of the sample covariance matrix. The coordinator sums the first submatrix to obtain the intra-class scatter matrix.

[0070] Specifically, the initiator sums up the vectors corresponding to each type of data in the third data set to obtain a first mean vector sum, takes the difference between the data (i.e., the corresponding vectors) in the third data set and the first mean vector sum of the corresponding category as updated data, encrypts the updated data according to the N-1 masks to obtain first encrypted data. The participants sum up the vectors corresponding to each type of data in the second data set to obtain a second mean vector sum, take the difference between the data (i.e., the corresponding vectors) in the fourth data set and the second mean vector sum of the corresponding category as updated data, encrypt the updated data according to the N-1 masks to obtain second encrypted data. At the same time, the initiator calculates a first covariance matrix, and encrypts the categories by hashing to obtain an encrypted first covariance matrix. The participants calculate a second covariance matrix, and encrypt the categories by hashing to obtain an encrypted second covariance matrix. The coordinator obtains the encrypted first covariance matrix and the encrypted second covariance matrix, takes the encrypted first covariance matrix and the encrypted second covariance matrix as Figure 2 The elements on the diagonal of the sample covariance matrix shown in The coordinator determines the same categories in the first encrypted data and the second encrypted data according to the categories encrypted by hashing, and calculates between the data of the same categories to obtain the elements of the sample covariance matrix shown in Figure 2 except the diagonal, thereby obtaining each first sub-matrix of the sample covariance matrix. Each first sub-matrix corresponds to a category, and the first sub-matrices of different categories located at the same position of the sample covariance matrix are summed up to obtain the intra-class scatter matrix shown in Figure 3

[0071] S103: Determine an inter-class scatter matrix according to the first mean data and the second mean data.

[0072] In an embodiment, in the case of meeting scenario one, after obtaining the first mean data and the second mean data, the coordinator determines a third mean vector according to the first mean data and the second mean data, and the third mean vector is the mean vector of each type of sample in the first data set and the second data set. If the data category is 2, the coordinator determines an inter-class scatter matrix according to the difference between the third mean vectors corresponding to the 2 types of data. If the data category is greater than 2, the coordinator determines a fourth mean vector of the first data set and the second data set according to the first mean data and the second mean data, and determines an inter-class scatter matrix according to the difference between the third mean vector corresponding to each type of data and the fourth mean vector.

[0073] ​In another embodiment, when scenario 2 is satisfied, if the data category is 2, after determining the first mean vector sums of the two categories of data, the initiator uses the difference between the two first mean vector sums as the first mean difference, and determines a second submatrix based on the first mean difference. For example, the first mean difference is a matrix, and the product of the first mean difference and the transposed matrix of the first mean difference is used as the second submatrix. After determining the second mean vector sums of the two categories of data, the participant uses the difference between the two second mean vector sums as the second mean difference, and determines a third submatrix based on the second mean difference. For example, the product of the second mean difference and the transposed matrix of the second mean difference is used as the third submatrix.

[0074] The initiator uses a mask to encrypt the first mean difference to obtain the first mean data. The participants use a mask to encrypt the second mean difference to obtain the second mean data. The coordinator obtains the first and second mean data and performs pairwise calculations on data of the same category. The resulting matrix is ​​used as the elements of the inter-class scatter matrix, excluding the diagonal. Simultaneously, the coordinator obtains the second and third submatrices and uses them as the diagonal elements of the inter-class scatter matrix to obtain the inter-class scatter matrix.

[0075] If the number of data categories is greater than two, the initiator determines the first mean vector for each data category and the global mean vector for the third data set. The global mean vector for the third data set is obtained by summing the vectors corresponding to all data in the third data set. The initiator then uses the difference between the first mean vector and the global mean vector of the third data set as the first mean difference and determines the second submatrix based on the first mean difference. The participants determine the second mean vector for each data category and the global mean vector for the fourth data set. The global mean vector for the fourth data set is obtained by summing the vectors corresponding to all data in the fourth data set. The participants then use the difference between the second mean vector and the global mean vector of the fourth data set as the second mean difference and determine the third submatrix based on the second mean difference.

[0076] The initiator uses a mask to encrypt the first mean difference to obtain the first mean data, and the participants use a mask to encrypt the second mean difference to obtain the second mean data. The coordinator obtains the first mean data and the second mean data, determines the data of the same category in the first mean data and the second mean data, and calculates the data of the same category pairwise to obtain Figure 4 The elements outside the diagonal of the matrix shown are And the second sub-matrix and the third sub-matrix are Figure 4 The elements on the diagonal of the matrix shown in . Afterwards, the coordinator sums the sub-matrices of different categories located at the same position and obtains Figure 5 The between-class scatter matrix is ​​shown.

[0077] S104: Determine a projection matrix according to the intra-class scatter matrix and the inter-class scatter matrix.

[0078] Specifically, the coordinator multiplies the inverse matrix of the intra-class scatter matrix and the inter-class scatter matrix to obtain the matrix M, calculates the eigenvalues ​​of the matrix M that are greater than the preset values ​​and the eigenvectors corresponding to these eigenvalues, and the matrix composed of the eigenvectors is the projection matrix.

[0079] S105: Send the projection matrix to the initiator and the participant to instruct the initiator to perform data dimensionality reduction on the first data set according to the projection matrix, and to instruct the participant to perform data dimensionality reduction on the second data set according to the projection matrix.

[0080] Specifically, after obtaining the projection matrix, the coordinator sends the projection matrix to the initiator and the participating parties. The initiator multiplies the transposed matrix of the projection matrix with the data of the first data set to obtain the data after dimensionality reduction of the first data set. The participating parties multiply the transposed matrix of the projection matrix with the data of the second data set to obtain the data after dimensionality reduction of the second data set.

[0081] In the above embodiment, the adjuster obtains the encrypted first covariance matrix and the encrypted first mean data sent by the initiator, and obtains the encrypted second covariance matrix and the encrypted second mean data sent by the participant, determines the intra-class scatter matrix according to the encrypted first covariance matrix and the encrypted second covariance matrix, determines the inter-class scatter matrix according to the first mean data and the second mean data, and then determines the projection matrix according to the intra-class scatter matrix and the inter-class scatter matrix, and sends the projection matrix to the initiator and the participant, thereby reducing the dimensionality of the data of the initiator and the participant without obtaining the data of the initiator and the participant and the initiator and the participant not publishing the data to each other.

[0082] The following introduces the specific implementation process of the data dimensionality reduction method in two scenarios.

[0083] When scenario one is satisfied, the dimensions of the data in the first data set of the initiator A are the same as the dimensions of the data in the second data sets of the participants B, C, D...N.

[0084] The first data set of initiator A and the labels corresponding to each data are expressed as represents any data in the first data set, The labels corresponding to the data in the first dataset are represented by ; the labels corresponding to the second dataset and each data of participant B are represented by Indicates any data in the second data set of party B, The labels corresponding to the data in the second dataset of Party B are represented as follows: Represents any data in the N-party second data set, Indicates the labels corresponding to the data in the N-square second data set. The dimension of any data is m, that is, any data is an m-dimensional vector. represents the number of the j-th category data of the l-th party, Represents the set of j-th category data of the l-th party.

[0085] When scenario one is met, the specific process of the data dimensionality reduction method is as follows Figure 6 shown.

[0086] 1. The coordinator instructs the initiator and each participant to generate a mask between each of them. The initiator and each participant can generate a PSA mask between each of them according to the PSA (Practical Secure Aggregation) algorithm. For example, the masks corresponding to party A and party B, party A and party C... party B and party C... party M and party N are {mask AB ,mask AC ,…,mask RC ,…,mask MN}.

[0087] 2. The initiator uses the formula Calculate the first mean vector sum of each type of data in the first data set, and the participants use the formula Calculate the second mean vector sum of each type of data in the second data set, Represents the mean vector sum of the j-th category data of the l-th party.

[0088] 3. The initiator uses the PSA mask to encrypt the number of each type of data and the first mean vector sum to obtain the first mean data. The participants use the PSA mask to encrypt the number of each type of data and the second mean vector sum to obtain the second mean data. Specifically, according to the formula

[0089]

[0090]

[0091] Calculate the first mean data and the second mean data, Represents a vector whose elements are all 1, mask st Represents the mask between any two parties in A, B...N, the sth and tth parties, l = A, B...N, from A to N, increasing in order, and the size relationship between s and t is determined according to the arrangement order.

[0092] When l=A, and is the first mean data, when l=B…N, and is the second mean data.

[0093] After determining the first mean data and the second mean data, the initiator sends the first mean data to the coordinator, and the participant sends the second mean data to the coordinator.

[0094] 4. After the coordinator obtains the first mean data and the second mean data, it aggregates the number of data of the same category in the data sets of each party and calculates the number of data of the same category according to the formula Calculate the third mean vector μ of each type of data in the first and second data sets j , l=A,B…N。

[0095] The coordinator then sends the third mean vector to the initiator and participants.

[0096] 5. Initiator A calculates the first covariance matrix according to the following formula Participants B…N calculate the second covariance matrix according to the following formula

[0097]

[0098] Afterwards, the initiator A and the participants B…N respectively follow the formula

[0099]

[0100] Get the encrypted first covariance matrix (l=A) and the encrypted second covariance matrix (l=B,C…N).

[0101] Afterwards, the initiator sends the encrypted first covariance matrix to the coordinator, and the participant sends the encrypted second covariance matrix to the coordinator.

[0102] 6. The coordinator shall follow the formula The encrypted first covariance matrix and the encrypted second covariance matrix are summed to obtain the intra-class scatter matrix S w .

[0103] 7. If the data category is 2 (i.e., binary classification), the coordinator determines the inter-class scatter matrix based on the difference between the third mean vectors μ0 and μ1 corresponding to the two categories of data. Specifically, according to the formula S b =(μ0-μ1)(μ0-μ1) T Determine the inter-class scatter matrix S b .

[0104] If the data categories are greater than 2 (i.e. multi-category), the coordinator shall use the formula Determine the fourth mean vector μ.

[0105] Afterwards, the coordinator uses the formula Determine the inter-class scatter matrix S b , μ j represents the third mean vector of the j-th class data,

[0106] 8. The coordinator shall follow the formula Determine the matrix M, then determine the largest d eigenvalues ​​of the matrix M and the corresponding d eigenvectors (w1, w2, ..., w d ), d eigenvectors form the projection matrix W, and the projection matrix is ​​sent to the initiator and participants.

[0107] 9. The initiator and the participants shall follow the formula Get the data after dimensionality reduction

[0108] When scenario 2 is satisfied, the dimensions of the data in the first data set of the initiator A are different from the dimensions of the data in the second data sets of the participants B, C, D...N.

[0109] The first data set of the initiator A and the labels corresponding to each data are expressed as represents any data in the first data set, The labels corresponding to the data in the first data set are represented by ; the labels corresponding to the second data set and each data of participant B are represented by Indicates any data in the second data set of party B, The labels corresponding to the data in the second dataset of Party B are represented as follows: Represents any data in the N-party second data set, Indicates the labels corresponding to the data in the N-party second dataset. is an a-dimensional vector, is a b-dimensional vector, …, is an n-dimensional vector. represents the number of the j-th category data of the l-th party, Represents the set of j-th category data of the l-th party.

[0110] When scenario 2 is met, the specific process of the data dimensionality reduction method is as follows Figure 7 shown.

[0111] 1. The coordinator instructs the initiator and each participant to generate a mask between each of them. The initiator and each participant can generate a PSA mask between each of them according to the PSA (Practical Secure Aggregation) algorithm. For example, the masks corresponding to party A and party B, party A and party C... party B and party C... party M and party N are {mask AB ,mask AC ,…,mask BC ,…,mask MN}.

[0112] 2. The initiator filters and sorts the first dataset using the PSI (Private Set Intersection) algorithm to obtain the third dataset. The participating party filters and sorts the second dataset using the PSI algorithm to obtain the fourth dataset. The ID sequence of the third and fourth datasets is consistent, and the number of data in the third and fourth datasets is the same. For example, the number of data in the third and fourth datasets is p. The third dataset of the initiator A and the labels corresponding to each data are expressed as The fourth data set of participant B and the labels corresponding to each data are expressed as The fourth data set of N participants and the labels corresponding to each data are expressed as

[0113] 3. The initiator shall follow the formula Calculate the first mean vector sum of various data types, and the participants use the formula Calculate the second mean vector sum of various types of data, Represents the mean vector sum of the j-th category data of the l-th party.

[0114] The initiator sums the first mean vectors corresponding to each type of data to obtain the global mean vector of the third data set, and the participants sum the first mean vectors corresponding to each type of data to obtain the global mean vector of the fourth data set.

[0115] The initiator uses the difference between the data in the third dataset and the first mean vector sum of the corresponding category as the updated third dataset, and the participant uses the difference between the data in the fourth dataset and the second mean vector sum of the corresponding category as the updated fourth dataset. That is, the updated third dataset and the labels corresponding to each data are expressed as The updated fourth data set of participant B and the labels corresponding to each data are expressed as The fourth data set of N participants and the labels corresponding to each data are expressed as in,

[0116] 4. The initiator encrypts the updated third data set to obtain first encrypted data, and the participant encrypts the updated fourth data set to obtain second encrypted data. Exemplarily, the first encrypted data includes N-1 groups of data, and each group of data corresponds to a mask. The first encrypted data is D" AB ,D" AC ,…,D" AN , The second encrypted data of each participant also includes N-1 groups of data, and each group of data corresponds to a mask. The second encrypted data of the participant l is D" lA ,D" lB ,…,D" ll-1 ,D" ll+1 ,…,D" AN , wherein,

[0117]

[0118] l = B, C…N, i = 1, 2…p, and hash represents a hash operation. mask Ah represents a mask between the initiator A and each participant, mask lh represents a mask between the lth participant and any of the other initiators or participants h. The size relationship between l and h is determined according to the order of the lth participant and the hth participant in A, B…N.

[0119] The initiator sends the first encrypted data to the coordinator, and the participant sends the second encrypted data to the coordinator.

[0120] 5. The initiator and the participant respectively calculate a first covariance matrix and a second covariance matrix according to the formula represents data in the updated third data set or the updated fourth data set.

[0121] The first covariance matrix and the hash-encrypted category is an encrypted first covariance matrix, the second covariance matrix and the hash-encrypted category is an encrypted second covariance matrix.

[0122] The initiator sends the encrypted first covariance matrix to the coordinator, and the participant sends the encrypted second covariance matrix to the coordinator.

[0123] 6. The data after the same category is hash-encrypted is still the same, and the corresponding data is the same category. The coordinator determines the same category in the first encrypted data and the second encrypted data according to the hash-encrypted categories in the first encrypted data and the second encrypted data, and determines the same category in the first encrypted data and the second encrypted data according to the formula

[0124]

[0125] The covariance matrix corresponding to each category is obtained by calculating between each pair of data in the same category E and F represent the E party and the F party respectively, E is not equal to F, represents the set of the jth category data of the E party, represents the set of the jth category data of the F party, mask EF represents the mask between the E party and the F party.

[0126] 7. The coordinator obtains the first encrypted covariance matrix and the second encrypted covariance matrix as Figure 2 The elements on the diagonal of the sample covariance matrix are shown in the formula, and The elements in the sample covariance matrix except the diagonal are shown in the formula. The coordinator sums the first sub-matrix of different categories in the same position of the sample covariance to obtain the intra-class scatter matrix S Figure 3 w .

[0127] For the case where the data category is 2, the process of determining the inter-class scatter matrix is as follows.

[0128] 8.1. The initiator determines the first mean difference between the two first mean vectors and according to the formula The participant determines the second mean difference between the two second mean vectors and according to the formula According to the formula The initiator calculates the second sub-matrix M ll (l=A), and the participant calculates the third sub-matrix M ll (l=B, C…N). The initiator sends the second sub-matrix to the coordinator, and the participant sends the third sub-matrix to the coordinator. 8.2. The initiator encrypts the first mean difference using the mask

[0129] to obtain the first mean data. Exemplarily, the first mean data The participant l encrypts the second mean difference using the mask to obtain the second mean data

[0130]

[0131] 8.3. The coordinator obtains the first mean data from the initiator and the second mean data from the participant, determines the data of the same category in the first mean data and the second mean data, and calculates between each pair of data in the same category to obtain the matrix M EF , wherein ​​E and F represent the Eth party and the Fth party respectively. E and F are not equal. Both represent any one of the first mean data or the second mean data, mask EF Indicates the mask between the E-th party and the F-th party.

[0132] The coordinator will M ll As Figure 5 The elements on the diagonal of the inter-class scatter matrix shown in the figure are M FF As the elements of the inter-class scatter matrix except the diagonal, the inter-class scatter matrix is ​​obtained.

[0133] When the number of data categories is greater than 2, the process of determining the inter-class scatter matrix is ​​as follows.

[0134] 8.1. According to the formula The initiator determines the first mean vector of each category and the first mean difference between it and the global mean vector Participants determine the second mean vector sum of each category and the second mean difference between the global mean vector According to the formula The initiator calculates the second sub-matrix The participants calculate the third sub-matrix It represents the number of the j-th type of data of the l-th party. The initiator sends the second sub-matrix to the coordinator, and the participating party sends the third sub-matrix to the coordinator.

[0135] 8.2. The initiator uses a mask to encrypt the first mean difference After obtaining the first mean value data, participant l uses the mask to encrypt the second mean difference Obtain the second mean data. For example, the first mean data is

[0136] The second mean data is

[0137]

[0138] 8.3. The coordinator obtains the first mean data from the initiator and the second mean data from the participants, determines the data of the same category in the first and second mean data, and calculates the data of the same category pairwise to obtain the matrix in represents the number of the j-th category data of party E, and represents either the first mean data or the second mean data, j=0, 1,…, k.

[0139] The coordinator will As Figure 4 The elements on the diagonal of the matrix shown in the figure are The elements of the matrix shown in the figure other than the diagonal. Figure 4 After that, the coordinator sums the matrices of different categories in the same position of the matrix shown in the figure to obtain the inter-class scatter matrix as shown in the figure. Figure 4 Figure 5

[0140] 9. The coordinator determines the matrix M according to the formula d eigenvectors (w1, w2, …, wd) of the matrix M, and sends the projection matrix W to the initiator and the participant. d

[0141] 10. The initiator and the participant obtain the reduced dimension data

[0142] In the above embodiment, when the data of the initiator and the participant both have corresponding labels, the coordinator obtains the encrypted first covariance matrix and the first mean data calculated by different methods according to whether the dimensions of the data of each party are the same, and then obtains the intra-class scatter matrix and the inter-class scatter matrix, so as to obtain the projection matrix to reduce the dimension of the first data set and the second data set. Then, the data of the initiator and the participant are reduced without obtaining the data of the initiator and the participant, and the initiator and the participant do not disclose the data to each other, so as to reduce the communication process, reduce the operation difficulty, and improve the data calculation speed under the premise of ensuring the data security.

[0143] It should be understood that the size of the serial number of each step in the above embodiment does not mean the order of execution, and the execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0144] Corresponding to the data dimension reduction method described in the above embodiment, Figure 8 The structure block diagram of the data dimension reduction device provided by the embodiment of the present application is shown, and only the part related to the embodiment of the present application is shown for the convenience of explanation.

[0145] As shown in the figure, the data dimension reduction device is executed in the coordinator, and the device comprises: Figure 8

[0146] ​​​​​An acquisition module 81 is configured to acquire an encrypted first covariance matrix and first mean data sent by an initiator, and an encrypted second covariance matrix and second mean data sent by a participant, wherein the first mean data is obtained by preprocessing and encrypting the first mean vector sum of various types of data in the initiator's first data set, and the second mean data is obtained by preprocessing and encrypting the second mean vector sum of various types of data in the participant's second data set;

[0147] A first calculation module 82 is configured to determine an intra-class scatter matrix based on the encrypted first covariance matrix and the encrypted second covariance matrix;

[0148] A second calculation module 83 is configured to determine an inter-class scatter matrix based on the first mean data and the second mean data;

[0149] A third calculation module 84 is configured to determine a projection matrix according to the intra-class scatter matrix and the inter-class scatter matrix;

[0150] The sending module 85 is used to send the projection matrix to the initiator and the participant to instruct the initiator to perform data dimensionality reduction on the first data set according to the projection matrix, and to instruct the participant to perform data dimensionality reduction on the second data set according to the projection matrix.

[0151] In one embodiment, the dimension of the data in the first data set is the same as the dimension of the data in the second data set, the first mean data is obtained by encrypting the first mean vector sum and the number of each type of data in the first data set, and the second mean data is obtained by encrypting the second mean vector sum and the number of each type of data in the second data set.

[0152] In one embodiment, the acquisition module 81 is further configured to:

[0153] Determine a third mean vector based on the first mean data and the second mean data, where the third mean vector is a mean vector of each type of data in the first data set and the second data set;

[0154] The third mean vector is sent to the initiator and the participant to instruct the initiator to determine the encrypted first covariance matrix based on the third mean vector, and to instruct the participant to determine the encrypted second covariance matrix based on the third mean vector.

[0155] In one embodiment, the first calculation module 82 is specifically configured to:

[0156] The encrypted first covariance matrix and the encrypted second covariance matrix are summed to obtain an intra-class scatter matrix.

[0157] In one embodiment, the second calculation module 83 is specifically configured to:

[0158] Determining a third mean vector based on the first mean data and the second mean data, where the third mean vector is a mean vector of each class of samples in the first data set and the second data set;

[0159] If the data category is 2 (binary classification), determine the inter-class scatter matrix according to the difference of the third mean vector corresponding to the two categories of data;

[0160] If the number of data categories is greater than 2 (multi-classification), a fourth mean vector is determined based on the first mean data and the second mean data, where the fourth mean vector is the mean vector of the first data set and the second data set; and an inter-class scatter matrix is ​​determined based on the difference between the third mean vector and the fourth mean vector corresponding to each type of data.

[0161] In one embodiment, the dimension of the initiator's data is different from the dimension of the participant's data, the encrypted first covariance matrix and the first mean data are determined based on a third data set, the encrypted second covariance matrix and the second mean data are determined based on a fourth data set, the third data set is obtained by screening the first data set, and the fourth data set is obtained by screening the second data set, and the order of data identifiers of the third data set and the fourth data set are consistent.

[0162] In one embodiment, the first calculation module 82 is specifically configured to:

[0163] Obtaining first encrypted data sent by the initiator and second encrypted data sent by the participant, where the first encrypted data is determined based on the third data set and the first mean vector sum, and the second encrypted data is determined based on the fourth data set and the second mean vector sum;

[0164] Determine a first sub-matrix of a sample covariance matrix according to the first encrypted data, the second encrypted data, the encrypted first covariance matrix, and the encrypted second covariance matrix;

[0165] The first sub-matrices are summed to obtain a within-class scatter matrix.

[0166] In one embodiment, the second calculation module 83 is specifically configured to:

[0167] If the data category is 2, obtain the second submatrix sent by the initiator and the third submatrix sent by the participant, where the second submatrix is ​​determined based on the difference between the sums of the two first mean vectors, and the third submatrix is ​​determined based on the difference between the sums of the two second mean vectors;

[0168] If the number of data categories is greater than 2, obtain a second submatrix sent by the initiator and a third submatrix sent by the participant, where the second submatrix is ​​determined based on the difference between the sum of the first mean vector and the global mean vector of the third data set, and the third submatrix is ​​determined based on the difference between the sum of the second mean vector and the global mean vector of the fourth data set;

[0169] An inter-class scatter matrix is ​​determined according to the second sub-matrix, the third sub-matrix, the first mean data, and the second mean data.

[0170] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of this application. Their specific functions and technical effects can be found in the method embodiment section and will not be repeated here.

[0171] Figure 9 Schematic diagram of the structure of the terminal device provided in the embodiment of the present application. The terminal device can be a computing device such as a desktop computer, notebook, PDA, and cloud server.

[0172] like Figure 9 As shown, the terminal device of this embodiment includes: a processor 91, a memory 92, and a computer program 93 stored in the memory 92 and executable on the processor 91. When the processor 91 executes the computer program 93, the steps in the above-mentioned data dimensionality reduction method embodiment are implemented, for example Figure 1 Alternatively, when the processor 91 executes the computer program 93, the functions of the modules / units in the above-mentioned device embodiments are realized, for example, Figure 8 The functions of the acquisition module 81 to the sending module 85 are shown.

[0173] Exemplarily, the computer program 93 may be divided into one or more modules / units, which are stored in the memory 92 and executed by the processor 91 to implement the present application. The one or more modules / units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program 93 in the terminal device.

[0174] Those skilled in the art will understand that Figure 9It is only an example of a terminal device and does not constitute a limitation of the terminal device. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal device may also include input and output devices, network access devices, buses, etc.

[0175] The processor 91 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0176] The memory 92 may be an internal storage unit of the terminal device, such as a hard disk or memory of the terminal device. The memory 92 may also be an external storage device of the terminal device, such as a plug-in hard disk equipped with the terminal device, a smart media card (SMC), a secure digital (SD) card, a flash memory card, etc. Furthermore, the memory 92 may include both an internal storage unit of the terminal device and an external storage device. The memory 92 is used to store the computer program and other programs and data required by the terminal device. The memory 92 may also be used to temporarily store data that has been output or is about to be output.

[0177] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0178] In the above embodiments, the description of each embodiment is focused on, and the part not described or recorded in a certain embodiment can be referred to the relevant description of other embodiments.

[0179] In the embodiments provided in the present application, it should be understood that the disclosed apparatus / terminal device and method can be implemented in other ways. For example, the apparatus / terminal device embodiments described above are only schematic. The division of the modules or units is only a logical function division, and there can be another division manner in actual implementation. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections between the units can be indirect couplings or communication connections through some interfaces, devices or units, and can be electrical, mechanical or in other forms.

[0180] The units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, i.e. can be located in one place, or can be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.

[0181] If the integrated module / unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, all or part of the flow of the above-mentioned embodiment method can also be completed by a computer program instructing related hardware, and the computer program can be stored in a computer readable storage medium. When the processor executes the computer program, the steps of each method embodiment described above can be implemented. The computer program includes computer program code, which can be in the form of source code, object code, executable file or some intermediate form. The computer readable medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc.

[0182] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0183] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.

Claims

1. A data dimensionality reduction method, executed by a coordinator, characterized in that: The method comprises: Obtaining the encrypted first covariance matrix and first mean data sent by the initiator, and obtaining the encrypted second covariance matrix and second mean data sent by the participant, where the first mean data is obtained by preprocessing and encrypting the first mean vector sum of various types of data in the initiator's first data set, and the second mean data is obtained by preprocessing and encrypting the second mean vector sum of various types of data in the participant's second data set; Determine an intra-class scatter matrix according to the encrypted first covariance matrix and the encrypted second covariance matrix; determining an inter-class scatter matrix according to the first mean data and the second mean data; Determining a projection matrix according to the intra-class scatter matrix and the inter-class scatter matrix; The projection matrix is ​​sent to the initiator and the participant to instruct the initiator to perform data dimensionality reduction on the first data set according to the projection matrix, and to instruct the participant to perform data dimensionality reduction on the second data set according to the projection matrix.

2. The data dimensionality reduction method according to claim 1, characterized in that: The dimension of the data in the first data set is the same as the dimension of the data in the second data set. The first mean data is obtained by encrypting the first mean vector sum and the number of each type of data in the first data set. The second mean data is obtained by encrypting the second mean vector sum and the number of each type of data in the second data set.

3. The data dimensionality reduction method according to claim 2, characterized in that: Before obtaining the encrypted first covariance matrix sent by the initiator and obtaining the encrypted second covariance matrix sent by the participant, the method further includes: Determine a third mean vector based on the first mean data and the second mean data, where the third mean vector is a mean vector of each type of data in the first data set and the second data set; The third mean vector is sent to the initiator and the participant to instruct the initiator to determine the encrypted first covariance matrix based on the third mean vector, and to instruct the participant to determine the encrypted second covariance matrix based on the third mean vector.

4. The data dimensionality reduction method according to claim 2, characterized in that: The determining the intra-class scatter matrix according to the encrypted first covariance matrix and the encrypted second covariance matrix includes: The encrypted first covariance matrix and the encrypted second covariance matrix are summed to obtain an intra-class scatter matrix.

5. The data dimensionality reduction method according to claim 2, characterized in that: The determining the inter-class scatter matrix according to the first mean data and the second mean data includes: Determining a third mean vector based on the first mean data and the second mean data, where the third mean vector is a mean vector of each class of samples in the first data set and the second data set; If the data category is 2, determine the inter-class scatter matrix according to the difference of the third mean vectors corresponding to the two categories of data; If the number of data categories is greater than 2, a fourth mean vector is determined based on the first mean data and the second mean data, where the fourth mean vector is the mean vector of the first data set and the second data set; and an inter-class scatter matrix is ​​determined based on the difference between the third mean vector and the fourth mean vector corresponding to each type of data.

6. The data dimensionality reduction method according to claim 1, characterized in that: The dimension of the initiator's data is different from the dimension of the participant's data. The encrypted first covariance matrix and the first mean data are determined based on the third data set. The encrypted second covariance matrix and the second mean data are determined based on the fourth data set. The third data set is obtained by screening the first data set, and the fourth data set is obtained by screening the second data set. The order of data identifiers of the third data set and the fourth data set is consistent.

7. The data dimensionality reduction method according to claim 6, characterized in that: The determining the intra-class scatter matrix according to the encrypted first covariance matrix and the encrypted second covariance matrix includes: Obtaining first encrypted data sent by the initiator and second encrypted data sent by the participant, where the first encrypted data is determined based on the third data set and the first mean vector sum, and the second encrypted data is determined based on the fourth data set and the second mean vector sum; Determine a first sub-matrix of a sample covariance matrix according to the first encrypted data, the second encrypted data, the encrypted first covariance matrix, and the encrypted second covariance matrix; The first sub-matrices are summed to obtain a within-class scatter matrix.

8. The data dimensionality reduction method according to claim 6, characterized in that: The determining the inter-class scatter matrix according to the first mean data and the second mean data includes: If the data category is 2, obtain the second submatrix sent by the initiator and the third submatrix sent by the participant, where the second submatrix is ​​determined based on the difference between the sums of the two first mean vectors, and the third submatrix is ​​determined based on the difference between the sums of the two second mean vectors; If the number of data categories is greater than 2, obtain a second submatrix sent by the initiator and a third submatrix sent by the participant, where the second submatrix is ​​determined based on the difference between the sum of the first mean vector and the global mean vector of the third data set, and the third submatrix is ​​determined based on the difference between the sum of the second mean vector and the global mean vector of the fourth data set; An inter-class scatter matrix is ​​determined according to the second sub-matrix, the third sub-matrix, the first mean data, and the second mean data.

9. A terminal device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 8 is implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Data dimension reduction method, terminal equipment and storage medium

    CN116578868A