DBSCAN classification method and device based on secret sharing privacy protection, equipment and medium
Through the DBSCAN classification method based on secret sharing, the access matrix can be calculated by proxy computing party is solved, and the problems of DBSCAN clustering method in the prior art in privacy protection and computing efficiency are achieved, and efficient data classification and data security are achieved.
Patent Information
- Application Number
- CN202411181518.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2024-12-13
AI Technical Summary
The existing DBSCAN clustering methods have problems of data leakage and low computing efficiency in privacy protection, especially in the scenarios of horizontal federated learning and vertical federated learning, which is difficult to meet the needs of data security and practical application.
Using a privacy protection method based on secret sharing, the sample features are secretly shared and encrypted through the service provider and the requesting party, and the reachable matrix is calculated by three independent proxy calculators. The requesting party executes the DBSCAN algorithm based on the reachable matrix to realize data classification .
Computing is performed without exposing the original data of both parties, avoiding data leakage, and significantly improving classification efficiency, reducing communication overhead, and meeting data security and practical application needs.
Smart Images

Figure CN119128640A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data privacy technology, and in particular to a DBSCAN classification method, device, equipment and medium based on secret sharing privacy protection. Background Art
[0002] In the field of machine learning, clustering is an unsupervised learning method whose core goal is to divide each data point in a complex data set into several different groups based on their intrinsic feature similarities. DBSCAN is one of them and has been widely used in many fields.
[0003] In the scenario of risk control modeling, different communities have very different consumption and repayment behaviors, and it is very important to classify the population. The public data currently held by various government agencies records high-quality portrait data in many dimensions. Based on this data, the population is divided into multiple sub-populations, and an independent model is built for each population.
[0004] At present, the implementation process of clustering computing usually requires obtaining specific personal data of the two parties involved, which poses a risk of exposing privacy. At present, the mainstream solutions for clustering methods under privacy protection focus on horizontal federated learning or DBSCAN privacy computing initiated by a single institution.
[0005] Among them, those aimed at horizontal federated learning, such as "Client Selection Federated Learning Method Based on DBSCAN Clustering" (application number 202210378145), proposed a strategy for selecting a group of similar clients based on the horizontal DBSCAN algorithm for training and updating the global model, focusing on reducing the impact of non-independent distribution of data on federated learning through DBSCAN, rather than performing privacy calculations on the DBSCAN algorithm itself. Another paper, "DBSCAN Clustering Method Based on Horizontal Federation and Related Equipment" (application number 202011388364.3), proposed a horizontal federated DBSCAN clustering method, which realizes feature screening and data set division to be clustered by calculating the federated mean square error, and then clusters the data set by the federated Euclidean distance. The transmission process of some processes of this method involves plaintext information, which cannot meet the strong security requirements of various institutions to protect sensitive data.
[0006] "Privacy protection method, terminal and storage medium for DBSCAN algorithm" (application number 202310080172.3) introduces two computing parties to assist a single client in performing encrypted DBSCAN privacy computing. In this scenario, a single data party lacks the computing resources required for DBSCAN, so it entrusts two proxy service parties to complete DBSCAN clustering through privacy computing methods. This scheme introduces the DH protocol and oblivious transmission at the same time, resulting in high interaction costs and low algorithm efficiency in practical applications. For the data party, the computing resources required for the DH protocol, splitting, and encryption exceed the DBSCAN operation itself, making it difficult to implement in actual production scenarios. In addition, in this scheme, all data is stored in a single local service party, and it is impossible to directly use vertical federated learning in the scenario of multiple data parties. Summary of the invention
[0007] The purpose of the present invention is to provide a DBSCAN classification method, apparatus, device and medium based on secret sharing privacy protection, to solve the classification problem in data security scenarios where all parties are sensitive to their own data and to improve classification efficiency.
[0008] The purpose of the present invention can be achieved by the following technical solutions:
[0009] According to a first aspect of the present invention, a DBSCAN classification method based on secret sharing privacy protection is provided, involving a service party, a request party and three independent, non-colluding proxy computing parties, wherein the service party and the request party respectively have different features of the same sample, and the method comprises the following steps:
[0010] S1, the service provider and the requester share the sample features they own and encrypt them and send them to the proxy computing party;
[0011] S2, the proxy computing party calculates the reachability matrix and sends the calculated reachability matrix to the requesting party;
[0012] S3, the requester executes the DBSCAN algorithm based on the reachable matrix to achieve data classification.
[0013] The step S1 is specifically as follows:
[0014] The requester C has a first sample set, each sample of which contains m features, and the service provider has a second sample set, each sample of which contains k features. The number of samples in the first sample set and the second sample set is n.
[0015] The requesting party C calculates the sum of squares of distances between each sample point in the first sample set in the feature dimension: Among them, a ij is the i-th sample point X1 in the first sample set X1i and the jth sample point X1 j The sum of squares of feature distances between, i, j = 1, 2, ... n and i < j;
[0016] The requester C performs secret sharing encryption on the distance square sum data of the first sample set and generates a random number a1 ij , and a1 ij Send to the first proxy computing party; calculate a2 ij =a ij -a1 ij , a2 ij Sent to the second proxy computing party, and a1 sent to different proxy computing parties respectively ij and a2 ij Constitute the encrypted data after secret sharing ij >, where <*> represents secret sharing of encrypted data;
[0017] The server S calculates the sum of squares of distances between each sample point in the second sample set in the feature dimension: Among them, b ij is the i-th sample point X2 in the first sample set X2 i and the jth sample point X2 j The sum of squared feature distances between ;
[0018] The server S performs secret sharing encryption on the distance square sum data of the second sample set and generates a random number b1 ij , and b1 ij Send to the first proxy computing party; calculate b2 ij =b ij -b1 ij , b2 ij Sent to the second proxy computing party, and b1 sent to different proxy computing parties respectively ij and b2 ij Constitute the encrypted data after secret sharing ij >
[0019] The requester C generates a random number r1 and calculates r2=r based on the preset radius r. 2 -r1, and r1 is sent to the first proxy computing party, and r2 is sent to the second proxy computing party. The r1 and r2 sent to different proxy computing parties respectively constitute the radius data after secret sharing encryption. <r 2 >.
[0020] The step S2 comprises the following steps:
[0021] S21, the first proxy computing party and the second proxy computing party respectively perform a secure addition operation on the received feature distance square sum data: <zij >=secure_add( ij >, ij >), and we get z1 respectively. ij and z2 ij , where secure_add represents a secure addition operation, z1 ij =a1 ij +b1 ij , z2 ij =a2 ij +b2 ij ;
[0022] S22: The first computing agent and the second computing agent share the encrypted radius based on the secret <r 2 >Perform safe subtraction operations separately: <diff ij >=secure_sub( <z ij >, <r 2 >), and get diff1 respectively ij and diff2 ij , where secure_sub represents a secure subtraction operation, diff1 ij =z1 ij -r1,diff2 ij =z2 ij -r2;
[0023] S23, the requesting party C generates a random large positive integer t and a triplet (a, b, c), performs secret sharing encryption and distributes it to the first proxy computing party and the second proxy computing party, and obtains <t> ,( , , <c>), to perform a safe multiplication operation: <diff′ ij >=secure_multiply( <diff ij >, <t>), where secure_multiply represents a secure multiplication operation;
[0024] S24, the first computing agent and the second computing agent respectively <diff′ ij >The result is sent to the requester C, who calculates diff′ ij Based on diff′ ij Determine the relationship between the Euclidean distance between each sample point and the preset radius r, and construct the reachable matrix β, where diff′ ij When >0, it means that the Euclidean distance between sample points is greater than the preset radius r, and the two sample points are reachable. ij =1; when diff′ ij When <0, it means that the Euclidean distance between sample points is less than the preset radius r, and the two sample points are unreachable. ij =0.
[0025] The step S3 comprises the following steps:
[0026] S31, based on the reachable matrix, calculate the total number of reachable points for each sample point i Mark all sample points where the total number of reachable points A is greater than the minimum number of clustering points as core points;
[0027] S32, randomly select an unclustered core point, mark it as clustered, generate a new cluster, and traverse the remaining unclustered points. If the element β corresponding to the reachable matrix between the core point and the traversed unclustered points is ij =1, the unclustered point is classified into the new cluster and marked as clustered;
[0028] S33, loop step S32 until all core points are marked and the classification is completed, and the remaining unclustered points are classified as a noise set.
[0029] The security addition is specifically:
[0030] Input: The first agent and the second agent hold two secrets <x>and <y>, x=x1+x2, y=y1+y2, where the first proxy calculation party has x1 and y1, and the second proxy calculation party has x2 and y2;
[0031] Output: The first proxy computing party and the second proxy computing party calculate a new encrypted data <z>, satisfying z=x+y;
[0032] Processing process: The first proxy calculates z1=x1+y1, and the second proxy calculates z2=x2+y2. The first proxy calculates z1 and the second proxy calculates z2 respectively, and the new encrypted data is obtained. <z>.
[0033] The safety subtraction method is specifically:
[0034] Input: The first and second proxy computing parties hold two encrypted data: <x>and <y>, x=x1+x2, y=y1+y2, where the first proxy calculation party has x1 and y1, and the second proxy calculation party has x2 and y2;
[0035] Output: The first proxy computing party and the second proxy computing party calculate a new encrypted data: <z>, satisfying z = xy;
[0036] Processing process: The first proxy calculates z1=x1-y1, and the second proxy calculates z2=x2-y2. The first proxy calculates z1 and the second proxy calculates z2 respectively, and the new encrypted data is obtained. <z>.
[0037] The safe multiplication method is specifically:
[0038] Input: The first and second agent computing parties hold encrypted data: <x>, x=x1+x2, where the first agent has x1 and the second agent has x2;
[0039] Output: The first and second proxy computing parties randomly generate a large positive integer t and calculate a new encrypted data <z>, satisfying z = x × t;
[0040] Processing process:
[0041] Step 1) The third agent generates random numbers a, b and t, and calculates c = a*b, converting a, b, c, t into secret through secret sharing encryption< / z> < / x> < / z> < / z> < / y> < / x> < / z> < / z> < / y> < / x> < / t> < / c> 、 、 <c> 、 <t>, a=a1+a2,b=b1+b2,c=c1+c2,t=t1+t2, and sent to the first agent computing party and the second agent computing party, wherein the first agent computing party holds x1, t1, a1, b1, c1, and the second agent computing party holds x2, t2, a2, b2, c2;
[0042] Step 2) The first proxy calculation party calculates: e1=x1-a1, f1=t1-b1;
[0043] Step 3) The second proxy calculation party calculates: e2=x2-a2, f2=t2-b2;
[0044] Step 4) The first computing agent sends e1 and f1 to the second computing agent, and the second computing agent sends e2 and f2 to the first computing agent; that is, the first computing agent and the second computing agent both hold e1, e2, f1 and f2;
[0045] Step 5) The first proxy calculates z1 = x1 × (f1 + f2) + t1 × (e1 + e2) + c1, and the second proxy calculates z2 = x2 × (f1 + f2) + t2 × (e1 + e2) + c2 - (e1 + e2) × (f1 + f2). The first proxy calculates z1 and the second proxy calculates z2 respectively, and the new encrypted data is obtained. <z>, satisfying z=x×t.
[0046] According to a second aspect of the present invention, a DBSCAN classification device based on secret sharing privacy protection is provided, involving a service party, a request party and three independent, non-colluding proxy computing parties, wherein the service party and the request party respectively have different features of the same sample, and the device comprises:
[0047] Secret sharing encryption module: The service provider and the requester perform secret sharing and encryption on the sample features they each possess and then send them to the proxy computing party;
[0048] Reachable matrix calculation module: The proxy calculation party calculates the reachable matrix and sends the calculated reachable matrix to the requesting party;
[0049] Classification module: The requester executes the DBSCAN algorithm based on the reachable matrix to achieve data classification.
[0050] According to a third aspect of the present invention, there is provided an electronic device, comprising a memory and a processor, wherein a computer program is stored in the memory, and the method described above is implemented when the processor executes the program.
[0051] According to a fourth aspect of the present invention, there is provided a computer-readable storage medium having a computer program stored thereon, wherein the program implements the method described when executed by a processor.
[0052] Compared with the prior art, the present invention has the following beneficial effects:
[0053] (1) The present invention uses secret sharing to protect data privacy and can perform calculations without exposing the original data of both parties, thus avoiding the leakage of data of both parties. In addition, the computational efficiency of secret sharing is much better than homomorphic encryption.
[0054] (2) The present invention only requires nine data transmissions between multiple parties to achieve classification, wherein each comparison requires only one interaction, which can greatly reduce communication overhead and improve classification efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] < / z> < / t> < / c> Figure 1 The figure is a flow chart of the method of the present invention. DETAILED DESCRIPTION
[0056] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.
[0057] Currently, if it is necessary to classify people based on the data of two institutions, the feature information of both parties needs to be aggregated (either the requesting party tells the service party its own feature information, or the service party tells the requesting party its own feature information, or both parties send the feature information to some other third party), and then the computing party that has aggregated the data of both parties completes the classification calculation based on the original feature information data. Therefore, in this process, at least one of the two parties has to expose its sensitive features or distance information to the outside world.
[0058] The present invention proposes a DBSCAN classification method based on secret sharing technology in multi-party secure computing. The classification is completed without the need for both parties to expose personal feature data to the outside world. At the same time, the transmission and computing efficiency is optimized, which has a wide range of application needs in reality.
[0059] This embodiment first introduces a method for implementing classification through DBSCAN when the full amount of plaintext data is obtained, and then introduces a method for calculating a reachable matrix while protecting the features and distance information of both parties.
[0060] DBSCAN (Density-Based Spatial Clustering of Applications with Noise) is a density-based clustering algorithm that determines clusters based on the density around data points. In DBSCAN, areas with high density are considered clusters, while areas with low density are considered noise.
[0061] Perform a complete DBSCAN operation on one side and implement the clustering steps as follows:
[0062] Step 1: Input:
[0063] 1) The feature matrix Xij of each point;
[0064] 2) Radius r;
[0065] 3) Minimum number of clustering points MinPts;
[0066] Step 2: Calculate the Euclidean distance between two points and compare it with r to get the matrix β (β ij =1 means reachable, β ij =0 means unreachable);
[0067] Step 3: For each point i, calculate the total number of reachable points Mark all points whose results are greater than MinPts as core points;
[0068] Step 4: Randomly select an unclustered core point, mark it as clustered, generate a new cluster, and traverse the remaining unclustered points. If the core point is β ij =1, the point is also classified into the new cluster, and the point is marked as clustered;
[0069] Step 5: Repeat step 4 until all core points are marked, and classify the remaining unclustered points as a noise set.
[0070] Based on the above introduction, specific Figure 1 As shown, this embodiment provides a DBSCAN classification method based on secret sharing privacy protection, which is applied to customer group classification and involves a service party, a request party and three independent, non-colluding proxy computing parties, wherein the service party and the request party respectively have different features of the same sample, and the method includes the following steps:
[0071] S1, the service provider and the requester secretly share the sample features they own and encrypt them and send them to the proxy calculation party.
[0072] S11, the requesting party C has a first sample set, each of which contains m features, and the service party has a second sample set, each of which contains k features, and the number of samples in the first sample set and the second sample set is n. In this embodiment, each sample corresponds to a person, and the target is to classify each person into the corresponding population according to their portrait features. The portrait features include but are not limited to personal education, consumption habits, travel records, click preferences, work type, gender, and age. The data in the sample set can come from different government service agencies or other platforms. The platforms do not want to directly transmit plaintext data, and they all have the need to protect their own data privacy.
[0073] S12, the requesting party C calculates the sum of squares of distances between each sample point in the first sample set in the feature dimension: Among them, a ij is the i-th sample point X1 in the first sample set X1 i and the ,th sample point X1 j The sum of squares of feature distances between i, j = 1, 2, ... n and i <j。
[0074] S13, the requesting party C performs secret sharing encryption on the distance square sum data of the first sample set to generate a random number a1 ij , and a1 ij Send to the first proxy computing party; calculate a2 ij =a ij -a1 ij , a2 ij Sent to the second proxy computing party, and a1 sent to different proxy computing parties respectively ij and a2 ij Constitute the encrypted data after secret sharing ij >, where <*> represents secret sharing of encrypted data.
[0075] S14, the server S calculates the sum of squares of distances between each sample point in the second sample set in the feature dimension: Among them, b ij is the i-th sample point X2 in the first sample set X2 i and the ,th sample point X2 j The sum of squared feature distances between .
[0076] S15, the service provider S performs secret sharing encryption on the distance square sum data of the second sample set to generate a random number b1 ij , and b1 ij Send to the first proxy computing party; calculate b2 ij =b ij -b1 ij , b2 ij Sent to the second proxy computing party, and b1 sent to different proxy computing parties respectively ij and b2 ij Constitute the encrypted data after secret sharing ij >.
[0077] S16, the requesting party C generates a random number r1, and calculates r2=r based on the preset radius r 2 -r1, and r1 is sent to the first proxy computing party, and r2 is sent to the second proxy computing party. The r1 and r2 sent to different proxy computing parties respectively constitute the radius data after secret sharing encryption. <r 2 >.
[0078] S2, the proxy computing party calculates the reachability matrix and sends the calculated reachability matrix to the requesting party.
[0079] S21, the first proxy computing party and the second proxy computing party respectively perform a secure addition operation on the received feature distance square sum data: <z ij >=secure_add( ij >, ij >), and we get z1 respectively. ij and z2 ij , where secure_add represents a secure addition operation, z1 ij =a1 ij +b1 ij , z2 ij =a2 ij +b2 ij .
[0080] In this embodiment, the security addition is specifically:
[0081] Input: The first agent and the second agent hold two secrets <x>and <y>, x=x1+x2, y=y1+y2, where the first proxy calculation party has x1 and y1, and the second proxy calculation party has x2 and y2;
[0082] Output: The first proxy computing party and the second proxy computing party calculate a new encrypted data <z>, satisfying z=x+y;
[0083] Processing process: The first proxy calculates z1=x1+y1, and the second proxy calculates z2=x2+y2. The first proxy calculates z1 and the second proxy calculates z2 respectively, and the new encrypted data is obtained. <z>.
[0084] S22: The first computing agent and the second computing agent share the encrypted radius based on the secret <r 2 >Perform safe subtraction operations separately: <diff ij >=secure_sub( <z ij >, <r 2 >), and get diff1 respectively ij and diff2 ij , where secure_sub represents a secure subtraction operation, diff1 ij =z1 ij -r1,diff2 ij =z2 ij -r2.
[0085] In this embodiment, the safety subtraction method is specifically:
[0086] Input: The first and second proxy computing parties hold two encrypted data: <x>and <y>, x=x1+x2, y=y1+y2, where the first proxy calculation party has x1 and y1, and the second proxy calculation party has x2 and y2;
[0087] Output: The first proxy computing party and the second proxy computing party calculate a new encrypted data: <z>, satisfying z = xy;
[0088] Processing process: The first proxy calculates z1=x1-y1, and the second proxy calculates z2=x2-y2. The first proxy calculates z1 and the second proxy calculates z2 respectively, and the new encrypted data is obtained. <z>.
[0089] S23, the requesting party C generates a random large positive integer t and a triplet (a, b, c), performs secret sharing encryption and distributes it to the first proxy computing party and the second proxy computing party, and obtains <t> ,( , , <c>), to perform a safe multiplication operation: <diff′ ij >=secure_multiply( <diff ij >, <t>), where secure_multiply represents a secure multiplication operation.
[0090] In this embodiment, the safe multiplication is specifically:
[0091] Input: The first and second agent computing parties hold encrypted data: <x>, x=x1+x2, where the first agent has x1 and the second agent has x2;
[0092] Output: The first and second proxy computing parties randomly generate a large positive integer t and calculate a new encrypted data <z>, satisfying z = x × t;
[0093] Processing process:
[0094] Step 1) The third agent generates random numbers a, b and t, and calculates c = a*b, converting a, b, c, t into secret through secret sharing encryption< / z> < / x> < / t> < / c> 、 、 <c> 、 <t>, a=a1+a2,b=b1+b2,c=c1+c2,t=t1+t2, and sent to the first agent computing party and the second agent computing party, wherein the first agent computing party holds x1, t1, a1, b1, c1, and the second agent computing party holds x2, t2, a2, b2, c2;
[0095] Step 2) The first proxy calculation party calculates: e1=x1-a1, f1=t1-b1;
[0096] Step 3) The second proxy calculation party calculates: e2=x2-a2, f2=t2-b2;
[0097] Step 4) The first computing agent sends e1 and f1 to the second computing agent, and the second computing agent sends e2 and f2 to the first computing agent; that is, the first computing agent and the second computing agent both hold e1, e2, f1 and f2;
[0098] Step 5) The first proxy calculates z1 = x1 × (f1 + f2) + t1 × (e1 + e2) + c1, and the second proxy calculates z2 = x2 × (f1 + f2) + t2 × (e1 + e2) + c2 - (e1 + e2) × (f1 + f2). The first proxy calculates z1 and the second proxy calculates z2 respectively, and the new encrypted data is obtained. <z>, satisfying z=x×t.
[0099] S24, the first computing agent and the second computing agent respectively <diff′ ij >The result is sent to the requester C, who calculates diff′ ij Based on diff′ ij Determine the relationship between the Euclidean distance between each sample point and the preset radius r, and construct the reachable matrix β, where diff′ ij When >0, it means that the Euclidean distance between sample points is greater than the preset radius r, and the two sample points are reachable. ij =1; when diff′ ij When <0, it means that the Euclidean distance between sample points is less than the preset radius r, and the two sample points are unreachable. ij =0.
[0100] S3, the requester executes the DBSCAN algorithm based on the reachable matrix to achieve data classification.
[0101] S31, based on the reachable matrix, calculate the total number of reachable points for each sample point i Mark all sample points where the total number of reachable points A is greater than the minimum number of clustering points as core points;
[0102] S32, randomly select an unclustered core point, mark it as clustered, generate a new cluster, and traverse the remaining unclustered points. If the element β corresponding to the reachable matrix between the core point and the traversed unclustered points is ij =1, the unclustered point is classified into the new cluster and marked as clustered;
[0103] S33, looping step S32 until all core points are marked, crowd classification is completed, and the remaining unclustered points are classified as a noise set.
[0104] It should be noted that the present invention will not traverse i, j when executing data interaction between the service party, the request party and the proxy calculation party, but will perform calculations on the full amount of data (n*(n-1) / 2) at each step, and then the communication interaction in each step is only executed once, and the results of all data are transmitted each time, so as to improve the calculation efficiency.
[0105] The method adopted by the present invention has the following core innovations:
[0106] 1. In the entire computing link, the characteristics and distance information of both parties are not leaked, protecting the sensitive information of both parties.
[0107] 2. It is not necessary for the service provider and the requester to trust each other. In other words, the security and accuracy of the entire computing process do not depend on the trust between the two parties, but are completely guaranteed by the designed algorithm. Similarly, the present invention does not require the proxy computing service providers (P0, P1 and P2) who provide computing power to trust each other (but they are required not to collude with each other), and the security and accuracy of the entire computing process are completely guaranteed by the algorithm.
[0108] Based on this, this embodiment realizes the implementation of the DBSCAN algorithm based on cross-institutional government data under secret sharing privacy computing, solves the data security issues of each government unit that is sensitive to its own data, and also lays the foundation for customized modeling for different groups of people in subsequent business links.
[0109] The above is an introduction to a method embodiment. The following is a further explanation of the solution of the present invention through an apparatus embodiment.
[0110] This embodiment provides a DBSCAN classification device based on secret sharing privacy protection, involving a service party, a request party, and three independent proxy computing parties that do not collude with each other, wherein the service party and the request party respectively have different features of the same sample, and the device includes:
[0111] Secret sharing encryption module: The service provider and the requester perform secret sharing and encryption on the sample features they each possess and then send them to the proxy computing party;
[0112] Reachable matrix calculation module: The proxy calculation party calculates the reachable matrix and sends the calculated reachable matrix to the requesting party;
[0113] Classification module: The requester executes the DBSCAN algorithm based on the reachable matrix to achieve data classification.
[0114] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the described module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0115] The electronic device of the present invention includes a processor, which may be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processing unit (CPU), an application processor (AP), a digital signal processor (DSP), a graphics processing unit (GPU), and a neural-network processing unit (NPU). The processor may perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) or computer program instructions loaded from a storage unit into a random access memory (RAM). In RAM, various programs and data required for device operation may also be stored. The processor, ROM, and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.
[0116] Multiple components in the device are connected to the I / O interface, including: input units, such as keyboards, mice, etc.; output units, such as various types of displays, speakers, etc.; storage units, such as disks, optical disks, etc.; and communication units, such as network cards, modems, wireless communication transceivers, etc. The communication unit allows the device to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunication networks.
[0117] The processor performs the various methods and processes described above, such as methods S1 to S3. For example, in some embodiments, methods S1 to S3 may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit. In some embodiments, part or all of the computer program may be loaded and / or installed on the device via a ROM and / or a communication unit. When the computer program is loaded into the RAM and executed by the processor, one or more steps of methods S1 to S3 described above may be performed. Alternatively, in other embodiments, the processor may be configured to perform methods S1 to S3 in any other appropriate manner (e.g., by means of firmware).
[0118] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), and the like.
[0119] The program code for implementing the method of the present invention can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code can be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.
[0120] In the context of the present invention, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0121] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning, or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.< / z> < / t> < / c> < / t> < / z> < / z> < / y> < / x> < / z> < / z> < / y> < / x> < / t>
Claims
1. A DBSCAN classification method based on secret sharing privacy protection, characterized in that: Involving a service party, a request party, and three independent, non-collusive proxy computing parties, wherein the service party and the request party respectively possess different characteristics of the same sample, the method comprises the following steps: S1, the service provider and the requester share the sample features they own and encrypt them and send them to the proxy computing party; S2, the proxy computing party calculates the reachability matrix and sends the calculated reachability matrix to the requesting party; S3, the requester executes the DBSCAN algorithm based on the reachable matrix to achieve data classification.
2. According to claim 1, a DBSCAN classification method based on secret sharing privacy protection is characterized in that: The step S1 is specifically as follows: The requester C has a first sample set, each sample of which contains m features, and the service provider has a second sample set, each sample of which contains k features. The number of samples in the first sample set and the second sample set is n. The requesting party C calculates the sum of squares of distances between each sample point in the first sample set in the feature dimension: Among them, a ij is the i-th sample point X1 in the first sample set X1 i and the jth sample point X1 j The sum of squares of feature distances between i, j = 1, 2, ... n and i <j; The requester C performs secret sharing encryption on the distance square sum data of the first sample set and generates a random number a1 ij , and a1 ij Send to the first proxy computing party; calculate a2 ij =a ij -a1 ij , a2 ij Sent to the second proxy computing party, and a1 sent to different proxy computing parties respectively ij and a2 ij Constitute the encrypted data after secret sharing ij >, where <*> represents secret sharing of encrypted data; The server S calculates the sum of squares of distances between each sample point in the second sample set in the feature dimension: Among them, b ij is the i-th sample point X2 in the first sample set X2 i and the jth sample point X2 j The sum of squared feature distances between ; The server S performs secret sharing encryption on the distance square sum data of the second sample set and generates a random number b1 ij , and b1 ij Send to the first proxy computing party; calculate b2 ij =b ij -b1 ij , b2 ij Sent to the second proxy computing party, and b1 sent to different proxy computing parties respectively ij and b2 ij Constitute the encrypted data after secret sharing ij > The requester C generates a random number r1 and calculates r2=r based on the preset radius r. 2 -r1, and r1 is sent to the first proxy computing party, and r2 is sent to the second proxy computing party. The r1 and r2 sent to different proxy computing parties respectively constitute the radius data after secret sharing encryption. <r 2 >.
3. According to claim 2, a DBSCAN classification method based on secret sharing privacy protection is characterized in that: The step S2 comprises the following steps: S21, the first proxy computing party and the second proxy computing party respectively perform a secure addition operation on the received feature distance square sum data: <z ij >=secure_add( ij >, ij >), and we get z1 respectively. ij and z2 ij , where secure_add represents a secure addition operation, z1 ij =a1 ij +b1 ij , z2 ij =a2 ij +b2 ij ; S22: The first computing agent and the second computing agent share the encrypted radius based on the secret <r 2 >Perform safe subtraction operations separately: <diff ij >=secure_sub( <z ij >, <r 2 >), and get diff1 respectively ij and diff2 ij , where secure_sub represents a secure subtraction operation, diff1 ij =z1 ij -r1,diff2 ij =z2 ij -r2; S23, the requesting party C generates a random large positive integer t and a triplet (a, b, c), performs secret sharing encryption and distributes it to the first proxy computing party and the second proxy computing party, and obtains <t> ,( , , <c>), to perform a safe multiplication operation: <diff′ ij >=secure_multiply( <diffi ij >, <t> ), where secure_multiply represents a secure multiplication operation;< / t> < / c> < / t> S24, the first computing agent and the second computing agent respectively <diff′ ij >The result is sent to the requester C, who calculates diff′ ij Based on diff′ ij Determine the relationship between the Euclidean distance between each sample point and the preset radius r, and construct the reachable matrix β, where diff′ ij When >0, it means that the Euclidean distance between sample points is greater than the preset radius r, and the two sample points are reachable. ij =1; when diff′ ij <0, it means that the Euclidean distance between the sample points is less than the preset radius r, and the two sample points are unreachable. ij =0.
4. According to claim 3, a DBSCAN classification method based on secret sharing privacy protection is characterized in that: The step S3 comprises the following steps: S31, based on the reachable matrix, calculate the total number of reachable points for each sample point i Mark all sample points where the total number of reachable points A is greater than the minimum number of clustering points as core points; S32, randomly select an unclustered core point, mark it as clustered, generate a new cluster, and traverse the remaining unclustered points. If the element β corresponding to the reachable matrix between the core point and the traversed unclustered points is ij =1, the unclustered point is classified into the new cluster and marked as clustered; S33, looping step S32 until all core points are marked and the classification is completed, and the remaining unclustered points are classified as a noise set.
5. The DBSCAN classification method based on secret sharing privacy protection according to claim 3 is characterized in that: The security addition is specifically: Input: The first agent and the second agent hold two secrets <x>and <y> , x=x1+x2, y=y1+y2, where the first proxy calculation party has x1 and y1, and the second proxy calculation party has x2 and y2;< / y> < / x> Output: The first proxy computing party and the second proxy computing party calculate a new encrypted data <z> , satisfying z=x+y;< / z> Processing process: The first proxy calculates z1=x1+y1, and the second proxy calculates z2=x2+y2. The first proxy calculates z1 and the second proxy calculates z2 respectively, and the new encrypted data is obtained. <z> 。< / z> 6. The DBSCAN classification method based on secret sharing privacy protection according to claim 3 is characterized in that: The safety subtraction method is specifically: Input: The first and second proxy computing parties hold two encrypted data: <x>and <y> , x=x1+x2, y=y1+y2, where the first proxy calculation party has x1 and y1, and the second proxy calculation party has x2 and y2;< / y> < / x> Output: The first proxy computing party and the second proxy computing party calculate a new encrypted data: <z> , satisfying z = xy;< / z> Processing process: The first proxy calculates z1=x1-y1, and the second proxy calculates z2=x2-y2. The first proxy calculates z1 and the second proxy calculates z2 respectively, and the new encrypted data is obtained. <z> 。< / z> 7. The DBSCAN classification method based on secret sharing privacy protection according to claim 3 is characterized in that: The safe multiplication method is specifically: Input: The first and second agent computing parties hold encrypted data: <x> , x=x1+x2, where the first agent has x1 and the second agent has x2;< / x> Output: The first and second proxy computing parties randomly generate a large positive integer t and calculate a new encrypted data <z> , satisfying z = x × t;< / z> Processing process: Step 1) The third agent generates random numbers a, b and t, and calculates c = a*b, converting a, b, c, t into secret through secret sharing encryption 、 、 <c> 、 <t> , a=a1+a2,b=b1+b2,c=c1+c2,t=t1+t2, and sent to the first agent computing party and the second agent computing party, where the first agent computing party holds x1, t1, a1, b1, c1, and the second agent computing party holds x2, t2, a2, b2, c2;< / t> < / c> Step 2) The first agent calculates: e1 = x1 - a1, f1 = t1 - b1; Step 3) The second proxy calculation party calculates: e2 = x2-a2, f2 = t2-b2; Step 4) The first computing agent sends e1 and f1 to the second computing agent, and the second computing agent sends e2 and f2 to the first computing agent; that is, the first computing agent and the second computing agent both hold e1, e2, f1 and f2; Step 5) The first proxy calculates z1 = x1 × (f1 + f2) + t1 × (e1 + e2) + c1, and the second proxy calculates z2 = x2 × (f1 + f2) + t2 × (e1 + e2) + c2 - (e1 + e2) × (f1 + f2). The first proxy calculates z1 and the second proxy calculates z2 respectively, and the new encrypted data is obtained. <z> , satisfying z=x×t.< / z> 8. A DBSCAN classification device based on secret sharing privacy protection, characterized in that: Involving a service party, a request party and three independent, non-collusive proxy computing parties, wherein the service party and the request party respectively have different characteristics of the same sample, the device includes: Secret sharing encryption module: The service provider and the requester perform secret sharing and encryption on the sample features they each possess and then send them to the proxy computing party; Reachable matrix calculation module: The proxy calculation party calculates the reachable matrix and sends the calculated reachable matrix to the requesting party; Classification module: The requester executes the DBSCAN algorithm based on the reachable matrix to achieve data classification.
9. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the program, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
DBSCAN algorithm calculation method and device for protecting data privacy
CN120449180A
Product recommendation method and device based on homomorphic encryption DBSCAN, equipment and medium
CN121278418A
