Disclosure of Invention
The purpose of the invention is as follows: the invention provides a distributed aggregation game method and a distributed aggregation game system based on network communication homomorphic encryption, which aim to solve the technical problem that the privacy protection is poorer by the existing distributed consistency algorithm based on network communication, and finally achieve the aims of achieving a consistency agreement and achieving a Nash equilibrium point by the system under the condition that the individual privacy is not disclosed by a user.
The technical scheme is as follows: in order to achieve the purpose, the invention adopts the following technical scheme:
a distributed aggregation gaming method based on network communication homomorphic encryption comprises the following steps:
(1) each user node i in the initial time network determines the relation between the estimation of the total decision quantity and the decision quantity of the user node i according to the cost function, and initializes the estimation D of the total decision quantityi(0) Auxiliary variable kappai(0) And a neighbor set directly connected with the neighbor set in the communication network, and calculating to obtain a self decision quantity li(0) And a public and private key pair;
(2) at time t each user node i generates a random number a for each neighbor node jij(t) calculating to obtain an encryption item deltax by applying a privacy encryption protocolij(ii) a The encryption term Δ xijInformation including a difference between the user node and a neighboring node with respect to the total decision quantity estimation;
(3) each user node i transmits k to the neighbors through the communication networki(t) and deriving an estimate D of the total decision quantity at the next time instant according to a consistency protocoli(t +1) and an auxiliary variable κi(t + 1); wherein the auxiliary variable κi(t +1) summarizing the delta x of all the neighbor nodes of the user node iij;
(4) Each user node i according to Di(t +1) obtaining the decision quantity l at the next momenti(t+1);
(5) And (4) each user node i judges whether the termination condition is met, if the termination condition is not met, the step (2) is continuously operated until the termination condition is met.
Preferably, in the step (1), the communication network structure is represented by a connectionless graph, and the pairwise neighbor relationship is determined according to the position relationship between the user nodes.
Preferably, the relationship between the estimation of the total decision quantity and the self decision quantity is expressed as:
li(t)=-βiDi(t)+γi
wherein beta isi、γiAre coefficients related to a cost function.
Preferably, in the step (2), each user node i generates its own public key and private key pair according to the following steps
i. User node i selects two prime numbers p with the same byte length
i,
And calculate n
i=p
iq
i;
Let λi=φ(ni)=(pi-1)(qi-1), where Φ (·) is an euler function;
let ui=φ(ni)-1mod niI.e. muiIs phi (n)i) Is the inverse of the modulo multiplication ofi*φ(ni)=1modni;
Obtaining a public key
Private key
Preferably, the privacy encryption protocol in the step (2) adopts a paillier encryption algorithm.
Preferably, in the step (2), a privacy encryption protocol is used to exchange information through a communication network, and each user node i obtains Δ x of each neighbor node jijConcretely speaking, pressThe method comprises the following steps:
i. user nodes i, j use their own public keys to respective Di(t),Dj(t) encrypting to obtain epsiloni(Di(t)),εj(Dj(t)); ε represents the encryption operation;
ii, respectively transmitting the encrypted values and the public key to the opposite side, and obtaining epsilon by the user node i
j(D
j(t)) and
user node j gets ε
i(D
i(t)) and
iii, the user nodes i and j respectively use the public keys of the opposite sides to encrypt the negative values of the user nodes to obtain epsilonj(-Di(t)) and εi(-Dj(t));
iv, multiplying the two values by the user nodes i, j respectively, and obtaining epsilon according to the property of the public keyj(Dj(t)-Di(t)),εi(Di(t)-Dj(t));
v. user nodes i, j respectively make the values obtained in the previous step into power aij(t) and aji(t), deriving ε by public key propertiesj(aij(t)(Dj(t)-Di(t))) and εi(aji(t)(Di(t)-Dj(t)));aij(t) and aji(t) is a random number;
vi, the user node i, j returns the value obtained in the previous step to the opposite side;
user nodes i, j decrypt the received values using their own keys and multiply the weights a, respectivelyij(t) and aji(t), final results were obtained: Δ xij=aij(t)aji(t)(Di(t)-Dj(t)) and Δ xji=aji(t)aij(t)(Dj(t)-Di(t))。
Preferably, in the step (3), the estimation of the total decision quantity is updated according to the following formula:
where N is the total number of user nodes in the communication network,
a neighbor set of a user node i is defined, and epsilon is a step length;
the auxiliary variable is updated according to the following formula:
preferably, the iteration termination condition in step (5) is expressed as:
|Di(t+1)-Di(t)|<10-3
|κi(t+1)-κi(t)|<10-5
if the user node i simultaneously satisfies the above two conditions, the iteration is terminated, Di,κi,liRemain unchanged.
Based on the same inventive concept, the invention provides a distributed aggregation game system based on network communication homomorphic encryption, wherein each user node participating in decision in a communication network is provided with the following modules:
an initialization module used for the user node i at the initial moment to determine the relation between the estimation of the total decision quantity and the decision quantity of the user node i according to the cost function and initialize the estimation D of the total decision quantityi(0) Auxiliary variable kappai(0) And a neighbor set directly connected with the neighbor set in the communication network, and calculating to obtain a self decision quantity li(0) And a public and private key pair;
a privacy encryption module for generating a random number a for each neighbor node j at a time tij(t) calculating to obtain an encryption item deltax by applying a privacy encryption protocolij(ii) a The encryption term Δ xijIncluding the total decision between the user node and the neighbor nodeInformation of the difference of the quantity estimates;
information transmission and update module for user node i to transmit k to neighbor through communication networki(t) and deriving an estimate D of the total decision quantity at the next time instant according to a consistency protocoli(t +1) and an auxiliary variable κi(t + 1); wherein the auxiliary variable κi(t +1) summarizing the delta x of all the neighbor nodes of the user node iij(ii) a And according to Di(t +1) obtaining the decision quantity l at the next momenti(t+1);
And the control module is used for calling the privacy encryption module at each moment t and making a decision by the information transmission and updating module until a termination condition is reached.
Based on the same inventive concept, the invention provides a distributed aggregation gaming system based on network communication homomorphic encryption, wherein each user node participating in decision in a communication network comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, and the computer program realizes the following method steps when being loaded on the processor:
(1) determining the relation between the estimation of the total decision quantity and the decision quantity of the user according to the cost function at the initial moment, and initializing the estimation D of the total decision quantityi(0) Auxiliary variable kappai(0) And a neighbor set directly connected with the neighbor set in the communication network, and calculating to obtain a self decision quantity li(0) And a public and private key pair;
(2) generating a random number a for each bit neighbor node j at time tij(t) calculating to obtain an encryption item deltax by applying a privacy encryption protocolij(ii) a The encryption term Δ xijInformation including a difference between the user node and a neighboring node with respect to the total decision quantity estimation;
(3) transmission of k to neighbors over communication networksi(t) and deriving an estimate D of the total decision quantity at the next time instant according to a consistency protocoli(t +1) and an auxiliary variable κi(t + 1); wherein the auxiliary variable κi(t +1) summarizing the delta x of all the neighbor nodes of the user node iij;
(4) According to Di(t +1) obtaining the decision quantity l at the next momenti(t+1);
(5) And (4) judging whether the termination condition is reached, if not, continuing to operate the step (2) until the termination condition is met.
Has the advantages that: compared with the prior art, the invention has the beneficial effects that: 1. the invention provides a distributed aggregation game method based on a consistency protocol, which can efficiently reach the Nash equilibrium point of a system and optimize the decision of each user. 2. In the process of reaching the Nash equilibrium point based on the communication network, the privacy of each user is effectively protected by applying the homomorphic encryption algorithm, namely the decision quantity of a neighbor can not be calculated by the value obtained by communication of each user, and the actual application value of the distributed aggregation game is improved.
Detailed Description
The invention is further described with reference to the drawings and examples.
As shown in fig. 1, a distributed aggregation gaming method based on network communication homomorphic encryption disclosed in the embodiment of the present invention includes the following specific steps:
(1) at the initial moment, each user node i in the network obtains the relation between the total decision quantity and the self decision quantity according to the self cost function, and initializes the estimation D of the total decision quantity
i(0) Auxiliary variable kappa
i(0) Neighbor set
Calculating to obtain self decision quantity l
i(0) And public and private key pair
Initializing an initial iteration round number t which is 0 and taking a step length epsilon;
(2) each user section at time tThe point i generates a random number a for each bit of neighbor node jij(t) calculating to obtain an encryption item deltax by applying a privacy encryption protocolij;
(3) Each user node i transmits k to the neighbors through the communication networki(t) and deriving D according to a coherency protocoli(t +1) and κi(t+1);
(4) Each user node i according to Di(t +1) obtaining the decision quantity l at the next momenti(t+1);
(5) And (4) each user node i judges whether the termination condition is met, if the termination condition is not met, the step (2) is continuously operated until the termination condition is met.
In specific implementation, the communication network structure is represented by a non-directional connected graph in the step (1), the total number of user nodes participating in decision making is N, and the pairwise neighbor relation is determined according to the position relation between users. The relationship between the estimation of the total decision amount and the self decision amount by the user node is determined according to a specific application scenario, and the embodiment takes the decision of the power consumption in a Heating Ventilation and Air Conditioning (Heating Ventilation and Air Conditioning) system as an example for explanation.
The step (1) specifically comprises the following steps:
(a) each user node i determines a cost function according to the condition of the user node i, wherein in the example:
wherein
Representing cost functions in HVAC systems, dependent on their power usage l
iAnd the actual total power consumption
(i.e., the total amount of decisions that this embodiment needs to estimate), v
i,ξ
iWhich represents the coefficient of heat transfer,
is vitamin A toThe amount of power required to maintain the desired temperature; c may be referred to as a price coefficient (representing the conversion of the calculation unit to the actual unit), p
0Representing the lowest unit price (the formula l can be put forward)
iCoefficient of
Is monovalent); v. of
i,ξ
i,c,
p
oAre all constant and
c>0。
(b) the step size epsilon is determined according to the desired iteration speed,
wherein
The convergence of algorithm iteration can be ensured by the values, and the more accurate range is
(c) Each user node initializes an estimate D of the total decision quantity
i(0) Auxiliary variable kappa
i(0) And neighbor set
Whether Di(0) How the value is taken, the algorithm converges through enough iteration rounds, but if D isi(0) With a large difference from the sum of the true values or D between usersi(0) The number of iteration rounds of algorithm convergence is larger when the difference is larger. Usually kappai(0) Take 0.
(d) Each user node generates its own public key and private key pair
The method specifically comprises the following steps:
i. the user node i selects two sufficiently large prime numbers p of the same byte length
i,
And calculate n
i=p
iq
i。
Let λi=φ(ni)=(pi-1)(qi-1), where φ (·) is an Euler function.
Let ui=φ(ni)-1modniI.e. muiIs phi (n)i) Is the inverse of the modulo multiplication ofi*φ(ni)=1modni。
Obtaining a public key
Private key
(e) Each user node i gets l by bringing t to 0 according to formula (i)i(0):
li(t)=-βiDi(t)+γi (Ι)
In the step (2), the privacy encryption protocol adopts a paillier encryption algorithm, which specifically comprises the following steps:
(a) each user node i to each neighbor
Random generation of a
ij(t) in which
(b) Private encryption protocol-encryption
The method specifically comprises the following steps:
i. definition of
Wherein gcd (a, b) represents the greatest common divisor of a and b, and n is a public key.
iii. ciphertext c ═ (n +1)
mr
nmod n
2Wherein
(c) Private encryption protocol-decryption
The method specifically comprises the following steps:
i. defining a real decomposition function
Plain text m ═ L (c)λmod n2) μ mod n, (λ, μ) is the private key.
(d) Information is exchanged via the communication network using a privacy encryption protocol, and each user node i obtains each neighbor
Δ x of
ijAs shown in fig. 3, the user node i and the user node j specifically perform the following steps:
i. user nodes i, j use their own public keys to respective Di(t),Dj(t) encrypting to obtain epsiloni(Di(t)),εj(Dj(t));
ii, respectively transmitting the encrypted values and the public key to the opposite side, and obtaining epsilon by the user node i
j(D
j(t)) and
user node j gets ε
i(D
i(t)) and
iii, the user nodes i and j respectively use the public keys of the opposite sides to encrypt the negative values of the user nodes to obtain epsilonj(-Di(t)) and εi(-Dj(t));
iv, multiplying the two values by the user nodes i, j respectively, and obtaining epsilon according to the property of the public keyj(Dj(t)-Di(t)),εi(Di(t)-Dj(t));
v. user nodes i, j respectively make the values obtained in the previous step into power aij(t) and aji(t), deriving ε by public key propertiesj(aij(t)(Dj(t)-Di(t))) and εi(aji(t)(Di(t)-Dj(t)));
vi, the user node i, j returns the value obtained in the previous step to the opposite side;
user nodes i, j decrypt the received values using their own keys and multiply the weights a, respectivelyij(t) and aji(t) obtaining the final result
Δxij=aij(t)aji(t)(Di(t)-Dj(t)) and Δ xji=aji(t)aij(t)(Dj(t)-Di(t))
In the step (3), the method specifically comprises the following steps:
(a) each user node transmits k to neighbors through a communication network
i(t) each user node receives k of the neighbor transmission
j(t),
(b) And each user node I updates the estimation of the total decision quantity according to the formula (I):
(c) and each user node i updates the auxiliary variable according to the formula (I):
in step (4), each user node i updates the estimate of the total decision quantity according to equation (IV).
li(t+1)=-βiDi(t+1)+γi (IV)
In step (5), each user node i judges iteration termination conditions (V) and (VI)
|Di(t+1)-Di(t)|<10-3 (V)
|κi(t+1)-κi(t)|<10-5 (VI)
If user node i satisfies (V) and (VI), the iteration terminates, Di,κi,liRemain unchanged.
And if the user node i does not satisfy the (V) or (VI), performing the next iteration, and adding one to the iteration time t.
The following describes in detail a specific iterative process of each user node in the embodiment of the present invention by taking the network topology shown in fig. 2 as an example. In this example, the total number N of user nodes participating in the decision is 6. The specific process is as follows:
(1) each user node initializes a cost function according to the condition of the user node
β
i,γ
iEstimate of the total decision quantity D
i(0) Auxiliary variable kappa
i(0) Neighbor set
Calculated to obtain l
i(0) And public and private key pair
Initializing an initial iteration round number t which is 0 and taking a step length epsilon; in this example, c is 1, p
0=1。
Table 1 initialization environment data
Determining the step size according to the desired iteration speed
Wherein
Each user node generates its own public key and private key pair
In this example, p and q are selected within the range [0,2 ]
20]Meanwhile, each user node i gets l by bringing t to 0 according to formula (i)
i(0)。
Table 2 selection results
(2) Each user node generates a random number a for each neighborij(t), calculating to obtain delta x by applying privacy encryption protocolij。
Each user node i to each neighbor
Random generation of a
ij(t) in which
In this example get
a=0.9,
An initial random matrix A (t), wherein A
ij(t)=a
ij(t)*a
ji(t)。
TABLE 3 initial random matrix
0
|
1.0065
|
0.8980
|
0
|
0
|
0
|
1.0065
|
0
|
1.1205
|
0
|
0
|
0
|
1.1068
|
1.1205
|
0
|
1.0334
|
0.8592
|
0.9012
|
0
|
0
|
1.0334
|
0
|
0.9168
|
0
|
0
|
0
|
0.8592
|
0.9168
|
0
|
0
|
0
|
0
|
0.9012
|
0
|
0
|
0 |
(3) Each user node transmits k to neighbors through a communication networki(t), updating the estimation of the total decision quantity according to the formula (I), and updating the auxiliary variable according to the formula (I):
TABLE 4 results of the three rounds of updating
(4) Each user node is according to Di(t +1) obtaining the decision quantity l at the next momenti(t +1), the update results are as above.
(5) And (3) each user node judges whether the termination condition is met, if the termination condition is not met, the step (2) is continuously operated until the termination conditions (V) and (VI) are met.
TABLE 5 results of iterative examination
And the first round and the second round of iteration do not meet the convergence condition, so each user node continues iteration, and the number t of the iteration rounds is increased by one.
In this example, the final convergence round number t is 2685. In this example, the decision quantity is small, Di(0) The value range is [240,300 ]]. If the decision quantity is large in value in practical application, the value range of p and q in the public and private keys is increased.
Based on the same inventive concept, the embodiment of the invention provides a distributed aggregation game system based on network communication homomorphic encryption, wherein each user node participating in decision in a communication network is provided with the following modules: an initialization module used for the user node i at the initial moment to determine the relation between the estimation of the total decision quantity and the decision quantity of the user node i according to the cost function and initialize the estimation D of the total decision quantityi(0) Auxiliary variable kappai(0) And a neighbor set directly connected with the neighbor set in the communication network, and calculating to obtain a self decision quantity li(0) And a public and private key pair; a privacy encryption module for generating a random number a for each neighbor node j at a time tij(t) calculating to obtain an encryption item deltax by applying a privacy encryption protocolij(ii) a Information transmission and update module for user node i to transmit k to neighbor through communication networki(t) and deriving an estimate D of the total decision quantity at the next time instant according to a consistency protocoli(t +1) and an auxiliary variable κi(t + 1); and according to Di(t +1) obtaining the decision quantity l at the next momenti(t + 1); and the control module is used for calling the privacy encryption module at each moment t and making a decision by the information transmission and updating module until a termination condition is reached. For details of the implementation of each module, reference is made to the above method embodiments, which are not described herein again.
Based on the same inventive concept, an embodiment of the present invention provides a distributed aggregation gaming system based on network communication homomorphic encryption, in which each user node participating in a decision in a communication network includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the computer program is loaded into the processor, the computer program implements the following method steps:
(1) determining the relation between the estimation of the total decision quantity and the decision quantity of the user according to the cost function at the initial moment, and initializing the estimation of the total decision quantityDi(0) Auxiliary variable kappai(0) And a neighbor set directly connected with the neighbor set in the communication network, and calculating to obtain a self decision quantity li(0) And a public and private key pair;
(2) generating a random number a for each bit neighbor node j at time tij(t) calculating to obtain an encryption item deltax by applying a privacy encryption protocolij;
(3) Transmission of k to neighbors over communication networksi(t) and deriving an estimate D of the total decision quantity at the next time instant according to a consistency protocoli(t +1) and an auxiliary variable κi(t+1);
(4) According to Di(t +1) obtaining the decision quantity l at the next momenti(t+1);
(5) And (4) judging whether the termination condition is reached, if not, continuing to operate the step (2) until the termination condition is met.
For details of the implementation of each step, reference is made to the above method embodiments, which are not described herein again.