Secure model aggregation method and apparatus
A method includes: receiving M scrambled models from M online service nodes; receiving descrambling secrets from T online service nodes, where a descrambling secret of any online service node is determined based on M first shared keys of the online service node corresponding to the M online service nodes and N−M second shared keys of the online service node corresponding to N−M offline service nodes; and determining an aggregated model, where disturbance vectors of the M scrambled models are determined based on the descrambling secrets from the at least T online service nodes, at least N−T+1 first subsecrets determined by each service node based on N first shared keys and a first disturbance item corresponding to the service node, and at least N−T+1 second subsecrets determined by the service node based on N second shared keys and a second disturbance item corresponding to the service node.
1 . A method, applicable for a central node, comprising:
receiving M scrambled models from M online service nodes, wherein a scrambled model of any online service node in the M online service nodes is determined by scrambling a submodel of the any service node based on a first disturbance item and a second disturbance item that correspond to the any online service node;
sending offline service node information to at least T online service nodes in the M online service nodes, wherein the offline service node information comprises information about N-M offline service nodes in a service node cluster corresponding to the central node, the service node cluster comprises N service nodes, N is greater than or equal to M, M is greater than or equal to T, and T is greater than or equal to 1 and less than or equal to N;
receiving descrambling secrets from the at least T online service nodes, wherein a descrambling secret of any online service node in the at least T online service nodes is determined based on M first shared keys of the any online service node that correspond to the M online service nodes and N-M second shared keys of the any online service node that correspond to the N-M offline service nodes;
determining an aggregated model based on the M scrambled models and disturbance vectors of the M scrambled models, wherein the disturbance vectors are determined based on the descrambling secrets from the at least T online service nodes and at least N−T+1 first subsecrets and at least N−T+1 second subsecrets of each service node in the N service nodes;
determining at least N−T+1 first subsecrets of any service node in the N service nodes based on a first disturbance item of the any service node, N first shared keys of the any service node that correspond to the N service nodes, and at least N−T+1 specified constants; and
determining at least N−T+1 second subsecrets based on a second disturbance item of the any service node, N second shared keys of the any service node that correspond to the N service nodes, and the at least N−T+1 specified constants.
2 . The method according to claim 1 , further comprising:
receiving the at least N−T+1 first subsecrets and the at least N−T+1 second subsecrets from the any service node in the N service nodes.
3 . The method according to claim 1 , further comprising:
determining the scrambled model of the any online service node in the M online service nodes based on a sum of the submodel of the any online service node and a scrambling random number; and
obtaining the scrambling random number by performing a random number generation operation on a sum of the first disturbance item and the second disturbance item of the any online service node by using a specified random number generation algorithm.
4 . The method according to claim 3 , wherein the specified random number generation algorithm satisfies a sum of a first sub scrambling random number obtained by performing a random number generation operation on the first disturbance item and a second sub scrambling random number obtained by performing a random number generation operation on the second disturbance item that is equal to the scrambling random number obtained by performing the random number generation operation on the sum of the first disturbance item and the second disturbance item.
5 . The method according to claim 1 , further comprising:
determining the N first shared keys of the any service node in the N service nodes that correspond to the N service nodes based on N shared keys of the any service node that correspond to the N service nodes and a first time parameter; and
determining the N second shared keys of the any service node in the N service nodes that correspond to the N service nodes based on the N shared keys of the any service node that correspond to the N service nodes and a second time parameter.
6 . A method, applicable for an online service node, comprising:
sending a scrambled model to a central node, wherein the scrambled model is determined by scrambling a submodel of the online service node based on a first disturbance item and a second disturbance item that correspond to the online service node;
receiving offline service node information from the central node, wherein the offline node information comprises information about N-M offline service nodes in a service node cluster corresponding to the central node, the service node cluster comprises N service nodes, the N service nodes comprise the online service node, and N is greater than or equal to M; and
sending a descrambling secret to the central node, wherein the descrambling secret is determined based on M first shared keys of the online service node that correspond to M online service nodes in the service node cluster and N-M second shared keys of the online service node that correspond to the N-M offline service nodes.
7 . The method according to claim 6 , further comprising:
sending at least N−T+1 first subsecrets and at least N−T+1 second subsecrets to the central node, wherein T is greater than or equal to 1 and is less than or equal to N;
determining the at least N−T+1 first subsecrets based on the first disturbance item, N first shared keys of the online service node that correspond to the N service nodes, and at least N−T+1 specified constants; and
determining the at least N−T+1 second subsecrets based on the second disturbance item, N second shared keys of the online service node that correspond to the N service nodes, and the at least N−T+1 specified constants.
8 . The method according to claim 7 , further comprising:
determining the scrambled model based on a sum of the submodel and a scrambling random number; and
obtaining the scrambling random number by performing a random number generation operation on a sum of the first disturbance item and the second disturbance item by using a specified random number generation algorithm.
9 . The method according to claim 8 , wherein the specified random number generation algorithm satisfies a sum of a first sub scrambling random number obtained by performing a random number generation operation on the first disturbance item and a second sub scrambling random number obtained by performing a random number generation operation on the second disturbance item that is equal to the scrambling random number obtained by performing the random number generation operation on the sum of the first disturbance item and the second disturbance item.
10 . The method according to claim 6 , wherein the N first shared keys of the online service node that correspond to the N service nodes are determined based on N shared keys of the online service node that correspond to the N service nodes and a first time parameter; and
the N second shared keys of the online service node that correspond to the N service nodes are determined based on the N shared keys of the online service node that correspond to the N service nodes and a second time parameter.
11 . An apparatus, used in a central node, and comprising a processor coupled to a memory storing instructions, which, when executed by the processor, cause the apparatus to:
receive M scrambled models from M online service nodes, wherein a scrambled model of any online service node in the M online service nodes is determined by scrambling a submodel of the any service node based on a first disturbance item and a second disturbance item that correspond to the any online service node;
send offline service node information to at least T online service nodes in the M online service nodes, wherein the offline service node information comprises information about N-M offline service nodes in a service node cluster corresponding to the apparatus, the service node cluster comprises N service nodes, N is greater than or equal to M, M is greater than or equal to T, and T is greater than or equal to 1 and less than or equal to N;
receive descrambling secrets from the at least T online service nodes, wherein a descrambling secret of any online service node in the at least T online service nodes is determined based on M first shared keys of the any online service node that correspond to the M online service nodes and N-M second shared keys of the any online service node that correspond to the N-M offline service nodes; and
determine an aggregated model based on the M scrambled models and disturbance vectors of the M scrambled models, wherein the disturbance vectors are determined based on the descrambling secrets from the at least T online service nodes and at least N−T+1 first subsecrets and at least N−T+1 second subsecrets of each service node in the N service nodes, at least N−T+1 first subsecrets of any service node in the N service nodes are determined based on a first disturbance item of the any service node, N first shared keys of the any service node that correspond to the N service nodes, and at least N−T+1 specified constants, and at least N−T+1 second subsecrets are determined based on a second disturbance item of the any service node, N second shared keys of the any service node that correspond to the N service nodes, and the at least N−T+1 specified constants.
12 . The apparatus according to claim 11 , wherein the instructions are further executed by the processor to cause the apparatus to:
receive the at least N−T+1 first subsecrets and the at least N−T+1 second subsecrets from the any service node in the N service nodes.
13 . The apparatus according to claim 11 , wherein the scrambled model of the any online service node in the M online service nodes is determined based on a sum of the submodel of the any online service node and a scrambling random number, and the scrambling random number is obtained by performing a random number generation operation on a sum of the first disturbance item and the second disturbance item of the any online service node by using a specified random number generation algorithm.
14 . The apparatus according to claim 13 , wherein the specified random number generation algorithm satisfies that a sum of a first sub scrambling random number obtained by performing a random number generation operation on the first disturbance item and a second sub scrambling random number obtained by performing a random number generation operation on the second disturbance item that is equal to the scrambling random number obtained by performing the random number generation operation on the sum of the first disturbance item and the second disturbance item.
15 . The apparatus according to claim 11 , wherein the N first shared keys of the any service node in the N service nodes that correspond to the N service nodes are determined based on N shared keys of the any service node that correspond to the N service nodes and a first time parameter; and
the N second shared keys of the any service node in the N service nodes that correspond to the N service nodes are determined based on the N shared keys of the any service node that correspond to the N service nodes and a second time parameter.
16 . An apparatus, used in an online service node, and comprising a processor coupled to a memory storing instructions, which, when executed by the processor, cause the apparatus to:
send a scrambled model to a central node, wherein the scrambled model is determined by scrambling a submodel of the online service node based on a first disturbance item and a second disturbance item that correspond to the online service node;
receive offline service node information from the central node, wherein the offline node information comprises information about N-M offline service nodes in a service node cluster corresponding to the central node, the service node cluster comprises N service nodes, the N service nodes comprise the online service node, and N is greater than or equal to M; and
send a descrambling secret to the central node, wherein the descrambling secret is determined based on M first shared keys of the online service node that correspond to M online service nodes in the service node cluster and N-M second shared keys of the online service node that correspond to the N-M offline service nodes.
17 . The apparatus according to claim 16 , wherein the instructions are further executed by the processor to cause the apparatus to:
send at least N−T+1 first subsecrets and at least N−T+1 second subsecrets to the central node, wherein T is greater than or equal to 1 and is less than or equal to N; and
the at least N−T+1 first subsecrets are determined based on the first disturbance item, N first shared keys of the online service node that correspond to the N service nodes, and at least N−T+1 specified constants, and the at least N−T+1 second subsecrets are determined based on the second disturbance item, N second shared keys of the online service node that correspond to the N service nodes, and the at least N−T+1 specified constants.
18 . The apparatus according to claim 17 , wherein the scrambled model is determined based on a sum of the submodel and a scrambling random number, and the scrambling random number is obtained by performing a random number generation operation on a sum of the first disturbance item and the second disturbance item by using a specified random number generation algorithm.
19 . The apparatus according to claim 18 , wherein the specified random number generation algorithm satisfies a sum of a first sub scrambling random number obtained by performing a random number generation operation on the first disturbance item and a second sub scrambling random number obtained by performing a random number generation operation on the second disturbance item that is equal to the scrambling random number obtained by performing the random number generation operation on the sum of the first disturbance item and the second disturbance item.
20 . The apparatus according to claim 16 , wherein the N first shared keys of the online service node that correspond to the N service nodes are determined based on N shared keys of the online service node that correspond to the N service nodes and a first time parameter; and
the N second shared keys of the online service node that correspond to the N service nodes are determined based on the N shared keys of the online service node that correspond to the N service nodes and a second time parameter.