A prototype model matching method, device, system and storage medium

By using the CKKS homomorphic encryption algorithm on the server side to perform encrypted calculations on the prototype matrix and the private matrix, the problem of mismatch between the model requirements and the need to protect data security is solved, thus achieving secure and efficient prototype model matching.

CN116684157BActive Publication Date: 2025-11-18HAINAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310693351.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-09
Publication Date
2025-11-18
Estimated Expiration
2043-06-09

AI Technical Summary

Technical Problem

In the engineering application of prototype models, the model requesting side cannot obtain sufficient computing power, and due to data security requirements, the model requesting side and the providing side hope to perform similarity matching without knowing the training set of the other party's training model, in order to protect the security of the training data.

Method used

The CKKS homomorphic encryption algorithm is used to encrypt the prototype matrix and the private matrix, and similarity calculation is performed on a third-party server to avoid the risk of training data leakage.

Benefits of technology

It enables prototype model matching without leaking training data, ensuring data security and matching accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116684157B_ABST
    Figure CN116684157B_ABST
Patent Text Reader

Abstract

The application discloses a prototype model matching method, device and system and a storage medium, and is applied to the field of model security matching. The method comprises the following steps: receiving a ciphertext prototype matrix encrypted by a CKKS homomorphic encryption algorithm and sent by a model demand end; receiving a private ciphertext prototype matrix set encrypted by the CKKS homomorphic encryption algorithm and sent by a model providing end; performing similarity calculation on the ciphertext prototype matrix and each private ciphertext prototype matrix in the private ciphertext prototype matrix set to obtain a ciphertext similarity set; and sending the ciphertext similarity set to the model demand end, so that the model demand end decrypts the ciphertext similarity set to obtain a similarity set, and matches a prototype model according to the similarity set. According to the prototype model similarity matching based on the homomorphic encryption, the similarity calculation is performed on the third-party server end, and the risk that the training data is leaked due to the matching of the demand model in the state that the training set is not encrypted in the prior art is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of model security matching, and in particular to a prototype model matching method, device, system and computer readable storage medium. BACKGROUND

[0002] In the engineering application of prototype models, the model demand side often cannot have enough computing power for training models, and therefore needs to find the most suitable prototype model from some model-providing service parties. Due to data security requirements, both the model demand side and the model providing side hope that the other party performs similarity matching without knowing the training set used for training the model, so as to protect the security of the training data of both parties. SUMMARY

[0003] The present application aims to provide a prototype model matching method, device, system and storage medium, applied to the field of model security matching, which performs similarity calculation on a third-party server side based on homomorphic encryption of prototype model similarity matching, thereby avoiding the risk of training data leakage caused by matching demand models in the prior art without encryption of the training set.

[0004] To solve the above technical problems, the present application provides a prototype model matching method applied to a server side, comprising:

[0005] receiving a ciphertext prototype matrix encrypted by a CKKS homomorphic encryption algorithm and sent by a model demand side;

[0006] receiving a set of private ciphertext prototype matrices encrypted by the CKKS homomorphic encryption algorithm and sent by a model providing side;

[0007] performing similarity calculation on the ciphertext prototype matrix and each private ciphertext prototype matrix in the set of private ciphertext prototype matrices to obtain a set of ciphertext similarities;

[0008] sending the set of ciphertext similarities to the model demand side, so that the model demand side decrypts the set of ciphertext similarities to obtain a set of similarities, and matches a prototype model according to the set of similarities.

[0009] Optionally, the similarity calculation on the ciphertext prototype matrix and each private ciphertext prototype matrix in the set of private ciphertext prototype matrices to obtain a set of ciphertext similarities comprises:

[0010] performing dot product operation on the ciphertext prototype matrix and each private ciphertext prototype matrix in the set of private ciphertext prototype matrices to obtain a corresponding result matrix;

[0011] averaging the elements in each result matrix to obtain the set of ciphertext similarities.

[0012] Optional, also includes:

[0013] When the calculation of the ciphertext similarity set is completed, the corresponding cached ciphertext prototype matrix and the private ciphertext prototype matrix set are cleared.

[0014] To address the aforementioned technical problems, this invention provides a prototype model matching method, applied to the model requirement side, comprising:

[0015] The ciphertext prototype matrix encrypted using the CKKS homomorphic encryption algorithm is sent to the server.

[0016] Receive the ciphertext similarity set sent by the server, which is obtained by calculating the similarity between the ciphertext prototype matrix and each private ciphertext prototype matrix in the private ciphertext prototype matrix set;

[0017] Decrypt the ciphertext similarity set to obtain a similarity set, and match the prototype model based on the similarity set;

[0018] The private encrypted prototype matrix set is encrypted by the model provider using the CKKS homomorphic encryption algorithm and then sent to the server.

[0019] Optionally, sending the ciphertext prototype matrix encrypted using the CKKS homomorphic encryption algorithm to the server includes:

[0020] The training set is input into the prototype model, and the feature vectors of each class in the training set are extracted and averaged in each round of training to obtain the prototype.

[0021] Construct a prototype matrix from all the prototypes mentioned in the training process;

[0022] The prototype matrix is ​​encrypted using the CKKS homomorphic encryption algorithm to obtain a ciphertext prototype matrix, and the ciphertext prototype matrix is ​​sent to the server.

[0023] To address the aforementioned technical problems, this invention provides a prototype model matching device, applied on a server side, comprising:

[0024] The first receiving module is used to receive the ciphertext prototype matrix encrypted by the CKKS homomorphic encryption algorithm sent by the model request end;

[0025] The second receiving module is used to receive the set of private ciphertext prototype matrices encrypted by the CKKS homomorphic encryption algorithm sent by the model provider.

[0026] The similarity calculation module is used to perform similarity calculation between the ciphertext prototype matrix and each private ciphertext prototype matrix in the private ciphertext prototype matrix set to obtain a ciphertext similarity set;

[0027] The first sending module is used to send the encrypted similarity set to the model request end, so that the model request end can decrypt the encrypted similarity set to obtain the similarity set, and match the prototype model according to the similarity set.

[0028] To address the aforementioned technical problems, this invention provides a prototype model matching device, applied to the model demand side, comprising:

[0029] The second sending module is used to send the ciphertext prototype matrix encrypted by the CKKS homomorphic encryption algorithm to the server.

[0030] The third receiving module is used to receive the ciphertext similarity set sent by the server, which is obtained by calculating the similarity between the ciphertext prototype matrix and each private ciphertext prototype matrix in the private ciphertext prototype matrix set.

[0031] The decryption module is used to decrypt the ciphertext similarity set to obtain a similarity set, and to match the prototype model based on the similarity set;

[0032] The private ciphertext prototype matrix set is encrypted by the model provider using the CKKS homomorphic encryption algorithm.

[0033] To address the aforementioned technical problems, this invention provides a prototype model matching system, comprising:

[0034] On the model demand side, a ciphertext prototype matrix encrypted with the CKKS homomorphic encryption algorithm is sent to the server side; the ciphertext similarity set is decrypted to obtain a similarity set, and the prototype model is matched according to the similarity set;

[0035] The model provider is used to send a set of private ciphertext prototype matrices encrypted by the CKKS homomorphic encryption algorithm to the server.

[0036] On the server side, it is used to receive the ciphertext prototype matrix; receive the private ciphertext prototype matrix set; and perform similarity calculation between the ciphertext prototype matrix and each private ciphertext prototype matrix in the private ciphertext prototype matrix set to obtain a ciphertext similarity set.

[0037] Optionally, the model providing end includes:

[0038] A private training unit is used to input a private training set into the prototype model of a preset dimension, and extract feature vectors from each class of the private training set in each round of training and average them to obtain a private prototype.

[0039] Private matrix unit, used by the model provider to construct the private prototype matrix from all the private prototypes during the training process;

[0040] A private sending unit is used to obtain the private ciphertext prototype matrix set by homomorphically encrypting all the private prototype matrices using the CKKS method, and then send the private ciphertext prototype matrix set to the server.

[0041] To address the aforementioned technical problems, the present invention provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement any of the aforementioned prototype model matching methods.

[0042] As can be seen, the method of the present invention includes receiving a ciphertext prototype matrix encrypted with the CKKS homomorphic encryption algorithm sent by the model requester; receiving a set of private ciphertext prototype matrices encrypted with the CKKS homomorphic encryption algorithm sent by the model provider; calculating the similarity between the ciphertext prototype matrix and each private ciphertext prototype matrix in the private ciphertext prototype matrix set to obtain a ciphertext similarity set; sending the ciphertext similarity set to the model requester so that the model requester decrypts the ciphertext similarity set to obtain a similarity set, and matches the prototype model according to the similarity set. The present invention avoids the risk of training data leakage caused by matching the requested model in an unencrypted training set by performing similarity calculation on the server side through prototype model similarity matching based on homomorphic encryption. Attached Figure Description

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

[0044] Figure 1 A flowchart of a prototype model matching method provided in an embodiment of the present invention;

[0045] Figure 2 A schematic diagram of a prototype model matching method provided in an embodiment of the present invention;

[0046] Figure 3 This is a structural block diagram of a prototype model matching system provided in an embodiment of the present invention. Detailed Implementation

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

[0048] The following combination Figure 1 , Figure 1 A flowchart of a prototype model matching method provided in an embodiment of the present invention, applied to the server side, the method may include:

[0049] S101: Receive the ciphertext prototype matrix encrypted with the CKKS homomorphic encryption algorithm sent by the receiving model request end.

[0050] This invention does not limit the method by which the server receives the encrypted prototype matrix, nor does it limit the method by which the model requester generates the encrypted matrix. In this embodiment, the model requester can initialize a prototype model and input the training set from the model requester's dataset into the model to extract feature vectors. In each round of training, feature vectors are extracted from each class of training sets and averaged to obtain the prototype. All prototypes in the training process are used to construct a prototype matrix. The specific calculation method is shown in the following formula:

[0051]

[0052] In the formula, c i Let be the training set for class i, and let k be the number of samples in each class. Let conv2 be the convolutional layer of the prototype model, and p n This is the prototype obtained in the nth round of training.

[0053] Each training round yields a prototype, and the prototypes from all training rounds form a prototype matrix:

[0054] P = [p1, p2, ..., p n ];

[0055] The prototype matrix is ​​then encrypted using the CKKS (Cheon-Kim-Kim-Song) homomorphic encryption algorithm to obtain the ciphertext prototype matrix. CKKS is a fully homomorphic encryption algorithm. In this embodiment, the generation method of the public and private keys used for CKKS homomorphic encryption is not limited. In this embodiment, the public and private keys can be generated by the model requesting party and then the public key can be made public to all model providers; alternatively, the model requesting party can apply for a pair of public and private keys from the key center from each model provider.

[0056] This embodiment does not limit the method of generating the public and private keys, and can generally be expressed as follows:

[0057]

[0058] In the formula, sk is the private key, pk is the public key, a is the first auxiliary parameter sampled from a uniform random distribution on the constructed ring R, b is the second auxiliary parameter, s is the third auxiliary parameter sampled from a discrete Gaussian distribution on the constructed ring R, R is the constructed ring, and Q is the maximum ciphertext modulus.

[0059] The calculation of the second auxiliary parameter b needs to satisfy the following formula:

[0060] b←-a·s+e(mod Q);

[0061] In the formula, a is the first auxiliary parameter, b is the second auxiliary parameter, s is the third auxiliary parameter, Q is the maximum ciphertext modulus, and e is the decryption error noise.

[0062] In this embodiment, the generation of the ring R can be represented by the following formula:

[0063]

[0064] In the formula, f(x) is a cyclotomic polynomial, Z[x] is a polynomial ring with integer coefficients, R is a constructed ring, and d is an integer power of 2.

[0065] In this embodiment, after generating the public and private keys, the prototype matrix is ​​homomorphically encrypted using CKKS to obtain the ciphertext prototype matrix. The specific encryption algorithm is shown in the following formula:

[0066] V = r·pk + (P + e1, e2) (mod Q);

[0067] In the formula, V is the encrypted ciphertext prototype matrix, P is the prototype matrix, Q is the maximum ciphertext modulus, r is the fourth auxiliary parameter sampled from the uniform random distribution on the construction ring R, and e1 and e2 are the fifth and sixth auxiliary parameters sampled from the discrete Gaussian distribution on the construction ring R.

[0068] In this embodiment, the model requester sends the ciphertext prototype matrix to a third-party server after encryption is completed. This embodiment does not limit the type of server, as long as it can perform similarity calculations.

[0069] S102: The set of private ciphertext prototype matrices encrypted with the CKKS homomorphic encryption algorithm sent by the receiving model provider.

[0070] In this embodiment, the server also receives a private ciphertext prototype matrix encrypted with the CKKS homomorphic encryption algorithm sent by the model provider. This embodiment does not limit the encryption method of the model provider. Generally, the private training set can be input into the prototype model. The prototype model of the model requester needs to have the same dimensions as the prototype model of the model provider. In this embodiment, the model provider can build the prototype model according to the preset dimensions agreed upon with the model requester, or the model requester can build the prototype model according to the dimensions of the prototype model of the model provider.

[0071] Generally, model providers will provide multiple prototype models for matching, that is, the model provider will encrypt multiple private training sets. Furthermore, this embodiment does not limit the number of model providers, and a model requester can have multiple model providers.

[0072] In this embodiment, in each round of training, feature vectors are extracted from each type of private training set and averaged to obtain a private prototype. All private prototypes in the training process are used to construct a private prototype matrix. All private prototype matrices are then homomorphically encrypted using CKKS to obtain a private ciphertext prototype matrix set, which is then sent to the server.

[0073] S103: Calculate the similarity between the ciphertext prototype matrix and each private ciphertext prototype matrix in the private ciphertext prototype matrix set to obtain the ciphertext similarity set.

[0074] In this embodiment, the server performs similarity calculations on the encrypted prototype matrix received from the model requester and each private encrypted prototype in the private encrypted prototype matrix set received from the model provider. This embodiment does not limit the specific similarity calculation method; generally, it can involve performing a dot product operation between the encrypted prototype matrix and each private encrypted prototype matrix in the private encrypted prototype matrix set to obtain a corresponding result matrix. This results in multiple result matrices. The average of the elements in each result matrix is ​​then used to obtain the corresponding encrypted similarity score. All encrypted similarities constitute a encrypted similarity set.

[0075] S104: Send the encrypted similarity set to the model request end so that the model request end can decrypt the encrypted similarity set to obtain the similarity set and match the prototype model according to the similarity set.

[0076] In this embodiment, after calculating the encrypted similarity set, the server sends the encrypted similarity set to the model requester. The model requester decrypts the encrypted similarity set to obtain the actual similarity set. From this set, the server selects the model with the highest similarity and matches the corresponding prototype model based on this highest similarity. A schematic diagram of the entire prototype model matching method can be shown below. Figure 2 As shown.

[0077] In this embodiment, the decryption method can be shown as follows:

[0078] M = N + e1 + e2s + r;

[0079] In the formula, M is the similarity set, N is the ciphertext similarity set, e1 and e2 are the fifth and sixth auxiliary parameters collected from the discrete Gaussian distribution on the construction ring R, r is the fourth auxiliary parameter sampled from the uniform random distribution on the construction ring R, and s is the third auxiliary parameter collected from the discrete Gaussian distribution on the construction ring R.

[0080] Furthermore, in this embodiment, to further ensure data security, the corresponding cached ciphertext prototype model and private ciphertext prototype model set can be deleted after the ciphertext similarity set calculation is completed.

[0081] This embodiment uses homomorphic encryption-based prototype model similarity matching to perform similarity calculation on the server side, avoiding the risk of training data leakage caused by matching the required model when the training set is unencrypted, as is the case in existing technologies.

[0082] The following is another prototype model matching method provided by an embodiment of the present invention, applied to the model demand side. The method may include:

[0083] The ciphertext prototype matrix encrypted using the CKKS homomorphic encryption algorithm is sent to the server.

[0084] Receive the ciphertext similarity set sent by the server, which is obtained by calculating the similarity between the ciphertext prototype matrix and each private ciphertext prototype matrix in the private ciphertext prototype matrix set;

[0085] The similarity set is obtained by decrypting the ciphertext similarity set, and the prototype model is matched based on the similarity set.

[0086] The private encrypted prototype matrix set is encrypted by the model provider using the CKKS homomorphic encryption algorithm and then sent to the server.

[0087] This embodiment uses homomorphic encryption-based prototype model similarity matching to perform similarity calculation on the server side, avoiding the risk of training data leakage caused by matching the required model when the training set is unencrypted, as is the case in existing technologies.

[0088] The following is a specific embodiment of a prototype model matching method provided by the present invention, which may include:

[0089] The model requester sends the model provider the preset dimensions of the prototype model and the public key used for CKKS homomorphic encryption.

[0090] The model requester generates a corresponding prototype matrix based on the training set and sends the encrypted prototype matrix after homomorphic encryption by CKKS to the server.

[0091] The model provider constructs a prototype model with a preset dimension, builds a private prototype matrix based on multiple private training sets, and performs CKKS homomorphic encryption on the private prototype matrix to obtain multiple private ciphertext prototype matrices. All private ciphertext prototype matrices are constructed into a private ciphertext prototype matrix set, and the private ciphertext prototype matrix set is sent to the server.

[0092] The server performs a dot product operation on each private ciphertext prototype in the ciphertext prototype matrix and the private ciphertext prototype matrix set to obtain the corresponding result matrix. The average of the elements in each result matrix is ​​used to obtain the corresponding ciphertext similarity. All ciphertext similarities constitute a ciphertext similarity set, and the ciphertext similarity set is sent to the model request end.

[0093] The model demand side obtains a similarity set by decrypting the ciphertext similarity set using the private key, and then selects the prototype model with the highest similarity from the similarity set.

[0094] The following is a prototype model matching device provided by the present invention, applied on the server side, which may include:

[0095] The first receiving module is used to receive the ciphertext prototype matrix encrypted by the CKKS homomorphic encryption algorithm sent by the model request end;

[0096] The second receiving module is used to receive the set of private ciphertext prototype matrices encrypted by the CKKS homomorphic encryption algorithm sent by the model provider.

[0097] The similarity calculation module is used to perform similarity calculation between the ciphertext prototype matrix and each private ciphertext prototype matrix in the private ciphertext prototype matrix set to obtain a ciphertext similarity set;

[0098] The first sending module is used to send the encrypted similarity set to the model request end, so that the model request end can decrypt the encrypted similarity set to obtain the similarity set, and match the prototype model according to the similarity set.

[0099] Based on the above embodiments, the present invention performs similarity calculation on the server side by matching prototype models based on homomorphic encryption, thereby avoiding the risk of training data leakage caused by matching the required model in the unencrypted state of the training set in the prior art.

[0100] The following is a prototype model matching device provided by the present invention, applied to the model demand side. The device may include:

[0101] The second sending module is used to send the ciphertext prototype matrix encrypted by the CKKS homomorphic encryption algorithm to the server.

[0102] The third receiving module is used to receive the ciphertext similarity set sent by the server, which is obtained by calculating the similarity between the ciphertext prototype matrix and each private ciphertext prototype matrix in the private ciphertext prototype matrix set.

[0103] The decryption module is used to decrypt the ciphertext similarity set to obtain a similarity set, and to match the prototype model based on the similarity set.

[0104] The private encrypted prototype matrix set is encrypted by the model provider using the CKKS homomorphic encryption algorithm and then sent to the server.

[0105] Based on the above embodiments, the present invention performs similarity calculation on the server side by matching prototype models based on homomorphic encryption, thereby avoiding the risk of training data leakage caused by matching the required model in the unencrypted state of the training set in the prior art.

[0106] The following combination Figure 3 , Figure 3 This is a structural block diagram of a prototype model matching system provided in an embodiment of the present invention. The system may include:

[0107] Model demand side 100 is used to send the ciphertext prototype matrix encrypted with the CKKS homomorphic encryption algorithm to the server side; decrypt the ciphertext similarity set to obtain the similarity set, and match the prototype model according to the similarity set;

[0108] The model provider 200 is used to send a set of private ciphertext prototype matrices encrypted by the CKKS homomorphic encryption algorithm to the server.

[0109] Server 300 is used to receive the ciphertext prototype matrix; receive the private ciphertext prototype matrix set; and perform similarity calculation between the ciphertext prototype matrix and each private ciphertext prototype matrix in the private ciphertext prototype matrix set to obtain a ciphertext similarity set.

[0110] Based on the above embodiments, the present invention performs similarity calculation on the server side by matching prototype models based on homomorphic encryption, thereby avoiding the risk of training data leakage caused by matching the required model in the unencrypted state of the training set in the prior art.

[0111] Based on the above embodiments, the model providing end 200 may include:

[0112] A private training unit is used to input a private training set into the prototype model of a preset dimension, and extract feature vectors from each class of the private training set in each round of training and average them to obtain a private prototype.

[0113] Private matrix unit, used by the model provider to construct the private prototype matrix from all the private prototypes during the training process;

[0114] A private sending unit is used to obtain the private ciphertext prototype matrix set by homomorphically encrypting all the private prototype matrices using the CKKS method, and then send the private ciphertext prototype matrix set to the server.

[0115] Based on the above embodiments, the server 300 may include:

[0116] The result matrix unit is used to perform a dot product operation between the ciphertext prototype matrix and each private ciphertext prototype matrix in the private ciphertext prototype matrix set to obtain the corresponding result matrix.

[0117] The averaging unit is used to average the elements in each of the resulting matrices to obtain the ciphertext similarity set.

[0118] Based on the above embodiments, the server 300 may further include:

[0119] The clearing unit is used to clear the corresponding cached ciphertext prototype matrix and the private ciphertext prototype matrix set when the calculation of the ciphertext similarity set is completed.

[0120] Based on the above embodiments, the model demand side 100 may include:

[0121] The training unit is used to input the training set into the prototype model and extract feature vectors from each class of the training set in each round of training and calculate the average to obtain the prototype.

[0122] Matrix unit, used to construct a prototype matrix from all the prototypes said during the training process;

[0123] The sending unit is used to encrypt the prototype matrix using the CKKS homomorphic encryption algorithm to obtain a ciphertext prototype matrix, and then send the ciphertext prototype matrix to the server.

[0124] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by an execution terminal or processor, can implement the method provided in the embodiments of the present invention; the storage medium may include various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0125] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.

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

[0127] The present invention has provided a detailed description of a prototype model matching method, apparatus, system, and storage medium. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A prototype model matching method, characterized in that, Applied to the server side, including: The receiver sends a ciphertext prototype matrix encrypted with the CKKS homomorphic encryption algorithm. The receiving model provider sends a set of private ciphertext prototype matrices encrypted using the CKKS homomorphic encryption algorithm; The ciphertext similarity set is obtained by calculating the similarity between the ciphertext prototype matrix and each private ciphertext prototype matrix in the private ciphertext prototype matrix set. The encrypted similarity set is sent to the model request end, so that the model request end can decrypt the encrypted similarity set to obtain the similarity set, and match the prototype model according to the similarity set.

2. The prototype model matching method according to claim 1, characterized in that, The step of calculating the similarity between the ciphertext prototype matrix and each private ciphertext prototype matrix in the private ciphertext prototype matrix set to obtain a ciphertext similarity set includes: Perform a dot product operation between the ciphertext prototype matrix and each private ciphertext prototype matrix in the private ciphertext prototype matrix set to obtain the corresponding result matrix; The ciphertext similarity set is obtained by averaging the elements in each of the resulting matrices.

3. The prototype model matching method according to claim 1, characterized in that, Also includes: When the calculation of the ciphertext similarity set is completed, the corresponding cached ciphertext prototype matrix and the private ciphertext prototype matrix set are cleared.

4. A prototype model matching method, characterized in that, Applied to the model requirements side, including: The ciphertext prototype matrix encrypted using the CKKS homomorphic encryption algorithm is sent to the server. Receive the ciphertext similarity set sent by the server, which is obtained by calculating the similarity between the ciphertext prototype matrix and each private ciphertext prototype matrix in the private ciphertext prototype matrix set; Decrypt the ciphertext similarity set to obtain a similarity set, and match the prototype model based on the similarity set; The private ciphertext prototype matrix set is encrypted by the model provider using the CKKS homomorphic encryption algorithm.

5. The prototype model matching method according to claim 4, characterized in that, Sending the ciphertext prototype matrix encrypted using the CKKS homomorphic encryption algorithm to the server includes: The training set is input into the prototype model, and the feature vectors of each class in the training set are extracted and averaged in each round of training to obtain the prototype. Construct a prototype matrix from all the prototypes mentioned in the training process; The prototype matrix is ​​encrypted using the CKKS homomorphic encryption algorithm to obtain a ciphertext prototype matrix, and the ciphertext prototype matrix is ​​sent to the server.

6. A prototype model matching device, characterized in that, Applied to the server side, including: The first receiving module is used to receive the ciphertext prototype matrix encrypted by the CKKS homomorphic encryption algorithm sent by the model request end; The second receiving module is used to receive the set of private ciphertext prototype matrices encrypted by the CKKS homomorphic encryption algorithm sent by the model provider. The similarity calculation module is used to perform similarity calculation between the ciphertext prototype matrix and each private ciphertext prototype matrix in the private ciphertext prototype matrix set to obtain a ciphertext similarity set; The first sending module is used to send the encrypted similarity set to the model request end, so that the model request end can decrypt the encrypted similarity set to obtain the similarity set, and match the prototype model according to the similarity set.

7. A prototype model matching device, characterized in that, Applied to the model requirements side, including: The second sending module is used to send the ciphertext prototype matrix encrypted by the CKKS homomorphic encryption algorithm to the server. The third receiving module is used to receive the ciphertext similarity set sent by the server, which is obtained by calculating the similarity between the ciphertext prototype matrix and each private ciphertext prototype matrix in the private ciphertext prototype matrix set. The decryption module is used to decrypt the ciphertext similarity set to obtain a similarity set, and to match the prototype model based on the similarity set; The private encrypted prototype matrix set is encrypted by the model provider using the CKKS homomorphic encryption algorithm and then sent to the server.

8. A prototype model matching system, characterized in that, include: The model demand side is used to send the ciphertext prototype matrix encrypted with the CKKS homomorphic encryption algorithm to the server side; Decrypt the ciphertext similarity set to obtain a similarity set, and match the prototype model based on the similarity set; The model provider is used to send a set of private ciphertext prototype matrices encrypted by the CKKS homomorphic encryption algorithm to the server. The server side is used to receive the ciphertext prototype matrix; Receive the set of private ciphertext prototype matrices; calculate the similarity between the ciphertext prototype matrices and each private ciphertext prototype matrix in the set of private ciphertext prototype matrices to obtain a ciphertext similarity set.

9. A prototype model matching system according to claim 8, characterized in that, The model provider includes: A private training unit is used to input a private training set into the prototype model of a preset dimension, and extract feature vectors from each class of the private training set in each round of training and average them to obtain a private prototype. Private matrix unit, used by the model provider to construct the private prototype matrix from all the private prototypes during the training process; A private sending unit is used to obtain the private ciphertext prototype matrix set by homomorphically encrypting all the private prototype matrices using the CKKS method, and then send the private ciphertext prototype matrix set to the server.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the prototype model matching method as described in any one of claims 1 to 5.