Safety prediction method, system, client device and server for personnel mobility

By using secret sharing and secure interaction protocols in personnel mobility prediction, we handle secret sharing of trajectory data and model parameters, we solve the problems of insecurity in the prior art, large communication overhead and insufficient privacy protection, and achieve efficient and secure Predict results.

CN114679316BActive Publication Date: 2025-02-11NAT UNIV OF DEFENSE TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210299560.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-25
Publication Date
2025-02-11
Estimated Expiration
2042-03-25

AI Technical Summary

Technical Problem

The existing personnel mobility prediction methods are not safe and effective enough, and have a large communication overhead, and are not effectively combined with privacy protection, especially in the calculation of activation function, which has problems with inefficiency and accuracy.

Method used

By obtaining the trajectory data of the user to which the client belongs, randomly divide it into secret shared data, and using the secure interaction protocol to interact with the server side, performing pre-trained inference of the personnel mobility prediction model, combining secret sharing and the use of random numbers, ensuring data privacy and computing security.

Benefits of technology

It realizes the reduction of communication overhead while ensuring the accuracy of prediction, and effectively protecting user data privacy, improving the security and efficiency of personnel mobility prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114679316B_ABST
    Figure CN114679316B_ABST
Patent Text Reader

Abstract

The present invention provides a method, system, client device and server for secure prediction of personnel mobility, the method comprising: obtaining trajectory data of a user belonging to a client, and randomly dividing it into first secret shared data according to the trajectory data; applying a secure interactive protocol to interact with a server to perform inference on a pre-trained personnel mobility prediction model according to the trajectory data, model parameters of a personnel mobility prediction model transmitted by a server, and a first random number set generated by a trusted third party, and obtaining a first inference result; receiving a second inference result obtained by interactive inference of the personnel mobility prediction model by the server according to the first secret shared data, model parameters and a second random number set generated by a trusted third party, and combining the first inference result and the second inference result to obtain a prediction result. The present invention can achieve secure and effective prediction, while ensuring accuracy, reducing communication overhead.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer technology, and specifically relates to a method, system, client device and server for safety prediction of personnel mobility. Background Art

[0002] With the widespread use of smart mobile devices (such as smartphones, watches, etc.) and their increasing data collection capabilities, people's mobility data is being collected in large quantities. Analyzing and utilizing the collected data, such as personnel mobility prediction, can better improve people's quality of life and has attracted special attention from academia and industry. Personnel mobility prediction refers to predicting the next location of people in an area where they are constantly moving. Its prediction results are of great significance in intelligent transportation, socioeconomic models of urban planning, resource management in mobile communications, personalized recommendation systems, mobile medical services, etc. For example, by predicting the next location that people tend to go to, the government can design better traffic planning and scheduling strategies to alleviate traffic congestion; taxi platforms can better predict user travel and provide better services; and even predict the next public safety location of criminals to prepare in advance, etc.

[0003] With the rapid development of computer technology and the deepening of neural network research, many companies provide users with widely used neural network prediction services. However, current neural network prediction services have the risk of privacy leakage. Existing neural network prediction services require users to provide their own sensitive information to service providers, or service providers store their unique neural networks on users' devices. Once the information is leaked, it will cause immeasurable losses to the property and privacy of users or service providers. In order to solve the above privacy protection problems, homomorphic encryption, secure multi-party computation and differential privacy are all commonly used technologies. Homomorphic encryption allows linear operations in neural networks to be performed directly on encrypted data, but the computational and storage overhead of homomorphic encryption is relatively large, so the efficiency is low. Differential privacy hides the characteristics of samples by adding perturbations to the data, but the problem is that it will affect the accuracy of the neural network. Secure multiparty computation (SMC) allows multiple participants to operate on data without actually sharing the input. The basic cryptographic protocols of SMC include oblivious transfer protocol (OT), garbled circuits (GC), secret sharing (SS), etc. The operations in neural networks mainly include linear operations and nonlinear activation function calculations. Nonlinear operations are often converted into linear operations by approximation or implemented using GC. Therefore, many machine learning privacy protection schemes are built by mixing multiple SMC basic cryptographic protocols. In the secure multi-party computing scheme based on secret sharing, each additional participant will increase the communication overhead and the risk of being attacked.

[0004] Currently, no one has combined personnel mobility prediction and privacy protection. Existing solutions either calculate the activation function through garbled circuits (GC) or convert nonlinear functions into linear functions in an approximate way. The former has low efficiency and reusability, while the latter has a certain impact on the accuracy of the neural network. Summary of the invention

[0005] The present invention provides a method, system, client device and server for safely predicting personnel mobility, so as to solve the problem that the existing personnel mobility prediction is not safe and effective enough and has a large communication overhead.

[0006] Based on the above-mentioned purpose, an embodiment of the present invention provides a secure prediction method for personnel mobility, including: obtaining trajectory data of a user belonging to a client, and randomly dividing it into first secret shared data according to the trajectory data; applying a secure interaction protocol to interact with the server to perform inference on a pre-trained personnel mobility prediction model based on the trajectory data, second secret shared data transmitted by the server, and a first random number set generated by a trusted third party, to obtain a first inference result, wherein the second secret shared data is obtained by the server randomly dividing the model parameters of the personnel mobility prediction model; receiving the second inference result obtained by the server performing interactive inference on the personnel mobility prediction model based on the first secret shared data, the model parameters, and a second random number set generated by a trusted third party, and obtaining a prediction result in combination with the first inference result and the second inference result.

[0007] Optionally, the secure interaction protocol includes: at least one of a multiplication-to-addition conversion protocol, a secure sigmoid protocol, a secure tanh protocol, a secure softmax protocol, and a secure re-addition protocol.

[0008] Optionally, the trajectory data includes current trajectory data and historical trajectory data, and the reasoning of the pre-trained personnel mobility prediction model based on the trajectory data, the second secret shared data transmitted by the server, and the first random number set using a secure interaction protocol to interact with the server to obtain a first reasoning result includes: reasoning of a gated recurrent unit based on the current trajectory data, the second secret shared data, and the first random number set using a secure interaction protocol to interact with the server to obtain a first gated output, and at the same time obtaining a second gated output on the server; reasoning of a historical attention module based on the historical trajectory data, the first gated output, the second gated output of the server-side secret sharing, the second secret shared data, and the first random number set using a secure interaction protocol to interact with the server to obtain a first normalized output, and at the same time obtaining a second normalized output on the server; processing of a fully connected layer based on the first gated output, the first normalized output, the second gated output and the second normalized output of the server-side secret sharing, the second secret shared data, and the first random number set using a secure interaction protocol to interact with the server to obtain the first reasoning result.

[0009] Optionally, the gated recurrent unit includes: a reset gate, an update gate, a candidate state output, and an update mode, which respectively satisfy the following relationships:

[0010] r t =σ(W ir *x t +bir +W hr *h t-1 +b hr ),

[0011] z t =σ(W iz *x t +b iz +W hz *h t-1 +b hz ),

[0012]

[0013]

[0014] Among them, W ir , b ir , W hr , b hr , W iz , b iz , W hz , b hz , W in , b in , W hn , b hn is the model parameter, x t is the input vector of the tth time step, h t-1 The information saved for the previous time step t-1, r t is the output of the reset gate at the tth time step, z t is the output of the update gate at the tth time step, n t represents the new memory content at the tth time step, h t Information saved for the tth time step.

[0015] Based on the same inventive concept, an embodiment of the present invention also proposes a method for securely predicting personnel mobility, comprising: obtaining model parameters of a pre-trained personnel mobility prediction model, and randomly dividing them into second secret shared data according to the model parameters; applying a secure interactive protocol to interact with the client to perform inference on the pre-trained personnel mobility prediction model according to the model parameters, the first secret shared data transmitted by the client, and a second random number set generated by a trusted third party, to obtain a second inference result, wherein the first secret shared data is obtained by the client randomly dividing the trajectory data of the user belonging to the client; transmitting the second inference result to the client, so that the client obtains a prediction result by combining the first inference result obtained in the interactive reasoning process with the second inference result.

[0016] Optionally, the first secret shared data includes current trajectory shared data and historical trajectory shared data, and the inference of the pre-trained personnel mobility prediction model is performed by applying a secure interaction protocol to interact with the client according to the model parameters, the first secret shared data transmitted by the client, and the second random number set generated by a trusted third party to obtain a second inference result, including: performing inference of a gated recurrent unit according to the current trajectory shared data, the model parameters, and the second random number set by applying a secure interaction protocol to interact with the client to obtain a second gated output, and obtaining a first gated output at the client; performing inference of a historical attention module according to the historical trajectory shared data, the second gated output, the first gated output secretly shared by the client, the model parameters, and the second random number set by applying a secure interaction protocol to interact with the client to obtain a second normalized output, and obtaining a first normalized output at the client; performing fully connected layer processing according to the second gated output, the second normalized output, the first gated output secretly shared by the client and the first normalized output, the model parameters, and the second random number set by applying a secure interaction protocol to interact with the client to obtain the second inference result.

[0017] Based on the same inventive concept, an embodiment of the present invention also proposes a client device, including: a first data acquisition unit, used to acquire trajectory data of a user belonging to the client, and randomly divide it into first secret shared data according to the trajectory data; a first prediction unit, used to interact with the server side using a secure interactive protocol to perform inference on a pre-trained personnel mobility prediction model based on the trajectory data, the second secret shared data transmitted by the server side, and a first random number set generated by a trusted third party, to obtain a first inference result, wherein the second secret shared data is obtained by the server side randomly dividing the model parameters of the personnel mobility prediction model; a result acquisition unit, used to receive the second inference result obtained by the server side interactively inferring the personnel mobility prediction model based on the first secret shared data, the model parameters, and a second random number set generated by a trusted third party, and obtain a prediction result in combination with the first inference result and the second inference result.

[0018] Based on the same inventive concept, an embodiment of the present invention further proposes a server, comprising: a second data acquisition unit, used to acquire model parameters of a pre-trained personnel mobility prediction model, and randomly divide them into second secret shared data according to the model parameters; a second prediction unit, used to interact with the client using a secure interactive protocol to perform inference on the pre-trained personnel mobility prediction model according to the model parameters, the first secret shared data transmitted by the client, and a second random number set generated by a trusted third party, to obtain a second inference result, wherein the first secret shared data is obtained by the client randomly dividing the trajectory data of the user belonging to the client; a data sending unit, used to transmit the second inference result to the client, so that the client combines the first inference result obtained in the interactive reasoning process with the second inference result to obtain a prediction result.

[0019] Based on the same inventive concept, an embodiment of the present invention also proposes a safety prediction system for personnel mobility, including: a trusted third party, the aforementioned client device and the aforementioned server.

[0020] Based on the same inventive concept, an embodiment of the present invention further proposes an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the methods described above when executing the program.

[0021] The technical effect of the present invention is that, as can be seen from the above description, an embodiment of the present invention provides a method, system, client device and server for secure prediction of personnel mobility, which obtains trajectory data of a user belonging to the client, and randomly divides it into first secret shared data according to the trajectory data; applies a secure interactive protocol to interact with the server to perform inference on a pre-trained personnel mobility prediction model based on the trajectory data, the second secret shared data transmitted by the server, and a first random number set generated by a trusted third party, to obtain a first inference result, wherein the second secret shared data is obtained by the server randomly dividing the model parameters of the personnel mobility prediction model; receives the second inference result obtained by the server interactively inferring the personnel mobility prediction model based on the first secret shared data, the model parameters and the second random number set generated by a trusted third party, and obtains a prediction result in combination with the first inference result and the second inference result, thereby achieving safe and effective prediction, while ensuring accuracy, reducing communication overhead. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0023] Figure 1 It is a flowchart of a method for predicting the safety of personnel mobility in an embodiment of the present invention;

[0024] Figure 2 It is a structural schematic diagram of a personnel mobility prediction model in an embodiment of the present invention;

[0025] Figure 3 for Figure 1 A schematic diagram of the method of step S12 in FIG.

[0026] Figure 4 It is a schematic diagram of the accuracy of top1 and top5 under multiple different schemes in an embodiment of the present invention;

[0027] Figure 5 A schematic diagram of the total running time of different solutions running on the client and server in an embodiment of the present invention;

[0028] Figure 6 It is a schematic diagram of the time consumption of each sub-process of the client in the embodiment of the present invention;

[0029] Figure 7 It is a schematic diagram of the time consumption of each sub-process on the server side in an embodiment of the present invention;

[0030] Figure 8 It is a schematic diagram of the overall running time of different schemes in the embodiments of the present invention;

[0031] Fig. 9 is a schematic diagram of the structure of a client device in an embodiment of the present invention;

[0032] Fig.10 A schematic flow chart of another method for predicting the safety of personnel mobility in an embodiment of the present invention;

[0033] Fig.11 is a schematic diagram of the structure of a server in an embodiment of the present invention;

[0034] Fig.12 Schematic diagram of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION

[0035] In order to make the objectives, technical solutions and advantages of the present disclosure more clearly understood, the present disclosure is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.

[0036] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present invention should be understood by people with ordinary skills in the field to which the present disclosure belongs. The "first", "second" and similar words used in the embodiments of the present invention do not represent any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0037] The embodiment of the present invention also provides a safety prediction method for personnel mobility. The safety prediction method of the embodiment of the present invention is applied to a client device. The client device can be a smart mobile device such as a smart phone, a watch, a mobile terminal, etc. Figure 1 As shown, the safe prediction methods for personnel mobility include:

[0038] Step S11: Acquire the trajectory data of the user to which the client belongs, and randomly divide the trajectory data into first secret shared data.

[0039] In an embodiment of the present invention, the trajectory data of the user to which the client belongs includes current trajectory data and historical trajectory data. Each trajectory data includes location, time and user ID. The trajectory data that needs to be secretly shared with the server is randomly divided into first secret sharing data at the client. Therefore, the first secret sharing data includes current trajectory sharing data and historical trajectory sharing data. In step S11, the trajectory data also needs to be preprocessed for normalization. The specific preprocessing method is the same as the data preprocessing method of the existing neural network model, which will not be repeated here.

[0040] Step S12: Apply a secure interaction protocol to interact with the server side according to the trajectory data, the second secret shared data transmitted by the server side, and the first random number set generated by a trusted third party to perform inference on the pre-trained personnel mobility prediction model to obtain a first inference result, wherein the second secret shared data is obtained by the server side randomly dividing the model parameters of the personnel mobility prediction model.

[0041] In the embodiment of the present invention, before step S12, the personnel mobility prediction model has been pre-trained on the server side. The first set of random numbers is randomly generated by a trusted third party and transmitted to the client, and the trusted third party can randomly generate random numbers using a standard normal distribution or a uniform distribution.

[0042] The personnel mobility prediction model of the embodiment of the present invention applies the attention recursive model DeepMove, and its framework is as follows: Figure 2 As shown in the figure, the personnel mobility prediction model is divided into three stages: feature extraction and embedding, recursion and historical attention, and prediction. By default, the first stage is completed by the client. All trajectory data are first embedded by the multimodal embedding layer, which jointly embeds spatiotemporal features and personal features into dense representation to help model complex transitions. Dense representation can better capture precise semantic spatiotemporal relationships. Another advantage is that this dense representation is always low-dimensional, which is conducive to subsequent calculations.

[0043] The recursive and historical attention stage includes two parts: the recursive module and the historical attention module. The current trajectory data is processed by the recursive module to model the complex sequence information; the historical attention module processes the historical trajectory to extract the regularity of the movement. The recursive module uses the gated recurrent unit (GRU) as the basic recursive unit and inputs the current trajectory data containing spatiotemporal information to capture the complex sequence information or long-term dependencies contained in the current trajectory. The historical attention module is parallel to the recursive module to capture the multi-level periodicity of human movement. The historical attention module first uses the attention candidate generator to generate the law of user mobility based on the historical trajectory data containing spatiotemporal information; then the attention selector is used to match the hidden results of the recursive layer with the user's movement law. The results of the recursive module and the historical attention module are then spliced ​​as the input of the prediction stage. The prediction stage consists of several fully connected layers and an output layer to obtain the final prediction result. In the embodiment of the present invention, the attention candidate generator uses GRU as the basic unit; the attention selector adopts the dot product model of the attention mechanism.

[0044] In an embodiment of the present invention, the gated recurrent unit includes: a reset gate, an update gate, a candidate state output, and an update mode, which respectively satisfy the following relationships:

[0045] Reset gate: r t =σ(W ir *x t +b ir +W hr *h t-1 +b hr ),

[0046] Update gate: z t =σ(W iz *x t +b iz +W hz *h t-1 +b hz ),

[0047] Candidate status:

[0048] Update method:

[0049] Among them, W ir , b ir , W hr , b hr , W iz , b iz , W hz , b hz , W in , b in , W hn , b hn is the model parameter, x t is the input vector of the tth time step, h t-1 The information saved for the previous time step t-1, r t is the output of the reset gate at the tth time step, z t is the output of the update gate at the tth time step, n t represents the new memory content at the tth time step, h t is the information saved for the tth time step, Represents matrix dot product.

[0050] The calculation of the attention mechanism is mainly divided into two steps. The first step is to calculate the attention distribution on all input information, and the second step is to calculate the weighted average of the input information based on the attention distribution, satisfying the following relationship:

[0051]

[0052]

[0053] Among them, att(X, q)) is the weighted average result of the calculation, α n is the attention distribution, s(x n , q) is the attention scoring function, which generally includes additive model, dot product model, scaled dot product model and bilinear model. The embodiment of the present invention uses the dot product model for calculation, that is, 5(x n ,q)=x n T q.

[0054] The secure interaction protocol of the embodiment of the present invention includes: at least one of: a multiplication-to-addition conversion protocol, a secure sigmoid protocol, a secure tanh protocol, a secure softmax protocol, and a secure re-addition protocol. The secure interaction protocols are all executed between two parties, and the input of each party is their own private data or a secret shared value generated by calculation. After the protocol, a new secret shared value is generated. The random values ​​involved in the protocol process are all generated in advance by a third party, that is, they are executed offline during the initialization phase. Among them, <> represents additive secret sharing, [] represents multiplicative secret sharing, subscript 1 represents shared data on the client side, and subscript 2 represents shared data on the server side.

[0055] The main idea of ​​the multiplication-to-addition conversion protocol (mul_to_add) is that the two parties calculate the product of their data without knowing each other's data. Specifically, party A has x and party B has y. After the protocol, both parties obtain <xy>1 and <xy>2 respectively. Before running the protocol, party A has random numbers a and c1, and party B has random numbers b and c2; party A calculates p1=xa locally, and party B calculates p2=yb locally, and then the two parties exchange data p1 and p2; party A calculates <xy>1=c1+a*p2 locally, and party B calculates <xy>2=c2+b*p1+p1*p2 locally. The specific expression is as follows:

[0056] mul_to_add

[0057] A: x1, a, c1, B: x2, b, c2;

[0058] p1 = x1-a, p2 = x2-b;

[0059] The two parties exchange p1 and p2, and then calculate respectively:

[0060] Ans1=c1+a*p2,Ans2=c2+b*p1+p1*p2

[0061] Then ans1+ans2=x1*x2.

[0062] Verify correctness:

[0063] ans1+ans2=c1+a*p2+c2+b*p1+p1*p2

[0064] =c1+c2+a*(x2-b)+b*(x1-a)+(x2-b)*(x1-a)

[0065] =c1+c2+a*x2-a*b+b*x1-a*b+x1*x2+a*ba*x2-b*x1

[0066] =x1*x2.

[0067] The calculation formula of sigmoid in the embodiment of the present invention is: The x value is shared by the client and server additively, that is, x = <x> 1 + <x> 2. The formula can be transformed into:

[0068]

[0069] Thus, for the secure sigmoid protocol of the embodiment of the present invention, input: the client has <x>1, a, c1, and the server has <x>2, b, c2; output: the client and the server obtain [σ(x)]1 and [σ(x)]2 respectively, where σ(x) = [σ(x)]1·[σ(x)]2. The secure sigmoid protocol process is described as follows:

[0070] First, the server calculates λ2 and sends it to the client.

[0071] The client then calculates λ1 and sends it to the server.

[0072] The server then performs the calculation: The client performs the calculation:

[0073] Verify correctness:

[0074]

[0075] Among them, a, b, c1, c2 are generated offline by a trusted third party and sent to the client and server, satisfying: a·b=c1+c2. Both parties have a secret shared value of x.

[0076] The implementation of the secure tanh protocol in the embodiment of the present invention is mainly based on secure sigmoid. The calculation formula of Tanh in the embodiment of the present invention is:

[0077]

[0078] The secure tanh protocol of the embodiment of the present invention has the following inputs: the client has <x>1, a, c1, and the server has <x>2, b, c2; output: the client and the server obtain <tanh(x)>1 and <tanh(x)>2, respectively, where tanh(x)=<tanh(x)>1+<tanh(x)>2. The secure tanh protocol process is described as follows:

[0079] First, both parties call the secure sigmoid function, inputting 2*<x>1 and 2*<x>2 respectively, and obtain the outputs recorded as [y]1 and [y]2 respectively;

[0080] Then both parties call the mul_to_add function, input [y]1, [y]2, and get the output <z>1, <z>2 respectively;

[0081] The client then performs a calculation of <tanh(x)>1=2*<z>1, and the server performs a calculation of <tanh(x)>2=2*<z>2-1.

[0082] Verify correctness:

[0083] <tanh(x)>1+<tanh(x)>2=2*<z>1+2*<z>2-1

[0084] =2*(<z>1+<z>2)-1=2*[y]1*[y]2-1

[0085] =2*σ(2*<x>1+2*<x>2)-1=2*σ(2*x)-1=tanh(x).

[0086] The calculation formula of softmax in the embodiment of the present invention is:

[0087]

[0088] Among them, s(x n ,q) is the attention scoring function, s(x n ,q)=x n T q.

[0089] Thus, for the secure softmax protocol of the embodiment of the present invention, input: the client has [x]1 = {[x1]1, ..., [x N ]1}, the server has [x]2={[x1]2,...,[x N ]2}; Output: The client and server obtain <softmax(x)>1 and <softmax(x)>2 respectively. The secure softmax protocol process is described as follows:

[0090] First, the client selects a random number r and Execute the calculation [x i ′]1=r*[x i ]1,

[0091] Then Both parties input [x i ′]1,[x i]2, call mul_to_add function, and get the output <y i >1, <y i >2;

[0092] The client then performs the calculation Server-side calculations

[0093] Then both parties restore the denominator D = REC (<D>1, <D>2);

[0094] right The client performs the calculation Server-side calculations

[0095] Verify correctness:

[0096]

[0097] Through experiments, it is found that if the calculation is always performed according to the above security interaction protocols, some values ​​will exceed the maximum limit that the computer can represent, that is, the maximum value or the minimum value, and thus cannot be calculated, resulting in a sharp drop in calculation accuracy. Therefore, a secure re-add protocol (re_add) is designed. For the secure re-add protocol of the embodiment of the present invention, input: the client has <x>1, and the server has <x>2; output: the client and the server obtain <x′>1 and <x′>2 respectively. The secure re-add protocol process is described as follows:

[0098] First, the client selects a random number r, calculates mid=<x>1-r, and sends it to the server, then <x′>1=r; then the server calculates <x′>2=mid+<x>2.

[0099] Verify correctness: <x′>1+<x′>2=mid+<x>2+r=<x>1-r+<x>2+r.

[0100] Among them, the range of the random number r selected by the client is limited to between 0-1, because the data will be preprocessed before training the neural network. Data preprocessing can eliminate the correlation between different features, reduce the difficulty of training the neural network, and improve training efficiency. The commonly used method is normalization, that is, mapping the data to [0, 1[ or [-1, 1[, or mapping it to a standard normal distribution with a mean of 0 and a variance of 1. Because the data of the neural network often has scale invariance, a more ideal result can be obtained after data preprocessing. Although the calculation process of the embodiment of the present invention is the reasoning process of the neural network and does not involve the gradient problem of training, the parameters of the neural network are all trained on the normalized data, so the data appearing in the process of the embodiment of the present invention should also try to meet the normalization requirements, so the range of random numbers is limited.

[0101] The following will integrate various security interaction protocols into the prediction and reasoning calculation process of the personnel mobility prediction model. At the beginning of the calculation, the client inputs private data, namely trajectory data (including time and location); the server inputs the model parameters of the neural network (personnel mobility prediction model). It should be noted that the input data of both parties are private to each other, and neither party will obtain the data input by the other party during the entire calculation process.

[0102] In step S12, optionally, Figure 3 As shown, including:

[0103] Step S121: applying a secure interaction protocol to interact with the server side according to the current trajectory data, the second secret sharing data and the first random number set to perform inference of a gated recurrent unit, obtain a first gated output, and simultaneously obtain a second gated output on the server side.

[0104] The gated loop unit includes: a reset gate, an update gate, a candidate state output, and an update method. In step S121, the client uses a secure interaction protocol to interact with the server in turn according to the current trajectory data, the second secret sharing data, and the first random number set to perform four parts of calculation reasoning. The reasoning calculation process of each part of the gated loop unit is as follows: Input: The client has X = {X1, ..., X N}, the server has W ir , , b ir , W hr , b hr , W iz , b iz , W hz , b hz , W in , b in , W hn , b hn, output: Both parties get the output results <H>1={1,...,<h<h1> N >1}, <H>2={2,...,<h<h1> N >2}.

[0105] For each cycle t∈{1,...,N} we have:

[0106] Reset gate:

[0107] First, both parties call mul_to_add(X t , W ir ) function, we get in

[0108] Then both parties call mul_to_add(h t-1 , W hr ) function, we get in

[0109] The client then performs the calculation:

[0110] The server performs calculations:

[0111] Finally, both parties call the security sigmoid Then the output is used as input to call the mul_to_add function to get <r t >1+<r t >2.

[0112] Update gate:

[0113] First, both parties call mul_to_add(X t , W iz ),get in

[0114] Then both parties call mul_to_add(h t-1 , W hz ),get in

[0115] The client then performs the calculation:

[0116] The server performs calculations:

[0117] Finally, both parties call the security sigmoid Then the output is used as input to call mul_to_add again to get <z t >1+<z t >2.

[0118] Candidate status:

[0119] First, both parties call mul_to_add(X t , W in ),get in

[0120] Then both parties call mul_to_add(h t-1 , W hn ),get in

[0121] The server then performs the calculation:

[0122] Then both parties call Had_to_add get

[0123] Both parties then call Had_to_add get

[0124] Finally, the client performs the calculation:

[0125] The server performs calculations:

[0126] Update method (Status update):

[0127] Both parties call Had_to_add(0.5-<z t >1, <n t >2), we get

[0128] Both parties call Had_to add(<n t >1,0.5-<z t >2), we get

[0129] Both parties call Had_to_add(<z t >1, <n t >2), we get

[0130] Both parties call Had_to_add(<nt >1, <z t >2), we get

[0131] The client performs the calculation:

[0132]

[0133] Server-side calculation:

[0134]

[0135] By applying the above-mentioned reasoning and calculation process of each part of the gated recurrent unit, the client uses the secure interactive protocol to interact with the server in sequence according to the current trajectory data, the second secret sharing data and the first random number set to perform calculation and reasoning of the four parts to obtain the first gated output; at the same time, the server obtains the second gated output through interactive reasoning with the client. It should be noted that the application of the secure re-addition protocol can be added as needed during the reasoning process of the gated recurrent unit in which the client interacts with the server. For example, the re-add operation can be used only once in the final output part of the gated recurrent unit (GRU), or the re-add operation can be used for each output of the GRU, or the re-add operation can be used for each output of all mul_to_add functions, or the re-add operation can be used after each interaction with the server.

[0136] Step S122: Based on the historical trajectory data, the first gated output, the second gated output of the server-side secret sharing, the second secret sharing data, and the first random number set, a secure interaction protocol is applied to interact with the server-side to perform reasoning on the historical attention module to obtain a first normalized output, and a second normalized output is obtained on the server side.

[0137] Since the attention candidate generator is based on GRU as the basic unit, and the attention selector adopts the dot product model of the attention mechanism. Thus, in step S122, first, the client uses a secure interaction protocol to interact with the server based on the historical trajectory data, the second secret sharing data, and the first random number set to perform reasoning on the gated recurrent unit in the attention candidate generator, and obtain the first candidate output, and at the same time obtain the second candidate output on the server. Then, based on the first candidate output, the first gated output, the second gated output and the second candidate output shared by the server, the first random number set, and the second secret sharing data, the secure interaction protocol is used to interact with the server to perform reasoning on the secure attention model (ATTN), and the first normalized output is obtained, and at the same time, the second normalized output is obtained on the server. The process of the client using a secure interaction protocol to interact with the server to perform reasoning on the gated recurrent unit in the attention candidate generator is similar to the reasoning process of step S121, and will not be repeated here. The reasoning process of the secure attention model is as follows: Input: The client has <X>1={<x1>1,...,<x n >1}, <Y>1={<y1>1,...,<y m >1}; the server has <X>2={<x1>2,...,<x n >2}, <Y>2={<y1>2,...,<y m >2}; Output: The client and server obtain <softmax(X T Y)>1,<softmax(X T Y)>2.

[0138] for j∈{1,...,m}

[0139] for i∈{1,...,n}

[0140] Both parties input <x i >1 T ,<y j >2, call mul_to_add function, and get output <f1 i >1, <f1 i >2;

[0141] Both parties input <y j >1 T , <x i >2, call mul_to_add function, and get output <f2 i >1, <f2 i >2;

[0142] The client performs the calculation:

[0143] The server performs the calculation:

[0144] Last pair Both sides input [sm i,j ]1,[sm i,j ]2, call the secure softmax function to get <softmax(x i T y j )>1,<softmax(x i T y j )>2.

[0145] Here, <X>1 and <Y>1 represent the first candidate output and the first gated output of the client, respectively, while <X>2 and <Y>2 represent the second candidate output and the second gated output of the server, respectively. i T y j )>1,<softmax(x i T y j )>2 are the first normalized output obtained by the client and the second normalized output obtained by the server respectively.

[0146] It should be noted that the secure re-add protocol can also be used as needed during the inference process of the secure attention model when the client interacts with the server. For example, the re-add operation can be used only once in the final output of the secure attention model (ATTN), or the re-add operation can be used for each output of all mul_to_add functions, or the re-add operation can be used after each interaction with the server.

[0147] Step S123: Apply a secure interaction protocol to interact with the server side to perform fully connected layer processing according to the first gated output, the first normalized output, the second gated output and the second normalized output of the server-side secret sharing, the second secret sharing data, and the first random number set to obtain the first inference result.

[0148] In an embodiment of the present invention, before the client interacts with the server to perform the fully connected layer (FC) processing, it is necessary to perform the splicing of the first gated output and the first normalized output on the client to obtain the first spliced ​​output, and at the same time, perform the splicing of the second gated output and the second normalized output on the server to obtain the second spliced ​​output. Then, the client uses the secure interaction protocol to interact with the server to perform the fully connected layer processing based on the first spliced ​​output, the second spliced ​​output of the server secret sharing, the second secret sharing data, and the first random number set. The processing process of the fully connected layer is as follows: Input: The client has <x>1, the server has <x>2, W fc , b fc , output: the client and server obtain <y>1, <y>2 respectively.

[0149] First, both parties call mul_to_add(<x>1,W fc ), and the output is <ans>1, <ans>2. Then <y>1=<ans>1;

[0150] The server then performs the calculation: <y>2=<ans>2+b fc +<x>2*W fc .

[0151] Safety verification: <y>1+<y>2=<ans>1+<ans>2+b fc +<x>2*W fc

[0152] =<x>1*W fc +<x>2*W fc +b fc =x*W fc +b fc .

[0153] Here, <x>1 and <x>2 represent the first concatenation output of the client and the second concatenation output of the server, respectively. <y>1 and <y>2 represent the first inference result obtained by the client and the second inference result obtained by the server, respectively.

[0154] It should be noted that the secure re-add protocol can also be used as needed during the fully connected layer processing of the client and the server. For example, the re_add operation can be used for each output of all mul_to_add functions, or after each interaction with the server.

[0155] Step S13: Receive the second inference result obtained by the server side through interactive inference on the personnel mobility prediction model based on the first secret sharing data, the model parameters and a second random number set generated by a trusted third party, and obtain a prediction result by combining the first inference result and the second inference result.

[0156] In an embodiment of the present invention, in step S12, the client uses a secure interaction protocol to interact with the server to perform inference on a pre-trained personnel mobility prediction model based on trajectory data, the second secret shared data transmitted by the server, and the first random number set and obtains a first inference result. At the same time, the server performs interactive inference on the personnel mobility prediction model based on the first secret shared data, model parameters, and a second random number set generated by a trusted third party and obtains a second inference result. The server sends the obtained second inference result to the client. In step S13, the client receives the second inference result sent by the server, and obtains a prediction result in combination with the first inference result obtained on the client. The prediction result indicates the possible location and corresponding probability of the user to which the client belongs.

[0157] In the embodiments of the present invention, correctness is part of the feasibility of the computational security interaction protocol. The following experiments verify the correctness of the security prediction method for personnel mobility of the seven invention embodiments. The initialization phase can be completed offline, and has little impact on the performance of the personnel mobility prediction model DeepMove, so the initialization experiment is omitted. In order to evaluate the performance of DeepMove, it is implemented using python3, and DeepMove is executed on an Intel Core i7 computer at 2.8GHz and 16GBRAM, and on a Tesla K80 and 62GB RAM server. The experimental data is the public Foursquare check-in data, which records the check-in data of users in a certain place for a period of time. Each piece of data includes user ID, time, user location and point of interest. Sessions are generated based on the user's adjacent records, and users with fewer records and sessions are filtered out. The following evaluates the effectiveness of the scheme from three aspects: accuracy, running time and communication volume.

[0158] Figure 4 The top 1 and top 5 accuracy rates under different schemes are given respectively. Figure 4 a) in the figure is the top 1 accuracy of solutions r-0 to r-6. Figure 4 b) in the figure is the top 5 accuracy of solutions r-0 to r-6. Figure 4c) is the accuracy of top1 and top5 of scheme r-7, scheme r-8 and scheme ora. Top1 means that there is a real place in the first possible predicted place, and top5 means that there is a real place in the first five possible predicted places. Schemes r-0 to r-8 use the prediction method for the safety prediction of personnel mobility of the embodiment of the present invention, and the difference lies in the use of re_add. Scheme r-0 means that re_add is not used, r-1 means that re_add is used only once in the final output of GRU and attn, r-2 means that re_add is used only once in the final output of GRU, r-3 means that re_add is used only once in the final output of attn, r-4 means that re_add is used in each output of GRU, r-5 means that re_add is used once in the final output of attn based on r-4, r-6 means that re_add is used in each output of all mul_to_add based on r-5, r-7 means that re_add is used only in each output of all mul_to_add, and r-8 means that re_add is used after each interaction. Scheme ora means the prediction of the original model. There are two ways to generate random numbers, one is to generate uniformly distributed random numbers, and the other is to generate normal random numbers. Figure 4 The above schemes are experimented with these two random values. Figure 4 The results are the average of more than ten executions.

[0159] from Figure 4 From a) and b) in , we can see that neither the uniformly distributed random values ​​nor the standard normally distributed random values ​​have any obvious advantages in the accuracy of schemes r-0 to r-6, and the accuracy is very low and almost negligible. Figure 4 In c), the accuracy of the uniformly distributed random values ​​in schemes r-7 and r-8 is comparable to that of scheme ora, but the accuracy of the standard normally distributed random values ​​is higher only in scheme r-8. Therefore, uniformly distributed random values ​​are selected in subsequent experiments.

[0160] In addition, by comparing schemes r-0, r-7, and r-8, it can be found that the addition of re_add has a very significant effect on improving the prediction accuracy. When re_add is not used at all, the accuracy can be said to be approximately zero, and after adding re_add, the accuracy can be consistent with the original model results. However, from schemes r-1 to r-6, it can be seen that the location of adding re_add is very critical. It is not necessarily guaranteed to have accuracy as long as re_add is used. Before re_add was added, the random numbers a, b, c1, and c2 were added multiple times during the calculation process of both parties, and the inverse and exponential operations were involved. The intermediate values ​​of both parties often have maximum or minimum values, but the sum of the intermediate values ​​is very small. Therefore, re_add can ensure that the intermediate values ​​of both parties are within a smaller range, thereby ensuring the accuracy of the calculation.

[0161] Figure 5 The total running time of different solutions on the client and server is shown. The running time here does not include the transmission process of the interaction between the two parties. Figure 5 It can be seen that the running time of the ora solution on the client and server is not much different, while the running time of the solutions r-0 to r-8 on the client and server is consistent, with a difference of about 3 seconds. Although the running time on the client is higher than that on the server, a prediction can be performed within 6 seconds. The time for both parties to execute once does not exceed 7 seconds. Although this time is much higher than that of the ora solution, it is completely acceptable.

[0162] Combination Figure 4 and Figure 5 It can be seen that adding re_add does not add much time burden, the difference is only about 1s, but the accuracy is greatly improved.

[0163] Next, the various security interaction protocols and sub-stages involved in the security prediction method for personnel mobility according to the embodiment of the present invention are analyzed. Table 1 shows the running time of different security interaction protocols on the client (local) and server (server).

[0164] Table 1 Running time of different security interaction protocols on local and server

[0165] mul1 mul2 mul3 sigmoid re_add tanh Local single run time 26.04429 28.92319 25.24988 48.90807 13.78187 101.3744 Server single running time 5.593141 4.683733 6.953319 13.66059 3.06503 28.90889

[0166] Among them, mul1, mul2, and mul3 are all applications of mul_to_add, the difference is that the input data dimensions are different, so they are also counted separately. The running time of mul1, mul2, and mul3 is relatively close, with a difference of less than 3ms. Only one data exchange is required, that is, the client sends a copy of the data to the server locally, and the server also sends a copy of the data to the client. The order of the two is irrelevant. In addition to the time of sending data, there is no additional waiting time. Relatively speaking, sigmoid and tanh have longer running times. The calculation of sigmoid involves exponents and reciprocals, and only one data exchange is required, but the server needs to send the data first, and then the client. In addition to calling sigmoid, the implementation of tanh also requires mul, so the data is exchanged twice. There is a requirement for the sending order the first time, but not the second time.

[0167] Although the calculation time of softmax is short, it also requires two rounds of interaction. Both parties call mul to interact and then interact to restore the D value. There is no time order requirement. re_add consumes the shortest time. It only requires both parties to interact with data once, and there is no time order either.

[0168] Table 2 shows the communication volume of different schemes in different sub-stages and in total. Among the three sub-stages of gated recurrent unit (GRU), secure attention model (ATTN), and fully connected layer (FC), FC has the lowest communication volume, which does not exceed 1.5KB at most. The communication volume of GRU and ATTN accounts for the majority of the total communication volume (ALL). From scheme r-0 to scheme r-8, it is found that as the number of calls to re_add increases, the communication volume also increases. Even if re_add is added after each interaction, the total communication volume is within 20MB, which is within an acceptable range. It can be seen that re_add ensures accuracy and does not bring a large burden on communication volume.

[0169] Table 2. The total communication volume of different schemes in different sub-phases

[0170] GRU(MB) ATTN(MB) FC(KB) ALL(MB) r-0 3.53 4.00 0.5 7.53 r-1 4.01 6.02 0.75 10.03 r-3 4.01 4.54 0.75 8.56 r-5 5.20 6.02 0.5 11.22 r-7 11.74 7.50 1.25 19.24 r-8 14.12 7.40 1.25 21.52

[0171] Figure 6 and Figure 7 The time of the three sub-processes on the client and server are shown separately. Whether on the client or server, the time share decreases from ATTN, GRU, and FC. This is because the ATTN process needs to calculate the similarity of each path and sort and compare, so it takes a little longer.

[0172] Figure 8The overall running time of different solutions under a network speed of 4.8MB is shown. The overall running time is between 18s and 45s, which means that the future path prediction of a user can be completed in less than 1 minute, which is a considerable time. The transmission time accounts for a large proportion of the entire time, and the local running time of both parties is relatively short. The transmission time depends more on the transmission network speed. The 4.8MB in the experiment is relatively medium in reality. In actual use, a higher-speed network can be set to transmit data.

[0173] The secure prediction method for personnel mobility in the embodiment of the present invention is a secure DeepMove neural network privacy protection method based on secret sharing. Several secure interaction protocols are designed for the execution process of DeepMove. These secure interaction protocols allow both parties to convert and calculate data and perform neural network reasoning. By randomly dividing the historical path and model parameters into secret parts, the calculation is performed without the participants knowing the metadata, without leaking the data of any party, and without compromising data privacy. Specifically, a secure and efficient two-party secure interaction protocol is designed for the calculation of nonlinear functions such as sigmoid, tanh, and softmax in the personnel mobility prediction model; a secure and effective solution is designed for the accuracy problem that arises in the calculation; and the security of the protocol is also proved in a semi-honest adversary model. Combined with experiments, it is proved that the secure interaction protocol has no effect on the reasoning accuracy, the accuracy rate is not reduced, and the calculation and communication overhead is small.

[0174] The embodiment of the present invention obtains trajectory data of a user belonging to a client, and randomly divides the trajectory data into first secret shared data; applies a secure interactive protocol to interact with the server to perform inference on a pre-trained personnel mobility prediction model based on the trajectory data, second secret shared data transmitted by the server, and a first random number set generated by a trusted third party, to obtain a first inference result, wherein the second secret shared data is obtained by the server randomly dividing the model parameters of the personnel mobility prediction model; receives the second inference result obtained by the server performing interactive inference on the personnel mobility prediction model based on the first secret shared data, the model parameters, and a second random number set generated by a trusted third party, and obtains a prediction result in combination with the first inference result and the second inference result, thereby achieving safe and effective prediction, while ensuring accuracy and reducing communication overhead.

[0175] Based on the same inventive concept, an embodiment of the present invention further provides a client device. Fig. 9 As shown, the client device includes: a first data acquisition unit, a first prediction unit and a result acquisition unit.

[0176] A first data acquisition unit, used to acquire the trajectory data of the user to which the client belongs, and randomly divide the trajectory data into first secret shared data;

[0177] A first prediction unit is configured to perform inference of a pre-trained personnel mobility prediction model by interacting with the server using a secure interaction protocol according to the trajectory data, the second secret shared data transmitted by the server, and a first random number set generated by a trusted third party, to obtain a first inference result, wherein the second secret shared data is obtained by the server randomly dividing the model parameters of the personnel mobility prediction model;

[0178] A result acquisition unit is used to receive a second inference result obtained by the server side through interactive inference on the personnel mobility prediction model based on the first secret sharing data, the model parameters and a second random number set generated by a trusted third party, and obtain a prediction result in combination with the first inference result and the second inference result.

[0179] For the convenience of description, the client device is described above by dividing it into various modules according to its functions. Of course, when implementing the embodiment of the present invention, the functions of each module can be implemented in the same or multiple software and / or hardware.

[0180] The client device of the above embodiment is used to implement the corresponding method in the above embodiment, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.

[0181] The embodiment of the present invention also provides a safety prediction method for personnel mobility. The safety prediction method of the embodiment of the present invention is applied to the server side, as shown in the attached Fig.10 As shown, the safe prediction methods for personnel mobility include:

[0182] Step S21: Obtain model parameters of a pre-trained personnel mobility prediction model, and randomly divide the model parameters into second secret shared data according to the model parameters.

[0183] In an embodiment of the present invention, before step S21, the server side trains the personnel mobility prediction model according to historical data to obtain the model parameters of the converged personnel mobility prediction model. In step S21, the server side randomly divides the model parameters of the pre-trained personnel mobility prediction model into second secret shared data for subsequent interactive processing with the client.

[0184] Step S22: Apply a secure interaction protocol to interact with the client to perform inference on a pre-trained personnel mobility prediction model based on the model parameters, the first secret shared data transmitted by the client, and a second random number set generated by a trusted third party, to obtain a second inference result, wherein the first secret shared data is obtained by the client randomly dividing the trajectory data of the user belonging to the client.

[0185] In the embodiment of the present invention, before step S22, the second random number set is randomly generated by a trusted third party and transmitted to the client, and the trusted third party may apply a standard normal distribution or a uniform distribution to randomly generate random numbers.

[0186] The trajectory data of the user to which the client belongs includes the current trajectory data and the historical trajectory data, and correspondingly, the first secret shared data includes the current trajectory shared data and the historical trajectory data. In step S22, optionally, firstly, according to the current trajectory shared data, the model parameters and the second random number set, a secure interaction protocol is applied to interact with the client to perform inference of the gated recurrent unit to obtain the second gated output, and at the same time, the first gated output is obtained at the client. The secure interaction protocol includes: at least one of a multiplication to addition conversion protocol, a secure sigmoid protocol, a secure tanh protocol, a secure softmax protocol and a secure re-addition protocol. The inference process of the gated recurrent unit performed by the server-side using the secure interaction protocol with the client is the same as the method in the aforementioned step S121, which will not be repeated here.

[0187] Then, according to the historical trajectory shared data, the second gated output, the first gated output secretly shared by the client, the model parameters and the second random number set, a secure interaction protocol is applied to interact with the client to perform reasoning of the historical attention module, and the second normalized output is obtained, and the first normalized output is obtained at the client. Since the attention candidate generator is based on GRU as the basic unit, and the attention selector adopts the dot product model of the attention mechanism. In this way, first, the server interacts with the client to perform reasoning of the gated recurrent unit in the attention candidate generator according to the historical trajectory shared data, model parameters and the second random number set, and obtains the second candidate output, and obtains the first candidate output at the client. Then, according to the second candidate output, the second gated output, the first gated output and the first candidate output secretly shared by the client, the second random number set and the model parameters, a secure interaction protocol is applied to interact with the client to perform reasoning of the secure attention model (ATTN), and the second normalized output is obtained, and the first normalized output is obtained at the client. The specific process of the server using a secure interaction protocol to interact with the client to perform reasoning on the gated recurrent unit in the attention candidate generator and the secure attention model is similar to the reasoning process of the aforementioned step S122 and will not be repeated here.

[0188] Finally, according to the second gated output, the second normalized output, the first gated output and the first normalized output secretly shared by the client, the model parameters and the second random number set, a secure interaction protocol is applied to interact with the client to perform full connection layer processing to obtain the second reasoning result. In an embodiment of the present invention, before the server interacts with the client to perform full connection layer (FC) processing, it is necessary to perform splicing of the second gated output and the second normalized output on the server to obtain the second spliced ​​output, and at the same time, perform splicing of the first gated output and the first normalized output on the client to obtain the first spliced ​​output. Then, according to the second spliced ​​output, the first spliced ​​output secretly shared by the client, the model parameters and the second random number set are applied on the server to interact with the client to perform full connection layer processing, and finally the second reasoning result is obtained on the server, and the first reasoning result is obtained on the client.

[0189] It should be noted that the secure re-add protocol can be added as needed during the inference process of the gated recurrent unit (GRU), the secure attention model (ATTN), and the fully connected layer (FC) when the server interacts with the client. For example, the re-add operation can be used only once in the final output of the gated recurrent unit, or the re-add operation can be used for each output of the GRU; the re-add operation can be used only once in the final output of the secure attention model (ATTN), or the re-add operation can be used for each output of all mul_to_add functions, and the re-add operation can be used after each interaction with the server.

[0190] Step S23: transmitting the second reasoning result to the client, so that the client can obtain a prediction result by combining the first reasoning result obtained in the interactive reasoning process with the second reasoning result.

[0191] The server sends the second inference result obtained in step S22 to the client, so that the client combines the second inference result with the first inference result obtained locally on the client to obtain a prediction result. The prediction result indicates the possible location of the user to which the client belongs and the corresponding probability.

[0192] The above specific embodiments of the present application are described. In some cases, the actions or steps recorded in the embodiments of the present invention can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the process depicted in the accompanying drawings does not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0193] Based on the same inventive concept, an embodiment of the present invention provides a server. Fig.11 As shown, the server includes: a second data acquisition unit, a second prediction unit and a data sending unit.

[0194] A second data acquisition unit, used to acquire model parameters of a pre-trained personnel mobility prediction model, and randomly divide the model parameters into second secret shared data according to the model parameters;

[0195] A second prediction unit is configured to perform reasoning of a pre-trained personnel mobility prediction model by interacting with the client using a secure interaction protocol according to the model parameters, the first secret shared data transmitted by the client, and a second random number set generated by a trusted third party, to obtain a second reasoning result, wherein the first secret shared data is obtained by the client randomly dividing trajectory data of a user belonging to the client;

[0196] A data sending unit is used to transmit the second reasoning result to the client, so that the client can obtain a prediction result by combining the first reasoning result obtained in the interactive reasoning process with the second reasoning result.

[0197] For the convenience of description, the above server is described by dividing it into various modules according to its functions. Of course, when implementing the embodiment of the present invention, the functions of each module can be implemented in the same or multiple software and / or hardware.

[0198] The server in the above embodiment is used to implement the corresponding method in the above embodiment, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.

[0199] Based on the same inventive concept, an embodiment of the present invention also provides a security prediction system for personnel mobility, which includes a trusted third party, the aforementioned client device and the aforementioned server. The security prediction system in the embodiment of the present invention provides a personnel mobility prediction model, applies the DeepMove framework, and realizes secure personnel mobility prediction reasoning through the interaction between the client device and the server. The DeepMove framework protects the privacy of user data and the privacy of the predicted neural network parameters without reducing the prediction accuracy. The server uses its internal model to provide prediction services, and the client device only needs to call the application program interface (Application ProgramInterface, API) provided by the server to realize the prediction. It transmits its own data to the server and predicts its own data. The server and the client device realize secure prediction by jointly executing the security protocol. The server inputs the parameters of the neural network, and the user to whom the client device belongs inputs the private data to be predicted. The trusted third party is only responsible for generating the random numbers required in the security protocol operation, and does not participate in the specific security protocol operation, that is, the trusted third party can be a light server or even a personal computer.

[0200] Before the client device and the server interact to perform inference on the pre-trained personnel mobility prediction model, the trusted third party is used to apply uniform distribution or standard normal distribution to offline generate a first set of random numbers and a second set of random numbers, and transmit the first set of random numbers to the client device, and transmit the second set of random numbers to the server. The client device locally obtains the trajectory data of the user to which the client belongs, and the client device randomly divides the trajectory data into first secret shared data according to the first secret shared data. The server obtains the model parameters of the pre-trained personnel mobility prediction model, and the server randomly divides the model parameters into second secret shared data according to the first secret shared data.

[0201] During the inference process of the pre-trained personnel mobility prediction model interactively performed by the client device and the server, the client device uses a secure interactive protocol to interact with the server to perform inference of the pre-trained personnel mobility prediction model according to the trajectory data, the second secret shared data, and the first random number set, and obtains a first inference result. At the same time, the server interactively infers the personnel mobility prediction model according to the first secret shared data, the model parameters, and the second random number set to obtain a second inference result.

[0202] Specifically, the inference process of the pre-trained personnel mobility prediction model performed by the interaction between the client device and the server is divided into the inference of the gated recurrent unit, the inference of the historical attention module, and the processing of the fully connected layer, wherein the inference of the historical attention module includes the inference of the gated recurrent unit and the inference of the secure attention model. The secure interaction protocol includes: at least one of the multiplication to addition conversion protocol, the secure sigmoid protocol, the secure tanh protocol, the secure softmax protocol, and the secure re-addition protocol. The trajectory data includes current trajectory data and historical trajectory data, and the corresponding first secret shared data includes current trajectory shared data and historical trajectory shared data.

[0203] In an embodiment of the present invention, first, the client device interacts with the server using a secure interaction protocol to perform inference of a gated recurrent unit according to the current trajectory data, the second secret shared data, and the first random number set, and obtains a first gated output. At the same time, the server interacts with the client using a secure interaction protocol to perform inference of a gated recurrent unit according to the current trajectory shared data, the model parameters, and the second random number set, and obtains a second gated output. For more specific methods, please refer to the aforementioned method embodiment section, which will not be repeated here.

[0204] Then, the client device uses a secure interaction protocol to interact with the server to perform reasoning of the historical attention module based on the historical trajectory data, the first gating output, the second gating output of the server-side secret sharing, the second secret sharing data, and the first random number set, and obtains a first normalized output, and simultaneously obtains a second normalized output on the server. At the same time, the server uses a secure interaction protocol to interact with the client to perform reasoning of the historical attention module based on the historical trajectory sharing data, the second gating output, the first gating output of the client-side secret sharing, the model parameters, and the second random number set, and obtains a second normalized output. For more specific methods, please refer to the aforementioned method embodiment section, which will not be repeated here.

[0205] Finally, the client device uses a secure interaction protocol to interact with the server to perform fully connected layer processing according to the first gated output, the first normalized output, the second gated output and the second normalized output of the server secret sharing, the second secret shared data, and the first random number set to obtain the first inference result. The server uses a secure interaction protocol to interact with the client to perform fully connected layer processing according to the second gated output, the second normalized output, the first gated output and the first normalized output of the client secret sharing, the model parameters, and the second random number set to obtain the second inference result. For more specific methods, please refer to the aforementioned method embodiment section, which will not be repeated here.

[0206] Based on the same inventive concept, an embodiment of the present invention further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in any one of the above embodiments is implemented.

[0207] Fig.12 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 1201, a memory 1202, an input / output interface 1203, a communication interface 1204, and a bus 1205. The processor 1201, the memory 1202, the input / output interface 1203, and the communication interface 1204 are connected to each other through the bus 1205 in the device.

[0208] The processor 1201 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided by the various method embodiments of the present invention.

[0209] The memory 1202 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1202 may store an operating system and other application programs. When the technical solutions provided by the various method embodiments of the present invention are implemented by software or firmware, the relevant program codes are stored in the memory 1202 and are called and executed by the processor 1201.

[0210] The input / output interface 1203 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.

[0211] The communication interface 1204 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).

[0212] The bus 1205 includes a path that transmits information between the various components of the device (eg, the processor 1201 , the memory 1202 , the input / output interface 1203 , and the communication interface 1204 ).

[0213] It should be noted that, although the above device only shows the processor 1201, the memory 1202, the input / output interface 1203, the communication interface 1204 and the bus 1205, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present invention, and does not necessarily include all the components shown in the figure.

[0214] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present disclosure is limited to these examples. In line with the concept of the present application, the above embodiments or technical features in different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the present invention as described above, which are not provided in detail for the sake of simplicity.

[0215] The present invention is intended to cover all such substitutions, modifications and variations that fall within the broad scope of the present application. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present disclosure.

Claims

1. A method for predicting the safety of personnel mobility, characterized in that: The method comprises: Acquire trajectory data of a user to which the client belongs, and randomly divide the trajectory data into first secret shared data according to the trajectory data, wherein the trajectory data includes current trajectory data and historical trajectory data; According to the trajectory data, the second secret shared data transmitted by the server, and the first random number set generated by a trusted third party, a secure interaction protocol is applied to interact with the server to perform inference on a pre-trained personnel mobility prediction model to obtain a first inference result, wherein the second secret shared data is obtained by the server randomly dividing the model parameters of the personnel mobility prediction model, wherein according to the current trajectory data, the second secret shared data, and the first random number set, a secure interaction protocol is applied to interact with the server to perform inference on a gated recurrent unit to obtain a first gated output, and a second gated output is obtained at the server at the same time; according to the historical trajectory data, the first gated output, the second gated output of the server-side secret sharing, and the second secret shared data, a gated output of the second gated output is obtained. The data and the first random number set use a secure interaction protocol to interact with the server side to perform reasoning of the history attention module, obtain a first normalized output, and obtain a second normalized output on the server side; according to the first gated output, the first normalized output, the second gated output and the second normalized output of the server-side secret sharing, the second secret sharing data and the first random number set, use a secure interaction protocol to interact with the server side to perform full connection layer processing to obtain the first reasoning result; the secure interaction protocol includes: at least one of a multiplication to addition conversion protocol, a secure sigmoid protocol, a secure tanh protocol, a secure softmax protocol and a secure re-addition protocol; a re-add operation is used after each interaction between the client and the server side; Receiving a second inference result obtained by the server end through interactive inference on the personnel mobility prediction model according to the first secret sharing data, the model parameters, and a second random number set generated by a trusted third party, and obtaining a prediction result by combining the first inference result and the second inference result; The secure interaction protocol is executed between two parties. The input of each party is their own private data or a secret shared value generated by calculation. After being processed by the secure interaction protocol, a new secret shared value is generated. The random values ​​involved in the secure interaction protocol processing are all generated in advance by a third party, that is, executed offline in the initialization phase. Among them, the multiplication-to-addition conversion protocol is used for two parties to calculate the product of their data without knowing each other's data; Among them, the calculation formula of the secure sigmoid protocol is: The x value is shared by the client and server as an additive secret, that is, x = <x> 1+ <x>2, where the client has <x>1. The server has <x> 2;< / x> < / x> < / x> < / x> The secure softmax protocol includes the following input: the client has [x]1 = {[x1]1, ..., [x N ]1}, the server has [x]2={[x1]2,...,[x N ]2}; Output: The client and server get<softmax(x)> 1 and<softmax(x)> 2; Among them, the secure re-addition protocol includes input: the client has <x>1. The server has <x> 2; Output: The client and server obtain<x′> 1 and<x′> 2. The secure re-addition protocol process is described as follows:< / x> < / x> The client selects a random number r and calculates mid= <x>1-r, and sent to the server, then<x′> 1=r; then the server performs the calculation<x′> 2=mid+ <x>2. Verify correctness:<x′> 1+<x′> 2=mid+ <x> 2+r= <x> 1-r+ <x> 2+r, where the random number r selected by the client is limited to the range of 0-1;< / x> < / x> < / x> < / x> < / x> Among them, the calculation formula of the secure tanh protocol is: For the secure tanh protocol: Input, the client has <x>1. a, c1, the server has <x>2. b, c2, where a, b, c1, c2 are generated offline by a trusted third party and sent to the client and server, and satisfy a·b=c1+c2, and both parties have a secret shared value of x;< / x> < / x> Output, the client and server get<tanh(x)> 1 and<tanh(x)> 2, where tanh(x) =<tanh(x)> 1+<tanh(x)> 2; The secure tanh protocol process includes: first, both parties call the secure sigmoid function and input 2* <x> 1,2* <x>2, the outputs are recorded as [y]1, [y]2 respectively; then both parties call the mul_to_add function, input [y]1, [y]2 respectively, and get the outputs respectively <z> 1, <z>2; Then the client performs the calculation<tanh(x)> 1=2* <z>1. Server-side calculation<tanh(x)> 2=2* <z> 2-1, where <> represents additive secret sharing, [] represents multiplicative secret sharing, subscript 1 represents the shared data of the client, and subscript 2 represents the shared data of the server;< / z> < / z> < / z> < / z> < / x> < / x> Verify correctness: <tanh(x)>1+<tanh(x)>2=2* <z> 1+2* <z> 2-1< / z> < / z> =2*( <z> 1+ <z> 2) -1 = 2*[y]1*[y]2-1< / z> < / z> =2*σ(2* <x> 1+2* <x> 2)-1=2*σ(2*x)-1=tanh(x).< / x> < / x> 2. The method according to claim 1, characterized in that: The gated recurrent unit includes: a reset gate, an update gate, a candidate state output, and an update method, which respectively satisfy the following relationships: r t =σ(W ir *x t +b ir +W hr *h t-1 +b hr ), z t =σ(W iz *x t +b iz +W hz *h t-1 +b hz ), Among them, W ir , b ir , W hr , b hr , W iz , b iz , W hz , b hz , W in , b in , W hn , b hn is the model parameter, x t is the input vector of the tth time step, h t-1 is the information saved at the previous time step t-1, r t is the output of the reset gate at the tth time step, z t is the output of the update gate at the tth time step, n t represents the new memory content at the tth time step, h t Information saved for the tth time step.

3. A method for predicting the safety of personnel mobility, characterized in that: The method comprises: Obtaining model parameters of a pre-trained personnel mobility prediction model, and randomly dividing the model parameters into second secret shared data, wherein the trajectory data includes current trajectory data and historical trajectory data; According to the model parameters, the first secret shared data transmitted by the client, and the second random number set generated by the trusted third party, a secure interaction protocol is applied to interact with the client to perform inference on the pre-trained personnel mobility prediction model to obtain a second inference result, wherein, according to the current trajectory shared data, the model parameters, and the second random number set, a secure interaction protocol is applied to interact with the client to perform inference on the gated recurrent unit to obtain a second gated output, and at the same time, the first gated output is obtained on the client; according to the historical trajectory shared data, the second gated output, the first gated output secretly shared by the client, the model parameters, and the second random number set, a secure interaction protocol is applied to interact with the client to perform inference on the historical attention module to obtain a second normalized output, and at the same time obtain a first normalized output on the client; according to the second gated output, the second normalized output, the first gated output and the first normalized output of the client secret sharing, the model parameters and the second random number set, a secure interaction protocol is applied to interact with the client to perform full connection layer processing to obtain the second inference result, wherein the first secret shared data is obtained by the client randomly dividing the trajectory data of the user to which the client belongs; the secure interaction protocol includes: at least one of a multiplication to addition conversion protocol, a secure sigmoid protocol, a secure tanh protocol, a secure softmax protocol and a secure re-addition protocol; a re_add operation is used after each interaction between the client and the server; Transmitting the second reasoning result to the client, so that the client obtains a prediction result by combining the first reasoning result obtained in the interactive reasoning process with the second reasoning result; The secure interaction protocol is executed between two parties. The input of each party is their own private data or a secret shared value generated by calculation. After being processed by the secure interaction protocol, a new secret shared value is generated. The random values ​​involved in the secure interaction protocol processing are all generated in advance by a third party, that is, executed offline in the initialization phase. Among them, the multiplication-to-addition conversion protocol is used for two parties to calculate the product of their data without knowing each other's data; Among them, the calculation formula of the secure sigmoid protocol is: The x value is shared by the client and server as an additive secret, that is, x = <x> 1+ <x>2, where the client has <x>1. The server has <x> 2;< / x> < / x> < / x> < / x> The secure softmax protocol includes the following input: the client has [x]1 = {[x1]1, ..., [x N ]1}, the server has [x]2={[x1]2,...,[x N ]2}; Output: The client and server get<softmax(x)> 1 and<softmax(x)> 2; Among them, the secure re-addition protocol includes input: the client has <x>1. The server has <x> 2; Output: The client and server obtain<x′> 1 and<x′> 2. The secure re-addition protocol process is described as follows:< / x> < / x> The client selects a random number r and calculates mid= <x>1-r, and sent to the server, then<x′> 1=r; then the server performs the calculation<x′> 2=mid+ <x>2. Verify correctness:<x′> 1+<x′> 2=mid+ <x> 2+r= <x> 1-r+ <x> 2+r, where the random number r selected by the client is limited to the range of 0-1;< / x> < / x> < / x> < / x> < / x> Among them, the calculation formula of the secure tanh protocol is: For the secure tanh protocol: Input, the client has <x>1. a, c1, the server has <x> 2. b, c2, where a, b, c1, c2 are generated offline by a trusted third party and sent to the client and server, and satisfy a·b=c1+c2, and both parties have a secret shared value of x;< / x> < / x> Output, the client and server get<tanh(x)> 1 and<tanh(x)> 2, where tanh(x) =<tanh(x)> 1+<tanh(x)> 2; The secure tanh protocol process includes: first, both parties call the secure sigmoid function and input 2* <x> 1,2* <x>2, the outputs are recorded as [y]1, [y]2 respectively; then both parties call the mul_to_add function, input [y]1, [y]2 respectively, and get the outputs respectively <z> 1 , <z>2; Then the client performs the calculation<tanh(x)> 1=2* <z>1. Server-side calculation<tanh(x)> 2=2* <z> 2-1, where <> represents additive secret sharing, [] represents multiplicative secret sharing, subscript 1 represents the shared data of the client, and subscript 2 represents the shared data of the server;< / z> < / z> < / z> < / z> < / x> < / x> Verify correctness: <tanh(x)>1+<tanh(x)>2=2* <z> 1+2* <z> 2-1< / z> < / z> =2*( <z> 1+ <z> 2) -1 = 2*[y]1*[y]2-1< / z> < / z> =2*σ(2* <x> 1+2* <x> 2)-1=2*σ(2*x)-1=tanh(x).< / x> < / x> 4. A client device, characterized in that: The client device comprises: A first data acquisition unit, used to acquire trajectory data of a user to which the client belongs, and randomly divide the trajectory data into first secret shared data according to the trajectory data, wherein the trajectory data includes current trajectory data and historical trajectory data; A first prediction unit is used to perform inference on a pre-trained personnel mobility prediction model by interacting with the server side using a secure interaction protocol according to the trajectory data, the second secret shared data transmitted by the server side, and the first random number set generated by a trusted third party, to obtain a first inference result, wherein the second secret shared data is obtained by the server side randomly dividing the model parameters of the personnel mobility prediction model; wherein, according to the current trajectory data, the second secret shared data, and the first random number set, a secure interaction protocol is applied to interact with the server side to perform inference on a gated loop unit to obtain a first gated output, and at the same time, a second gated output is obtained on the server side; according to the historical trajectory data, the first gated output, the second gated output of the server-side secret sharing, and the second secret shared The shared data and the first random number set use a secure interaction protocol to interact with the server side to perform reasoning of the history attention module, obtain a first normalized output, and obtain a second normalized output on the server side; according to the first gated output, the first normalized output, the second gated output and the second normalized output of the server-side secret sharing, the second secret shared data and the first random number set, the secure interaction protocol is used to interact with the server side to perform full connection layer processing to obtain the first reasoning result; the secure interaction protocol includes: at least one of a multiplication to addition conversion protocol, a secure sigmoid protocol, a secure tanh protocol, a secure softmax protocol and a secure re-addition protocol; a re_add operation is used after each interaction between the client and the server side; A result acquisition unit is used to receive a second inference result obtained by the server end through interactive inference on the personnel mobility prediction model according to the first secret sharing data, the model parameters and a second random number set generated by a trusted third party, and obtain a prediction result by combining the first inference result and the second inference result; The secure interaction protocol is executed between two parties. The input of each party is their own private data or a secret shared value generated by calculation. After being processed by the secure interaction protocol, a new secret shared value is generated. The random values ​​involved in the secure interaction protocol processing are all generated in advance by a third party, that is, executed offline in the initialization phase. Among them, the multiplication-to-addition conversion protocol is used for two parties to calculate the product of their data without knowing each other's data; Among them, the calculation formula of the secure sigmoid protocol is: The x value is shared by the client and server as an additive secret, that is, x = <x> 1+ <x>2, where the client has <x>1. The server has <x> 2;< / x> < / x> < / x> < / x> The secure softmax protocol includes the following input: the client has [x]1 = {[x1]1, ..., [x N ]1}, the server has [x]2={[x1]2,...,[x N ]2}; Output: The client and server get<softmax(x)> 1 and<softmax(x)> 2; Among them, the secure re-addition protocol includes input: the client has <x>1. The server has <x> 2; Output: The client and server obtain<x′> 1 and<x′> 2. The secure re-addition protocol process is described as follows:< / x> < / x> The client selects a random number r and calculates mid= <x>1 - r and send it to the server side, then <x′>1 = r; then the server side performs the calculation <x′>2 = mid + <x>2. Verify correctness:<x′> 1+<x′> 2=mid+ <x> 2+r= <x> 1-r+ <x> 2+r, where the random number r selected by the client is limited to the range of 0-1;< / x> < / x> < / x> < / x> < / x> Among them, the calculation formula of the secure tanh protocol is: For the secure tanh protocol: Input, the client has <x>1. a, c1, the server has <x> 2. b, c2, where a, b, c1, c2 are generated offline by a trusted third party and sent to the client and server, and satisfy a·b=c1+c2, and both parties have a secret shared value of x;< / x> < / x> Output, the client and server get<tanh(x)> 1 and<tanh(x)> 2, where tanh(x) =<tanh(x)> 1+<tanh(x)> 2; The secure tanh protocol process includes: first, both parties call the secure sigmoid function and input 2* <x> 1,2* <x>2, the outputs are recorded as [y]1, [y]2 respectively; then both parties call the mul_to_add function, input [y]1, [y]2 respectively, and get the outputs respectively <z> 1, <z>2; Then the client performs the calculation<tanh(x)> 1=2* <z>1. Server-side calculation<tanh(x)> 2=2* <z> 2-1, where <> represents additive secret sharing, [] represents multiplicative secret sharing, subscript 1 represents the shared data of the client, and subscript 2 represents the shared data of the server;< / z> < / z> < / z> < / z> < / x> < / x> Verify correctness: <tanh(x)>1+<tanh(x)>2=2* <z> 1+2* <z> 2-1< / z> < / z> =2*( <z> 1+ <z> 2) -1 = 2*[y]1*[y]2-1< / z> < / z> =2*σ(2* <x> 1+2* <x> 2)-1=2*σ(2*x)-1=tanh(x).< / x> < / x> 5. A server, characterized in that: The server comprises: A second data acquisition unit is used to acquire model parameters of a pre-trained personnel mobility prediction model, and randomly divide the model parameters into second secret shared data, wherein the trajectory data includes current trajectory data and historical trajectory data; The second prediction unit is used to perform inference on the pre-trained personnel mobility prediction model by interacting with the client using a secure interaction protocol according to the model parameters, the first secret shared data transmitted by the client, and the second random number set generated by a trusted third party, and obtain a second inference result, wherein the gated recurrent unit is inferred by interacting with the client using a secure interaction protocol according to the current trajectory shared data, the model parameters, and the second random number set to obtain the second gated output, and the first gated output is obtained at the client at the same time; the historical attention module is inferred by interacting with the client using a secure interaction protocol according to the historical trajectory shared data, the second gated output, the first gated output secretly shared by the client, the model parameters, and the second random number set to obtain to the second normalized output, and at the same time obtain the first normalized output on the client; according to the second gated output, the second normalized output, the first gated output and the first normalized output of the client secret sharing, the model parameters and the second random number set, a secure interaction protocol is applied to interact with the client to perform full connection layer processing to obtain the second inference result, wherein the first secret shared data is obtained by the client randomly dividing the trajectory data of the user to which the client belongs; the secure interaction protocol includes: at least one of a multiplication to addition conversion protocol, a secure sigmoid protocol, a secure tanh protocol, a secure softmax protocol and a secure re-addition protocol; a re_add operation is used after each interaction between the client and the server; A data sending unit, configured to transmit the second reasoning result to the client, so that the client can obtain a prediction result by combining the first reasoning result obtained in the interactive reasoning process with the second reasoning result; The secure interaction protocol is executed between two parties. The input of each party is their own private data or a secret shared value generated by calculation. After being processed by the secure interaction protocol, a new secret shared value is generated. The random values ​​involved in the secure interaction protocol processing are all generated in advance by a third party, that is, executed offline in the initialization phase. Among them, the multiplication-to-addition conversion protocol is used for two parties to calculate the product of their data without knowing each other's data; Among them, the calculation formula of the secure sigmoid protocol is: The x value is shared by the client and server as an additive secret, that is, x = <x> 1+ <x>2, where the client has <x>1. The server has <x> 2;< / x> < / x> < / x> < / x> The secure softmax protocol includes the following input: the client has [x]1 = {[x1]1, ..., [x N ]1}, the server has [x]2={[x1]2,...,[x N ]2}; Output: The client and server get<softmax(x)> 1 and<softmax(x)> 2; Among them, the secure re-addition protocol includes input: the client has <x>1. The server has <x> 2; Output: The client and server obtain<x′> 1 and<x′> 2. The secure re-addition protocol process is described as follows:< / x> < / x> The client selects a random number r and calculates mid= <x>1-r, and sent to the server, then<x′> 1=r; then the server performs the calculation <x>2 = mid + <x>2; Verify the correctness: <x'>1 + <x'>2 = mid + <x> 2+r= <x> 1-r+ <x> 2+r, where the random number r selected by the client is limited to the range of 0-1;< / x> < / x> < / x> < / x> < / x> Among them, the calculation formula of the secure tanh protocol is: For the secure tanh protocol: Input, the client has <x>1. a, c1, the server has <x> 2. b, c2, where a, b, c1, c2 are generated offline by a trusted third party and sent to the client and server, and satisfy a·b=c1+c2, and both parties have a secret shared value of x;< / x> < / x> Output, the client and server get<tanh(x)> 1 and<tanh(x)> 2, where tanh(x) =<tanh(x)> 1+<tanh(x)> 2; The secure tanh protocol process includes: first, both parties call the secure sigmoid function and input 2* <x> 1,2* <x>2, the outputs are recorded as [y]1, [y]2 respectively; then both parties call the mul_to_add function, input [y]1, [y]2 respectively, and get the outputs respectively <z> 1, <z>2; Then the client performs the calculation<tanh(x)> 1=2* <z>1. Server-side calculation<tanh(x)> 2=2* <z> 2-1, where <> represents additive secret sharing, [] represents multiplicative secret sharing, subscript 1 represents the shared data of the client, and subscript 2 represents the shared data of the server;< / z> < / z> < / z> < / z> < / x> < / x> Verify correctness: <tanh(x)>1+<tanh(x)>2=2* <z> 1+2* <z> 2-1< / z> < / z> =2*( <z> 1+ <z> 2) -1 = 2*[y]1*[y]2-1< / z> < / z> =2*σ(2* <x> 1+2* <x> 2)-1=2*σ(2*x)-1=tanh(x).< / x> < / x> 6. A safety prediction system for personnel mobility, characterized in that: The system comprises: a trusted third party, a client device as claimed in claim 4 and a server as claimed in claim 5 .

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method according to any one of claims 1 to 2 is implemented.

Citation Information

Patent Citations

  • Privacy protection linear regression method based on secret sharing and random disturbance

    CN113065145A