Private data similarity determination method and device, storage medium and electronic equipment

By generating target branch structures from training data pairs on the server and combining them with cosine distance calculations, the problem of high resource consumption and low efficiency in calculating privacy data similarity between different clients in the server is solved, and efficient and accurate privacy data similarity judgments are achieved.

CN118568518APending Publication Date: 2024-08-30SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410706145.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-31
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

In the existing technology, the calculation of the privacy data similarity of different clients in the server requires a large amount of server resources, which results in high computational cost and low efficiency.

Method used

By training data pairs on the server to generate the target branch structure, and configuring the target branch structure for the target client, calculate the similarity of the output data of different branch structures to determine the similarity of private data, and combine with cosine distance calculation to improve computing efficiency and accuracy sex.

Benefits of technology

It reduces server resource consumption, improves the efficiency and accuracy of privacy data similarity calculation, and solves the problems of high computing cost and low efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118568518A
    Figure CN118568518A
Patent Text Reader

Abstract

The embodiment of the invention provides a privacy data similarity determination method and device, a storage medium and electronic equipment, the method is applied to a server, the server is preset with a plurality of data pairs with similar identifiers, the similar identifiers are used for indicating the similarity degree between different data in the data pairs, and the similarity degree between the different data in the data pairs is determined according to the similarity degree. The server is connected with the multiple clients, and the method specifically comprises the steps that a target branch structure for data processing is configured for a target client through the server, and the target client is the client to be subjected to data similarity judgment in the multiple clients; acquiring output data obtained by performing data processing on the target client by using the target branch structure; and according to the output data, determining the similarity of privacy data existing between different target clients.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer storage, and more specifically, to a method and device for determining similarity of privacy data, a storage medium, and an electronic device. Background Art

[0002] In the field of machine learning, privacy is often required to judge the similarity between two users. For example, in the preference matching of dating software, it is hoped that the degree of personal preference matching between two people will be calculated without leaking one's own personal preference data. For another example, in the article duplicate check and new check system, users hope that the system will find files with high similarity, but do not want the system to obtain the specific content of their articles. And in the field of medical imaging, users hope to find cases similar to themselves through medical image retrieval, while not leaking their medical imaging information to the system. In related technologies, a relatively simple way to judge similarity is to directly use distance judgment. Commonly used distances include Euclidean distance, Manhattan distance, cosine distance, etc. Compared with other distances, cosine distance has some significant advantages. For example, in high-dimensional sparse space, other distances will lose their effect in judging similarity, while cosine distance can still be used normally to judge the similarity between objects, and cosine distance is the result of normalization, through which an intuitive feeling of the similarity between objects can be generated. Cosine distance is often used to judge the measurement of image similarity, text similarity, and personal preference similarity. However, the effect of directly using the above cosine distance to judge the similarity of users is often not so ideal, and the method of using neural network to judge the similarity of users has better effect. However, the cost of the general secure multi-party computing scheme used in related technologies for privacy computing of neural networks is too high.

[0003] Therefore, performing similarity privacy calculations on the privacy data corresponding to different clients in the server consumes a lot of server resources, has high calculation costs, and has low calculation efficiency, which has become a technical problem that needs to be solved urgently.

[0004] Therefore, it is necessary to improve the related technology to overcome the above-mentioned defects in the related technology. Summary of the invention

[0005] The embodiments of the present application provide a method and device for determining the similarity of privacy data, a storage medium, and an electronic device, so as to at least solve the technical problems in the related art that similarity privacy calculation for privacy data corresponding to different clients in a server consumes a large amount of server resources, has high calculation cost, and has low calculation efficiency.

[0006] According to one embodiment of the present application, a method for determining the similarity of privacy data is provided, which is applied to a server, wherein the server is pre-set with multiple data pairs with similarity identifiers, and the similarity identifiers are used to indicate the degree of similarity between different data in the data pairs, and the server is connected to multiple clients, including: configuring a target branch structure for data processing to a target client through the server, wherein the target client is a client among the multiple clients on which data similarity judgment is to be performed; obtaining output data obtained by the target client using the target branch structure for data processing; and determining the similarity of privacy data between different target clients based on the output data.

[0007] According to another embodiment of the present application, there is provided a device for determining the similarity of privacy data, which is applied to a server, wherein the server is pre-installed with multiple data pairs with similarity identifiers, and the similarity identifiers are used to indicate the degree of similarity between different data in the data pairs, and the server is connected to multiple clients, including: a configuration module, used to configure a target branch structure for data processing to a target client through the server, wherein the target client is a client among the multiple clients on which data similarity judgment is to be performed; an acquisition module, used to obtain output data obtained by the target client using the target branch structure for data processing; and a determination module, used to determine the similarity of privacy data between different target clients based on the output data.

[0008] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.

[0009] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0010] According to another embodiment of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0011] Through the present application, a target network is trained by using data existing on a server to obtain a target branch structure that can be configured with different target clients for data processing. Then, by assigning corresponding target branch structures to different target clients and calculating the data similarity of output data finally output by different branch structures, the similarity of privacy data between different target clients is determined, thereby improving the efficiency of determining the similarity of privacy data between different target clients. By flexibly combining the network with the cosine distance to calculate the similarity, the accuracy of subsequent determination of privacy data is greatly improved, and the overall consumption of server resources is less. Therefore, the technical problems in the related technology that similarity privacy calculation for privacy data corresponding to different clients in the server requires more server resources, has high computational cost, and has low computational efficiency can be solved, thereby achieving the technical effect of reducing the computational cost of calculating the similarity of privacy data between different target clients and effectively reducing the resource consumption of the server in performing privacy calculations. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 It is a hardware structure block diagram of a server device of a method for determining similarity of privacy data in an embodiment of the present application;

[0013] Figure 2 is a flowchart of a method for determining similarity of privacy data according to an embodiment of the present application;

[0014] Figure 3 is a schematic diagram of the structure of a Siamese network according to an embodiment of the present application (I);

[0015] Figure 4 is a schematic diagram of the structure of a Siamese network according to an embodiment of the present application (II);

[0016] Figure 5 is a schematic diagram of the structure of a pseudo-Siamese network according to an embodiment of the present application (I);

[0017] Figure 6 is a schematic diagram of the structure of a pseudo-Siamese network according to an embodiment of the present application (II);

[0018] Figure 7 is a schematic diagram of the structure of a device for determining similarity of privacy data according to an embodiment of the present application;

[0019] Figure 8 It is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0020] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0021] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0022] The method embodiments provided in the embodiments of the present application can be executed in a server device or a similar computing device. Taking running on a server device as an example, Figure 1 1 is a hardware structure block diagram of a server device of a method for determining similarity of privacy data in an embodiment of the present application. Figure 1 As shown, the server device may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the server device may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above server device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0023] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for determining the similarity of privacy data in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the server device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0024] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the server device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0025] In this embodiment, a method for determining the similarity of private data is provided. Figure 2 is a flowchart of a method for determining similarity of privacy data according to an embodiment of the present application. Figure 2 As shown, the process includes the following steps:

[0026] Step S202, configuring a target branch structure for data processing to a target client through the server, wherein the target client is a client among the multiple clients on which data similarity judgment is to be performed;

[0027] Step S204, obtaining output data obtained by the target client performing data processing using the target branch structure;

[0028] Step S206: determining the similarity of the private data between different target clients according to the output data.

[0029] It is understandable that before determining the above target branch structure, it is necessary to complete the establishment of the target network in combination with the data already existing in the server, specifically, including the following steps:

[0030] Step S301: determining the target number of target clients for which data similarity determination is to be performed;

[0031] Step S302: establishing an initial network in the server based on the target number; wherein the initial network includes: a branch structure of the target number;

[0032] Step S303: training the initial network using the data pairs and the similarity identifiers to obtain a target network.

[0033] Optionally, in an actual application, when the parameter information of different branch structures in the target network is the same, a first function for limiting the use of the parameter information is added to the target network, wherein the first function is determined in the following manner: The S is the square of the parameter vector size of the pre-set sub-branch structure; when the target network has two sub-branch structures, is the input parameter of the first sub-branch structure, is the input parameter of the second sub-branch structure, is the parameter data of the initial parameter information of the branch structure, zi is the value corresponding to the initial similarity mark, where λ is the preset parameter of the pre-set sub-branch structure;

[0034] Optionally, when the parameter information of different branch structures in the target network is different, a second function for limiting the use of parameter information is added to the target network, wherein the second function is determined in the following manner: The s1 is the square of the parameter vector size of the preset first sub-branch structure, and s2 is the square of the parameter vector size of the preset second sub-branch structure; when the target network has two sub-branch structures, is the input parameter of the first sub-branch structure, is the input parameter of the second sub-branch structure, is the parameter data of the initial parameter information of the first sub-branch structure, is the parameter data of the initial parameter information of the second sub-branch structure, z i is the numerical value corresponding to the initial similarity mark; λ1 is the preset parameter of the first sub-branch structure, and λ2 is the preset parameter of the second sub-branch structure.

[0035] In summary, through the above implementation, the server can use the data pair as training data to train the network. After the training is completed, the server sends the network parameters to the client that needs to compare the similarity. Then the two clients respectively bring the data into the branch to obtain the output of the corresponding branch. Finally, the privacy calculation of the cosine distance of the two branch outputs can be used to realize the privacy calculation of user similarity.

[0036] Optionally, step S202 may be implemented, for example, by following the steps S401-S403, specifically:

[0037] Step S401, obtaining structural information of different branch structures in the target network that has completed training in the server and parameter information of the different branch structures;

[0038] Step S402: Determine the similarity determination requirements corresponding to the target client;

[0039] Step S403: configuring a target branch structure for data processing to a target client based on the similarity determination requirement, the structure information, and the parameter information.

[0040] It can be understood that by configuring a target branch structure that matches different target clients based on similar determined needs and combining the structural information and parameter information in the target network, and then using the specially configured target branch structure to process the data of the current target client, the privacy data of the current target client can be avoided from being leaked during the processing.

[0041] In summary, through the above embodiments, data leakage in the process of determining the private data of different clients can be effectively avoided, and the security of determining the similarity of private data can be improved.

[0042] Through the above steps, the target network is trained by the data existing on the server to obtain a target branch structure that can be configured with different target clients for data processing, and then by assigning corresponding target branch structures to different target clients and calculating the data similarity of the output data finally output by different branch structures, the similarity of the privacy data between different target clients is determined, thereby improving the efficiency of determining the similarity of the privacy data between different target clients, and by flexibly combining the network with the cosine distance to calculate the similarity, the accuracy of the subsequent determination of the privacy data is greatly improved, and the overall consumption of server resources is less. Therefore, the technical problems in the related technology that the similarity privacy calculation of the privacy data corresponding to different clients in the server requires more server resources, high calculation cost, and low calculation efficiency can be solved, thereby achieving the technical effect of reducing the calculation cost of calculating the similarity of the privacy data between different target clients and effectively reducing the resource consumption of the server to perform privacy calculations.

[0043] Optionally, the target network may select a Siamese network in actual use, wherein the Siamese network is a highly efficient method for determining the similarity of user data, and its main structure can be divided into two independent branches and a similarity discrimination structure. However, the method using the Siamese network basically does not consider the protection of user privacy information, and the privacy calculation of the cosine distance is relatively simple, and because the cosine distance is the result of normalization and has the advantage of being applicable to high-dimensional data, the above technical solution represents the objective function of the neural network through the cosine distance in the Siamese network, and combines the privacy calculation of the cosine distance in the discrimination stage to realize the privacy calculation of user similarity, thereby greatly improving the determination efficiency.

[0044] In an exemplary embodiment, a target branch structure for data processing is configured to a target client based on the similarity determination requirement, the structural information, and the parameter information, including: when the similarity determination requirement is partially confidential, determining that a first type of branch structure that does not share the same structure and the same parameters is configured for the target client, and based on the first type of branch structure, selecting first sub-structure information and first sub-parameter information from the structural information and the parameter information for combination to obtain a first target branch structure; when the similarity determination requirement is not confidential, determining that a second type of branch structure that shares the same structure and the same parameters is configured for the target client, and based on the second type of branch structure, selecting second sub-structure information and second sub-parameter information from the structural information and the parameter information for combination to obtain a second target branch structure.

[0045] As an optional implementation manner, the process of determining the branch structure is described by taking the case where there are two target clients as an example.

[0046] Optional, privacy calculation method based on similarity of Siamese network. When applied, it is necessary to collect a large number of data pairs in the server connected to the client, and determine the mark of the similarity of each data pair (a number between [0, 2], where the closer the number used for marking is to 0, the higher the similarity, and the closer it is to 2, the lower the similarity. It should be noted that in some application scenarios, the similarity is not easy to mark, so the similarity can be directly marked as 0 and the dissimilarity can be marked as 2.

[0047] Assume that the server has a total of N data pairs and corresponding tags. The i-th data pair and the corresponding tag are Among them, the data pair consists of data and data That is, a data pair is composed of two vectors with a dimension of n. These data can be pictures, audio, text, personal feature data and other information. If the server has too little data, you can add data through some means, such as taking a piece of data from different data pairs to form new data; generating some random data (such as Gaussian noise) and adding it to the database, etc.

[0048] Optional, if the target clients to determine data similarity are client A and client B, if client A has data Client B has the data

[0049] Under the above conditions, the privacy calculation method based on the similarity of the Siamese network is as follows:

[0050] The server builds a Siamese network and the corresponding objective function. There are two branches in this network (represented by branch 1 and branch 2 respectively), which share the same architecture and the same model parameters. Each branch takes one of the data pairs as input, and the decision layer of the network is the cosine distance between the outputs of the two branches. The loss function uses the square loss function.

[0051] Since network branch 1 and network branch 2 have the same network architecture and parameters, they can be represented by the same expression (such as f). Let the expression be in is the input parameter, is the model parameter data of the network branch, is the output parameter of the branch.

[0052] Secondly, the square loss function is used as the loss function of the current network, and the scaling of the vector size does not affect the calculation of the cosine distance, and certain restrictions are placed on the model parameters. In order to facilitate the calculation of the cosine distance, the size of the model parameter vector is fixed, so the objective function can be expressed as:

[0053] Where s is the square of the model parameter vector size set by the user. For example, s can be taken as Using the Lagrange multiplier method, the above objective function can be transformed into: That is, the goal of the above network is to find the appropriate λ makes the function The minimum obtained These are the model parameters of the desired branch.

[0054] It should be noted that in this network, the output of each network branch is equivalent to extracting some important features of the output. Then the cosine distance is used in the decision layer to compare the similarity between these important features, so as to well reflect the similarity of user data.

[0055] In summary, through the above implementation, the shortcomings of the general Siamese network that usually uses Euclidean distance to measure the similarity of users in the decision layer are avoided. Specifically, the first disadvantage is that the similarity obtained by the general Siamese network is not a normalized result, and there is no intuitive feeling for the degree of similarity. The second disadvantage is that the Euclidean distance used to measure similarity in the general Siamese network is no longer applicable in high-dimensional space. Therefore, the scope of application of the network is limited, that is, it is only applicable to networks that extract fewer features. The above-mentioned privacy calculation method based on the similarity of the Siamese network based on the decision layer of the cosine distance can effectively overcome the above-mentioned shortcomings.

[0056] In an exemplary embodiment, determining the similarity of private data between different target clients according to the output data includes: normalizing the output data corresponding to the different target clients to obtain data vectors corresponding to the output data, wherein the normalization is determined in the following manner: in, Output data corresponding to different target clients, is the data vector, For data pairs corresponding to different target clients, is parameter information of the target branch structure corresponding to different target clients in the trained target network; when the different target clients share privacy data, the vector sum corresponding to the data vector is calculated, and the vector sum corresponding to the different target clients is synchronized between the different target clients; the cosine distance between the current target client and the other target clients calculated by the different target clients based on the vector sum is determined; the similarity value corresponding to the cosine distance is compared with the identification value corresponding to the similarity identification; when the similarity value approaches the minimum value in the identification value, it is determined that the privacy data between the current target client and the other target clients are similar, and a first similarity is obtained; wherein the first similarity is used to indicate that when the similarity value approaches the maximum value in the identification value, it is determined that the privacy data between the current target client and the other target clients are not similar, and a second similarity is obtained.

[0057] Optionally, assume that user A owns the data User B owns the data Follow these steps:

[0058] Step 1: Users A and B standardize their data. A calculates B is calculated

[0059] Step 2: Users A and B share secrets through multiplication to achieve v′ 1,j ·v′ 2,j The secret sharing (v′ 1,j As x,v′ in the multiplication secret sharing step 1,j as y in the multiplication secret sharing step). A obtains the secret sharing value Δ1z j , B obtains the secret shared value Δ2z j .

[0060] Optionally, the above multiplication secret sharing can be implemented by the following steps:

[0061] Assume that participant P1 (equivalent to user A in the above embodiment) owns data x, and participant P2 (equivalent to user B in the above embodiment) owns data y. If x is expressed in N-ary form as x=x s-1 …x0.x -1 …x -t , that is Integers have s digits and decimals have t digits. y can also be expressed in N-base form y=y s-1 …y0.y -1 …y -t . Multiplicative secret sharing can be achieved using 1-out-of-N OT.

[0062] Specifically, when i=-t, ..., s-1, the following methods are used for calculation: 1. P2 generates (m i,0 ,…,m i,N-1 ), where m i,0 is a random number, m i,j =N i jy-m i,0 , where j = 1, ..., N-1. 2. P1 is obtained using 1-out-of-N OT After completing the above calculations: 3. P1 calculation P2 calculation Based on the above calculation, it is easy to see that Δ1z+Δ2z=x·y. That is, to obtain the value of x·y, we only need to sum up the values ​​of Δ1z and Δ2z, without revealing the values ​​of x and y.

[0063] It should be noted that oblivious transfer (OT) is one of the most basic protocols for multi-party secure computing. OT can be used to construct schemes such as obfuscated circuits and zero-knowledge proof protocols. 1-out-of-N OT protocol. It is used to solve the following problem: Alice has N values ​​v0, ..., v N-1 , Bob wants to know which v σ ,σ∈{0,…,N-1}, by executing the OT protocol, Bob can obtain v σ , but cannot get the value of v i , i≠σ. Alice does not know which value Bob obtained, that is, Alice does not know the value of σ.

[0064] Specifically, in the application, 1-out-of-N OT can be implemented as follows: Preparation phase. The protocol is in a group with a large prime number q. The above operation (that is, the operation results in this protocol are all the results under the modulo q meaning), select the group A primitive root g is chosen. A random oracle function H (e.g. SHA-1) is chosen. Parameters q, g, H are shared by Alice and Bob. Initialization phase: Alice chooses N-1 random numbers C1, C2, …, C N-1 . Then choose a random number r and calculate g r , then C1, C2, ..., C N-1 , g r Sent to Bob. Alice precomputes (C1) r , (C2) r ,…,(C N-1 ) r (Due to the difficulty of discrete logarithms, Bob cannot obtain C1, C2, ..., C N-1 The online calculation phase includes: a. Bob selects a random number k and sets: Then PK0 is sent to Alice. (Alice cannot obtain the value of k). b. Alice calculates (PK0) r , then calculate (PK i ) r =(C i / PK0) r , 1≤i≤N-1. Then select a random string R (the R here should be long enough to ensure that the hash values ​​corresponding to two different data are different) for each M i , 0≤i≤N-1 for encryption Then send the encrypted result and R to Bob. c. Bob can calculate (PK σ ) r =(C σ / PK0) r =(g k ) r =(g r ) k , then use H((PK σ ) r , R, σ) decrypted to get M σ .

[0065] Step 3: Users A and B calculate the sum of their secret shared values ​​and send them to each other. And send it to B, B calculates And send it to A.

[0066] Step 4: Users A and B calculate the cosine distance between them respectively. The cosine distance is

[0067] Optional, If the value is close to 0, it means that the similarity between the two is high; if The value is close to 2, indicating that the similarity between the two is low.

[0068] In summary, through the above implementation method, the cosine distance is used to represent the objective function of the neural network, and the privacy calculation of the cosine distance is combined in the discrimination stage to realize the privacy calculation of user similarity. On the basis of improving the efficiency of determining privacy data, information leakage is reduced, and according to the actual needs of different target clients, the combination of branch structures is flexibly adjusted, thereby improving the recognition efficiency of the similarity of privacy data between different clients.

[0069] In an exemplary embodiment, after determining the similarity of privacy data between different target clients based on the output data, it includes: recording the similarity of privacy data between the different target clients; and sending prompt information to the management object of the server based on the similarity, wherein the prompt information is used to indicate the client information in the server that needs to perform the same privacy data management.

[0070] Through the above implementation, the prompt information can be used to enable the operation object of the management server to uniformly manage different clients with the same private data, further improving the security of private data management.

[0071] Obviously, the above-described embodiments are only embodiments of a part of the present invention, rather than all embodiments. In order to better understand the above method, the above process is described below in conjunction with embodiments, but it is not intended to limit the technical solutions of the embodiments of the present invention, specifically:

[0072] Based on the defects existing in the above-mentioned related technologies, the optional embodiments of the present application propose a privacy calculation method based on Siamese network similarity and a privacy calculation method based on pseudo-Siamese network similarity. First, the privacy calculation of cosine distance is realized using multiplication secret sharing. Then, in order to perform privacy calculation of Siamese network, the calculation of cosine distance constitutes the decision layer of Siamese network, wherein the Siamese network is composed of two completely identical network branches, and the parameters are shared between the two branches, and the network is trained on the server side using training data on the basis of the corresponding objective function. After the training is completed, the server sends the network parameters to the client that needs to compare the similarity, and then the two clients respectively bring the data into the branch to obtain the output of the corresponding branch, and finally the privacy calculation of the cosine distance output by these two branches can be used to realize the privacy calculation of user similarity.

[0073] It should be noted that the privacy calculation process based on the similarity of the pseudo-Siamese network is basically the same as the privacy calculation process based on the similarity of the Siamese network. The difference is that the two branches in the pseudo-Siamese network have different network structures and parameters.

[0074] As an optional implementation, the specific steps of the privacy calculation method based on the similarity of the Siamese network are as follows:

[0075] Figure 3 1 is a schematic diagram of the structure of the Siamese network according to an embodiment of the present application (I), wherein, since network branch 1 and network branch 2 have the same network architecture and parameters, the decision layer is the cosine distance between the outputs of the two branches. The loss function uses a square loss function; each branch takes one of the data pairs as input. After completing the above settings, the above Siamese network is adjusted as follows Figure 4 The network structure shown, Figure 4 This is a schematic diagram of the structure of a Siamese network according to an embodiment of the present application (II).

[0076] Optionally, the data flow of the adjusted network is as follows: the network is trained using the stochastic gradient descent method, assuming that the model parameters obtained by training are After training is completed, the server will send the network branch structure f and model parameters Send to client A and client B, and Substitute this into the above privacy calculation cosine distance process and calculate Value, if If the value is close to 0, it means that the similarity between the two is high; if The value is close to 2, indicating that the similarity between the two is low.

[0077] It should be noted that, generally speaking, the above network operation is relatively simple and has high flexibility. After the server training is completed, it only needs to send the same network and parameters to each user who needs to calculate the similarity. This network is suitable for situations where a large number of users need to compare the similarity between each other. However, it also has some problems. If only a small number of users need to compare the similarity, and the server may not want the user to fully know the parameter settings in the network. In particular, when the server plays the role of one of the users (such as user A), it does not want other users to fully understand the structure and parameters of the network, for example, when the user retrieves similar pictures, similar texts and other information on the server. In order to solve the above problems, the optional implementation method of the present application also proposes a form of using a pseudo-Siamese network. In the network structure, different architectures can be used, and parameters are not shared. Of course, due to the completely different architecture, this network is generally used in situations where the two branches have input data of different dimensions, for example: one branch's input is a picture, and the other branch's input is a text description; or one branch's input is a whole picture, and the other branch's input is a fragment of some pictures; or one branch's input is personal information collected on website A, and the other branch's input is personal information collected on website B, and the indicators collected by the two are inconsistent. In this case, the dimensions of the input data of the two branches may be different, but the parameter dimensions of the outputs of the two branches must be set to the same.

[0078] As an optional implementation, the specific steps of the privacy calculation method based on the similarity of the pseudo-Siamese network are as follows:

[0079] Step 1: The server builds a neural network and gives the corresponding objective function. There are two branches in this network (represented by branch 1 and branch 2 respectively), which are composed of different architectures and model parameters. Each branch takes one of the data pairs as input, and the decision layer of the network is the cosine distance between the outputs of the two branches (this requires that the outputs of the two branches have the same dimension). The loss function uses the square loss function. Figure 5 is a schematic diagram of the structure of a pseudo-Siamese network according to an embodiment of the present application (I). Wherein, network branch 1 and network branch 2 are respectively expressed as It indicates that, is the input parameter of network branch 1, is the model parameter data of network branch 1, is the output parameter of network branch 1; is the input parameter of network branch 2, is the model parameter data of network branch 2, is the output parameter of network branch 2. Since the square loss function is used and the scaling of the vector size does not affect the calculation of the cosine distance, it is necessary to impose certain restrictions on the model parameters. In order to facilitate the calculation of the cosine distance, the model parameter vector size is fixed, so the objective function can be expressed as:

[0080] Among them, s1 and s2 are the squares of the sizes of the two branch model parameter vectors set by the user. For example, s1 can be taken as The dimension of m2 is The dimension of .

[0081] Using the Lagrange multiplier method, the above objective function can be transformed into:

[0082]

[0083] That is, the goal of function calculation is to find the appropriate λ1,λ2 make the function The minimum obtained These are the model parameters required for the two branches.

[0084] Step 2: The server uses the data pairs and the corresponding similarity labels to train the Siamese network. After the training is completed, the relevant network branch structure and parameters are sent to client A and client B. Optionally, the network can be trained using the stochastic gradient descent method. Assume that the model parameters obtained by training are After training is completed, the server will send the network branch structure f1 and model parameters Send to client A, network branch structure f2 and model parameters Send to client B. In addition, if the server plays the role of client A, it retains the network branch structure f1 and model parameters Only the network branch structure f2 and model parameters Just send it to client B.

[0085] Step 3: Client A and client B each bring their own data into the network branch to calculate the corresponding output. For example, suppose user A and user B calculate and

[0086] Step 4: Client A and client B calculate the cosine distance between the outputs of their network branches to obtain the similarity between them. Figure 6 is a schematic diagram of the structure of a pseudo Siamese network according to an embodiment of the present application (II), and Bring it into the process of calculating the cosine distance of privacy, and get the similarity between client A and client B. And if the calculation is Value, if If the value is close to 0, it means that the similarity between the two is high; if The value is close to 2, indicating that the similarity between the two is low.

[0087] In summary, through the above implementation methods, a privacy calculation method for user similarity based on Siamese network is proposed, which can be applied to situations where a large number of similarity comparisons between users are required, and a privacy calculation method for user similarity based on pseudo-Siamese network is proposed, which can be applied to scenarios with higher privacy protection requirements or situations where users retrieve similar information privately on the server. In these two methods, the privacy calculation of cosine similarity is applied to Siamese network and pseudo-Siamese network, and the corresponding objective function is given, thereby realizing the privacy calculation of user data similarity, so that when the user input data has different dimensions, the judgment of privacy data similarity can also be quickly realized.

[0088] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0089] In this embodiment, a device for determining the similarity of privacy data is also provided, which is used to implement the above embodiments and preferred implementation modes, and will not be repeated here. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0090] Figure 7 is a schematic diagram of the structure of a device for determining similarity of privacy data according to an embodiment of the present application. Figure 7 As shown, it is applied to a server, wherein the server is pre-set with a plurality of data pairs with similar identifiers, the similar identifiers are used to indicate the degree of similarity between different data in the data pairs, and the server is connected to a plurality of clients. The device includes:

[0091] A configuration module 72 is used to configure a target branch structure for data processing to a target client through the server,

[0092] The target client is a client among the multiple clients on which data similarity determination is to be performed;

[0093] An acquisition module 74 is used to acquire output data obtained by the target client performing data processing using the target branch structure;

[0094] The determination module 76 is used to determine the similarity of the privacy data between different target clients according to the output data.

[0095] Through the above-mentioned device, the target network is trained by the data existing on the server to obtain a target branch structure that can be configured with different target clients for data processing, and then by assigning corresponding target branch structures to different target clients and calculating the data similarity of the output data finally output by different branch structures, the similarity of the privacy data between different target clients is determined, thereby improving the efficiency of determining the similarity of the privacy data between different target clients, and by flexibly combining the network with the cosine distance to calculate the similarity, the accuracy of the subsequent determination of the privacy data is greatly improved, and the overall consumption of server resources is less. Therefore, the technical problems in the related technology that the similarity privacy calculation of the privacy data corresponding to different clients in the server requires more server resources, high calculation cost, and low calculation efficiency can be solved, thereby achieving the technical effect of reducing the calculation cost of calculating the similarity of the privacy data between different target clients and effectively reducing the resource consumption of the server in performing privacy calculations.

[0096] In an exemplary embodiment, the above-mentioned device also includes: a training module, which is used to determine the target number of target clients to be subjected to data similarity judgment before configuring the target branch structure for data processing to the target client through the server; establish an initial network in the server based on the target number; wherein the initial network includes: a branch structure of the target number; and train the initial network using the data pairs and the similarity identifiers to obtain a target network.

[0097] In an exemplary embodiment, the training module further includes: an adding unit for training the initial network using the data pair and the similarity identifier, and before obtaining the target network, when the parameter information of different branch structures in the target network is the same, adding a first function for limiting the use of parameter information to the target network, wherein the first function is determined by: The S is the square of the parameter vector size of the pre-set sub-branch structure; when the target network has two sub-branch structures, is the input parameter of the first sub-branch structure, is the input parameter of the second sub-branch structure, is the parameter data of the initial parameter information of the branch structure, z i is a value corresponding to the initial similarity identifier, wherein λ is a preset parameter of a pre-set sub-branch structure; when the parameter information of different branch structures in the target network is different, a second function for limiting the use of parameter information is added to the target network, wherein the second function is determined by the following method:

[0098] The s1 is the square of the parameter vector size of the preset first sub-branch structure, and s2 is the square of the parameter vector size of the preset second sub-branch structure; when the target network has two sub-branch structures, is the input parameter of the first sub-branch structure, is the input parameter of the second sub-branch structure, is the parameter data of the initial parameter information of the first sub-branch structure, is the parameter data of the initial parameter information of the second sub-branch structure, z i is the numerical value corresponding to the initial similarity mark; λ1 is the preset parameter of the first sub-branch structure, and λ2 is the preset parameter of the second sub-branch structure.

[0099] In an exemplary embodiment, the above-mentioned configuration module is also used to obtain structural information of different branch structures in the target network that has completed training in the server and parameter information of the different branch structures; determine the similarity determination requirements corresponding to the target client; and configure the target branch structure for data processing to the target client based on the similarity determination requirements, the structural information, and the parameter information.

[0100] In an exemplary embodiment, the above-mentioned configuration module is also used to determine, when the similarity determination requirement is partially confidential, a first type of branch structure that does not share the same structure and the same parameters is configured for the target client, and based on the first type of branch structure, first sub-structure information and first sub-parameter information are selected from the structure information and the parameter information for combination to obtain a first target branch structure; when the similarity determination requirement is not confidential, determine a second type of branch structure that shares the same structure and the same parameters is configured for the target client, and based on the second type of branch structure, second sub-structure information and second sub-parameter information are selected from the structure information and the parameter information for combination to obtain a second target branch structure.

[0101] In an exemplary embodiment, the determination module is further used to standardize the output data corresponding to the different target clients to obtain data vectors corresponding to the output data, wherein the standardization is determined in the following manner: in, Output data corresponding to different target clients, is the data vector, For data pairs corresponding to different target clients, is parameter information of the target branch structure corresponding to different target clients in the trained target network; when the different target clients share privacy data, the vector sum corresponding to the data vector is calculated, and the vector sum corresponding to the different target clients is synchronized between the different target clients; the cosine distance between the current target client and the other target clients calculated by the different target clients based on the vector sum is determined; the similarity value corresponding to the cosine distance is compared with the identification value corresponding to the similarity identification; when the similarity value approaches the minimum value in the identification value, it is determined that the privacy data between the current target client and the other target clients are similar, and a first similarity is obtained; wherein the first similarity is used to indicate that when the similarity value approaches the maximum value in the identification value, it is determined that the privacy data between the current target client and the other target clients are not similar, and a second similarity is obtained.

[0102] In an exemplary embodiment, the above-mentioned device also includes: a prompt module, which is used to determine the similarity of privacy data between different target clients based on the output data, and then record the similarity of privacy data between the different target clients; based on the similarity, send prompt information to the management object of the server, wherein the prompt information is used to indicate the client information in the server that needs to perform the same privacy data management.

[0103] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0104] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0105] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0106] Optionally, in this embodiment, the above-mentioned computer program may be configured to execute steps corresponding to the method in the above-mentioned embodiment through the computer program.

[0107] The embodiment of the present application also provides an electronic device, such as Figure 8 As shown, the electronic device includes a memory 702 and a processor 704. The memory 702 stores a computer program, and the processor 704 is configured to execute the steps in any of the above method embodiments through the computer program.

[0108] Optionally, in this embodiment, the processor 704 may be configured to perform the following steps through a computer program:

[0109] S1, configuring a target branch structure for data processing to a target client through the server, wherein the target client is a client among the multiple clients on which data similarity judgment is to be performed;

[0110] S2, obtaining output data obtained by the target client through data processing using the target branch structure;

[0111] S3: Determine the similarity of the privacy data between different target clients according to the output data.

[0112] Optionally, in this embodiment, the processor 704 may also be configured to execute the above steps through a computer program.

[0113] Alternatively, a person skilled in the art may understand that: Figure 8 The structure shown is for illustration only. Figure 8 The structure of the electronic device is not limited. For example, the electronic device may also include Figure 8 More or fewer components (such as network interfaces, etc.) as shown in, or with Figure 8 Different configurations are shown.

[0114] Among them, the memory 702 can be used to store software programs and modules, such as the program instructions / modules corresponding to the signal sending method and routing nodes in the embodiments of the present application. The processor 704 executes various functional applications and data processing by running the software programs and modules stored in the memory 702, that is, realizing the above-mentioned signal sending method. The memory 702 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 702 may further include a memory remotely located relative to the processor 704, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Among them, the memory 702 can be specifically, but not limited to, used to store information such as system configuration files. As an example, such as Figure 8 As shown, the memory 702 may include but is not limited to all modules in the above-mentioned device for determining similarity of private data. In addition, it may also include but is not limited to other module units in the above-mentioned device for determining similarity of private data, which will not be described in detail in this example.

[0115] Optionally, the transmission device 706 is used to receive or send data via a network. Specific examples of the network may include a wired network and a wireless network. In one example, the transmission device 706 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 706 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0116] In addition, the electronic device further includes: a display 708; and a connection bus 710, which is used to connect various module components in the electronic device.

[0117] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.

[0118] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0119] The embodiments of the present application also provide a computer program, which includes computer instructions stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps of any one of the above method embodiments.

[0120] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0121] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0122] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A method for determining similarity of private data, characterized in that: Applied to a server, wherein the server is pre-set with a plurality of data pairs having similar identifiers, the similar identifiers being used to indicate the degree of similarity between different data in the data pairs, and the server is connected to a plurality of clients, including: configuring, by the server, a target branch structure for data processing to a target client, wherein the target client is a client among the multiple clients on which data similarity judgment is to be performed; Obtaining output data obtained by the target client performing data processing using the target branch structure; Determine the similarity of the privacy data between different target clients according to the output data.

2. The method according to claim 1, characterized in that Before configuring the target branch structure for data processing to the target client through the server, the method further includes: Determine the target number of target clients for which data similarity judgment is to be performed; An initial network is established in the server based on the target number; wherein the initial network includes: a branch structure of the target number; The initial network is trained using the data pairs and the similarity identifiers to obtain a target network.

3. The method according to claim 1, characterized in that: Before training the initial network using the data pairs and the similarity identifiers to obtain the target network, the method further includes: When the parameter information of different branch structures in the target network is the same, a first function for limiting the use of the parameter information is added to the target network, wherein the first function is determined in the following manner: The S is the square of the parameter vector size of the pre-set sub-branch structure; when the target network has two sub-branch structures, is the input parameter of the first sub-branch structure, is the input parameter of the second sub-branch structure, is the parameter data of the initial parameter information of the branch structure, z i is the value corresponding to the initial similarity mark, where λ is a preset parameter of the pre-set sub-branch structure; When the parameter information of different branch structures in the target network is different, a second function for limiting the use of parameter information is added to the target network, wherein the second function is determined in the following manner: The s1 is the square of the parameter vector size of the preset first sub-branch structure, and s2 is the square of the parameter vector size of the preset second sub-branch structure; when the target network has two sub-branch structures, is the input parameter of the first sub-branch structure, is the input parameter of the second sub-branch structure, is the parameter data of the initial parameter information of the first sub-branch structure, is the parameter data of the initial parameter information of the second sub-branch structure, z i is the numerical value corresponding to the initial similarity mark; λ1 is the preset parameter of the first sub-branch structure, and λ2 is the preset parameter of the second sub-branch structure.

4. The method according to claim 1, characterized in that: The target branch structure for data processing configured by the server to the target client includes: Acquire structural information of different branch structures in the target network that has completed training in the server and parameter information of the different branch structures; Determine similarity requirements corresponding to the target client; A target branch structure for data processing is configured to a target client based on the similarity determination requirement, the structure information, and the parameter information.

5. The method according to claim 4, characterized in that Configuring a target branch structure for data processing to a target client based on the similarity determination requirement, the structure information, and the parameter information includes: In the case where the similarity determination requirement is partially confidential, determining to configure a first type of branch structure that does not share the same structure and the same parameters for the target client, and selecting first sub-structure information and first sub-parameter information from the structure information and the parameter information based on the first type of branch structure to combine and obtain a first target branch structure; When the similarity determination requirement is not confidential, a second type of branch structure sharing the same structure and the same parameters is determined to be configured for the target client, and based on the second type of branch structure, second sub-structure information and second sub-parameter information are selected from the structure information and the parameter information for combination to obtain a second target branch structure.

6. The method according to claim 1, characterized in that Determining the similarity of private data between different target clients according to the output data includes: The output data corresponding to the different target clients are standardized to obtain data vectors corresponding to the output data, wherein the standardization is determined in the following manner: in, Output data corresponding to different target clients, is the data vector, For data pairs corresponding to different target clients, The parameter information of the target branch structure corresponding to different target clients in the trained target network; In the case where the different target clients share private data, calculating the vector sum corresponding to the data vector, and synchronizing the vector sum corresponding to the different target clients among the different target clients; Determine the different target clients based on the vector and the calculated cosine distance between the current target client and other target clients; Compare the similarity value corresponding to the cosine distance with the identification value corresponding to the similar identification; When the similarity value approaches the minimum value of the identification value, it is determined that the privacy data between the current target client and other target clients are similar, and a first similarity is obtained; wherein the first similarity is used to indicate the When the similarity value approaches the maximum value of the identification values, it is determined that there is no similarity between the privacy data of the current target client and other target clients, and a second similarity is obtained.

7. The method according to claim 1, characterized in that After determining the similarity of the privacy data between different target clients according to the output data, the method further includes: Recording the similarity of privacy data between different target clients; Prompt information is sent to the management object of the server according to the similar situation, wherein the prompt information is used to indicate client information in the server that needs to perform the same privacy data management.

8. A device for determining similarity of private data, characterized in that: Applied to a server, wherein the server is pre-set with a plurality of data pairs having similar identifiers, the similar identifiers being used to indicate the degree of similarity between different data in the data pairs, and the server is connected to a plurality of clients, including: A configuration module, configured to configure a target branch structure for data processing to a target client through the server, wherein the target client is a client among the multiple clients on which data similarity judgment is to be performed; An acquisition module, used for acquiring output data obtained by the target client performing data processing using the target branch structure; The determination module is used to determine the similarity of the privacy data between different target clients according to the output data.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 7 when executed by a processor.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 7 are implemented.