CN117724854A - Data processing method, device, equipment and readable storage medium - Google Patents

Data processing method, device, equipment and readable storage medium Download PDF

Info

Publication number
CN117724854A
CN117724854A CN202410177139.7A CN202410177139A CN117724854A CN 117724854 A CN117724854 A CN 117724854A CN 202410177139 A CN202410177139 A CN 202410177139A CN 117724854 A CN117724854 A CN 117724854A
Authority
CN
China
Prior art keywords
arithmetic
slice
factor
secret
bit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202410177139.7A
Other languages
Chinese (zh)
Other versions
CN117724854B (en
Inventor
张凡
陈鹏
杨晓峰
黄丹青
黄晨宇
饶华铭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202410177139.7A priority Critical patent/CN117724854B/en
Publication of CN117724854A publication Critical patent/CN117724854A/en
Application granted granted Critical
Publication of CN117724854B publication Critical patent/CN117724854B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Storage Device Security (AREA)

Abstract

The application discloses a data processing method, a device, equipment and a readable storage medium, wherein the method comprises the following steps: performing slicing scaling on the first secret arithmetic slicing to obtain first scaling arithmetic slicing and a first scaling factor; generating a reciprocal factor slice based on the first scaling factor and the first arithmetic scaling slice; acquiring bit unit fragments on each bit in a first scaling factor, respectively performing fragment selection operation on the P bit unit fragments and the reciprocal factor fragments based on the stretching factor to obtain P selected arithmetic fragments, and performing fragment addition operation on the P selected arithmetic fragments to obtain a restored reciprocal arithmetic fragment; performing piecewise multiplication operation on the second secret arithmetic slicing and the restored reciprocal arithmetic slicing to obtain target secret arithmetic slicing; the target secret arithmetic slice is used to provide computing services for the federal model. By adopting the method and the device, the calculation accuracy and the calculation speed of the federal model calculation service can be improved.

Description

Data processing method, device, equipment and readable storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a data processing method, apparatus, device, and readable storage medium.
Background
In the federal model, a first secret arithmetic fragment is input by a first participant, a second secret arithmetic fragment is input by a second participant, the first secret arithmetic fragment and the second secret arithmetic fragment participate in training the federal model together, and in the training process of the federal model, two-side fragment division (namely, fragment division of the first secret arithmetic fragment and the second secret arithmetic fragment) related to floating point numbers is an important basic operation.
The existing two-party segmentation division is realized based on Goldschmidt (approximate division), and Goldschmidt approximates by performing reciprocal operation on divisors and dividends in two-party segmentation division, when the method is applied to secret segmentation, if a stretching factor used by floating point number coding is larger, or a first secret arithmetic segmentation is larger, or a second secret arithmetic segmentation is larger, when Goldschmidt iterates on the first secret arithmetic segmentation, the generated reciprocal segmentation is too large, and when the generated reciprocal segmentation and the second secret arithmetic segmentation are subjected to two-party segmentation multiplication, the reciprocal segmentation is also caused to cross the boundary, so that the integer ring structure of the segmentation operation is enlarged, and the calculation time cost of at least doubling is brought.
In order to avoid boundary crossing, the stretching factor is reduced in the prior art, so that the accuracy of the division of the two-side fragments is greatly reduced, and on the other hand, the reciprocal fragments are directly multiplied by the second arithmetic secret fragments, so that the calculation complexity is high and the calculation speed is low.
Disclosure of Invention
The embodiment of the application provides a data processing method, a device, equipment and a readable storage medium, which can improve the calculation accuracy and calculation speed of federal model calculation service.
In one aspect, an embodiment of the present application provides a data processing method, including:
acquiring a first secret arithmetic fragment corresponding to the first service data, acquiring a second secret arithmetic fragment corresponding to the second service data, and carrying out fragment scaling on the first secret arithmetic fragment to obtain a first scaling arithmetic fragment and a first scaling factor corresponding to the first secret arithmetic fragment; the first secret arithmetic slice is input by a first participant, and the second secret arithmetic slice is input by a second participant; the first business data and the second business data participate in training a federal model aiming at the first participator and the second participator; the first scaling factor has P bits, P being a positive integer;
generating reciprocal factor slices corresponding to the first secret arithmetic slices based on the first scaling factors and the first scaling arithmetic slices;
Acquiring bit unit fragments on each bit in a first scaling factor, respectively performing fragment selection operation on the P bit unit fragments and reciprocal factor fragments based on a stretching factor to obtain P selected arithmetic fragments, and performing fragment addition operation on the P selected arithmetic fragments to obtain restored reciprocal arithmetic fragments corresponding to the first secret arithmetic fragments;
performing piecewise multiplication operation on the second secret arithmetic slicing and the restored reciprocal arithmetic slicing to obtain target secret arithmetic slicing; the target secret arithmetic shard is used to provide a computational service for the federation model for the first business data and the second business data.
Wherein the P bit unit slices include C first bit unit slices and D second bit unit slices, and the P selection arithmetic slices include C first selection arithmetic slices and D second selection arithmetic slices; d is the value of the stretching factor, C is the difference between P and the stretching factor;
obtaining P bit unit fragments in the first scaling factor, based on the stretching factor, performing fragment selection operation on the P bit unit fragments and the reciprocal factor fragments respectively to obtain P selection arithmetic fragments, performing fragment addition operation on the P selection arithmetic fragments to obtain reduction reciprocal arithmetic fragments corresponding to the first secret arithmetic fragments, and comprising:
Based on the stretching factors, C first bit unit fragments and D second bit unit fragments in the first scaling factors are obtained, fragment selection operation is carried out on the C first bit unit fragments and the reciprocal factor fragments respectively to obtain C first selection arithmetic fragments, and fragment selection operation is carried out on the D second bit unit fragments and the reciprocal factor fragments respectively to obtain D second selection arithmetic fragments; the bits of the C first bit unit slices in the first scaling factor are higher than the dividing bits; dividing the bit refers to the highest bit of the D second bit unit slices in the first scaling factor;
and generating a reduction reciprocal arithmetic slice corresponding to the first secret arithmetic slice through the first reduction factors corresponding to the C first selection arithmetic slices and the second reduction factors corresponding to the D second selection arithmetic slices.
Wherein the C first bit unit slices comprise first bit unit slices,/>Slicing the bit unit of the ith bit in the first scaling factor, wherein i is a positive integer;
performing a slice selection operation on the C first bit unit slices and the reciprocal factor slices, respectively, to obtain C first selection arithmetic slices, including:
slicing the first bit unit Performing fragment selection operation with the reciprocal factor fragments;
if the first bit unit is slicedFor a first boolean value, the reciprocal factor slice is determined as the first bit unit slice +.>A corresponding first selected arithmetic slice;
if the first bit unit is slicedFor the second boolean value the value of the second boolean value,then the first boolean value is determined to be the first bit unit sliceThe corresponding first selected arithmetic slice.
Wherein generating a reduced reciprocal arithmetic slice corresponding to the first secret arithmetic slice by a first reduction factor corresponding to the C first selected arithmetic slices and a second reduction factor corresponding to the D second selected arithmetic slices, comprises:
determining the operation results of the fragment addition operation of the C first selected arithmetic fragments as first reduction factors;
determining the operation results of the slicing addition operation of the D second selected arithmetic slices as factors to be cut, and cutting bits of the factors to be cut based on the stretching factors to obtain second reduction factors;
and performing fragment addition operation on the first reduction factor and the second reduction factor to obtain a reduction reciprocal arithmetic fragment corresponding to the first secret arithmetic fragment.
The method for obtaining the first secret arithmetic fragment corresponding to the first service data comprises the following steps:
Acquiring first service data, and determining a stretching factor based on the bit width length of the first service data;
floating point number coding is carried out on the first service data based on the stretching factors to obtain stretching coding values, arithmetic slicing processing is carried out on the stretching coding values to obtain first secret arithmetic slicing and interactive arithmetic slicing; the stretching coding value is an element in an integer ring, and the operation result of the piecewise addition operation of the first secret arithmetic slicing and the interactive arithmetic slicing is the stretching coding value; the interactive arithmetic fragmentation is used to provide to the second party.
The method for scaling the first secret arithmetic slice to obtain a first scaling factor and a first scaling factor of the first scaling arithmetic slice corresponding to the first secret arithmetic slice comprises the following steps:
performing fragment symbol operation on the first secret arithmetic fragment to obtain a first fragment symbol of the first secret arithmetic fragment;
determining a first absolute value arithmetic slice and a first scaling factor corresponding to the first secret arithmetic slice based on the first slice symbol;
and performing piecewise multiplication operation on the first scaling factor and the first absolute value arithmetic slicing to obtain a first scaling arithmetic slicing corresponding to the first secret arithmetic slicing, and performing Boolean conversion operation on the first scaling factor to obtain the first scaling factor corresponding to the first secret arithmetic slicing.
Wherein determining, based on the first tile symbol, a first scaling factor corresponding to the first secret arithmetic tile comprises:
determining a first absolute value arithmetic slice of a first secret arithmetic slice based on the first slice symbol, converting the first absolute value arithmetic slice into a first absolute value Boolean slice, and obtaining a first target bit slice of the first absolute value Boolean slice; the first target bit slice is a Boolean slice corresponding to the target bit in the first absolute value Boolean slice; the target bit refers to the highest bit in the bits with the value of 1 in the first absolute value Boolean segment;
based on the stretching factors, carrying out bit inversion on the first target bit slices to obtain first scaling factors corresponding to the first secret arithmetic slices; the first scaling factor has E bits, the first target bit slice has G bits, G is a positive integer, and E is the difference between the value of twice the stretch factor and G.
Generating the reciprocal factor slice corresponding to the first secret arithmetic slice based on the first scaling factor and the first scaling arithmetic slice comprises the following steps:
determining an initial reciprocal factor corresponding to the first secret arithmetic slice based on the first scaling factor and the first scaling arithmetic slice, determining an initial iteration factor corresponding to the first secret arithmetic slice based on the initial reciprocal factor and the first scaling arithmetic slice, and generating an iterative arithmetic slice corresponding to the first secret arithmetic slice through iteration by the initial reciprocal factor and the initial iteration factor;
Generating reciprocal factor slices corresponding to the first secret arithmetic slices based on the iterative arithmetic slices and the first slice symbols; the first sliced symbol is obtained by performing a sliced symbol operation on the first secret arithmetic slice.
The iterative arithmetic slicing corresponding to the first secret arithmetic slicing is generated through iteration through the initial reciprocal factor and the initial iteration factor, and the iterative arithmetic slicing comprises the following steps:
acquiring an iteration number threshold; the iteration number threshold is a number threshold determined based on the accuracy of the federal model's computing service;
generating an updated reciprocal factor based on the initial reciprocal factor and the initial iteration factor, determining an operation result of the piecewise multiplication operation of the initial iteration factor as the updated iteration factor, continuously determining a new updated reciprocal factor and a new updated iteration factor based on the updated reciprocal factor and the updated iteration factor until the iteration number reaches an iteration number threshold, and determining the reciprocal factor with the iteration number reaching the iteration number threshold as the iterative arithmetic piecewise corresponding to the first secret arithmetic piecewise.
Performing a piece multiplication operation on the second secret arithmetic piece and the restored reciprocal arithmetic piece to obtain a target secret arithmetic piece, including:
performing slicing scaling on the second secret arithmetic slicing to obtain a second slicing symbol, a second target bit slicing and a second scaling arithmetic slicing corresponding to the second secret arithmetic slicing; the second scaling factor is determined based on the second secret arithmetic slice; the second target bit slice is a boolean slice corresponding to a target bit of a second absolute value boolean slice corresponding to the second secret arithmetic slice; the target bit refers to the highest bit in the bits with the value of 1 in the second absolute value Boolean segment;
Performing fragment multiplication operation on the reduced reciprocal arithmetic fragment and the second scaled arithmetic fragment to obtain an arithmetic fragment to be corrected, generating a corrected arithmetic fragment of the arithmetic fragment to be corrected based on the first fragment symbol and the second fragment symbol, generating a target reduced arithmetic fragment based on the bit unit fragment corresponding to each bit in the first scaled factor and the corrected arithmetic fragment, and generating a target secret arithmetic fragment based on the unit target bit factor corresponding to each bit in the second target bit fragment and the target reduced arithmetic fragment.
Wherein generating a target secret arithmetic slice based on the target restoration arithmetic slice and a unit target bit factor corresponding to each bit in the second target bit slice, comprises:
based on the stretching factors, C first target bit factors and D second target bit factors in the second target bit slices are obtained, the C first target bit factors and the target reduction arithmetic slices are subjected to slice selection operation respectively to obtain C first selection reduction slices, and the D second target bit factors and the target reduction arithmetic slices are subjected to slice selection operation respectively to obtain D second selection reduction slices; the bit positions of the C first target bit factors in the second target bit slices are higher than the bit positions of the scaling bits; the scaled bit refers to the highest bit of the D second target bit factors in the second target bit slice; d is the value of the stretching factor, C is the difference between P and the stretching factor;
And generating the target secret arithmetic slice through the first target factors corresponding to the C first selective reduction slices and the second target factors corresponding to the D second selective reduction slices.
Wherein the federal model is a longitudinal federal model;
performing a piece multiplication operation on the reduced reciprocal arithmetic piece and the second scaled arithmetic piece to obtain an arithmetic piece to be corrected, generating a corrected arithmetic piece of the arithmetic piece to be corrected based on the first piece symbol and the second piece symbol, generating a target reduced arithmetic piece based on the bit unit piece and the corrected arithmetic piece corresponding to each bit in the first scaled factor, generating a target secret arithmetic piece based on the unit target bit factor and the target reduced arithmetic piece corresponding to each bit in the second target bit piece, including:
performing piecewise multiplication operation on the second scaling arithmetic slicing to obtain a second scaling square slicing, performing piecewise multiplication operation on the reduction reciprocal arithmetic slicing and the second scaling square slicing to obtain an arithmetic slicing to be corrected, and generating a correction arithmetic slicing of the arithmetic slicing to be corrected based on the first slicing symbol;
generating a target restored arithmetic slice based on the bit unit slice and the corrected arithmetic slice corresponding to each bit in the first scaling factor, generating a target basic arithmetic slice based on the unit target bit factor and the target restored arithmetic slice corresponding to each bit in the second target bit slice, and generating a target secret arithmetic slice based on the unit target bit factor and the target basic arithmetic slice corresponding to each bit in the second target bit slice; the target secret arithmetic slicing is used for providing a computing service for the federation model for the first service data and the second service data, and the computing service is used for determining an optimal splitting result or leaf node weight of the longitudinal federation model.
An aspect of an embodiment of the present application provides a data processing apparatus, including:
the system comprises a segmentation scaling module, a segmentation scaling module and a scaling module, wherein the segmentation scaling module is used for acquiring a first secret arithmetic segmentation corresponding to first service data, acquiring a second secret arithmetic segmentation corresponding to second service data, and scaling the first secret arithmetic segmentation to obtain a first scaling arithmetic segmentation corresponding to the first secret arithmetic segmentation and a first scaling factor; the first secret arithmetic slice is input by a first participant, and the second secret arithmetic slice is input by a second participant; the first business data and the second business data participate in training a federal model aiming at the first participator and the second participator; the first scaling factor has P bits, P being a positive integer;
the reciprocal iteration module is used for generating reciprocal factor fragments corresponding to the first secret arithmetic fragments based on the first scaling factors and the first scaling arithmetic fragments;
the reciprocal reduction module is used for obtaining bit unit fragments on each bit in the first scaling factor, performing fragment selection operation on the P bit unit fragments and the reciprocal factor fragments based on the stretching factor to obtain P selected arithmetic fragments, and performing fragment addition operation on the P selected arithmetic fragments to obtain reduced reciprocal arithmetic fragments corresponding to the first secret arithmetic fragments;
The slicing processing module is used for carrying out slicing multiplication operation on the second secret arithmetic slicing and the restored reciprocal arithmetic slicing to obtain the target secret arithmetic slicing; the target secret arithmetic shard is used to provide a computational service for the federation model for the first business data and the second business data.
In one possible implementation, the P bitunit slices include C first bitunit slices and D second bitunit slices, and the P selected arithmetic slices include C first selected arithmetic slices and D second selected arithmetic slices; d is the value of the stretching factor, C is the difference between P and the stretching factor; the reciprocal reduction module is configured to obtain P bit unit slices in the first scaling factor, perform a slice selection operation on the P bit unit slices and the reciprocal factor slices based on the stretching factor, to obtain P selected arithmetic slices, and perform a slice addition operation on the P selected arithmetic slices, so as to perform the following operations when obtaining a reduced reciprocal arithmetic slice corresponding to the first secret arithmetic slice:
based on the stretching factors, C first bit unit fragments and D second bit unit fragments in the first scaling factors are obtained, fragment selection operation is carried out on the C first bit unit fragments and the reciprocal factor fragments respectively to obtain C first selection arithmetic fragments, and fragment selection operation is carried out on the D second bit unit fragments and the reciprocal factor fragments respectively to obtain D second selection arithmetic fragments; the bits of the C first bit unit slices in the first scaling factor are higher than the dividing bits; dividing the bit refers to the highest bit of the D second bit unit slices in the first scaling factor;
And generating a reduction reciprocal arithmetic slice corresponding to the first secret arithmetic slice through the first reduction factors corresponding to the C first selection arithmetic slices and the second reduction factors corresponding to the D second selection arithmetic slices.
In one possible implementation, the C first bit unit slices include first bit unit slices,/>Slicing the bit unit of the ith bit in the first scaling factor, wherein i is a positive integer; the reciprocal reduction module is used for performing a segment selection operation on the C first bit unit segments and the reciprocal factor segments respectively, and is specifically used for executing the following operations when the C first selection arithmetic segments are obtained:
slicing the first bit unitPerforming fragment selection operation with the reciprocal factor fragments;
if the first bit unit is slicedFor a first boolean value, the reciprocal factor slice is determined as the first bit unit slice +.>A corresponding first selected arithmetic slice;
if the first bit unit is slicedFor the second Boolean value, then the first Boolean value is determined to be the first bit unit sliceThe corresponding first selected arithmetic slice.
In one possible implementation manner, the reciprocal reduction module is configured to, when generating the reduced reciprocal arithmetic slice corresponding to the first secret arithmetic slice by using the first reduction factors corresponding to the C first selected arithmetic slices and the second reduction factors corresponding to the D second selected arithmetic slices, specifically perform the following operations:
Determining the operation results of the fragment addition operation of the C first selected arithmetic fragments as first reduction factors;
determining the operation results of the slicing addition operation of the D second selected arithmetic slices as factors to be cut, and cutting bits of the factors to be cut based on the stretching factors to obtain second reduction factors;
and performing fragment addition operation on the first reduction factor and the second reduction factor to obtain a reduction reciprocal arithmetic fragment corresponding to the first secret arithmetic fragment.
In one possible implementation manner, the slice scaling module is configured to, when acquiring a first secret arithmetic slice corresponding to the first service data, specifically perform the following operations:
acquiring first service data, and determining a stretching factor based on the bit width length of the first service data;
floating point number coding is carried out on the first service data based on the stretching factors to obtain stretching coding values, arithmetic slicing processing is carried out on the stretching coding values to obtain first secret arithmetic slicing and interactive arithmetic slicing; the stretching coding value is an element in an integer ring, and the operation result of the piecewise addition operation of the first secret arithmetic slicing and the interactive arithmetic slicing is the stretching coding value; the interactive arithmetic fragmentation is used to provide to the second party.
In one possible implementation manner, the slicing scaling module is configured to perform slicing scaling on the first secret arithmetic slice to obtain a first scaling factor and a first scaling factor of the first scaling arithmetic slice corresponding to the first secret arithmetic slice, and is specifically configured to perform the following operations:
performing fragment symbol operation on the first secret arithmetic fragment to obtain a first fragment symbol of the first secret arithmetic fragment;
determining a first absolute value arithmetic slice and a first scaling factor corresponding to the first secret arithmetic slice based on the first slice symbol;
and performing piecewise multiplication operation on the first scaling factor and the first absolute value arithmetic slicing to obtain a first scaling arithmetic slicing corresponding to the first secret arithmetic slicing, and performing Boolean conversion operation on the first scaling factor to obtain the first scaling factor corresponding to the first secret arithmetic slicing.
In one possible implementation manner, the tile scaling module is configured to determine, based on the first tile symbol, a first scaling factor corresponding to the first secret arithmetic tile, and specifically configured to perform the following operations:
determining a first absolute value arithmetic slice of a first secret arithmetic slice based on the first slice symbol, converting the first absolute value arithmetic slice into a first absolute value Boolean slice, and obtaining a first target bit slice of the first absolute value Boolean slice; the first target bit slice is a Boolean slice corresponding to the target bit in the first absolute value Boolean slice; the target bit refers to the highest bit in the bits with the value of 1 in the first absolute value Boolean segment;
Based on the stretching factors, carrying out bit inversion on the first target bit slices to obtain first scaling factors corresponding to the first secret arithmetic slices; the first scaling factor has E bits, the first target bit slice has G bits, G is a positive integer, and E is the difference between the value of twice the stretch factor and G.
In one possible implementation manner, the reciprocal iteration module is configured to, when generating the reciprocal factor slice corresponding to the first secret arithmetic slice based on the first scaling factor and the first scaling arithmetic slice, specifically perform the following operations:
determining an initial reciprocal factor corresponding to the first secret arithmetic slice based on the first scaling factor and the first scaling arithmetic slice, determining an initial iteration factor corresponding to the first secret arithmetic slice based on the initial reciprocal factor and the first scaling arithmetic slice, and generating an iterative arithmetic slice corresponding to the first secret arithmetic slice through iteration by the initial reciprocal factor and the initial iteration factor;
generating reciprocal factor slices corresponding to the first secret arithmetic slices based on the iterative arithmetic slices and the first slice symbols; the first sliced symbol is obtained by performing a sliced symbol operation on the first secret arithmetic slice.
In one possible implementation manner, the reciprocal iteration module is configured to, when generating, by iteration, the iterative arithmetic slice corresponding to the first secret arithmetic slice through the initial reciprocal factor and the initial iteration factor, specifically perform the following operations:
acquiring an iteration number threshold; the iteration number threshold is a number threshold determined based on the accuracy of the federal model's computing service;
generating an updated reciprocal factor based on the initial reciprocal factor and the initial iteration factor, determining an operation result of the piecewise multiplication operation of the initial iteration factor as the updated iteration factor, continuously determining a new updated reciprocal factor and a new updated iteration factor based on the updated reciprocal factor and the updated iteration factor until the iteration number reaches an iteration number threshold, and determining the reciprocal factor with the iteration number reaching the iteration number threshold as the iterative arithmetic piecewise corresponding to the first secret arithmetic piecewise.
In one possible implementation manner, the slice processing module is configured to perform a slice multiplication operation on the second secret arithmetic slice and the reduced reciprocal arithmetic slice, and when obtaining the target secret arithmetic slice, specifically is configured to perform the following operations:
performing slicing scaling on the second secret arithmetic slicing to obtain a second slicing symbol, a second target bit slicing and a second scaling arithmetic slicing corresponding to the second secret arithmetic slicing; the second scaling factor is determined based on the second secret arithmetic slice; the second target bit slice is a boolean slice corresponding to a target bit of a second absolute value boolean slice corresponding to the second secret arithmetic slice; the target bit refers to the highest bit in the bits with the value of 1 in the second absolute value Boolean segment;
Performing fragment multiplication operation on the reduced reciprocal arithmetic fragment and the second scaled arithmetic fragment to obtain an arithmetic fragment to be corrected, generating a corrected arithmetic fragment of the arithmetic fragment to be corrected based on the first fragment symbol and the second fragment symbol, generating a target reduced arithmetic fragment based on the bit unit fragment corresponding to each bit in the first scaled factor and the corrected arithmetic fragment, and generating a target secret arithmetic fragment based on the unit target bit factor corresponding to each bit in the second target bit fragment and the target reduced arithmetic fragment.
In one possible implementation manner, the slice processing module is configured to, based on the unit target bit factor corresponding to each bit in the second target bit slice and the target restored arithmetic slice, generate a target secret arithmetic slice, specifically configured to perform the following operations:
based on the stretching factors, C first target bit factors and D second target bit factors in the second target bit slices are obtained, the C first target bit factors and the target reduction arithmetic slices are subjected to slice selection operation respectively to obtain C first selection reduction slices, and the D second target bit factors and the target reduction arithmetic slices are subjected to slice selection operation respectively to obtain D second selection reduction slices; the bit positions of the C first target bit factors in the second target bit slices are higher than the bit positions of the scaling bits; the scaled bit refers to the highest bit of the D second target bit factors in the second target bit slice; d is the value of the stretching factor, C is the difference between P and the stretching factor;
And generating the target secret arithmetic slice through the first target factors corresponding to the C first selective reduction slices and the second target factors corresponding to the D second selective reduction slices.
In one possible implementation, the federal model is a longitudinal federal model; the slice processing module is configured to perform a slice multiplication operation on the reduced reciprocal arithmetic slice and the second scalable arithmetic slice to obtain an arithmetic slice to be corrected, generate a modified arithmetic slice of the arithmetic slice to be corrected based on the first slice symbol and the second slice symbol, generate a target reduced arithmetic slice based on the modified arithmetic slice and a bit unit slice corresponding to each bit in the first scaling factor, and generate a target secret arithmetic slice based on the target reduced arithmetic slice and a unit target bit factor corresponding to each bit in the second target bit slice, and specifically perform the following operations when generating the target secret arithmetic slice:
performing piecewise multiplication operation on the second scaling arithmetic slicing to obtain a second scaling square slicing, performing piecewise multiplication operation on the reduction reciprocal arithmetic slicing and the second scaling square slicing to obtain an arithmetic slicing to be corrected, and generating a correction arithmetic slicing of the arithmetic slicing to be corrected based on the first slicing symbol;
Generating a target restored arithmetic slice based on the bit unit slice and the corrected arithmetic slice corresponding to each bit in the first scaling factor, generating a target basic arithmetic slice based on the unit target bit factor and the target restored arithmetic slice corresponding to each bit in the second target bit slice, and generating a target secret arithmetic slice based on the unit target bit factor and the target basic arithmetic slice corresponding to each bit in the second target bit slice; the target secret arithmetic slicing is used for providing a computing service for the federation model for the first service data and the second service data, and the computing service is used for determining an optimal splitting result or leaf node weight of the longitudinal federation model.
In one aspect, a computer device is provided, including: a processor, a memory, and a network interface;
the processor is connected with the memory and the network interface, wherein the network interface is used for providing a data communication function, the memory is used for storing a computer program, and when the computer program is executed by the processor, the computer device is caused to execute the method provided by the embodiment of the application.
In one aspect, the present application provides a computer readable storage medium storing a computer program adapted to be loaded and executed by a processor, so that a computer device having the processor performs the method provided in the embodiments of the present application.
In one aspect, the present application provides a computer program product comprising a computer program stored on a computer readable storage medium. The processor of the computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the method provided in the embodiment of the present application.
The embodiment of the application obtains a second secret arithmetic slice corresponding to second business data by obtaining a first secret arithmetic slice corresponding to the first business data, performs slice scaling operation on the first secret arithmetic slice to obtain a first scaled arithmetic slice corresponding to the first secret arithmetic slice, avoids the out-of-limits caused by overlarge of the first secret arithmetic slice, iteratively calculates a reciprocal factor slice corresponding to the first secret arithmetic slice through a first scaling factor corresponding to the first scaled arithmetic slice and the first scaled arithmetic slice, obtains a bit unit slice on each bit in the first scaling factor, performs slice selective operation on the P bit unit slices and the reciprocal factor slice based on the stretching factor, performs slice addition operation on the P selected arithmetic slices to obtain a reduced reciprocal arithmetic slice corresponding to the first secret arithmetic slice, approximates the reciprocal of the first secret slice through the reduced arithmetic slice, performs iterative computation on the second secret slice and the reduced arithmetic slice through the first scaling factor and the first scaled arithmetic slice, directly performs the out-of-limits to obtain the first secret arithmetic slice, and directly performs multiplication operation on the second secret arithmetic slice and the second secret arithmetic slice, thereby avoiding the problem that the first secret arithmetic slice is directly calculated with the first secret arithmetic slice and the second secret arithmetic slice, and the problem is solved by the first secret arithmetic slice is solved, the first scaling factor is split into bit unit fragments for fragment selection operation, so that the calculation complexity is low, the calculation speed of the federal model calculation service is improved, the multiple calculation expense caused by expanding the integer ring structure due to the boundary crossing of the fragment multiplication operation of a computer processor is avoided, and the calculation efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a blockchain network according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of a data processing scenario I according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating a data processing method according to an embodiment of the present application;
FIG. 4 is a second flow chart of a data processing method according to an embodiment of the present disclosure;
fig. 5 is a second schematic diagram of a data processing scenario provided in an embodiment of the present application;
fig. 6 is a third schematic diagram of a data processing scenario provided in an embodiment of the present application;
fig. 7 is a schematic diagram of a data processing scenario provided in an embodiment of the present application;
fig. 8 is a schematic diagram fifth data processing scenario provided in an embodiment of the present application;
fig. 9 is a flowchart of a data processing method according to an embodiment of the present application;
FIG. 10 is a schematic diagram of a data processing apparatus according to an embodiment of the present application;
fig. 11 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
Referring to fig. 1, fig. 1 is a schematic diagram of a network architecture according to an embodiment of the present application. As shown in fig. 1, the network architecture may include a first server 100 and a second server 200, where the first server 100 may be in communication connection with the second server 200, where the communication connection is not limited to a connection manner, may be directly or indirectly connected through a wired communication manner, may be directly or indirectly connected through a wireless communication manner, and may also be other manners, which are not limited herein.
The first server 100 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs (Content Delivery Network, content delivery networks), basic cloud computing services such as big data and artificial intelligence platforms, and the like. The second server 200 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, basic cloud computing services such as big data and artificial intelligence platforms, and the like.
As shown in fig. 1, the first server 100 may be a server for data interaction by a first participant, and the second server 200 may be a server for data interaction by a second participant.
The first server 100 may obtain a first secret arithmetic slice corresponding to the first service data, and obtain a second secret arithmetic slice corresponding to the second service data sent by the second server 200. The first business data held by the first server 100 and the second business data held by the second server 200 may jointly participate in training a federal model for the first participant and the second participant.
The federal model may refer to federal learning (Federated Learning, FL), which is a distributed machine learning technology oriented to privacy protection, and solves the problem of how to train a global model together on virtually 'aggregated' data on the premise of protecting data privacy when sensitive data exists in multiple independent institutions, communities, individuals (e.g., first party and second party).
Secret sharing may be used to generate the secret shards, which may include arithmetic secret sharing (Arithmetic Secret Sharing) which may be used to generate the arithmetic shards, and boolean secret sharing (Boolean Secret Sharing) which may be used to generate the boolean shards.
The first server 100 may perform scaling on the first secret arithmetic slice to obtain a first scaling factor and a first scaling arithmetic slice, and then iterate through the first scaling factor and the first scaling arithmetic slice to generate an inverse factor slice corresponding to the first secret arithmetic slice. The first secret arithmetic fragment can be scaled to be a number between [1.0,2.0] by fragment scaling, so that the problem of boundary crossing caused by overlarge first secret arithmetic fragment is avoided.
The first server 100 may obtain a bit unit slice on each bit in the first scaling factor, perform a slice selection operation on the P bit unit slices and the reciprocal factor slice based on the stretching factor to obtain P selected arithmetic slices, and perform a slice addition operation on the P selected arithmetic slices to obtain a restored reciprocal arithmetic slice corresponding to the first secret arithmetic slice. Wherein the stretch factor is determined based on a bit width length of the first traffic data. The bit unit fragments on each bit are respectively subjected to fragment selection operation with the reciprocal factor fragments, so that the problem of out-of-limit caused by direct fragment multiplication of the first scalable arithmetic fragments and the second secret arithmetic fragments is avoided, the stretching factor is not required to be adjusted to avoid out-of-limit, the calculation precision of the federal model for the calculation service of the first service data and the second service data is improved, the first scalable factor is split into the bit unit fragments to be subjected to fragment selection operation, the calculation complexity is low, the calculation speed of the federal model calculation service is improved, the multiple calculation expense caused by expanding the integer ring structure due to out-of-limit multiplication operation of a computer processor is avoided, and the calculation efficiency is improved.
The first server 100 may perform a piecewise multiplication operation on the second secret arithmetic slicing and the reduced reciprocal arithmetic slicing to obtain a target secret arithmetic slicing, and provide a computing service for the first service data and the second service data for the federal model through the target secret arithmetic slicing. For example, in the federal learning task, such as gradient histogram calculation, searching for an optimal splitting point, updating a tree structure, calculating a leaf node weight, and the like, all need to perform security calculation in the form of secret shards, the first server 100 may determine the grad in the federal model as a second secret arithmetic shard, determine the hess in the federal model as a first secret arithmetic shard, and provide a computing service of security calculation by finally obtaining the target secret arithmetic shard.
It is to be appreciated that the above-described network framework can be applicable in business scenarios of finance (e.g., boost credit amortization), medical (e.g., cross-country medical research), unmanned (e.g., boost driving experience), multimedia data recommendation (e.g., video recommendation), and the like. For example, in a medical scene, rare diseases are frequently encountered in medical research, and practical difficulties such as sample dispersion in different hospitals exist at present, which greatly prevent auxiliary diagnosis work, and samples of different hospitals can be fused through longitudinal federal learning, so that auxiliary diagnosis of the rare diseases is realized. For example, in a financial scenario, the credit management of a small and micro enterprise uses federal transfer learning, and the existing model of the financial institution in the past application (for example, a credit model of a medium and large enterprise or a marketing model of a small and micro enterprise) can be used for transfer learning, so that the application effect is improved. For example, in the unmanned scene, the interactive learning of the vehicle and the system environment can assist in fusing different source information under privacy protection by means of a longitudinal federal mode with other information (such as urban cameras, traffic lights and future intelligent roads) of the city, so that the unmanned experience is improved. For another example, in the multimedia data recommendation scene, the data under different platforms can be interactively learned, so that the accuracy of the multimedia data recommendation is improved. Therefore, the first business data may be referred to as first medical data or first driving data, and the second business data may be referred to as second medical data or second driving data.
Referring to fig. 2, fig. 2 is a schematic view of a scenario of data processing according to an embodiment of the present application.
It should be appreciated that secret sharing may be used to generate the secret shards, which may include arithmetic secret sharing, which may be used to generate the arithmetic shards, and boolean secret sharing, which may be used to generate the boolean shards. Secret sharing has "homomorphism", and the parties can directly sum and multiply the cryptographic data (i.e. arithmetic or boolean slices) without exchanging any data. In arithmetic secret sharing, integer ringsFor moulds, e.g. for->Equal to2 64 (i.e. die 2 64 Plus, represents a maximum value of 2 64 -1, in this case, the addition means +.>The addition and subtraction operations of the above are referred to asSubtraction above), will->The upper number->Splitting into two slices (i.e. arithmetic slices)/(>And->,/>Held by the first party,/->Held by the second party while satisfying +.>It can be seen in the same wayArithmetic slicing has additive homomorphism, i.e. In Boolean secret sharing, the Boolean value is +.>Splitting into two slices (i.e., boolean slices)>And->,/>Held by the first party,/->Held by the second party- >. In other words, if secret sharing is performed in an exclusive or manner, the random number obtained by the calculator is called boolean fragmentation; if secret sharing is adopted in an arithmetic addition mode, the random number obtained by the computing party is called arithmetic fragmentation. Wherein boolean and arithmetic slices may be collectively referred to as secret slices (simply slices).
For the first participant and the second participant, the embodiment of the application can be usedThe fragment is represented by a, the fragment superscript is a representing an arithmetic fragment, the fragment superscript is B representing a boolean fragment, the fragment subscript is 0 representing a fragment held by a first participant, and the fragment subscript is 1 representing a fragment held by a second participant. For ease of understanding, when a fragment is subscripted, then this means that the calculation is performed by the first party, e.g. a first secret arithmetic fragment +.>Can also be expressed as +.>. In other words (I)>Representation->The two parties respectively have a random value, the two random values are in +.>The addition is +.>;/>Representation->The Boolean fragments of (1), i.e. the parties each possess a random bit, the exclusive OR of the two random bits is +.>
As shown in fig. 2, the first server 100 may obtain a first secret arithmetic slice corresponding to the first service data y Acquiring a second secret arithmetic slice corresponding to the second service data x sent by the second server 200>. The first secret arithmetic slice is input by the first party and the second secret arithmetic slice is input by the second party. The first business data held by the first server 100 and the second business data held by the second server 200 together participate in training a federal model for the first party and the second party.
The first server 100 may fragment the first secret arithmeticPerforming slicing scaling to obtain a first secret arithmetic slice +.>Corresponding first scalable arithmetic slice +.>A first scaling factor->. Wherein the first scaling factorMay have P bits.
The first server 100 may be based on a first scaling factorAnd a first scalable arithmetic slice +>Iterative generation of a first secret arithmetic slice +.>Corresponding reciprocal factor fragmentation->
The first server 100 may obtain the first scaling factorBit unit slicing on each bit of (a),/>For the first scale factor->Bit unit slices of the i-th bit in (a). />It may be a Boolean fragment with bit width 1, e.g. first scaling factor +.>In the case of 0110, the first scaling factor +.>Can include 4 bit unit slices +. >Wherein, bit unit slice +>May be 0, bit unit slice +.>Can be 1, bit unit slice +.>Can be 1, bit unit slice +.>May be 0.
The first server 100 may slice the P bit units based on the stretch factor fAre respectively fragmented with reciprocal factors>Performing a slice selection operation (also referred to as two-way slice selection) to obtain P selected arithmetic slices, and performing a slice addition operation on the P selected arithmetic slices to obtain a first secret arithmetic slice ∈>Corresponding reduced reciprocal arithmetic slicing. Wherein the stretch factor f is determined based on the bit width lengths of the first traffic data y and the second traffic data x.
For ease of understanding, integer rings in secret shardsP in (1) is 64 as an example, the first scaling factor +.>The P bit unit slices of (a) may include: bit unit slice->Bit unit slice->… …, bit unit slicing. The first server 100 may divide P bit units into +.>Are respectively fragmented with reciprocal factors>The selection of the slice is performed, for example, by +.>And->Performing a slice selection operation, < >>And->Performing a partition selection operation, … …, < > and->And->Performing fragment selection operation to obtain P selection arithmetic fragments, and performing fragment addition operation on the P selection arithmetic fragments to obtain a first secret arithmetic fragment ∈ >Corresponding reduced reciprocal arithmetic slicing
The first server 100 may be opposite to the secondSecret arithmetic slicingAnd reduction reciprocal arithmetic fragmentation->Performing piecewise multiplication to obtain target secret arithmetic piecewise +.>Target secret arithmetic slice->May be used to provide a federal model with computing services for the first business data x and the second business data y. The first scalable arithmetic slice +.>With second secret arithmetic slice +.>Is converted into a second secret arithmetic slice +.>And reduction reciprocal arithmetic fragmentationTo restore the reciprocal arithmetic slice +.>Is by a first scaling factor +.>Bit unit slice +.>Are respectively fragmented with reciprocal factors>The first arithmetic scaling is avoided by selecting the slices>With second secret arithmetic slice +.>The problem of out-of-range caused by direct slice multiplication is solved, so that the stretching factor f is not required to be adjusted to avoid out-of-range, the calculation accuracy of the federal model for the calculation service of the first service data and the second service data is improved, and the first scaling factor is increased>The method is divided into bit unit fragments to carry out fragment selection operation, and the calculation complexity is low, so that the calculation speed of the federal model calculation service is improved.
In the federation model XGBoost scenario, the first server 100 may determine the grad in the federation model XGBoost as the second secret arithmetic shardDetermining the hess in the federal model XGBoost as the first secret arithmetic slice +.>Target secret arithmetic slice obtained by final calculation>And the optimal splitting point or the leaf node weight is determined, so that high-efficiency and accurate joint calculation can be performed while the privacy security of data is ensured.
In the integrated MPC (Model-based Predictive Control, model predictive control) -based longitudinal federal XGBoost algorithm, which may be, for example, a privacy computing platform PowerFL in which a secure computing script providing a custom function is required, the first server 100 may execute the process of fragmenting the calculated target secret arithmeticThe determination is related to a safe division operator, so that the problems of incorrect result of safe calculation and the like caused by overlarge precision or numerical value can be solvedThe practicality of the PowerFL is improved.
In a joint query (SQL query) scenario, the query statement and the private data in the database are secretly fragmented, and the second secret arithmetic is fragmentedWith first secret arithmetic slice +.>Calculating to obtain target secret arithmetic slice >The process of the method is determined as a division operator in the SQL query statement, so that the data privacy safety in the database can be protected, and the division can be calculated with high precision and high efficiency, so as to meet the requirements of accuracy, high efficiency and safety of large-scale data query.
It is to be appreciated that the above-described network framework can be applicable in business scenarios of finance (e.g., boost credit amortization), medical (e.g., cross-country medical research), unmanned (e.g., boost driving experience), multimedia data recommendation (e.g., video recommendation), and the like. For example, in a medical scene, rare diseases are frequently encountered in medical research, and practical difficulties such as sample dispersion in different hospitals exist at present, which greatly prevent auxiliary diagnosis work, and samples of different hospitals can be fused through longitudinal federal learning, so that auxiliary diagnosis of the rare diseases is realized. For example, in a financial scenario, the credit management of a small and micro enterprise uses federal transfer learning, and the existing model of the financial institution in the past application (for example, a credit model of a medium and large enterprise or a marketing model of a small and micro enterprise) can be used for transfer learning, so that the application effect is improved. For example, in the unmanned scene, the interactive learning of the vehicle and the system environment can assist in fusing different source information under privacy protection by means of a longitudinal federal mode with other information (such as urban cameras, traffic lights and future intelligent roads) of the city, so that the unmanned experience is improved. For another example, in the multimedia data recommendation scene, the data under different platforms can be interactively learned, so that the accuracy of the multimedia data recommendation is improved. Therefore, the first business data may be referred to as first medical data or first driving data, and the second business data may be referred to as second medical data or second driving data.
The embodiment of the application obtains a second secret arithmetic slice corresponding to second business data by obtaining a first secret arithmetic slice corresponding to the first business data, performs slice scaling operation on the first secret arithmetic slice to obtain a first scaled arithmetic slice corresponding to the first secret arithmetic slice, avoids the out-of-limits caused by overlarge of the first secret arithmetic slice, iteratively calculates a reciprocal factor slice corresponding to the first secret arithmetic slice through a first scaling factor corresponding to the first scaled arithmetic slice and the first scaled arithmetic slice, obtains a bit unit slice on each bit in the first scaling factor, performs slice selective operation on the P bit unit slices and the reciprocal factor slice based on the stretching factor, performs slice addition operation on the P selected arithmetic slices to obtain a reduced reciprocal arithmetic slice corresponding to the first secret arithmetic slice, approximates the reciprocal of the first secret slice through the reduced arithmetic slice, performs iterative computation on the second secret slice and the reduced arithmetic slice through the first scaling factor and the first scaled arithmetic slice, directly performs the out-of-limits to obtain the first secret arithmetic slice, and directly performs multiplication operation on the second secret arithmetic slice and the second secret arithmetic slice, thereby avoiding the problem that the first secret arithmetic slice is directly calculated with the first secret arithmetic slice and the second secret arithmetic slice, and the problem is solved by the first secret arithmetic slice is solved, the first scaling factor is split into bit unit fragments for fragment selection operation, so that the calculation complexity is low, the calculation speed of the federal model calculation service is improved, the multiple calculation expense caused by expanding the integer ring structure due to the boundary crossing of the fragment multiplication operation of a computer processor is avoided, and the calculation efficiency is improved.
Referring to fig. 3, fig. 3 is a schematic flow chart of a data processing method according to an embodiment of the present application, where the data processing method may be performed by a computer device, and the computer device may be the first server 100 shown in fig. 1. The present data processing method will be described below as an example of execution by a computer device. The data processing method at least comprises the following steps of S101-S104:
step S101, obtaining a first secret arithmetic fragment corresponding to first service data, obtaining a second secret arithmetic fragment corresponding to second service data, and carrying out fragment scaling on the first secret arithmetic fragment to obtain a first scaling arithmetic fragment corresponding to the first secret arithmetic fragment and a first scaling factor; the first secret arithmetic slice is input by a first participant, and the second secret arithmetic slice is input by a second participant; the first business data and the second business data participate in training a federal model aiming at the first participator and the second participator; the first scaling factor has P bits, P being a positive integer;
specifically, the computer device may obtain a first secret arithmetic slice corresponding to the first service data, and obtain a second secret arithmetic slice corresponding to the second service data, for example, may obtain a first secret arithmetic slice corresponding to the first service data y Acquiring a second secret arithmetic slice corresponding to the second service data x>
The secret sharing may be used to generate the secret shards, and the secret sharing may include arithmetic secret sharing, which may be used to generate the arithmetic shards, and boolean secret sharing, which may be used to generate the boolean shards. Secret sharing has "homomorphism" in that parties can directly access cryptographic data (i.e., arithmetic slicing or boolean partitioning) without exchanging any dataSlices) and the product. In arithmetic secret sharing, integer ringsFor moulds, e.g. for->Equal to 2 64 (i.e. die 2 64 Plus, represents a maximum value of 2 64 -1, in this case, the addition means +.>The addition, subtraction means +.>Subtraction above), will->The upper number->Splitting into two slices (i.e. arithmetic slices)/(>And->,/>Held by the first party,/->Held by the second party while satisfying +.>Similarly, know->Arithmetic slicing has the addition homomorphism +.>. In boolean secret sharing, exclusive-or (XO-basedR) Boolean value->Splitting into two slices (i.e., boolean slices)>And->,/>Held by the first party,/->Held by the second party->. In other words, if secret sharing is performed in an exclusive or manner, the random number obtained by the calculator is called boolean fragmentation; if secret sharing is adopted in an arithmetic addition mode, the random number obtained by the computing party is called arithmetic fragmentation. Wherein boolean and arithmetic slices may be collectively referred to as secret slices (simply slices).
For the first participant and the second participant, the embodiment of the application can be usedThe fragment is represented by a, the fragment superscript is a representing an arithmetic fragment, the fragment superscript is B representing a boolean fragment, the fragment subscript is 0 representing a fragment held by a first participant, and the fragment subscript is 1 representing a fragment held by a second participant. For ease of understanding, when a fragment is subscripted, then this means that the calculation is performed by the first party, e.g. a first secret arithmetic fragment +.>Can also be expressed as +.>. In other words (I)>Representation->The two parties respectively have a random value, the two random values are in +.>The addition is +.>;/>Representation->The Boolean fragments of (1), i.e. the parties each possess a random bit, the exclusive OR of the two random bits is +.>
The computer device may perform a piece-wise scaling of the first secret arithmetic slice to obtain a first scaled arithmetic slice and a first scaling factor corresponding to the first secret arithmetic slice. Wherein the first scaling factor may have P bits. For example, the first secret arithmetic slicing can bePerforming slicing scaling to obtain a first secret arithmetic slice +.>Corresponding first scalable arithmetic slice +. >A first scaling factor->
Step S102, generating reciprocal factor slices corresponding to the first secret arithmetic slices based on the first scaling factors and the first scaling arithmetic slices;
specifically, the computer device may generate an initial reciprocal factor and an initial iterative factor based on the first scaling factor and the first arithmetic partitioning, iterate the initial reciprocal factor and the initial iterative factor k times by a Goldschmidt algorithm, generate the first secret arithmetic partitioningCorresponding reciprocal factor fragmentation->. Where k is the iteration number threshold, and k is determined based on the accuracy of the computing service.
The Goldschmidt algorithm is an approximation algorithm for calculating division, the idea of which is based onWhere k is the number of iterations by iterative calculation +.>、/>、/>、……、Until the accuracy of the required computing service is reached, let +.>If the value of (2) tends to be 1, mx will be approximated by a quotient q, thereby approximating the division. It will be appreciated that in the secret slicing of the Goldschmidt algorithm, the reciprocal factor slices after k iterations +.>About equal to the arithmetic slice corresponding to the inverse of the first traffic data y.
Step S103, obtaining bit unit fragments on each bit in the first scaling factor, respectively carrying out fragment selection operation on the P bit unit fragments and the reciprocal factor fragments based on the stretching factor to obtain P selected arithmetic fragments, and carrying out fragment addition operation on the P selected arithmetic fragments to obtain restored reciprocal arithmetic fragments corresponding to the first secret arithmetic fragments;
Specifically, the computer device may obtain the first scaling factorBit unit slice at each bit of (1), a first scaling factor +.>The bit unit slice on each bit of (a) can be expressed as +.>,/>For the first scale factor->Bit unit slices of the i-th bit in (a). />It may be a Boolean fragment with bit width 1, e.g. first scaling factor +.>In the case of 0110, the first scaling factor +.>Can include 4 bit unit slices +.>Wherein, bit unit slice +>May be 0, bit unit slice +.>Can be 1, bit unit slice +.>Can be 1, bit unit slice +.>May be 0.
The computer device may segment the P bit units separately from the reciprocal factors based on the stretch factorsAnd performing fragment selection operation to obtain P selected arithmetic fragments.
Wherein, the two-sided slice selection (multiple may also be called as slice selection operation) refers to input boolean slicesAnd arithmetic slice->Calculate->Satisfy->. Input->And->Output->I.e. +.>Outputting y corresponding to the fragments, otherwise outputting 0 corresponding to the fragments; when x and y are vectors, the components representing x and y perform multiplexing; when x is a vector and y is a scalar, each element representing x performs multiplexing with y.
For example, it may beAnd->Performing a slice selection operation, < >>And->Performing a partition selection operation, … …, < > and->And->And performing fragment selection operation to obtain P selected arithmetic fragments.
The computer device may perform a slice addition operation on the P selected arithmetic slices to obtain a reduced reciprocal arithmetic slice corresponding to the first secret arithmetic slice, where the reduced reciprocal arithmetic slice may be represented as. Wherein, two-sided Add (Add, also called Add-on), here, "-is used>"means: input->And->Output of
For example, the P bit unit slices include C first bit unit slices and D second bit unit slices, and the computer device may obtain the first scaling factor based on the stretch factorThe method comprises the steps of dividing C first bit unit slices and D second bit unit slices, wherein the bits of the C first bit unit slices in a first scaling factor are higher than dividing bits; dividing bits refers to the highest bit of the D second bit unit slices in the first scaling factor, D is the value of the stretching factor, C is the difference between P and the stretching factor, namely +.>=/>Wherein->For the first bit unit slice, +.>Slicing for the second bit unit. / >Can be expressed as,/>Can be expressed as +.>,/>Can be expressed as +.>,/>Can be expressed as +.>. For example, floating point number 1.23 corresponds to binaryData is 1.00111010111 … …, which converts floating point number 1.23 to an element in an integer ring, and the stretch factor is 2, then P is 64, D is 2, and C is 62.
The computer device may perform a slice selection operation on the C first bit unit slices and the reciprocal factor slices, respectively, to obtain C first selected arithmetic slices, and perform a slice selection operation on the D second bit unit slices and the reciprocal factor slices, respectively, to obtain D second selected arithmetic slices.
The computer device may determine the operation result of the sliced-addition operation of the C first selected arithmetic slices as the first reduction factorDetermining the operation result of the slice addition operation of the D second selected arithmetic slices as a reduction factor to be truncated +.>The computer device may treat the truncated reduction factor +.>Truncating the bit corresponding to the value of the stretch factor f to obtain a second reduction factor +.>. The computer device may perform a piece-wise addition operation on the first reduction factor and the second reduction factor to obtain a reduction reciprocal arithmetic piece corresponding to the first secret arithmetic piece. Wherein the truncation processing can be a Truncate module, and the reduction factor to be truncated is +. >Cutting off, stretching bits corresponding to the value of the factor f to obtain a second reduction factorThe course of (2) can be expressed as +.>=Truncate(/>F). By the truncation processing, the value of the double stretching factor used in the segmentation selection operation of the low D bit can be kept to be the value of the double stretching factor, so that the expansion of the stretching factor can be avoided, the double calculation cost caused by the expansion of the integer ring structure can be avoided, and the calculation efficiency is improved.
It will be appreciated that the first bit unit sliceCorresponding to the first scaling factor->High P-D bits of (1) first bit unit slice +.>Corresponding to the first scaling factor->In the low D bit of (1) for the first scale factor->When the low D bit of (2) is used for selecting the slice, the value of twice the stretching factor is needed, and the +.>The trunk treatment is carried out, namely Multiplex is needed) Execute trunk to obtain the second reduction factor +.>
Step S104, performing piecewise multiplication operation on the second secret arithmetic slicing and the restored reciprocal arithmetic slicing to obtain target secret arithmetic slicing; the target secret arithmetic shard is used to provide a computational service for the federation model for the first business data and the second business data.
In particular, the computer device may fragment the second secret arithmeticAnd reduction reciprocal arithmetic fragmentation->Performing piecewise multiplication to obtain target secret arithmetic piecewise +.>Target secret arithmetic slice->May be used to provide a federal model with computing services for the first business data x and the second business data y.
Wherein two-sided sliced multiplication (Mul, also known as sliced multiplication), herein "is used""means: input->And->Output->The method comprises the steps of carrying out a first treatment on the surface of the If the input is two matrix slices, also denoted here as element dot multiplication, i.e. the multiplication of the sliced elements of two matrices corresponding to the same row and column results in a matrix slice of the same size.
The embodiment of the application obtains a second secret arithmetic slice corresponding to second business data by obtaining a first secret arithmetic slice corresponding to the first business data, performs slice scaling operation on the first secret arithmetic slice to obtain a first scaled arithmetic slice corresponding to the first secret arithmetic slice, avoids the out-of-limits caused by overlarge of the first secret arithmetic slice, iteratively calculates a reciprocal factor slice corresponding to the first secret arithmetic slice through a first scaling factor corresponding to the first scaled arithmetic slice and the first scaled arithmetic slice, obtains a bit unit slice on each bit in the first scaling factor, performs slice selective operation on the P bit unit slices and the reciprocal factor slice based on the stretching factor, performs slice addition operation on the P selected arithmetic slices to obtain a reduced reciprocal arithmetic slice corresponding to the first secret arithmetic slice, approximates the reciprocal of the first secret slice through the reduced arithmetic slice, performs iterative computation on the second secret slice and the reduced arithmetic slice through the first scaling factor and the first scaled arithmetic slice, directly performs the out-of-limits to obtain the first secret arithmetic slice, and directly performs multiplication operation on the second secret arithmetic slice and the second secret arithmetic slice, thereby avoiding the problem that the first secret arithmetic slice is directly calculated with the first secret arithmetic slice and the second secret arithmetic slice, and the problem is solved by the first secret arithmetic slice is solved, the first scaling factor is split into bit unit fragments for fragment selection operation, so that the calculation complexity is low, the calculation speed of the federal model calculation service is improved, the multiple calculation expense caused by expanding the integer ring structure due to the boundary crossing of the fragment multiplication operation of a computer processor is avoided, and the calculation efficiency is improved.
Referring to fig. 4, fig. 4 is a second flowchart of a data processing method according to an embodiment of the present application, where the data processing method may be performed by a computer device, and the computer device may be the first server 100 shown in fig. 1. The present data processing method will be described below as an example of execution by a computer device. The data processing method at least includes the following steps S201 to S205:
step S201, obtaining first service data, and determining a stretching factor based on the bit width length of the first service data; floating point number coding is carried out on the first service data based on the stretching factors to obtain stretching coding values, arithmetic slicing processing is carried out on the stretching coding values to obtain first secret arithmetic slicing and interactive arithmetic slicing; the stretching coding value is an element in an integer ring, and the operation result of the piecewise addition operation of the first secret arithmetic slicing and the interactive arithmetic slicing is the stretching coding value; the interactive arithmetic fragmentation is used to provide to the second party.
Specifically, the computer device may obtain first service data provided by the first participant, and determine the stretch factor based on a bit width length of the first service data. Referring to fig. 5 again, fig. 5 is a schematic diagram of a second data processing scenario provided in the embodiment of the present application, as shown in fig. 5, the computer device may perform floating point number encoding on the first service data y based on the stretch factor f to obtain a stretch encoded value t. This process can be expressed as t=encode (y, f). Wherein the stretch encoded value is an element in the integer ring, i.e., tε
Wherein, the first service data y may be a floating point number, the first service data y may include an integer part and a fractional part, that is, y e R, f is a positive integer, the stretching factor f may be used to represent the decimal floating point number as a binary floating point number, and then the stretching factor f may represent the bit width of the fractional part of the first service data y, and the stretching factor f may be generally set to 20.
The computer device may input the first traffic data y and the stretch factor f, perform t=Encode (y, f), calculateCan be y and +.>Multiplying, rounding the calculation result, and outputting t E +.>The method comprises the steps of carrying out a first treatment on the surface of the Otherwise output t + & gt>∈/>. Where P may generally be set to 64, i.e. t has 64 bits. The computer equipment can carry out arithmetic slicing processing on the stretching coding value t to obtain a first secret arithmetic slice +.>And Interactive arithmetic slice->. It can be appreciated that interactive arithmetic slices +.>For sharing to a second provider for federal model training.
Wherein, the first secret arithmetic slicingWith Interactive arithmetic slice->The result of the slice addition operation of (a) is the stretch-coded value t, the interactive arithmetic slice +.>May be used to provide to the second party. Two-way Add (Add, also called a slice Add operation), here- >"means: input->And->Output->
Step S202, performing fragment symbol operation on a first secret arithmetic fragment to obtain a first fragment symbol of the first secret arithmetic fragment; determining a first absolute value arithmetic slice and a first scaling factor corresponding to the first secret arithmetic slice based on the first slice symbol; and performing piecewise multiplication operation on the first scaling factor and the first absolute value arithmetic slicing to obtain a first scaling arithmetic slicing corresponding to the first secret arithmetic slicing, and performing Boolean conversion operation on the first scaling arithmetic slicing to obtain the first scaling factor corresponding to the first secret arithmetic slicing.
In particular, the computer device may fragment the first secret arithmeticPerforming a sliced symbol operation to obtain a first secret arithmetic slice->Is +.>The computer device may add to the first tile symbol>First secret arithmetic slice +.>Performing a slice multiplexing operation to obtain a first secret arithmetic slice->Corresponding first absolute value arithmetic slice +.>
The computer device may be based on a first absolute value arithmetic slicingDetermining a first scaling factor +.>. Determining a first scaling factor->The process of (2) may be: determining a first absolute value arithmetic slice of a first secret arithmetic slice based on the first slice symbol, converting the first absolute value arithmetic slice into a first absolute value Boolean slice, and obtaining a first target bit slice of the first absolute value Boolean slice; the first target bit slice is a Boolean slice corresponding to the target bit in the first absolute value Boolean slice; the target bit refers to the highest bit in the bits with the value of 1 in the first absolute value Boolean segment; and carrying out bit inversion on the first target bit slice based on the stretching factors to obtain a first scaling factor corresponding to the first secret arithmetic slice.
Specifically, please refer to fig. 6, fig. 6 is a schematic diagram of a third data processing scenario provided in the embodiment of the present application, and as shown in fig. 6, the computer device may divide the first secret arithmetic into slicesPerforming a sliced symbol operation, performingObtaining a first secret arithmetic slice +.>Is +.>. Wherein, two-sided sliced symbol (Sign, also called sliced symbol operation) is input with arithmetic slicing +.>Calculate->Whether or not it is negative, i.eSatisfy input +.>Is a non-negative number, then->=0; otherwise->=1。
The computer equipment performs the first slicing symbolFirst secret arithmetic slice +.>Performing a slice multiplexing operation, performing +.>Determining a first secret arithmetic slice +.>Corresponding first absolute value arithmetic slice +.>. Wherein, two-sided slice multiplexing (Mux, also called as slice multiplexing operation) refers to input Boolean slices +.>Arithmetic slice->And arithmetic slice->Calculate->Satisfies the following conditions. When->=-/>When (I)>Is->Is divided into absolute value arithmetic slices.
The computer device may executeDividing the first absolute value arithmetic into +.>Conversion to first absolute value Boolean fraction->. Wherein, two-sided sliced conversion (A2B&B2A),/>Converting the arithmetic slices into Boolean slices; />Boolean fragments are converted into arithmetic fragments.
The computer device may obtain a first absolute value Boolean fragmentFirst target bit slice +.>Can be +.>=/>. The first target bit slice is a boolean slice corresponding to a target bit in the first absolute value boolean slice, and the target bit is the highest bit in bits with a value of 1 in the first absolute value boolean slice. The highest bit (extractMSB) of both sides is set to +.>Is positive floating point number->Boolean fragments of (1), thenIn (1), will->The bit position of the highest 1 is denoted +.>ExactMSB output +.>Boolean fragments of->Satisfy->And->
The computer device may be based on the stretch factor f and the first secret arithmetic slicingFor the first target bit slicingBit inversion and execution->= BitRev(/>,/>) Obtaining a first secret arithmetic slice +.>Corresponding first scaling factor +.>. Two-sided bit inversion (BitRev), let +.>Is->Input floating point number +.>Corresponding arithmetic slice->And floating point number->Corresponding slice->Output->So that
The computer device may scale the first scaling factorCorresponding Boolean fragmenting->Arithmetic slice with first absolute value->Performing a piece multiplication operation, performing +.>Obtaining a first secret arithmetic slice +.>Corresponding first scalable arithmetic slice +. >. Wherein, two-sided sliced multiplication (Mul) refers to input arithmetic slicingAnd->Output->So that->I.e. +.>Here, where,/>. Referring to fig. 7 again, fig. 7 is a schematic diagram of a fourth data processing scenario provided in the embodiment of the present application, as shown in fig. 7, note that the stretch factor required for performing floating point decoding on d is +.>I.e. +.>=/>In (I)>In order to keep the stretch factor at f, a trunk module is required to keep the stretch factor at 2f, will +.>Clipping f bits to obtain ++>Is described asThe above procedure of executing Mul and then executing trunk is described as
Step S203, determining an initial reciprocal factor corresponding to the first secret arithmetic slice based on the first scaling factor and the first scaling arithmetic slice, determining an initial iteration factor corresponding to the first secret arithmetic slice based on the initial reciprocal factor and the first scaling arithmetic slice, and generating an iterative arithmetic slice corresponding to the first secret arithmetic slice through iteration by the initial reciprocal factor and the initial iteration factor; generating reciprocal factor slices corresponding to the first secret arithmetic slices based on the iterative arithmetic slices and the first slice symbols; the first sliced symbol is obtained by performing a sliced symbol operation on the first secret arithmetic slice.
In particular, the computer device may be based on the first scaling factorAnd a first scalable arithmetic slice +>Determining a first secret arithmetic slice +.>Corresponding initial reciprocal factor->Based on the initial reciprocal factor->And a first scalable arithmetic slice +>Determining a first secret arithmetic slice +.>Corresponding initial iteration factor->
The computer device may iterate to generate an iterative arithmetic fragment corresponding to the first secret arithmetic fragment by the initial reciprocal factor and the initial iterative factor, and the specific process of iterating may be: acquiring an iteration number threshold; the iteration number threshold is a number threshold determined based on the accuracy of the federal model's computing service; generating an updated reciprocal factor based on the initial reciprocal factor and the initial iteration factor, determining an operation result of the piecewise multiplication operation of the initial iteration factor as the updated iteration factor, continuously determining a new updated reciprocal factor and a new updated iteration factor based on the updated reciprocal factor and the updated iteration factor until the iteration number reaches an iteration number threshold, and determining the reciprocal factor with the iteration number reaching the iteration number threshold as the iterative arithmetic piecewise corresponding to the first secret arithmetic piecewise.
Specifically, the computer device may obtain the iteration number threshold k. Wherein the iteration threshold k is determined based on the accuracy of the computational service of the federal model, and the Goldschmidt algorithm is an approximation algorithm for computing division based on the idea Where k is the number of iterations by iterative calculation +.>、/>、/>、……、/>Until reaching the precision of the required computing service, to makeIf the value of (2) tends to be 1, mx will be approximated by a quotient q, thereby approximating the division. It will be appreciated that in the secret slicing of the Goldschmidt algorithm, the reciprocal factor slices after k iterations +.>About equal to the arithmetic slice corresponding to the inverse of the first traffic data y.
The computer device may be based on an initial reciprocal factorAnd an initial iteration factor->Generating an update reciprocal factor->The manner of determining the updated reciprocal factor may be as shown in equation (1):
formula (1)
Wherein, when i is 1,namely the initial reciprocal factor->,/>I.e. the initial iteration factor
Will initially iterate the factorThe result of the piecewise multiplication operation of (a), i.eIs determined as update iteration factor->When i is 1,/is->Namely the initial iteration factor->. The computer device can factor the initial reciprocal by the Goldschmidt algorithm>And an initial iteration factor->Iterative update of the reciprocal factor->And update iteration factor->Continuing to update the reciprocal factorAnd update iteration factor->Performing iteration to obtain updated reciprocal factor->And update iteration factor->Until the iteration number reaches the iteration number threshold k, the iteration number is repeated The reciprocal factor of the number reaching the iteration number threshold k is determined as the first secret arithmetic slice +.>Corresponding iterative arithmetic slice->
The computer device may be based on iterative arithmetic slicingAnd the first slice symbol->Generating a first secret arithmetic slice +.>Corresponding reciprocal factor fragmentation->The process can be to add the first scaling factor +.>Corresponding arithmetic slice->And iterative arithmetic slicing->Performing a piece multiplication operation, performing +.>Execute->Will->Determine as first secret arithmetic slice +.>The corresponding reciprocal factor slices.Wherein the first slice symbol->Is to the first secret arithmetic slice +.>Performing a sliced symbology operation, i.e. performing +.>The obtained product.
Step S204, based on the stretching factors, C first bit unit fragments and D second bit unit fragments in the first scaling factors are obtained, fragment selection operation is carried out on the C first bit unit fragments and the reciprocal factor fragments respectively to obtain C first selection arithmetic fragments, and fragment selection operation is carried out on the D second bit unit fragments and the reciprocal factor fragments respectively to obtain D second selection arithmetic fragments; the bits of the C first bit unit slices in the first scaling factor are higher than the dividing bits; dividing the bit refers to the highest bit of the D second bit unit slices in the first scaling factor; and generating a reduction reciprocal arithmetic slice corresponding to the first secret arithmetic slice through the first reduction factors corresponding to the C first selection arithmetic slices and the second reduction factors corresponding to the D second selection arithmetic slices.
Specifically, the computer device may obtain the first scaling factor based on the stretch factor fBit unit slice at each bit of (1), a first scaling factor +.>Bit unit slices on each bit of a pair can be expressed as,/>For the first scale factor->Bit unit slices of the i-th bit in (a). Bit unit slicingComprising a first bit unit slice->And second bit unit slice->The computer device may obtain the first scaling factor +.>C first bit unit slices +.>D second bit unit slices +.>Wherein C first bit unit slices +.>At the first scale factor->The bit positions in the two-dimensional space are all higher than the dividing bit positions; dividing bits means D second bit unit slices +.>At the first scale factor->The highest bit of (a), D is the value of the stretching factor (i.e. D can be equal to f), C is the difference between P and the stretching factor f, i.e.)>=Wherein->For the first bit unit slice, +.>Slicing for the second bit unit.Can be expressed as +.>,/>Can be expressed as
The computer device may slice the C first bit unitsAre respectively fragmented with reciprocal factors>Performing a slice selection operation, performing +.>Wherein i is [ f, P-1 ] ]Obtaining C first selection arithmetic slices +.>For example, it may be +.>And->Performing a slice selection operation, < >>And (3) withPerforming a partition selection operation, … …, < > and->And->Performing a slice selection operation to obtain C first selected arithmetic slices +.>
The specific process of calculating the first bit unit slice and the reciprocal factor to perform the slice selection operation may be: slicing the first bit unitPerforming fragment selection operation with the reciprocal factor fragments; if the first bit unit is sliced +>For a first boolean value, the reciprocal factor slice is determined as the first bit unit slice +.>A corresponding first selected arithmetic slice; if the first bit unit is sliced +>For the second Boolean value, the first Boolean value is determined as the first bit unit slice +.>The corresponding first selected arithmetic slice. Wherein the C first bit unit slices comprise a first bit unit slice +.>,/>The bit unit slice for the ith bit in the first scale factor.
Specifically, two-sided chip selection (multipleex, also known as a slice selection operation), is input into the boolean sliceAnd arithmetic slice->Calculate->Satisfy->. Input->Andoutput->I.e. +.>Outputting y corresponding to the fragments, otherwise outputting 0 corresponding to the fragments; when x and y are both vectors, the representation component performs multiplexing; when x is a vector and y is a scalar, each element representing x performs multiplexing with y. It will be appreciated that the first bit unit slice +. >Can be expressed as a first bit unit slice +.>If the first bit unit slice +>For the first boolean value (the first boolean value may also be 0), the reciprocal factor is sliced +.>Determined as a first bit unit slice +.>Corresponding first selected arithmetic slice +.>The method comprises the steps of carrying out a first treatment on the surface of the If the first bit unit is sliced +>For the second boolean value (the first boolean value may also be 1), the first boolean value is determined as the first bit unit slice +.>Corresponding first selected arithmetic slicing
The computer device may slice the D second bit unitsAre respectively fragmented with reciprocal factors>Performing a slice selection operation, performing +.>Wherein i.epsilon.0, f) gives D second selected arithmetic slices +.>. For example, it can be +.>And->Performing a slice selection operation, < >>And (3) withPerforming a partition selection operation, … …, < > and->And->Performing a slice selection operation to obtain D second selected arithmetic slices +.>
The computer device may pass the first reduction factorAnd a second reducing factor->Generating reduced reciprocal arithmetic slices->The process can be as follows: determining the operation results of the fragment addition operation of the C first selected arithmetic fragments as first reduction factors; determining the operation results of the slicing addition operation of the D second selected arithmetic slices as factors to be cut, and cutting bits of the factors to be cut based on the stretching factors to obtain second reduction factors; and performing fragment addition operation on the first reduction factor and the second reduction factor to obtain a reduction reciprocal arithmetic fragment corresponding to the first secret arithmetic fragment.
Specifically, the computer device may slice the C first selected arithmetic slicesThe result of the fragment addition of (a) is determined as a first reduction factor +.>. I.e. < ->=Add(/>+/>+……+/>). The computer device may divide the D second selected arithmetic slices +.>The operation result of the fragment addition operation of (a) is determined as the reduction factor to be truncatedI.e. +.>
It will be appreciated that the first bit unit sliceCorresponding to the first scaling factor->High P-D bits of (1) first bit unit slice +.>Corresponding to the first scaling factor->In the low D bit of (1) for the first scale factor->When the low D bit of (2) is used for selecting the slice, the value of twice the stretching factor is needed, and the +.>The trunk treatment is carried out, namely Multiplex is needed) Execute trunk to obtain the second reduction factor +.>. Reduction factor to be truncated->Cutting off, stretching the bit corresponding to the value of the factor f to obtain a second reduction factor +.>The course of (2) can also be denoted +.>=Truncate(/>,f)。
The computer device may treat the truncated reduction factorTruncating the bit corresponding to the value of the stretch factor f to obtain a second reduction factor +.>. Can be applied to the first reduction factor->And a second reducing factor->Performing fragment addition operation to obtain a reduced reciprocal arithmetic fragment +. >. By the truncation processing, the value of the double stretching factor used in the segmentation selection operation of the low D bit can be kept to be the value of the double stretching factor, so that the expansion of the stretching factor can be avoided, the double calculation cost caused by the expansion of the integer ring structure can be avoided, and the calculation efficiency is improved.
It will be appreciated that the above first applies to the first scaling factorThe bit unit slice on each bit of (2) is respectively divided into (I) and (II) by the inverse factor>The process of performing the selection operation (multiple) and then performing the addition operation (Add) on the operation result can be summarized as the cross-slice operation (MulAB, also called two-sided cross-slice), mulAB #,/>)= Truncate(/>,f)+/>=/>+/>. Let x be the arithmetic slice +.>The Boolean fraction of y is +.>Then->Notice thatHere->Representation->I-th bit of (2), then each item +.>Available by Multiplex calculation, i.e. +.>And finally, accumulating the secret fragments obtained by calculation.
For ease of understanding, for arithmetic slicingWith Boolean fragmenting->Performing two-way cross operation (i.e. MulAB #),/>) The procedure of) may be: 1. will->Is divided into->And->Two parts, wherein->Is the high P-f bit and,is low f-bit, i.e.)>The method comprises the steps of carrying out a first treatment on the surface of the 2. Calculate- >Here, 64-f multiple post-summation is performedThe method comprises the steps of carrying out a first treatment on the surface of the 3. Calculate->Here, f multiple post-summation is performed; 4. calculate->
Step S205, performing piecewise multiplication operation on the second secret arithmetic slicing and the restored reciprocal arithmetic slicing to obtain target secret arithmetic slicing; the target secret arithmetic shard is used to provide a computational service for the federation model for the first business data and the second business data.
In particular, the computer device may fragment the second secret arithmeticAnd reduction reciprocal arithmetic fragmentation->Performing a piece multiplication operation, performing +.>Mul(/>,/>F) obtaining the target secret arithmetic slice +.>Target secret arithmetic slice->May be used to provide a federal model with computing services for the first business data x and the second business data y.
Optionally, the computer device is configured to avoid the second secret arithmetic slice when performing the computing serviceOut of range, the second secret arithmetic slice can be also be->The process of scaling is also carried out, and the process can be as follows: performing slicing scaling on the second secret arithmetic slicing to obtain a second slicing symbol, a second target bit slicing and a second scaling arithmetic slicing corresponding to the second secret arithmetic slicing; the second scaling factor is determined based on the second secret arithmetic slice; the second target bit slice is a boolean slice corresponding to a target bit of a second absolute value boolean slice corresponding to the second secret arithmetic slice; the target bit refers to the highest bit in the bits with the value of 1 in the second absolute value Boolean segment;
In particular, the computer device may fragment the second secret arithmeticPerforming a sliced symbol operation, performingObtaining a second secret arithmetic slice +.>Second segment symbol->The computer device may be based on the second tile notation +.>For the second segment symbol->Second secret arithmetic slice +.>Performing a slice multiplexing operation, performing +.>Determining a second secret arithmetic slice +.>Corresponding second absolute value arithmetic slice +.>. The computer device can execute->Dividing the second absolute value into arithmetic slices +.>Conversion to a second absolute value Boolean fraction +.>. Can obtain a second absolute value Boolean fragmentSecond target bit slice +.>Can be +.>=/>. Wherein the second target bit slice +.>For the second absolute value Boolean fraction +.>The target bit in the block is the second absolute value Boolean block +.>The highest bit of the bits having a median value of 1.
The computer device may be based on the stretch factor f and the second secret arithmetic slicingFor the second target bit slicingBit inversion and execution->= BitRev(/>,/>) Obtaining a second secret arithmetic slice +.>Corresponding second scaling factor +.>. The computer device may add a second scaling factor to>Corresponding Boolean fragmenting- >Arithmetic slice with the second absolute value +.>Performing a piece multiplication operation, performing +.>Obtaining a second secret arithmetic slice +.>Corresponding second scalable arithmetic slice +.>. The specific process of scaling the second secret arithmetic slice may be described with reference to step S202.
In the second secret arithmetic slicingComputer equipment after scalingCan be based on reduction reciprocal arithmetic fragmentationAnd a second arithmetic scaling slice->Performing a piece multiplication operation to generate a target secret arithmetic piece +.>. The process can be as follows: performing fragment multiplication operation on the reduced reciprocal arithmetic fragment and the second scaled arithmetic fragment to obtain an arithmetic fragment to be corrected, generating a corrected arithmetic fragment of the arithmetic fragment to be corrected based on the first fragment symbol and the second fragment symbol, generating a target reduced arithmetic fragment based on the bit unit fragment corresponding to each bit in the first scaled factor and the corrected arithmetic fragment, and generating a target secret arithmetic fragment based on the unit target bit factor corresponding to each bit in the second target bit fragment and the target reduced arithmetic fragment.
In particular, the computer device may perform arithmetic slicing on the reduction reciprocalAnd a second arithmetic scaling slice->Performing a piece multiplication operation, and performing Mul (+) >,/>) Obtaining arithmetic slices to be corrected>Based on the first tile symbol +.>And the second segment symbol->Generating arithmetic slices to be corrected>Is modified arithmetic slice->I.e. calculate +.>
The computer device may be based on the first scaling factorBit unit slicing corresponding to each bit in a plurality of bitsAnd correction arithmetic slice->Generating target reduction arithmetic slice->Execution->MulAB(/>,) For example, it may be +.>And->Performing a slice selection operation, < >>And->Performing a partition selection operation, … …, < > and->And->Performing fragment selection operation, performing fragment addition operation on operation results of P fragment selection operations, and performing trunk on operation results corresponding to low D bits to obtain target reduction arithmetic fragments->. The procedure of MulAB can be seen from the detailed description of step S204 above.
The computer device may be based on the unit target bit factor corresponding to each bit in the second target bit slice and the target reduction arithmetic sliceThe process of generating the target secret arithmetic slice may be: based on the stretching factors, C first target bit factors and D second target bit factors in the second target bit slices are obtained, the C first target bit factors and the target reduction arithmetic slices are subjected to slice selection operation respectively to obtain C first selection reduction slices, and the D second target bit factors and the target reduction arithmetic slices are subjected to slice selection operation respectively to obtain D second selection reduction slices; the bit positions of the C first target bit factors in the second target bit slices are higher than the bit positions of the scaling bits; the scaled bit refers to the highest bit of the D second target bit factors in the second target bit slice; d is the value of the stretching factor, C is the difference between P and the stretching factor; and generating the target secret arithmetic slice through the first target factors corresponding to the C first selective reduction slices and the second target factors corresponding to the D second selective reduction slices.
Specifically, the computer device may obtain the second target bit slice based on the stretch factor fTarget on each bit of (a)Bit factor, second target bit slice->The target bit factor on each bit of (2) can be expressed as + ->,/>For the second target bit slice +>A target bit factor for the i-th bit of the (b) signal. Target bit factor->Comprising a first target bit factor->And a second target bit factor->The computer device can obtain the second target bit slice +.>C first target bit factors +.>D second target bit factorsWherein C first target bit factors +.>In the second target bit slice +>The bit positions in the two-dimensional space are all higher than the dividing bit positions; dividing bits means D second target bit factors +.>In the second target bit slice +>The highest bit of (a), D is the value of the stretching factor (i.e. D can be equal to f), C is the difference between P and the stretching factor f, i.e=/>Wherein->For the first target bit factor,/o>Is the second target bit factor. />Can be expressed as +.>,/>Can be expressed as
The computer device may perform the following operations on the C first target bit factorsArithmetic fragmentation with target reduction respectively->Performing fragment selection operation to obtain C first selection reduction fragments, and respectively carrying out +.f on D second target bit factors and target reduction arithmetic fragments >Performing fragment selection operation to obtainD second selective reduction fragments, wherein a target secret arithmetic fragment ∈10 is generated by the first target factors corresponding to the C first selective reduction fragments and the second target factors corresponding to the D second selective reduction fragments>. Generating a target secret arithmetic slice by a first target factor and a second target factor>The procedure of (2) can be seen in step S204 above with respect to the first reduction factor +.>And a second reducing factor->Generating reduced reciprocal arithmetic slicesIs described in detail in (2).
Alternatively, when the computing service is used to determine the optimal splitting result or leaf node weight of the longitudinal federal model, the final computed target secret arithmetic shards may be usedThe optimal splitting point and the leaf node weight are determined, and the process can be as follows: performing piecewise multiplication operation on the second scaling arithmetic slicing to obtain a second scaling square slicing, performing piecewise multiplication operation on the reduction reciprocal arithmetic slicing and the second scaling square slicing to obtain an arithmetic slicing to be corrected, and generating a correction arithmetic slicing of the arithmetic slicing to be corrected based on the first slicing symbol; generating a target reduction arithmetic slice based on the bit unit slice and the correction arithmetic slice corresponding to each bit in the first scaling factor, generating a target basic arithmetic slice based on the unit target bit factor and the target reduction arithmetic slice corresponding to each bit in the second target bit slice, generating a target basic arithmetic slice based on the unit target bit factor and the target basic arithmetic slice corresponding to each bit in the second target bit slice, and generating a target Marking secret arithmetic slices; the target secret arithmetic slicing is used for providing a computing service for the federation model for the first service data and the second service data, and the computing service is used for determining an optimal splitting result or leaf node weight of the longitudinal federation model.
Specifically, referring to fig. 8 again, fig. 8 is a schematic diagram five of a data processing scenario provided in the embodiment of the present application, as shown in fig. 8, in a federal model XGBoost, when a first participant and a second participant use grad and hess as secret-slice security computation, the grad in the federal model XGBoost may be determined as a second secret arithmetic sliceDetermining the hess in the federal model XGBoost as the first secret arithmetic slice +.>
Wherein federal learning may include longitudinal federal learning (Vertical Federated Learning) and transverse federal learning (Horizontal Federated Learning).
The longitudinal federal learning can include a method for training a longitudinal federal learning model on the premise of not exposing the ID set after intersection, that is, the sample alignment process is longitudinal federal learning without information leakage, and the feature data is used for training model parameters indiscriminately. In federal practice, the vertical federal XGBoost (eXtreme Gradient Boosting) algorithm (i.e., the hidden longitudinal federal XGBoost training algorithm) is the most widely used federal machine learning algorithm (i.e., the vertical federal learning model training algorithm). The XGBoost is a lifting version of the gradient lifting decision tree, and the XGBoost takes the classification tree or the regression tree as a lifting method of the basic classifier, so that the method has higher expandability and higher speed and efficiency.
In federal learning tasks such as gradient histogram calculation, finding optimal splitting points, updating tree structure, calculating leaf node weights, etc., it is necessary to perform security calculation in the form of secret shards, e.g., security calculation of the weights of leaf nodesThe calculation mode of (2) is as shown in the formula:
formula (2)
Where grad represents the gradient and hess represents the curvature. In XGBoost, grad is the partial derivative of the objective function with respect to the feature, i.e. the gradient of the loss function with respect to the feature. hess is the Hessian matrix, in XGBoost, hess is the second partial derivative of the objective function with respect to the feature, i.e. the Hessian matrix of the loss function with respect to the feature.Representing the subset to which the j-th leaf node corresponds. Lambda is a regularization parameter, and embodiments of the present application are not limited herein.
Its objective functionThe secure computation in the form of secret shards is required as shown in equation (3):
formula (3)
Wherein,representing the corresponding subset of leaf nodes of the left subtree, < ->Representing the corresponding subset of leaf nodes of the left subtree, < ->Representing the vector or feature to be partitioned. Gamma is a regularization parameter, and embodiments of the present application are not limited herein.
It will be appreciated that when the sample size is up to millions, the numerator denominator is at least a floating point number of hundreds of thousands, and the method described above can only safely calculate leaf node weights (i.e., slicing division); if squaring is followed by division, out of bounds is very likely to result in erroneous results. To address this problem, the computer device may modify the tile division flow to implement the tile square followed by division. The specific details are as follows:
For equation (2) involving only sliced division, the computer device can directly apply MulAB to calculate the weights of leaf nodes. For equation (3), the computer device may square the arithmetic slice involved before MulAB, and the computer device may square the second scaled arithmetic slice +.>Performing a piece multiplication operation, performing +.>Mul(,/>F) obtaining a second scaled square tile->For reduction reciprocal arithmetic fragmentation->And a second scaled square slice->Performing a piece multiplication operation, performing +.>Mul(/>,/>F), obtaining arithmetic slices to be corrected>Based on the first tile symbol +.>Execution->Generating arithmetic slices to be corrected>Is modified arithmetic slice->
The computer device may be based on the first scaling factorBit unit slice corresponding to each bit of (a) and modified arithmetic slice +.>Execution->MulAB(/>,/>) Generating target reduction arithmetic slice->Based on the second target bit slice +.>Unit target bit factor corresponding to each bit of (a) and target reduction arithmetic slice +.>Execution->MulAB(/>,/>) Generating a target basic arithmetic slice->Based on the second target bit slice +.>A unit target bit factor corresponding to each bit of the (a) and a target basic arithmetic slice +.>ExecuteMulAB(/>,/>) Generating a target secret arithmetic slice >
It will be appreciated that embodiments of the present application operate by slicing a second secret arithmetic representing a gradAnd a first secret arithmetic slice representing hess +.>And after the scaling, performing the reciprocal and square of the slices and the multiplication of the slices, and finally restoring the final result according to the scaling factor. Avoid XGBoost middle sampleWhen the scale reaches millions, the molecular denominator is at least hundreds of thousands of floating point numbers, so that the leaf node weight (namely the slicing division) can be calculated safely, and the result error caused by out-of-range is avoided.
In the integrated MPC-based longitudinal federal XGBoost algorithm, for example, a privacy computing platform PowerFL is a safe computing script which needs to provide a custom function, and the target secret arithmetic obtained by computing is slicedThe method is determined to relate to the safe division operator, so that the problems that the result of safe calculation is incorrect and the like due to overlarge precision or numerical value can be solved, and the practicability of the PowerFL is improved.
In a joint query (SQL query) scenario, the query statement and the private data in the database are secretly fragmented, and the second secret arithmetic is fragmentedWith first secret arithmetic slice +.>Calculating to obtain target secret arithmetic slice>The process of the method is determined as a division operator in the SQL query statement, so that the data privacy safety in the database can be protected, and the division can be calculated with high precision and high efficiency, so as to meet the requirements of accuracy, high efficiency and safety of large-scale data query.
The embodiment of the application obtains a second secret arithmetic slice corresponding to second business data by obtaining a first secret arithmetic slice corresponding to the first business data, performs slice scaling operation on the first secret arithmetic slice to obtain a first scaled arithmetic slice corresponding to the first secret arithmetic slice, avoids the out-of-limits caused by overlarge of the first secret arithmetic slice, iteratively calculates a reciprocal factor slice corresponding to the first secret arithmetic slice through a first scaling factor corresponding to the first scaled arithmetic slice and the first scaled arithmetic slice, obtains a bit unit slice on each bit in the first scaling factor, performs slice selective operation on the P bit unit slices and the reciprocal factor slice based on the stretching factor, performs slice addition operation on the P selected arithmetic slices to obtain a reduced reciprocal arithmetic slice corresponding to the first secret arithmetic slice, approximates the reciprocal of the first secret slice through the reduced arithmetic slice, performs iterative computation on the second secret slice and the reduced arithmetic slice through the first scaling factor and the first scaled arithmetic slice, directly performs the out-of-limits to obtain the first secret arithmetic slice, and directly performs multiplication operation on the second secret arithmetic slice and the second secret arithmetic slice, thereby avoiding the problem that the first secret arithmetic slice is directly calculated with the first secret arithmetic slice and the second secret arithmetic slice, and the problem is solved by the first secret arithmetic slice is solved, the first scaling factor is split into bit unit fragments for fragment selection operation, so that the calculation complexity is low, the calculation speed of the federal model calculation service is improved, the multiple calculation expense caused by expanding the integer ring structure due to the boundary crossing of the fragment multiplication operation of a computer processor is avoided, and the calculation efficiency is improved.
Referring to fig. 9, fig. 9 is a flowchart illustrating a third embodiment of a data processing method according to the present application, where the data processing method may be performed by a computer device, and the computer device may be the first server 100 shown in fig. 1.
Specifically, the computer device may obtain a first secret arithmetic slice corresponding to the first service data yAcquiring a second secret arithmetic slice corresponding to the second service data x>For->Calculation symbol->Then find its absolute value +>And do->Scaling to obtain->And a first scale factor->Wherein->. For->Calculation symbol->Then find its absolute value +>And do->Scaling to obtain->And target bit slicingWherein->
The computer device can calculateIs the inverse of (c). I.e. performing the Goldschmidt algorithm to get +.>. Calculation ofThen according to->And->Correction->Of (i.e. calculating)According to the first scaling factor +.>And target bit slice->Restoring the final result, i.e. first calculating +.>Recalculating. Finally obtained->I.e. the target secret arithmetic slice, can be used to provide the federal model with computational services for the first traffic data x and the second traffic data y.
It can be understood that in the embodiment of the present application, by acquiring a first secret arithmetic slice corresponding to first service data, acquiring a second secret arithmetic slice corresponding to second service data, scaling the first secret arithmetic slice to obtain a first scaled arithmetic slice corresponding to the first secret arithmetic slice, avoiding out-of-range caused by oversized first secret arithmetic slice, iteratively calculating an inverse factor slice corresponding to the first secret arithmetic slice through a first scaling factor and the first scaling arithmetic slice corresponding to the first scaled arithmetic slice, acquiring a bit unit slice on each bit in the first scaling factor, performing slice selection operation on P bit unit slices and the inverse factor slice respectively based on the stretching factor to obtain P selected arithmetic slices, performing slice addition operation on the P selected arithmetic slices to obtain a reduced arithmetic slice corresponding to the first secret arithmetic slice, the reciprocal reduction arithmetic fragmentation approximates the reciprocal of the first arithmetic secret fragmentation, and carries out the fragmentation multiplication operation on the second secret arithmetic fragmentation and the reciprocal reduction arithmetic fragmentation to obtain the target secret arithmetic fragmentation, the fragmentation multiplication of the first scalable arithmetic fragmentation and the second secret arithmetic fragmentation can be converted into the fragmentation multiplication operation of the second secret arithmetic fragmentation and the reciprocal reduction arithmetic fragmentation, the reciprocal reduction arithmetic fragmentation is obtained by carrying out the fragmentation selection operation on the bit unit fragmentation on each bit in the first scaling factor and the reciprocal factor fragmentation respectively, the problem of out-of-range caused by the direct carrying out of the fragmentation multiplication of the first scalable arithmetic fragmentation and the second secret arithmetic fragmentation is avoided, the stretching factor is not required to be adjusted to avoid out-of-range, the calculation precision of the calculation service of the federal model for the first service data and the second service data is improved, the first scaling factor is split into bit unit fragments for fragment selection operation, so that the calculation complexity is low, and the calculation speed of the federal model calculation service is improved.
The performance comparison of the improved slicing division described above with Goldschmidt-based slicing division proposed by the embodiments of the present application may be as shown in table 1:
TABLE 1
Wherein, the values of x and y are both (-10, 10), and the stretching factor is 25. The precision loss of Goldschmidt slicing division of 1000 data is 5.2e-5, the calculation time length is 1.7s, the precision loss of Goldschmidt slicing division of 10000 data is 1.92, the calculation time length is 10.5s, the precision loss of Goldschmidt slicing division of 100000 data is 1.8, and the calculation time length is 81.3s. The precision loss of the improved slicing division of 1000 data is 1.1e-5, the calculation time length is 3.3s, the precision loss of the improved slicing division of 10000 data is 9.2e-6, the calculation time length is 12.3s, the precision loss of the improved slicing division of 100000 data is 6.3e-5, and the calculation time length is 89.8s.
It can be understood that the embodiment of the application can simultaneously amplify and shrink the first secret arithmetic slice and the second secret arithmetic slice, and convert the first secret arithmetic slice and the second secret arithmetic slice into the second secret arithmetic slice and the inverse arithmetic slice restoration slice when calculating the slice multiplication operation of the inverse arithmetic slice and the second secret arithmetic slice, wherein the inverse arithmetic slice is obtained by carrying out slice selection operation on the bit unit slice on each bit in the first scaling factor and the inverse factor slice respectively, so that the problem of out-of-range caused by direct slice multiplication of the first scaling arithmetic slice and the second secret arithmetic slice is avoided, the problem of out-of-range caused by direct slice multiplication of the first secret arithmetic slice and the second secret arithmetic slice is avoided, the problem of out-of-range caused by out of-range caused by direct slice multiplication of the first secret arithmetic slice and the inverse arithmetic slice is avoided when calculating the inverse arithmetic slice is iterated, the inverse arithmetic slice and the second secret slice is subjected to out-of-range caused by slice multiplication operation, the performance loss of slice division is reduced, and the precision is kept stable. However, the precision based on Goldschmidt slicing division is not stable, and when the data size is large, there are instances where the calculation is completely incorrect. Taking P as an example, when the precision is guaranteed to be within the same range as the improved slicing division, the ring structure needs to be expanded, then additional calculation needs to be performed to expand the 64-bit slicing input into 128-bit slicing, and the output result is cut from 128-bit slicing to 64-bit slicing, so that the ring structure corresponding to the whole secret sharing-based protocol is That would bring at least a doubled computational/communication overhead to each security operator of the protocol, which would be much longer to compute than the computational duration of the improved algorithm.
On the other hand, the second secret arithmetic fragment is too small, namely when the second secret arithmetic fragment is not required to be scaled, the embodiment of the application can only convert the reciprocal fragment into the fragment multiplication operation of the second secret arithmetic fragment and the reduction reciprocal arithmetic fragment when the fragment multiplication operation of the reciprocal fragment and the second secret arithmetic fragment is carried out, so that the calculation steps of improving the fragment division are reduced, and the calculation complexity can be reduced compared with the calculation speed based on the Goldschmidt fragment division after the scaling of the second secret arithmetic fragment.
Referring to fig. 10, fig. 10 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present application. As shown in fig. 10, the data processing apparatus 1 includes a fragment scaling module 300, a reciprocal iteration module 400, a reciprocal reduction module 500, and a fragment processing module 600.
The slicing scaling module 300 is configured to obtain a first secret arithmetic slice corresponding to the first service data, obtain a second secret arithmetic slice corresponding to the second service data, and perform slicing scaling on the first secret arithmetic slice to obtain a first scaling arithmetic slice corresponding to the first secret arithmetic slice and a first scaling factor; the first secret arithmetic slice is input by a first participant, and the second secret arithmetic slice is input by a second participant; the first business data and the second business data participate in training a federal model aiming at the first participator and the second participator; the first scaling factor has P bits, P being a positive integer;
The reciprocal iteration module 400 is configured to generate a reciprocal factor slice corresponding to the first secret arithmetic slice based on the first scaling factor and the first scaling arithmetic slice;
the reciprocal reduction module 500 is configured to obtain bit unit slices on each bit in the first scaling factor, perform a slice selection operation on the P bit unit slices and the reciprocal factor slices based on the stretch factor, obtain P selected arithmetic slices, and perform a slice addition operation on the P selected arithmetic slices, so as to obtain a reduced reciprocal arithmetic slice corresponding to the first secret arithmetic slice;
the slicing processing module 600 is configured to perform a slicing multiplication operation on the second secret arithmetic slice and the reduced reciprocal arithmetic slice, so as to obtain a target secret arithmetic slice; the target secret arithmetic shard is used to provide a computational service for the federation model for the first business data and the second business data.
In one possible implementation, the P bitunit slices include C first bitunit slices and D second bitunit slices, and the P selected arithmetic slices include C first selected arithmetic slices and D second selected arithmetic slices; d is the value of the stretching factor, C is the difference between P and the stretching factor; the reciprocal reduction module 500 is configured to obtain P bit unit slices in the first scaling factor, perform a slice selection operation on the P bit unit slices and the reciprocal factor slices based on the stretching factor, to obtain P selected arithmetic slices, and perform a slice addition operation on the P selected arithmetic slices, to obtain a reduced reciprocal arithmetic slice corresponding to the first secret arithmetic slice, where the reciprocal reduction module is specifically configured to perform the following operations:
Based on the stretching factors, C first bit unit fragments and D second bit unit fragments in the first scaling factors are obtained, fragment selection operation is carried out on the C first bit unit fragments and the reciprocal factor fragments respectively to obtain C first selection arithmetic fragments, and fragment selection operation is carried out on the D second bit unit fragments and the reciprocal factor fragments respectively to obtain D second selection arithmetic fragments; the bits of the C first bit unit slices in the first scaling factor are higher than the dividing bits; dividing the bit refers to the highest bit of the D second bit unit slices in the first scaling factor;
and generating a reduction reciprocal arithmetic slice corresponding to the first secret arithmetic slice through the first reduction factors corresponding to the C first selection arithmetic slices and the second reduction factors corresponding to the D second selection arithmetic slices.
In one possible implementation, the C first bit unit slices include first bit unit slices,/>Slicing the bit unit of the ith bit in the first scaling factor, wherein i is a positive integer; the reciprocal reduction module 500 is used for pairingThe C first bit unit slices are respectively subjected to a slice selection operation with the reciprocal factor slices, and when C first selection arithmetic slices are obtained, the method is specifically used for executing the following operations:
Slicing the first bit unitPerforming fragment selection operation with the reciprocal factor fragments;
if the first bit unit is slicedFor a first boolean value, the reciprocal factor slice is determined as the first bit unit slice +.>A corresponding first selected arithmetic slice;
if the first bit unit is slicedFor the second Boolean value, then the first Boolean value is determined to be the first bit unit sliceThe corresponding first selected arithmetic slice.
In one possible implementation manner, the reciprocal reduction module 500 is configured to, when generating the reduced reciprocal arithmetic slice corresponding to the first secret arithmetic slice by using the first reduction factors corresponding to the C first selected arithmetic slices and the second reduction factors corresponding to the D second selected arithmetic slices, specifically perform the following operations:
determining the operation results of the fragment addition operation of the C first selected arithmetic fragments as first reduction factors;
determining the operation results of the slicing addition operation of the D second selected arithmetic slices as factors to be cut, and cutting bits of the factors to be cut based on the stretching factors to obtain second reduction factors;
and performing fragment addition operation on the first reduction factor and the second reduction factor to obtain a reduction reciprocal arithmetic fragment corresponding to the first secret arithmetic fragment.
In one possible implementation manner, the fragment scaling module 300 is configured to, when acquiring a first secret arithmetic fragment corresponding to first service data, specifically perform the following operations:
acquiring first service data, and determining a stretching factor based on the bit width length of the first service data;
floating point number coding is carried out on the first service data based on the stretching factors to obtain stretching coding values, arithmetic slicing processing is carried out on the stretching coding values to obtain first secret arithmetic slicing and interactive arithmetic slicing; the stretching coding value is an element in an integer ring, and the operation result of the piecewise addition operation of the first secret arithmetic slicing and the interactive arithmetic slicing is the stretching coding value; the interactive arithmetic fragmentation is used to provide to the second party.
In one possible implementation manner, the tile scaling module 300 is configured to scale the first secret arithmetic tile to obtain a first scaling factor and a first scaling factor of the first scaling arithmetic tile corresponding to the first secret arithmetic tile, and is specifically configured to perform the following operations:
performing fragment symbol operation on the first secret arithmetic fragment to obtain a first fragment symbol of the first secret arithmetic fragment;
determining a first absolute value arithmetic slice and a first scaling factor corresponding to the first secret arithmetic slice based on the first slice symbol;
And performing piecewise multiplication operation on the first scaling factor and the first absolute value arithmetic slicing to obtain a first scaling arithmetic slicing corresponding to the first secret arithmetic slicing, and performing Boolean conversion operation on the first scaling arithmetic slicing to obtain the first scaling factor corresponding to the first secret arithmetic slicing.
In one possible implementation manner, the tile scaling module 300 is configured to determine, based on the first tile symbol, a first scaling factor corresponding to the first secret arithmetic tile, and specifically configured to perform the following operations:
determining a first absolute value arithmetic slice of a first secret arithmetic slice based on the first slice symbol, converting the first absolute value arithmetic slice into a first absolute value Boolean slice, and obtaining a first target bit slice of the first absolute value Boolean slice; the first target bit slice is a Boolean slice corresponding to the target bit in the first absolute value Boolean slice; the target bit refers to the highest bit in the bits with the value of 1 in the first absolute value Boolean segment;
based on the stretching factors, carrying out bit inversion on the first target bit slices to obtain first scaling factors corresponding to the first secret arithmetic slices; the first scaling factor has E bits, the first target bit slice has G bits, G is a positive integer, and E is the difference between the value of twice the stretch factor and G.
In one possible implementation manner, the reciprocal iteration module 400 is configured to, when generating the reciprocal factor slice corresponding to the first secret arithmetic slice based on the first scaling factor and the first scaling arithmetic slice, specifically perform the following operations:
determining an initial reciprocal factor corresponding to the first secret arithmetic slice based on the first scaling factor and the first scaling arithmetic slice, determining an initial iteration factor corresponding to the first secret arithmetic slice based on the initial reciprocal factor and the first scaling arithmetic slice, and generating an iterative arithmetic slice corresponding to the first secret arithmetic slice through iteration by the initial reciprocal factor and the initial iteration factor;
generating reciprocal factor slices corresponding to the first secret arithmetic slices based on the iterative arithmetic slices and the first slice symbols; the first sliced symbol is obtained by performing a sliced symbol operation on the first secret arithmetic slice.
In one possible implementation manner, the reciprocal iteration module 400 is configured to, when iteratively generating the iterative arithmetic slice corresponding to the first secret arithmetic slice by using the initial reciprocal factor and the initial iteration factor, specifically perform the following operations:
acquiring an iteration number threshold; the iteration number threshold is a number threshold determined based on the accuracy of the federal model's computing service;
Generating an updated reciprocal factor based on the initial reciprocal factor and the initial iteration factor, determining an operation result of the piecewise multiplication operation of the initial iteration factor as the updated iteration factor, continuously determining a new updated reciprocal factor and a new updated iteration factor based on the updated reciprocal factor and the updated iteration factor until the iteration number reaches an iteration number threshold, and determining the reciprocal factor with the iteration number reaching the iteration number threshold as the iterative arithmetic piecewise corresponding to the first secret arithmetic piecewise.
In one possible implementation manner, the slice processing module 600 is configured to perform a slice multiplication operation on the second secret arithmetic slice and the reduced reciprocal arithmetic slice, and when obtaining the target secret arithmetic slice, specifically is configured to perform the following operations:
performing slicing scaling on the second secret arithmetic slicing to obtain a second slicing symbol, a second target bit slicing and a second scaling arithmetic slicing corresponding to the second secret arithmetic slicing; the second scaling factor is determined based on the second secret arithmetic slice; the second target bit slice is a boolean slice corresponding to a target bit of a second absolute value boolean slice corresponding to the second secret arithmetic slice; the target bit refers to the highest bit in the bits with the value of 1 in the second absolute value Boolean segment;
Performing fragment multiplication operation on the reduced reciprocal arithmetic fragment and the second scaled arithmetic fragment to obtain an arithmetic fragment to be corrected, generating a corrected arithmetic fragment of the arithmetic fragment to be corrected based on the first fragment symbol and the second fragment symbol, generating a target reduced arithmetic fragment based on the bit unit fragment corresponding to each bit in the first scaled factor and the corrected arithmetic fragment, and generating a target secret arithmetic fragment based on the unit target bit factor corresponding to each bit in the second target bit fragment and the target reduced arithmetic fragment.
In a possible implementation manner, the slice processing module 600 is configured to, based on the unit target bit factor corresponding to each bit in the second target bit slice and the target restored arithmetic slice, generate a target secret arithmetic slice, specifically be configured to perform the following operations:
based on the stretching factors, C first target bit factors and D second target bit factors in the second target bit slices are obtained, the C first target bit factors and the target reduction arithmetic slices are subjected to slice selection operation respectively to obtain C first selection reduction slices, and the D second target bit factors and the target reduction arithmetic slices are subjected to slice selection operation respectively to obtain D second selection reduction slices; the bit positions of the C first target bit factors in the second target bit slices are higher than the bit positions of the scaling bits; the scaled bit refers to the highest bit of the D second target bit factors in the second target bit slice; d is the value of the stretching factor, C is the difference between P and the stretching factor;
And generating the target secret arithmetic slice through the first target factors corresponding to the C first selective reduction slices and the second target factors corresponding to the D second selective reduction slices.
In one possible implementation, the federal model is a longitudinal federal model; the slice processing module 600 is configured to perform a slice multiplication operation on the reduced reciprocal arithmetic slice and the second scalable arithmetic slice to obtain an arithmetic slice to be corrected, generate a modified arithmetic slice of the arithmetic slice to be corrected based on the first slice symbol and the second slice symbol, generate a target reduced arithmetic slice based on the modified arithmetic slice and a bit unit slice corresponding to each bit in the first scaling factor, and generate a target secret arithmetic slice based on the target reduced arithmetic slice and a unit target bit factor corresponding to each bit in the second target bit slice, and specifically configured to perform the following operations when generating the target secret arithmetic slice:
performing piecewise multiplication operation on the second scaling arithmetic slicing to obtain a second scaling square slicing, performing piecewise multiplication operation on the reduction reciprocal arithmetic slicing and the second scaling square slicing to obtain an arithmetic slicing to be corrected, and generating a correction arithmetic slicing of the arithmetic slicing to be corrected based on the first slicing symbol;
Generating a target restored arithmetic slice based on the bit unit slice and the corrected arithmetic slice corresponding to each bit in the first scaling factor, generating a target basic arithmetic slice based on the unit target bit factor and the target restored arithmetic slice corresponding to each bit in the second target bit slice, and generating a target secret arithmetic slice based on the unit target bit factor and the target basic arithmetic slice corresponding to each bit in the second target bit slice; the target secret arithmetic slicing is used for providing a computing service for the federation model for the first service data and the second service data, and the computing service is used for determining an optimal splitting result or leaf node weight of the longitudinal federation model.
In the present embodiment, the term "module" or "unit" refers to a computer program or a part of a computer program having a predetermined function, and works together with other relevant parts to achieve a predetermined object, and may be implemented in whole or in part by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Also, a processor (or multiple processors or memories) may be used to implement one or more modules or units. Furthermore, each module or unit may be part of an overall module or unit that incorporates the functionality of the module or unit.
Referring to fig. 11, fig. 11 is a schematic structural diagram of a computer device according to an embodiment of the present application. As shown in fig. 11, the computer device 1000 may include: processor 1001, network interface 1004, and memory 1005, and in addition, the above-described computer device 1000 may further include: a user interface 1003, and at least one communication bus 1002. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display (Display), a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface, among others. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 1005 may also optionally be at least one storage device located remotely from the processor 1001. As shown in fig. 11, an operating system, a network communication module, a user interface module, and a device control application may be included in the memory 1005, which is one type of computer-readable storage medium.
In the computer device 1000 shown in fig. 11, the network interface 1004 may provide a network communication network element; while user interface 1003 is primarily used as an interface for providing input to a user; and the processor 1001 may be used to invoke a device control application stored in the memory 1005 to implement:
acquiring a first secret arithmetic fragment corresponding to the first service data, acquiring a second secret arithmetic fragment corresponding to the second service data, and carrying out fragment scaling on the first secret arithmetic fragment to obtain a first scaling arithmetic fragment and a first scaling factor corresponding to the first secret arithmetic fragment; the first secret arithmetic slice is input by a first participant, and the second secret arithmetic slice is input by a second participant; the first business data and the second business data participate in training a federal model aiming at the first participator and the second participator; the first scaling factor has P bits, P being a positive integer;
generating reciprocal factor slices corresponding to the first secret arithmetic slices based on the first scaling factors and the first scaling arithmetic slices;
acquiring bit unit fragments on each bit in a first scaling factor, respectively performing fragment selection operation on the P bit unit fragments and reciprocal factor fragments based on a stretching factor to obtain P selected arithmetic fragments, and performing fragment addition operation on the P selected arithmetic fragments to obtain restored reciprocal arithmetic fragments corresponding to the first secret arithmetic fragments;
Performing piecewise multiplication operation on the second secret arithmetic slicing and the restored reciprocal arithmetic slicing to obtain target secret arithmetic slicing; the target secret arithmetic shard is used to provide a computational service for the federation model for the first business data and the second business data.
It should be understood that the computer device 1000 described in the embodiments of the present application may perform the description of the data processing method in any of the foregoing embodiments corresponding to any of fig. 3, fig. 4, and fig. 9, which is not repeated herein. In addition, the description of the beneficial effects of the same method is omitted.
Furthermore, it should be noted here that: the embodiment of the present application further provides a computer readable storage medium, and the computer readable storage medium stores a computer program, when the processor executes the computer program, the description of the data processing method in any one of the embodiments corresponding to fig. 3, fig. 4, and fig. 9 can be executed, and therefore, a detailed description will not be given here. In addition, the description of the beneficial effects of the same method is omitted. For technical details not disclosed in the embodiments of the computer-readable storage medium according to the present application, please refer to the description of the method embodiments of the present application.
The computer readable storage medium may be the data processing apparatus provided in any one of the foregoing embodiments or an internal storage unit of the computer device, for example, a hard disk or a memory of the computer device. The computer readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash card (flash card) or the like, which are provided on the computer device. Further, the computer-readable storage medium may also include both internal storage units and external storage devices of the computer device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer readable storage medium may also be used to temporarily store data that has been or is to be displayed.
Furthermore, it should be noted here that: embodiments of the present application also provide a computer program product comprising a computer program stored in a computer readable storage medium. The processor of the computer device reads the computer program from the computer readable storage medium and executes the computer program to cause the computer device to perform the method provided by the corresponding embodiments of any of the previous figures 3, 4 and 9.
The terms first, second and the like in the description and in the claims and drawings of the embodiments of the present application are used for distinguishing between different objects and not for describing a particular sequential order. Furthermore, the term "include" and any variations thereof is intended to cover a non-exclusive inclusion. For example, a process, method, apparatus, article, or device that comprises a list of steps or elements is not limited to the list of steps or modules but may, in the alternative, include other steps or modules not listed or inherent to such process, method, apparatus, article, or device.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein may be embodied as electronic hardware, as a computer software, or in a combination of the two, and that the elements and steps of the examples have been generally described in terms of network elements in the foregoing description to clearly illustrate the interchangeability of hardware and software. Whether these network elements are implemented in hardware or software depends on the specific application and design constraints of the solution. The skilled person may use different methods for implementing the described network elements for each specific application, but such implementation should not be considered beyond the scope of the present application.
The methods and related devices provided in the embodiments of the present application are described with reference to the method flowcharts and/or structure diagrams provided in the embodiments of the present application, and each flowchart and/or block of the method flowcharts and/or structure diagrams may be implemented by computer program instructions, and combinations of flowcharts and/or blocks in the flowchart and/or block diagrams. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks. These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or structural diagram block or blocks. These computer program instructions may also be loaded onto a computer or other programmable apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or structures.
The steps in the method of the embodiment of the application can be sequentially adjusted, combined and deleted according to actual needs.
The modules in the device of the embodiment of the application can be combined, divided and deleted according to actual needs.
The foregoing disclosure is only illustrative of the preferred embodiments of the present application and is not intended to limit the scope of the claims herein, as the equivalent of the claims herein shall be construed to fall within the scope of the claims herein.

Claims (16)

1. A method of data processing, comprising:
acquiring a first secret arithmetic fragment corresponding to first service data, acquiring a second secret arithmetic fragment corresponding to second service data, and carrying out fragment scaling on the first secret arithmetic fragment to obtain a first scaling arithmetic fragment corresponding to the first secret arithmetic fragment and a first scaling factor; the first secret arithmetic slice is input by a first participant, and the second secret arithmetic slice is input by a second participant; the first business data and the second business data participate in training a federal model for the first participant and the second participant together; the first scaling factor has P bits, and P is a positive integer;
Generating a reciprocal factor slice corresponding to the first secret arithmetic slice based on the first scaling factor and the first scaling arithmetic slice;
acquiring bit unit fragments on each bit in the first scaling factor, respectively performing fragment selection operation on P bit unit fragments and the reciprocal factor fragments based on a stretching factor to obtain P selected arithmetic fragments, and performing fragment addition operation on the P selected arithmetic fragments to obtain restored reciprocal arithmetic fragments corresponding to the first secret arithmetic fragments;
performing piecewise multiplication operation on the second secret arithmetic slicing and the restored reciprocal arithmetic slicing to obtain target secret arithmetic slicing; the target secret arithmetic slice is to provide computing services for the federation model for the first business data and the second business data.
2. The method of claim 1, wherein the P bitunit slices comprise C first bitunit slices and D second bitunit slices, and wherein the P selected arithmetic slices comprise C first selected arithmetic slices and D second selected arithmetic slices; d is the value of the stretching factor, C is the difference between P and the stretching factor;
The obtaining P bit unit slices in the first scaling factor, based on a stretching factor, performing a slice selection operation on the P bit unit slices and the reciprocal factor slices to obtain P selected arithmetic slices, and performing a slice addition operation on the P selected arithmetic slices to obtain a reduced reciprocal arithmetic slice corresponding to the first secret arithmetic slice, including:
based on a stretching factor, C first bit unit fragments and D second bit unit fragments in the first scaling factor are obtained, fragment selection operation is carried out on the C first bit unit fragments and the reciprocal factor fragments respectively to obtain C first selection arithmetic fragments, and fragment selection operation is carried out on the D second bit unit fragments and the reciprocal factor fragments respectively to obtain D second selection arithmetic fragments; the bits of the C first bit unit fragments in the first scaling factor are higher than the dividing bits; the dividing bit refers to the highest bit of the D second bit unit slices in the first scaling factor;
and generating a reduced reciprocal arithmetic slice corresponding to the first secret arithmetic slice through the first reduction factors corresponding to the C first selected arithmetic slices and the second reduction factors corresponding to the D second selected arithmetic slices.
3. The method of claim 2, wherein the C first bit unit slices comprise first bit unit slices,/>Slicing the bit unit of the ith bit in the first scaling factor, wherein i is a positive integer;
the performing a slice selection operation on the C first bit unit slices and the reciprocal factor slices to obtain C first selection arithmetic slices, including:
slicing the first bit unitPerforming fragment selection operation with the reciprocal factor fragments;
if the first bit unit is slicedFor a first boolean value, determining the reciprocal factor-slice as the first bit unit slice +.>A corresponding first selected arithmetic slice;
if the first bit unit is slicedFor a second Boolean value, determining the first Boolean value as the first bit unit slice +.>The corresponding first selected arithmetic slice.
4. The method of claim 2, wherein the generating the reduced reciprocal arithmetic slice corresponding to the first secret arithmetic slice by the first reduction factor corresponding to the C first selected arithmetic slices and the second reduction factor corresponding to the D second selected arithmetic slices comprises:
Determining the operation result of the fragment addition operation of the C first selected arithmetic fragments as a first reduction factor;
determining the operation result of the slicing addition operation of the D second selected arithmetic slices as a factor to be cut, and cutting bits of the factor to be cut based on the stretching factor to obtain a second reduction factor;
and performing fragment addition operation on the first reduction factor and the second reduction factor to obtain a reduction reciprocal arithmetic fragment corresponding to the first secret arithmetic fragment.
5. The method of claim 1, wherein the obtaining the first secret arithmetic slice corresponding to the first service data comprises:
acquiring first service data, and determining a stretching factor based on the bit width length of the first service data;
floating point number coding is carried out on the first service data based on the stretching factors to obtain stretching coding values, arithmetic slicing processing is carried out on the stretching coding values to obtain first secret arithmetic slicing and interactive arithmetic slicing; the stretching coding value is an element in an integer ring, and the operation result of the piecewise addition operation of the first secret arithmetic slicing and the interactive arithmetic slicing is the stretching coding value; the interactive arithmetic tile is for provision to the second party.
6. The method of claim 1, wherein the performing the scaling of the first secret arithmetic slice to obtain a first scaling factor and a first scaling factor for the first scaled arithmetic slice corresponding to the first secret arithmetic slice comprises:
performing fragment symbol operation on the first secret arithmetic fragment to obtain a first fragment symbol of the first secret arithmetic fragment;
determining a first absolute value arithmetic slice and a first scaling factor corresponding to the first secret arithmetic slice based on the first slice symbol;
and performing piecewise multiplication operation on the arithmetic slicing corresponding to the first scaling factor and the first absolute value arithmetic slicing to obtain the first scaling arithmetic slicing corresponding to the first secret arithmetic slicing.
7. The method of claim 6, wherein the determining a first scaling factor corresponding to the first secret arithmetic slicing based on the first slicing notation comprises:
determining a first absolute value arithmetic slice of the first secret arithmetic slice based on the first slice symbol, converting the first absolute value arithmetic slice into a first absolute value Boolean slice, and obtaining a first target bit slice of the first absolute value Boolean slice; the first target bit slice is a boolean slice corresponding to a target bit in the first absolute value boolean slice; the target bit is the highest bit in the bits with the value of 1 in the first absolute value Boolean segment;
Performing bit inversion on the first target bit slice based on the stretching factor to obtain a first scaling factor corresponding to the first secret arithmetic slice; the first scaling factor has E bits, the first target bit slice has G bits, G is a positive integer, and E is the difference between the value of twice the stretching factor and G.
8. The method of claim 1, wherein the generating the reciprocal factor tile corresponding to the first secret arithmetic tile based on the first scaling factor and the first scaling arithmetic tile comprises:
determining an initial reciprocal factor corresponding to the first secret arithmetic slice based on the first scaling factor and the first scaling arithmetic slice, determining an initial iteration factor corresponding to the first secret arithmetic slice based on the initial reciprocal factor and the first scaling arithmetic slice, and generating an iteration arithmetic slice corresponding to the first secret arithmetic slice in an iteration mode through the initial reciprocal factor and the initial iteration factor;
generating reciprocal factor slices corresponding to the first secret arithmetic slices based on the iterative arithmetic slices and the first slice symbols; the first sliced symbol is obtained by carrying out sliced symbol operation on the first secret arithmetic slicing.
9. The method of claim 8, wherein iteratively generating the iterative arithmetic slice corresponding to the first secret arithmetic slice by the initial reciprocal factor and the initial iterative factor comprises:
acquiring an iteration number threshold; the iteration number threshold is a number threshold determined based on the accuracy of the computational services of the federal model;
generating an updated reciprocal factor based on the initial reciprocal factor and the initial iteration factor, determining an operation result of the piecewise multiplication operation of the initial iteration factor as the updated iteration factor, continuously determining a new updated reciprocal factor and a new updated iteration factor based on the updated reciprocal factor and the updated iteration factor until the iteration times reach an iteration times threshold, and determining the reciprocal factor with the iteration times reaching the iteration times threshold as the iterative arithmetic piecewise corresponding to the first secret arithmetic piecewise.
10. The method of claim 1, wherein performing the piecewise multiplication on the second secret arithmetic slicing and the reduced reciprocal arithmetic slicing to obtain the target secret arithmetic slicing comprises:
performing fragment scaling on the second secret arithmetic fragment to obtain a second fragment symbol, a second target bit fragment and a second scaled arithmetic fragment corresponding to the second secret arithmetic fragment; the second scalable arithmetic slice is determined based on a second scaling factor and the second secret arithmetic slice; the second target bit slice is a boolean slice corresponding to a target bit of a second absolute value boolean slice corresponding to the second secret arithmetic slice; the target bit is the highest bit in the bits with the value of 1 in the second absolute value Boolean segment;
Performing piecewise multiplication operation on the reduced reciprocal arithmetic slicing and the second scaling arithmetic slicing to obtain an arithmetic slicing to be corrected, generating a corrected arithmetic slicing of the arithmetic slicing to be corrected based on a first slicing symbol and the second slicing symbol, generating a target reduced arithmetic slicing based on a bit unit slicing corresponding to each bit in the first scaling factor and the corrected arithmetic slicing, and generating a target secret arithmetic slicing based on a unit target bit factor corresponding to each bit in the second target bit slicing and the target reduced arithmetic slicing.
11. The method of claim 10, wherein the unit target bit factors include C first target bit factors and D second target bit factors, wherein generating the target secret arithmetic slice based on the unit target bit factors corresponding to each bit in the second target bit slice and the target restored arithmetic slice comprises:
based on a stretching factor, C first target bit factors and D second target bit factors in the second target bit slices are obtained, the C first target bit factors and the target reduction arithmetic slices are subjected to slice selection operation respectively to obtain C first selection reduction slices, and the D second target bit factors and the target reduction arithmetic slices are subjected to slice selection operation respectively to obtain D second selection reduction slices; the bit positions of the C first target bit factors in the second target bit slices are all higher than the bit positions of the C first target bit factors in the second target bit slices; the scaled bit refers to the highest bit of the D second target bit factors in the second target bit slice; d is the value of the stretching factor, C is the difference between P and the stretching factor;
And generating a target secret arithmetic slice through the first target factors corresponding to the C first selective reduction slices and the second target factors corresponding to the D second selective reduction slices.
12. The method of claim 10, wherein the federal model is a longitudinal federal model;
performing a piece multiplication operation on the reduced reciprocal arithmetic piece and the second scaled arithmetic piece to obtain an arithmetic piece to be corrected, generating a corrected arithmetic piece of the arithmetic piece to be corrected based on the first piece symbol and the second piece symbol, generating a target reduced arithmetic piece based on a bit unit piece corresponding to each bit in the first scaled factor and the corrected arithmetic piece, generating a target secret arithmetic piece based on a unit target bit factor corresponding to each bit in the second target bit piece and the target reduced arithmetic piece, including:
performing a piece multiplication operation on the second scaling arithmetic piece to obtain a second scaling square piece, performing a piece multiplication operation on the reduction reciprocal arithmetic piece and the second scaling square piece to obtain an arithmetic piece to be corrected, and generating a correction arithmetic piece of the arithmetic piece to be corrected based on the first piece symbol;
Generating a target reduction arithmetic slice based on the bit unit slice corresponding to each bit in the first scaling factor and the correction arithmetic slice, generating a target basic arithmetic slice based on the unit target bit factor corresponding to each bit in the second target bit slice and the target reduction arithmetic slice, and generating a target secret arithmetic slice based on the unit target bit factor corresponding to each bit in the second target bit slice and the target basic arithmetic slice; the target secret arithmetic slicing is used for providing a computing service for the first service data and the second service data for the federation model, and the computing service is used for determining an optimal splitting result or leaf node weight of the longitudinal federation model.
13. A data processing apparatus, comprising:
the system comprises a segmentation scaling module, a segmentation scaling module and a scaling module, wherein the segmentation scaling module is used for acquiring a first secret arithmetic segmentation corresponding to first service data, acquiring a second secret arithmetic segmentation corresponding to second service data, and scaling the first secret arithmetic segmentation to obtain a first scaling arithmetic segmentation corresponding to the first secret arithmetic segmentation and a first scaling factor; the first secret arithmetic slice is input by a first participant, and the second secret arithmetic slice is input by a second participant; the first business data and the second business data participate in training a federal model for the first participant and the second participant together; the first scaling factor has P bits, and P is a positive integer;
The reciprocal iteration module is used for generating reciprocal factor fragments corresponding to the first secret arithmetic fragments based on the first scaling factors and the first scaling arithmetic fragments;
the reciprocal reduction module is used for obtaining bit unit fragments on each bit in the first scaling factor, performing fragment selection operation on the P bit unit fragments and the reciprocal factor fragments based on the stretching factor to obtain P selected arithmetic fragments, and performing fragment addition operation on the P selected arithmetic fragments to obtain reduced reciprocal arithmetic fragments corresponding to the first secret arithmetic fragments;
the slicing processing module is used for carrying out slicing multiplication operation on the second secret arithmetic slicing and the restored reciprocal arithmetic slicing to obtain a target secret arithmetic slicing; the target secret arithmetic slice is to provide computing services for the federation model for the first business data and the second business data.
14. A computer device, comprising: a processor, a memory, and a network interface;
the processor is connected to the memory and the network interface, wherein the network interface is configured to provide a data communication function, the memory is configured to store a computer program, and the processor is configured to invoke the computer program to cause the computer device to perform the method of any of claims 1-12.
15. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program adapted to be loaded and executed by a processor to cause a computer device having the processor to perform the method of any of claims 1-12.
16. A computer program product, characterized in that the computer program product comprises a computer program stored in a computer readable storage medium and adapted to be read and executed by a processor to cause a computer device with the processor to perform the method of any of claims 1-12.
CN202410177139.7A 2024-02-08 2024-02-08 Data processing method, device, equipment and readable storage medium Active CN117724854B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410177139.7A CN117724854B (en) 2024-02-08 2024-02-08 Data processing method, device, equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410177139.7A CN117724854B (en) 2024-02-08 2024-02-08 Data processing method, device, equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN117724854A true CN117724854A (en) 2024-03-19
CN117724854B CN117724854B (en) 2024-05-24

Family

ID=90209215

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410177139.7A Active CN117724854B (en) 2024-02-08 2024-02-08 Data processing method, device, equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN117724854B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021197035A1 (en) * 2020-04-01 2021-10-07 支付宝(杭州)信息技术有限公司 Method and device for jointly training service prediction model by two parties for protecting data privacy
CN114816751A (en) * 2022-04-25 2022-07-29 中国工商银行股份有限公司 Data processing method and server
CN115114662A (en) * 2022-06-30 2022-09-27 蚂蚁区块链科技(上海)有限公司 Secure processing method and device for private data
CN115719094A (en) * 2023-01-06 2023-02-28 腾讯科技(深圳)有限公司 Model training method, device, equipment and storage medium based on federal learning
US20230084325A1 (en) * 2021-01-14 2023-03-16 Ennew Digital Technology Co., Ltd. Random greedy algorithm-based horizontal federated gradient boosted tree optimization method
CN116305206A (en) * 2023-03-06 2023-06-23 杭州博盾习言科技有限公司 Secure multiparty computing method, device, electronic equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021197035A1 (en) * 2020-04-01 2021-10-07 支付宝(杭州)信息技术有限公司 Method and device for jointly training service prediction model by two parties for protecting data privacy
US20230084325A1 (en) * 2021-01-14 2023-03-16 Ennew Digital Technology Co., Ltd. Random greedy algorithm-based horizontal federated gradient boosted tree optimization method
CN114816751A (en) * 2022-04-25 2022-07-29 中国工商银行股份有限公司 Data processing method and server
CN115114662A (en) * 2022-06-30 2022-09-27 蚂蚁区块链科技(上海)有限公司 Secure processing method and device for private data
CN115719094A (en) * 2023-01-06 2023-02-28 腾讯科技(深圳)有限公司 Model training method, device, equipment and storage medium based on federal learning
CN116305206A (en) * 2023-03-06 2023-06-23 杭州博盾习言科技有限公司 Secure multiparty computing method, device, electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
董业 等: "基于秘密分享和梯度选择的高效安全联邦学习", 《计算机研究与发展》, vol. 57, no. 10, 31 October 2020 (2020-10-31), pages 2241 - 2250 *

Also Published As

Publication number Publication date
CN117724854B (en) 2024-05-24

Similar Documents

Publication Publication Date Title
CN109002861B (en) Federal modeling method, device and storage medium
Al Badawi et al. Privft: Private and fast text classification with homomorphic encryption
US11176469B2 (en) Model training methods, apparatuses, and systems
CN112116155A (en) Population mobility prediction method and device based on intelligent decision and computer equipment
CN111931241B (en) Linear regression feature significance testing method and device based on privacy protection
CN111026788A (en) Homomorphic encryption-based multi-keyword ciphertext sorting and retrieving method in hybrid cloud
WO2018102861A1 (en) Secure text analytics
CN112418292A (en) Image quality evaluation method and device, computer equipment and storage medium
CN112734104B (en) Cross-domain recommendation method fusing generation countermeasure network and self-encoder
CN113542228A (en) Data transmission method and device based on federal learning and readable storage medium
CN113051239A (en) Data sharing method, use method of model applying data sharing method and related equipment
CN114448598A (en) Ciphertext compression method, ciphertext decompression method, device, equipment and storage medium
Nepomuceno et al. On the use of interval extensions to estimate the largest Lyapunov exponent from chaotic data
EP4016506B1 (en) Softmax function secret calculation system, softmax function secret calculation device, softmax function secret calculation method, neural network secret calculation system, neural network secret learning system, and program
CN114186263A (en) Data regression method based on longitudinal federal learning and electronic device
CN114925786A (en) Longitudinal federal linear support vector classification method based on secret sharing
CN111582284B (en) Privacy protection method and device for image recognition and electronic equipment
CN117724854B (en) Data processing method, device, equipment and readable storage medium
CN112182108A (en) Block chain based distributed data storage updating method and electronic equipment
EP3096308B1 (en) Element replication device, element replication method, and program
WO2023163652A2 (en) Privacy-preserving neural network model and privacy-preserving prediction using the privacy-preserving neural network model
US11961277B2 (en) Image information detection method and apparatus and storage medium
CN117725621B (en) Data processing method, device, equipment and readable storage medium
Toulias et al. Generalizations of entropy and information measures
CN114722902A (en) Unmarked video Hash retrieval method and device based on self-supervision learning

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant