A program running method and system

By performing data set fragmentation and using specific fragmentation algorithms, the problem of devices acquiring sensitive information during program execution was solved, thus achieving information security protection.

CN112836210BActive Publication Date: 2026-01-13ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110090831.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-22
Publication Date
2026-01-13
Estimated Expiration
2041-01-22

AI Technical Summary

Technical Problem

During program execution, the device acquires sensitive information from the data set, leading to information security leaks.

Method used

The original data set is fragmented to generate N fragmented data sets, which are then run on N devices. A specific fragmentation algorithm ensures that each device can only obtain values ​​from the fragmented data sets and cannot obtain the plaintext data from the original data set.

Benefits of technology

Given the program execution results of the original data set, each device can only obtain the fragment values ​​of the fragmented data set and cannot obtain sensitive information, thus protecting information security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112836210B_ABST
    Figure CN112836210B_ABST
Patent Text Reader

Abstract

The specification discloses a program running method and system. The method comprises: performing sharding processing on the value of each data in an original data set to obtain N sharding values of each data; the original data set comprises data for assigning values to variables in a program; determining N sharding data sets; the value of the same data in the N sharding data sets corresponds to the N sharding values of the same data one by one; under a specified condition, N running devices run a target program based on different sharding data sets respectively; wherein, through pre-configuration, for each basic operation unit corresponding to the target program, the operation result obtained by inputting an arbitrary group of values into the basic operation unit for operation is equal to the processing result obtained by performing inverse sharding processing on all operation results obtained by respectively inputting each group of sharding values of the arbitrary group of values into the basic operation unit for operation.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present specification relate to the field of computers, and particularly relate to a program running method and system. BACKGROUND

[0002] When a device runs a program, it often performs operations on a data set according to the operation logic in the program to obtain an operation result as the output of the program. The data set at least includes data used to assign values to program variables.

[0003] In some scenarios, due to the need for information security, it is not desirable for sensitive information carried by the data set to be leaked to the device running the program. For example, in a model training scenario, a device running a model training program needs to obtain a plurality of user samples and corresponding labels for operation, which means that the device can obtain user privacy information based on the plurality of user samples and corresponding labels.

[0004] Therefore, there is an urgent need for a program running method that ensures information security. SUMMARY

[0005] To ensure information security, the present specification provides a program running method and system. The technical solution is as follows.

[0006] A program running method, comprising:

[0007] performing sharding processing on the value of each data in an original data set to obtain N sharded values of each data; the original data set includes data used to assign values to variables in a program;

[0008] determining N sharded data sets; determining each sharded data set includes reassigning one sharded value of each data in the original data set; the value of the same data in the N sharded data sets corresponds to the N sharded values of the same data one by one;

[0009] under specified conditions, N running devices run a target program based on different sharded data sets respectively;

[0010] wherein, by pre-configuration, for each basic operation unit corresponding to the target program, the operation result obtained by inputting any one group of values into the basic operation unit for operation is equal to the processing result obtained by performing inverse sharding processing on all operation results obtained by respectively inputting each group of sharded values of the any one group of values into the basic operation unit for respective operation.

[0011] A program running system, which performs a sharding process on a value of each data in an original data set in advance to obtain N sharding values of each data; the original data set comprises data used for assigning values to variables in a program; determining N sharding data sets; determining each sharding data set comprises: reassigning one sharding value of each data in the original data set; values of the same data in the N sharding data sets correspond to the N sharding values of the same data one by one;

[0012] The system comprises N running devices, each of which is configured to run a target program based on a sharding data set under a specified condition;

[0013] The N running devices run the target program based on different sharding data sets respectively; through pre-configuration, for each basic operation unit corresponding to the target program, an operation result obtained by inputting an arbitrary group of values into the basic operation unit for operation is equal to a processing result obtained by performing inverse sharding processing on all operation results obtained by respectively inputting each group of sharding values of the arbitrary group of values into the basic operation unit for operation.

[0014] The above technical solution enables the N running devices to run the target program based on the sharding data sets to obtain a target program running result based on the original data set. Therefore, under the premise of being able to obtain the target program running result based on the original data set, each running device can only obtain the sharding values in the sharding data set and cannot obtain any plaintext data in the original data set, so as to prevent the sensitive information in the original data set from being obtained, thereby protecting information security. BRIEF DESCRIPTION OF DRAWINGS

[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present specification or the prior art, the drawings needed in the embodiments or prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments described in the present specification, and other drawings can also be obtained by those skilled in the art based on these drawings.

[0016] Figure 1 is a flowchart of a program running method provided by the embodiments of the present specification;

[0017] Figure 2 is a principle diagram of a sharding data set determination method provided by the embodiments of the present specification;

[0018] Figure 3 is a principle diagram of another sharding data set determination method provided by the embodiments of the present specification;

[0019] Figure 4is a structural schematic diagram of a virtual running device provided by an embodiment of the present specification.

[0020] Figure 5 is a flow schematic diagram of a model training program running method provided by an embodiment of the present specification.

[0021] Figure 6 is a structural schematic diagram of a program running system provided by an embodiment of the present specification. DETAILED DESCRIPTION

[0022] In order for those skilled in the art to better understand the technical solutions in the embodiments of the present specification, the technical solutions in the embodiments of the present specification will be described in detail below with reference to the drawings in the embodiments of the present specification. Obviously, the described embodiments are only part of the embodiments of the present specification, not all the embodiments. Based on the embodiments in the present specification, all other embodiments obtained by those skilled in the art should belong to the disclosed range.

[0023] When a device runs a program, it often operates a data set according to the operation logic in the program to obtain an operation result as the output of the program. The data set at least includes data used to assign values to program variables.

[0024] In some scenarios, due to the need for information security, sensitive information carried by the data set is not expected to be leaked to the device running the program.

[0025] For example, in the model training scenario, the device running the model training program needs to obtain multiple user samples and corresponding labels for operation. However, this means that the device can obtain user privacy information based on the obtained multiple user samples and corresponding labels.

[0026] Therefore, there is an urgent need for a program running method that ensures information security.

[0027] The present specification provides a program running method. Since a single device usually obtains all plaintext data in the data set operated by the program (for ease of description, the data set containing all plaintext data is referred to as the original data set) when running the program, the program running method provided by the present specification can perform sharding processing on the value of each plaintext data in the original data set to obtain multiple shard values; then multiple shard data sets containing all data (values are shard values) in the original data set can be obtained, and the obtained multiple shard data sets can be deployed on multiple devices respectively, so that these devices can run the same program based on the shard data sets.

[0028] When the program is actually run, the program in the program code is executed on the data set of the slice to make the results of the program run on the data set of the slice of the plurality of devices equal to the result of the program run on the original data set after inverse slicing.

[0029] For ease of understanding, a specific example is given below.

[0030] The original data set contains data X, and the value of data X is a. The slicing processing on data X can be to split the value a into N parts, specifically a1, a2, a3,..., aN. N . Wherein,

[0031] N data sets of slices are determined, and the N data sets of slices all contain data X. For the data set of slice i, the value of data X contained is a i , i = 1, 2, 3,..., N.

[0032] The program to be run is F(X), and F(X) is configured and modified based on a specific slicing operation algorithm to obtain F'(X) so that Wherein, each device can calculate F'(a i ) based on the local data slice value a i .

[0033] In the above method embodiment, because the plurality of devices based on the data set of the slice obtains a plurality of program run results, and after inverse slicing processing, the program run result based on the original data set can still be obtained, therefore, under the premise that the actual required program run result (i.e., the program run result based on the original data set) can be obtained, the slicing processing is performed on the value of each data in the original data set, and a plurality of slice values without actual meaning can be obtained, and no information (including sensitive information) is contained, thereby removing the sensitive information contained in the data, and the desensitization processing is realized. Each device cannot obtain any sensitive information according to the obtained data slice value.

[0034] That is, the data set (i.e., the data set of the slice) operated by each device in the plurality of devices running the program does not contain sensitive information, and the sensitive information carried by the original data set is not leaked to any device running the program in the program running process, and the safety of the sensitive information is protected.

[0035] The specific slicing operation algorithm in the above method embodiment is explained below.

[0036] In the execution of the program, any kind of operation can be included in the program, such as addition, subtraction, multiplication, division, derivation, square root, etc. Each operation needs to be performed on the device running the program, which can be performed by the computing unit of the device, such as the central processing unit CPU.

[0037] In order to better understand the above specific slicing operation algorithm, two points worth noting are introduced as follows.

[0038] Premise 1: Since the device has limited storage space for data allocation, the data on the device has precision.

[0039] It should be noted that the device has limitations on storage space, data size and precision when performing operations on data. For example, for integer data, it usually occupies 4 bytes in the storage space of the device, and the data size that can be represented is limited, with a precision of 1; for double-precision floating-point data, it usually occupies 8 bytes in the storage space of the device, and the precision that can be represented is limited.

[0040] Based on this point, when the device runs the program to operate on the data, if the operation result is limited by the data storage space and cannot be accurately represented, an approximate value will be taken as the operation result. A specific example is that when using double-precision floating-point data to represent 1 / 3, the device usually represents it as 0.333333, rather than as an infinite repeating decimal.

[0041] Premise 2: Any kind of operation included in the program will be decomposed into basic operation operations that can be performed by the computing unit.

[0042] The computing unit of the device can usually only perform part of the basic operation operations, such as addition, multiplication, and logical operations such as and or not. Any kind of operation included in the program needs to be performed by the computing unit, which specifically converts any kind of operation into one or more basic operation operations that can be implemented by the computing unit.

[0043] Since any kind of logical operation can be represented by exclusive or operation, and operation, and not operation, any kind of logical operation can be converted into a basic operation operation.

[0044] For arithmetic operations, it is obvious that they can be converted into basic operation operations. For example, the subtraction operation between two data can be converted into the addition operation between the data and the opposite number of the other data, and the division operation between two data can be converted into the multiplication operation between the dividend and the reciprocal of the divisor.

[0045] For more complex operations, some approximation methods can be used to convert them into one or more basic operation. For example, Newton iteration method, dichotomy method, Taylor expansion formula, etc. Due to the limitation of the precision of the data stored in the device itself, the precision of the approximation value can be improved to be higher than the precision of the operation result on the device, so as to reduce the precision of the operation result; or in the case of using the original data for forward operation, the difference between the inverse operation result of the approximation value and the original data cannot be represented by the device, so that the approximation value is used as the forward operation result.

[0046] Two specific examples of complex operations are given below.

[0047] The first example is to calculate the derivative value, which can be directly calculated according to the definition of the derivative value. The derivative value can be directly calculated as where Δx can take a very small value. Since the device itself has strong computing power and can quickly perform complex numerical calculations, the derivative value can be directly calculated, so that the complex operation of calculating the derivative value is converted into one subtraction operation and one division operation, i.e. one addition operation and one multiplication operation.

[0048] It should be noted that the derivative value obtained by this calculation method is an approximation value, but due to the limitation of the precision of the data on the device itself, the size of Δx can be controlled to make the precision of the derivative value obtained by this calculation method higher than the precision of the derivative value on the device.

[0049] For example, in the case where the precision of the derivative value data is 0.1, Δx can be continuously reduced and calculated multiple times to make the first decimal of the multiple operation results of remain unchanged, so that the derivative value with a precision of 0.1 can be obtained.

[0050] The second example is the square root operation, which can be calculated using the dichotomy method. In a specific calculation operation, the following calculation can be performed.

[0051] 1*1=1<2

[0052] 1.5*1.5=2.25>2

[0053] 1.25*1.25=1.5625<2

[0054] 1.375*1.375=1.890625<2

[0055] 1.4375*1.4375=2.06640625>2

[0056] 1.40625*1.40625=1.9775390625<2

[0057] 1.421875 * 1.421875 = 2.021728515625 > 2

[0058] 1.4140625 * 1.4140625 = 1.9995727539062...

[0059] When the difference between the product and 2 is less than the precision of the calculation result of 0.01, the device cannot represent the error value of 0.00042... for the calculation result. The result of squaring 1.4140625 can actually be represented as 2. Therefore, the calculation result can be determined to be 1.41.

[0060] Based on the analysis of the two premises above, any operation contained in the program, if it can be executed by the device, can usually be converted into one or more basic operations that the computing unit can execute.

[0061] If, based on a specific sharding algorithm, each basic operation of the computing unit satisfies the condition that "the inverse sharding result obtained after inverse sharding of multiple basic operation results based on sharded data sets is equal to the basic operation result based on the original data set," since any operation in the program is implemented by one or more basic operation operations, any operation in the program also satisfies the condition that "the inverse sharding result obtained after inverse sharding of multiple operation results based on sharded data sets is equal to the operation result based on the original data set."

[0062] Furthermore, the final result of the program is obtained through multiple operations in the program, and the result of the program also satisfies the condition that "the result of the inverse fragmentation process obtained after the program execution results of multiple devices based on fragmented data sets are equal to the result of the program execution based on the original data set".

[0063] Therefore, if "the inverse fragmentation result obtained after inverse fragmentation of multiple program execution results based on multiple fragmented data sets from multiple devices is equal to the program execution result based on the original data set", then each basic operation of the computing unit needs to satisfy "the inverse fragmentation result obtained after inverse fragmentation of multiple basic operation results based on fragmented data sets is equal to the basic operation result based on the original data set".

[0064] Before explaining the configuration of basic operations based on a specific sharding algorithm, it is necessary to first explain the specific operations of sharding. When performing sharding, it is necessary to distinguish between two cases: those involving arithmetic operations and those involving logical operations.

[0065] For the value of the same data (for the convenience of description, referred to as the initial value), in the case of needing to participate in an arithmetic operation, the split shard value needs to satisfy "the sum of each shard value is equal to the initial value"; and in the case of needing to participate in a logical operation, the split shard value needs to satisfy "the result of exclusive OR of each shard value is equal to the initial value".

[0066] For example, for data X with a value of a, in the case of needing to participate in an arithmetic operation, the split shard values a1, a2, a3,..., aN-1 obtained by splitting need to satisfy N And in the case of needing to participate in a logical operation, the split shard values a1, a2, a3,..., aN-1 obtained by splitting need to satisfy N+1 N+2 N+3 2N In the present specification represents an exclusive OR operation.

[0067] The above-mentioned shard processing can be specifically: splitting based on a random algorithm. For example, N-1 random numbers are obtained based on a random algorithm, as a1, a2, a3,..., aN-1. N-1 a1, a2, a3,..., aN-1 are calculated again N so as to satisfy the above-mentioned condition Or

[0068] In addition, the shard values satisfying different conditions can be converted to each other based on existing methods. Therefore, in the case of containing arithmetic operations and logical operations in the program, the shard values can be converted in real time according to the needs, and it is not necessary to perform two different shard processing respectively to obtain two different groups of shard values.

[0069] And the inverse shard processing corresponding to the two shard processing cases is also different, which is addition operation for arithmetic operation and exclusive OR operation for logical operation.

[0070] Since the shard processing is a kind of desensitization processing method, it can make the device unable to obtain the sensitive information contained in the data subjected to the shard processing under the premise of completing the calculation. Therefore, the shard processing can be performed on the data which needs to hide sensitive information and protect information security, such as the input of the program, the value of part of the constant, and the value of part of the variable.

[0071] But there are also some data in the program which do not need to protect information security, such as part of the constant, part of the weight, and part of the fixed value. They do not contain sensitive information, so they do not need to be subjected to shard processing.

[0072] Therefore, the data participating in the operation in the program includes the data subjected to shard processing and the data not subjected to shard processing.

[0073] ​​​​​For the convenience of understanding, the following is for the configuration of the basic operation operation, it is for two data, can be understood that, for the operation including more than two data, can be split into multiple groups of two data basic operation.

[0074] 1. Addition operation.

[0075] For the addition operation between two data of the slice processing, each device can directly add the slice values of the two data to obtain the addition operation result. The sum of the addition operation results based on the slice values of all devices is equal to the addition operation result based on the initial values.

[0076] For example, for data X with value a and data Y with value b, after slice processing, the value of data X on device i is a i , and the value of data Y is b i , where i = 1, 2, 3,..., N. The slice value satisfies and

[0077] For X+Y executed in the program, device i specifically executes a i +b i . And based on the following derivation, for all N devices, the sum of the N addition operation results is equal to a+b (i.e. the inverse slice processing result obtained after the N addition operation results based on the slice data set are processed by inverse slice processing (addition operation) is equal to the addition operation result based on the original data set).

[0078]

[0079] For the addition operation between one data without slice processing and one data with slice processing, one device can be selected from N devices to perform the addition operation, and the other N-1 devices do not perform; each device can also slice the data without slice processing in real time, for example, divide the value of the data by N, and then add the slice values of the two data to obtain the addition operation result.

[0080] Similarly, based on the following derivation, a is the initial value of the data without slice processing, and for all N devices, the sum of the N addition operation results is equal to a+b (i.e. the inverse slice processing result obtained after the N addition operation results based on the slice data set are processed by inverse slice processing (addition operation) is equal to the addition operation result based on the original data set).

[0081]

[0082] For the addition operation between two data without slice processing, since neither involves slice processing nor inverse slice processing, the addition operation can be normally executed.

[0083] 2. Multiplication operation.

[0084] For multiplication operation between two data after sharding processing, a group of random numbers can be agreed between N devices, and the sharded values of the two data are encrypted by random numbers based on the group of random numbers, so that the encrypted data sharded values can be interacted without leaking the original values and sensitive information of the data, and further specified operation is performed, so that the sum of the specified operation results of the sharded values based on N devices is equal to the multiplication operation result of the initial values of the two data. The sum of the specified operation results of the sharded values based on all devices is equal to the multiplication operation result based on the initial values.

[0085] In order to facilitate the explanation of the specified operation, a specific example is given below.

[0086] For example, for data X with value a and data Y with value b, after sharding processing, the value of data X on device i is a i , and the value of data Y is b i , where i = 1, 2, 3,..., N. The sharded values satisfy and

[0087] Step one: A group of random numbers including three random numbers α, β, δ, where αβ = δ, need to be agreed between N devices for multiplication operation between data X and data Y this time.

[0088] The three random numbers are also sharded to obtain where i = 1, 2, 3,..., N, and each sharded value is respectively deployed to N devices, so that device i has α i , β i , and δ i .

[0089] N devices interact (a i -α i ) and (b i -β i ) with each other, so that each device can calculate and to obtain (a-α) and (b-β). Since random numbers α and β are introduced, each device still cannot obtain the original values a and b and the sensitive information contained therein.

[0090] Step two: Each device i performs specified operation and can take the specified operation result as the multiplication operation result of data X and data Y on the device.

[0091] Based on the following derivation, the sum of the N multiplication results of the N devices is equal to ab (i.e., the specified operation result based on the fragmented data set (the multiplication result for the device) of the N devices after the inverse fragmentation processing (addition operation) is equal to the multiplication result based on the original data set).

[0092]

[0093] In addition, in step two, a device can also calculate (a-α)(b-β)+(b-β)α i +(a-α)β i +δ i as the multiplication result of the device, and the other N-1 devices can calculate (b-β)α i +(a-α)β i +δ i as the multiplication result. Obviously, in this case, the sum of the N multiplication results of the N devices is also equal to ab for all N devices.

[0094] For the multiplication operation between the unfragmented data value and the fragmented data, each device can directly determine the product of the unfragmented data value and the fragmented value as the multiplication result. Based on the following derivation, for example, A is the unfragmented data value, the sum of the N multiplication results of the N devices is equal to Ab for all N devices.

[0095]

[0096] Of course, the unfragmented data value can also be fragmented in real time, so that the multiplication result can be obtained based on the above steps one and two.

[0097] For the multiplication operation between two unfragmented data, since neither involves fragmentation processing nor inverse fragmentation processing, the multiplication operation can be normally performed.

[0098] 3, XOR operation.

[0099] For logical operation, the fragmented value obtained by fragmentation processing can specifically satisfy that the result of XORing each fragmented value with each other is equal to the initial value.

[0100] For the XOR operation between two fragmented data, each device can directly perform XOR operation on the fragmented values of the two data to obtain the XOR operation execution result. The result of XORing the XOR operation execution results of all devices with each other is equal to the XOR operation execution result based on the initial value.

[0101] For example, for data X with value a and data Y with value b, after the sharding processing, the value of data X on device i is a i , and the value of data Y is b i , where i = 1, 2, 3,..., N. The shard value satisfies and

[0102] Based on the following derivation, for all N devices, the results of N XOR operations are XORed with each other, which is equal to (that is, the results of N XOR operations based on the shard data set, after the inverse sharding processing (XOR operation), the inverse sharding processing result obtained is equal to the result of the XOR operation based on the original data set).

[0103]

[0104] For the XOR operation between the unsharded data and the sharded data, one device can perform the XOR operation between the value of the unsharded data and the local shard value, and the other N-1 devices do not perform the operation and directly take the shard value as the result of the XOR operation. The results of the XOR operations based on the shard values of all devices are XORed with each other, which is equal to the result of the XOR operation based on the initial value.

[0105] For example, for data X with value a, after the sharding processing, the value of data X on device i is a i , where i = 1, 2, 3,..., N. The shard value satisfies

[0106]

[0107] Based on the following derivation, A is the initial value of the unsharded data, and for all N devices, the results of N XOR operations are XORed with each other, which is equal to (that is, the results of N XOR operations based on the shard data set, after the inverse sharding processing (XOR operation), the inverse sharding processing result obtained is equal to the result of the XOR operation based on the original data set).

[0108]

[0109] Of course, A can also be sharded immediately, and the XOR operation is performed directly on the shard values of the two data to obtain the result of the XOR operation.

[0110] For the XOR operation between the two unsharded data, since neither involves sharding processing nor inverse sharding processing, the XOR operation can be normally performed.

[0111] 4, and operation.

[0112] For the and operation between two data processed by fragmentation, a set of random numbers can be agreed between N devices, and the fragmentation values of the two data are encrypted by random numbers based on the set of random numbers, so that the encrypted data fragmentation values can be interacted without leaking the original values and sensitive information of the data, and further specified operations are performed, so that the execution results of the specified operations of the N devices based on the fragmentation values after the mutual XOR operation (inverse fragmentation processing) are equal to the execution results of the and operation of the initial values of the two data.

[0113] In order to facilitate the explanation of the specified operation, a specific example is given below.

[0114] For example, for data X with value a and data Y with value b, after fragmentation processing, the value of data X on device i is a i , and the value of data Y is b i , where i = 1, 2, 3,..., N. The fragmentation values satisfy and

[0115] Step one: A set of random numbers need to be agreed between N devices for the and operation between data X and data Y this time, which contains three random numbers α, β, δ, and α ∧ β = δ.

[0116] The three random numbers are also processed by fragmentation to obtain and and each fragmentation value is deployed to N devices, so that device i has α i , β i , and δ i .

[0117] N devices interact with each other and so that each device can calculate and Since random numbers α and β are introduced, each device still cannot obtain the original values a and b and the sensitive information contained therein.

[0118] Step two: a device is specified to calculate as the execution result of the and operation, and the other N-1 devices can calculate as the execution result of the and operation.

[0119] Based on the following derivation, for all N devices, the results of the N XOR operations of the N specified operation execution results (for the devices, the AND operation execution results) of the N data sets based on the sharding satisfy a ^ b (i.e., after the inverse sharding processing (XOR operation), the inverse sharding processing results of the N specified operation execution results (for the devices, the AND operation execution results) of the N data sets based on the sharding are equal to the AND operation execution results of the original data set).

[0120]

[0121] For the AND operation between the unsharded data and the sharded data, each device can directly determine the AND operation execution result between the unsharded data value and the sharding value as the AND operation execution result, based on the following derivation, for example, A is the unsharded data value, for all N devices, the results of the N XOR operations of the N specified operation execution results (for the devices, the AND operation execution results) of the N data sets based on the sharding satisfy A ^ b (i.e., after the inverse sharding processing (XOR operation), the inverse sharding processing results of the N specified operation execution results (for the devices, the AND operation execution results) of the N data sets based on the sharding are equal to the AND operation execution results of the original data set).

[0122]

[0123] Of course, the unsharded data value can also be sharded in real time, so that the AND operation execution result can be obtained based on the above steps one and two.

[0124] For the AND operation between the unsharded data and the sharded data, since neither involves sharding processing, nor inverse sharding processing, the AND operation can be normally executed.

[0125] 5, Non-operation.

[0126] The non-operation can be regarded as an operation on a single data, therefore, for the non-operation on the sharded data, N devices can specify one device, the specified device can execute the non-operation on the sharding value to obtain the non-operation execution result, and the other N-1 devices can directly take the sharding value as the non-operation execution result.

[0127] For example, for data X with a value of a, after sharding processing, the value of data X on device i is a i , where i = 1, 2, 3,..., N. The sharding value satisfies

[0128] Based on the following derivation, for all N devices, the results of the N XOR operations of the N specified operation execution results (for the devices, the AND operation execution results) of the N data sets based on the sharding satisfy a ^ b (i.e., after the inverse sharding processing (XOR operation), the inverse sharding processing results of the N specified operation execution results (for the devices, the AND operation execution results) of the N data sets based on the sharding are equal to the AND operation execution results of the original data set). (i.e., the specified operation execution result of N data sets based on the slice (non-operation execution result for the device) after the inverse slice processing (XOR operation), the inverse slice processing result is equal to the non-operation execution result based on the original data set).

[0129]

[0130] For the non-operation of one data without slice processing, since it does not involve slice processing, it will not be inverse slice processed, and the non-operation can be normally executed.

[0131] 6, or operation.

[0132] For the or operation between two data with slice processing, N devices can agree on a set of random numbers, encrypt the slice values of the two data based on the set of random numbers, so as to interact with the encrypted data slice values without leaking the original value and sensitive information of the data, and further perform the specified operation, so that the specified operation execution result of N devices based on the slice value after the mutual XOR operation (inverse slice processing) is equal to the or operation execution result of the initial value of the two data.

[0133] In order to facilitate the explanation of the specified operation, a specific example is given below.

[0134] For example, for data X with value a and data Y with value b, after slice processing, the value of data X on device i is a i , and the value of data Y is b i , where i = 1, 2, 3,..., N. The slice value satisfies and

[0135] Step 1: N devices need to agree on a set of random numbers for the or operation between data X and data Y this time, which contains 3 random numbers α, β, δ, where α ∧ β = δ.

[0136] The 3 random numbers are also slice processed to obtain and and deploy each slice value to N devices, so that device i has α i , β i , δ i .

[0137] N devices interact with each other and so that each device can calculate and Due to the introduction of random numbers a, b, each device still cannot obtain the original values a and b, and the sensitive information contained therein.

[0138] Step two: one device calculates as the result of the or operation, and the other N-1 devices can calculate as the result of the or operation.

[0139] Based on the following derivation, for all N devices, the results of the N or operations after the mutual XOR operation are equal to a V b (i.e., the inverse slicing processing result obtained after the N specified operation execution results based on the sliced data set (for the device, the or operation execution result) are subjected to the inverse slicing processing (XOR operation) is equal to the or operation execution result based on the original data set).

[0140]

[0141] For the or operation between the un-sliced data and the sliced data, each device can perform the specified operation so that the results of the N device specified operation execution results based on the slicing values after the mutual XOR operation (inverse slicing processing) are equal to the or operation execution result of the initial values of the two data.

[0142] For example, for data X with value a, after slicing processing, the value of data X on device i is a i where i = 1, 2, 3,..., N. The slicing value satisfies The un-sliced data has a value of A.

[0143] One device can be designated to perform and the other N-1 devices can perform

[0144] Based on the following derivation, for all N devices, the results of the N or operations after the mutual XOR operation are equal to a V b (i.e., the inverse slicing processing result obtained after the N specified operation execution results based on the sliced data set (for the device, the or operation execution result) are subjected to the inverse slicing processing (XOR operation) is equal to the or operation execution result based on the original data set).

[0145]

[0146] Of course, the un-sliced data value can also be sliced in real time, so that the or operation execution result can be obtained based on the above steps one and two.

[0147] For OR operations between two un-sharded data, since neither involves sharding and no reverse sharding is performed, the OR operation can be executed normally.

[0148] Through the above explanation of specific fragmentation operation algorithms, it is possible to achieve the following for operations including addition, multiplication, AND, OR, NOT, and XOR: "After multiple basic operation results based on fragmented data sets are processed by inverse fragmentation, the resulting inverse fragmentation is equal to the basic operation results based on the original data set." This enables the following: "After multiple program execution results based on fragmented data sets from multiple devices are processed by inverse fragmentation, the resulting inverse fragmentation is equal to the program execution results based on the original data set."

[0149] The following section, with reference to the accompanying drawings, provides a detailed explanation of one method for running a program as described in this specification.

[0150] like Figure 1 The diagram shown is a flowchart illustrating a program execution method provided in this specification. This method may include at least the following steps S101-S103.

[0151] S101: Perform sharding on the value of each data in the original dataset to obtain N shard values ​​for each data.

[0152] The original data set can include data that requires protection of sensitive information, such as data used to assign values ​​to variables in the program, data used to assign values ​​to constants in the program, and program input data. Data fragmentation can hide sensitive information contained within the data values.

[0153] N is the preset number of devices participating in the program execution. N≥2. For ease of description, the devices to be included in the program execution are referred to as running devices.

[0154] S102: Determine N fragmented data sets; determine each fragmented data set, including: for each data in the original data set, reassign a value using one of the fragmented values ​​of that data; the value of the same data in the N fragmented data sets corresponds one-to-one with the N fragmented values ​​of the same data.

[0155] The above explanation is based on S101 and S102.

[0156] There are at least two implementations for storing the original data set, and correspondingly, the specific methods for determining the N fragmented data sets are also different.

[0157] Example 1: The original data set can be stored on a target device in addition to the N running devices.

[0158] The target device can be any storage device other than the N running devices, and can store all data in the original data set. The target device can perform slicing on each data in the original data set to obtain N slice values, thereby creating N slice data sets, each of which can contain all data in the original data set, and reassigning the N slice values to the data in the N slice data sets, respectively, so that the values of the same data in the N slice data sets correspond one-to-one to the N slice values of the same data.

[0159] The target device can send the N slice data sets created to the N running devices, so that the N running devices correspond one-to-one to the N slice data sets.

[0160] For ease of understanding, in an optional embodiment, as shown in FIG. 1, a schematic diagram of the principle of a slice data set determination method provided by the present specification is provided, which includes a target device, device 1 and device 2, wherein the target device stores an original data set {X=a, Y=b}. Figure 2

[0161] For the original data set {X=a, Y=b}, the devices participating in the program running include device 1 and device 2. The target device performs slicing on each data in the original data set to obtain a1, a2, b1 and b2, and creates two slice data sets, and reassigns the slice values to the slice data sets to obtain slice data sets {X=a1, Y=b1} and {X=a2, Y=b2}.

[0162] The target device sends the slice data set {X=a1, Y=b1} to device 1, and sends the slice data set {X=a2, Y=b2} to device 2.

[0163] Embodiment two: The original data set can be distributed and stored on the N running devices.

[0164] That is, each of the N running devices can store part of the data in the original data set.

[0165] And obtaining N slice values of each data and determining N slice data sets can be that the N running devices perform slicing on the data values stored locally (data values stored by the running devices and belonging to the original data set) and interact with each other the slicing results, so that each running device can obtain a slice value of each data in the original data set, that is, a slice data set.

[0166] For ease of understanding, in an optional embodiment, as shown in FIG. 1, a schematic diagram of the principle of a slice data set determination method provided by the present specification is provided, which includes a target device, device 1 and device 2, wherein the target device stores an original data set {X=a, Y=b}. Figure 3 ​As shown, the principle diagram of another method for determining a piece of data provided by the specification, including device 1 and device 2.

[0167] For the original data set {X=a, Y=b}, the devices participating in the program run include device 1 and device 2. Device 1 stores data X with value a, and device 2 stores data Y with value b. Device 1 performs piece processing on the locally stored data X to obtain piece values a1 and a2, and sends a2 to device 2; device 2 performs piece processing on the locally stored data Y to obtain piece values b1 and b2, and sends b1 to device 1.

[0168] Device 1 reassigns data X with a1 to create data Y, and reassigns data Y with b1 to obtain a piece of data set {X=a1, Y=b1}; device 2 can obtain a piece of data set {X=a2, Y=b2} in the same way.

[0169] For the above case two, the specification also provides a specific embodiment, which specifically limits the interaction between the running devices and the form of the piece of data.

[0170] The N running devices can create a symbol table in advance. The symbol table can at least be used to store variables predefined by the running devices. The symbol table can specifically include variable names, variable data types, and variable value storage addresses.

[0171] Each of the N running devices stores part of the data in the original data set. The running device can create a corresponding variable in the symbol table according to the local data.

[0172] In the case where any running device creates a variable in the symbol table according to any local data, the running device can generate the corresponding variable name, variable data type, and variable value storage address. At the same time, the data can be processed, one of the piece values is assigned to the variable in the symbol table, and the variable name, variable data type, and other N-1 piece values of this variable are sent to the other N-1 running devices, so that each of the other N-1 running devices can obtain the variable name, variable data type, and 1 piece value, so that the other N-1 running devices can create a variable with the same variable name and variable data type in the local symbol table, and assign a value obtained from 1 piece value.

[0173] In the case where N running devices create variables in the symbol table according to the local data values (data values stored by the running devices and belonging to the original data set) and perform piece processing, they interact with each other so that the symbol table of each running device contains a variable corresponding to each data in the original data set and a piece value of each data.

[0174] For the convenience of understanding, in an optional embodiment, for the original data set {X=a, Y=b}, the devices participating in the program running include device 1 and device 2. The device 1 stores the data X with the value a, and the device 2 stores the data Y with the value b.

[0175] The device 1 can create a variable X in the local symbol table according to the locally stored data X, the variable name of which is X, the variable data type of which is integer data, and the variable value storage address of which can be specified by the device. The device 1 can perform slicing processing on a to obtain slice values a1 and a2, and assign a1 to the variable X in the symbol table, which can be specifically writing a1 back to the variable value storage address corresponding to the variable X.

[0176] Meanwhile, the device 1 can send the variable name X, the variable data type of which is integer data, and the slice value a2 to the device 2. The device 2 can create a variable X with the same variable name and the same variable data type in the local symbol table according to the received information, and assign a2 to the variable X.

[0177] Similarly, the device 2 creates a variable Y in the local symbol table and assigns b2 to the variable Y; the device 1 creates a variable Y with the same variable name and the same variable data type in the local symbol table according to the information sent by the device 2, and assigns b1 to the variable Y.

[0178] Therefore, the local symbol table of the device 1 can contain a sliced data set {X=a1, Y=b1}, and the local symbol table of the device 2 can contain a sliced data set {X=a2, Y=b2}.

[0179] It should be noted that two variables with the same name cannot exist in the same symbol table. Therefore, before actual interaction, the N running devices need to perform variable name conflict checking to ensure that there are no two variables with the same name in the symbol table of any running device after interaction.

[0180] In an optional embodiment, before the N running devices interact with each other on the newly created variables in the respective symbol tables, it can be determined whether there are variables with the same name between different running devices. If there are, the names can be replaced; if not, the interaction can continue.

[0181] In addition, the symbol table can also be used to store the constants predefined by the running devices, and the constants are also subjected to the above slicing processing and interaction with each other, so as to synchronize the constants in the symbol table of the N running devices.

[0182] S103: In a specified condition, the N running devices respectively run the target program based on different sets of sharded data. Through pre-configuration, for each basic operation unit corresponding to the target program, the operation result obtained by inputting an arbitrary set of values into the basic operation unit for operation is equal to: the processing result obtained by respectively inputting each set of sharded values of the arbitrary set of values into the basic operation unit for respective operation and then performing inverse sharding processing on all obtained operation results.

[0183] After S102, the N running devices respectively deploy a set of sharded data, and the program can be run according to the locally deployed set of sharded data.

[0184] S103 is explained from four angles as follows.

[0185] 1. Specified condition.

[0186] The specified condition can be a condition in which the premise that the N running devices specified in the method flow can run the target program is met.

[0187] In an optional embodiment, the specified condition can be that the N running devices complete the deployment of the set of sharded data and the target program. For example, it is determined that each running device deploys a set of sharded data and a target program, and then the target program can be run based on the set of sharded data.

[0188] In another optional embodiment, the running of the target program requires one or more data in the original data set, and the specified condition can be that each set of sharded data deployed by each running device contains all data in the original data set, so as to ensure that any running device can normally run the target program, and there is no situation that a running device cannot run the target program due to the lack of any data in the original data set. Based on the embodiment of the above symbol table, the specified condition can specifically be that the symbol table of each running device contains a variable created according to all data in the original data set.

[0189] In a specific embodiment, before the target program is run, it is necessary to determine that the consistency between the variable attribute sets predefined by the N running devices is met, so that the same variable has a definition between the N running devices and can store sharded values. If there is no sharded value of a variable on any running device, the target program can not be successfully run on the running device.

[0190] Therefore, in order to ensure that the N running devices can successfully run the target program, there are all the variable slice values on each running device, and the specified condition can be that the N running devices respectively predefine variable attribute sets that meet consistency. One variable attribute can include a variable symbol and a variable data type. Specifically, the N running devices can receive N variable attribute sets respectively predefined by the specified device, and determine that the N variable attribute sets contain the same variable attributes; or any running device can receive N variable attribute sets respectively predefined by other N-1 running devices, and determine that the N variable attribute sets contain the same variable attributes; or each running device can receive N variable attribute sets respectively predefined by other N-1 running devices, and determine that the N variable attribute sets contain the same variable attributes.

[0191] In addition, the variable attribute set predefined by the running device can be obtained according to a predefined symbol table. The symbol table predefined by the running device can at least include a variable symbol corresponding to a variable predefined by the running device, a variable data type, and a variable value storage address; and the variable attribute set can include the variable symbol and the variable data type in the symbol table.

[0192] 2. The target program.

[0193] In the method flow, the relationship between the target program and the original data set can exist at least the following two embodiments.

[0194] Embodiment one: the target program can be written based on the data in the original data set.

[0195] In order to facilitate understanding, a specific example can be given.

[0196] For example, the original data set is {X=1, Y=2, Z=3}. When writing the target program, one or more data in the original data set can be used to write the target program, specifically, X, Y or Z can be used to write the target program, so that the target program can be successfully run according to the used data value (initial value or slice value) to obtain the program running result. In a specific example, X and Y can be used to write the target program, specifically, (X+Y 2 ) can be calculated, so that the target program can be successfully run with the values of X and Y to obtain the program running result (1+2 2 ) = 5.

[0197] Therefore, any running device can run the target program based on the data slice value in the slice data set (containing all the data in the original data set).

[0198] Embodiment two: the original data set can be created according to the data required by the target program running.

[0199] For the convenience of understanding, a specific example can be given.

[0200] For example, for a target program written to calculate (X+Y 2 ), which involves variables X and Y, only the values of X and Y are needed to run the target program. Therefore, a raw data set containing X and Y can be constructed, and X and Y in the raw data set can be assigned values according to actual needs.

[0201] And for a shard data set containing all the data in the raw data set, the variables X and Y in the target program can also be assigned values and the target program can be run.

[0202] Therefore, in the method flow, it is not limited how the target program is written, as long as the target program can be successfully run based on the data values in the raw data set, that is, the target program can be successfully run based on the shard values in the shard data set.

[0203] It is worth emphasizing that N running devices can run the same target program to obtain program running results based on different shard data sets.

[0204] 3. Pre-configuration.

[0205] For the convenience of understanding, the basic operation operation can be regarded as a basic operation unit, which has input and output. Based on the above-mentioned specific shard operation algorithm, the basic operation unit is configured, and specifically, the configured basic operation unit can perform the basic operation operation corresponding to the above-mentioned specific shard operation algorithm.

[0206] For example, for multiplication operation, it can be regarded as a multiplication operation unit. Based on the above-mentioned specific shard operation algorithm, any group of values is input to the multiplication operation unit before the specific shard operation algorithm is configured, and the output operation result is obtained, which is equal to: each group of shard values of the arbitrary group of values is input to the multiplication operation unit after the specific shard operation algorithm is configured, and the output operation result is obtained after the inverse shard processing of all the operation results is performed.

[0207] Among them, in the configured multiplication operation unit, for the two input shard processed data, steps one and two corresponding to the multiplication operation in the above-mentioned specific shard operation algorithm can be specifically performed. And for other cases, for example, inputting two unshard processed data, or inputting one shard processed data and one unshard processed data, the multiplication operation can be specifically performed directly.

[0208] And for the specific configuration method, at least the following two embodiments can exist.

[0209] Embodiment One: configuring the operation logic corresponding to the basic operation in the instruction set of the running device.

[0210] In the running device, the function of different basic operations is realized by calling the operation instruction in the system instruction set. Among them, the system instruction set is the instruction set of the operating system of the running device. For example, for multiplication operation, the multiplication operation instruction in the system instruction set can be called, and then the operation logic corresponding to the multiplication operation instruction is executed by the calculation unit of the running device to complete the multiplication operation.

[0211] Therefore, the pre-configuration can be specifically determining the operation instruction corresponding to each basic operation unit in the system instruction set, and configuring the operation logic corresponding to the determined operation instruction in the operating system based on the specific slicing operation algorithm.

[0212] In the process of specifically running the target program, for any basic operation unit corresponding to the target program, the operation instruction corresponding to the basic operation unit can be determined in the compiled process based on the configured instruction set of the running device, and the operation logic corresponding to the basic operation unit in the specific slicing operation algorithm is obtained.

[0213] For example, for the multiplication operation unit corresponding to the target program, when the input is two data processed by slicing, the step one and step two corresponding to the multiplication operation in the specific slicing operation algorithm can be obtained based on the compiled configuration of the instruction set, so as to obtain the output by executing step one and step two using the input.

[0214] Embodiment Two: configuring the operation logic corresponding to the basic operation in the calculation unit of the running device.

[0215] In the running device, for each basic operation unit corresponding to the target program, the operation logic of the basic operation is called by the calculation unit to perform the operation. For example, for a plurality of multiplication operation units corresponding to the target program, the multiplier of the CPU of the running device is called to perform the operation.

[0216] Therefore, the pre-configuration can be specifically configuring the operation logic corresponding to each basic operation in the calculation unit of the running device based on the specific slicing operation algorithm. For example, for the configured calculation unit, the multiplication operation logic in it is configured to specifically execute step one and step two corresponding to the multiplication operation in the specific slicing operation algorithm for the input of two data processed by slicing; for the input of two data not processed by slicing, or the input of one data processed by slicing and one data not processed by slicing, the multiplication operation can be directly executed.

[0217] In addition, based on the specific slicing operation algorithm described above, the data not subjected to slicing processing and the data subjected to slicing processing are distinguished, and the same basic operation can correspond to different operation logics for different cases. Therefore, in the target program, the data not subjected to slicing processing and the data subjected to slicing processing can be distinguished by specifying an identifier.

[0218] For example, a data type is newly set as a slicing type, and for the variable subjected to slicing processing, the variable data type can be specified as the slicing type. The slicing type does not distinguish the specific data type as an integer type, a floating point type or other types.

[0219] After the target program is deployed to the running device, for the variable of the slicing type, the variable in the symbol table with the same variable name as the variable of the slicing type can be determined according to the symbol table predefined on the running device, and the variable of the slicing type is re-determined as the variable determined in the symbol table.

[0220] In order to facilitate understanding, a specific example is provided below.

[0221] In the target program, the slicing type can be represented by ashr. A variable X of the slicing type can be created in the target program.

[0222] After the target program is deployed to the running device, the variable with the variable name X (the variable data type can be an integer type, and the value can be a slicing value) is determined in the symbol table, and then the variable X of the slicing type can be determined as the variable X determined in the symbol table, and the value is the slicing value.

[0223] The variable not subjected to slicing processing is not of the ashr type, and it is not necessary to determine the variable according to the symbol table, and the value is also the initial value, so that the variable not subjected to slicing processing and the variable subjected to slicing processing can be distinguished.

[0224] 4. Program running result.

[0225] After N running devices respectively run the target program based on the slicing data set to obtain the respective program running results, it can be considered that the target program has been run. However, it should be noted that when the program running result of the target program based on the original data set is required, the program running results of the N running devices are required, and then inverse slicing processing is performed.

[0226] Since the N running devices run the same target program, although based on different sliced data sets, for each operation in the target program, the operation results based on the sliced data sets on the N running devices after inverse slicing processing are equal to the operation result based on the original data set on a single running device, thus the N running devices as a whole can be regarded as a virtual running device, and the target program can be run based on the original data set.

[0227] For the convenience of understanding, as shown in Figure 4 Fig. 1 is a structural schematic diagram of a virtual running device provided by the present specification. It includes three running devices, namely running device 1, running device 2 and running device 3.

[0228] The original data set is sliced to obtain sliced data set 1, sliced data set 2 and sliced data set 3. Running device 1 runs the target program based on sliced data set 1 to obtain program running result 1, running device 2 runs the target program based on sliced data set 2 to obtain program running result 2, and running device 3 runs the target program based on sliced data set 3 to obtain program running result 3. After inverse slicing processing of program running result 1, program running result 2 and program running result 3, the program running result of the virtual running device running the target program based on the original data set can be obtained.

[0229] Therefore, running device 1, running device 2 and running device 3 running the same program can be regarded as a virtual running device.

[0230] As to the actual running device, each running device cannot obtain the plaintext data in the original data set required for running the target program, thus no sensitive information is leaked.

[0231] It can be understood that in order to protect the security of sensitive information and make the device unable to obtain the plaintext data, the above method processes the slicing of the original data set, and N running devices run the same target program based on different sliced data sets, so that under the premise of meeting the normal running of the target program and obtaining the correct target program running result, each actual running device of the target program cannot obtain any plaintext data in the original data set, but only obtains the sliced value. The sliced value itself does not have actual meaning and does not contain any information (for example, sensitive information), and the intermediate running result of the target program based on the sliced value also does not have any actual meaning and does not contain any information.

[0232] Since some basic operations in the above-mentioned specific sharding algorithm require N running devices to exchange random number encryption sharding values ​​in their corresponding operation logic, this specification also provides an optional embodiment based on the above method flow.

[0233] When N running devices need to exchange fragment values ​​for any variable in the target program, the fragment values ​​of that variable stored locally can be encrypted with random numbers.

[0234] Therefore, based on the above method and process, during the execution of the target program on N running devices, for each variable in the target program, when the fragment value of the variable is first encrypted with a random number, a random number can be requested from the random number provider and assigned to the variable; when the fragment value of the variable is encrypted with a random number again, the random number assigned to the variable can be reused; when the transformation result obtained by mathematical transformation of the fragment value of the variable is encrypted with a random number, the random number assigned to the variable can also be reused.

[0235] When encrypting the transformed result of the piecewise values ​​of a variable by performing mathematical transformations using random numbers, one approach is to reuse the random number assigned to the variable, perform the same mathematical transformation on that random number, and then use the transformed random number to encrypt the transformed result of the piecewise values. Alternatively, one can directly reuse the random number assigned to the variable to encrypt the transformed result of the piecewise values. Specific mathematical transformations can include transpose, matrix cutting, multiplication with coefficients, etc.

[0236] The random number provider can be a trusted third party that provides random numbers. Based on the specific sharding algorithm described above, the random number provider can generate a set of random numbers, including three random numbers that meet specific conditions, and shard the three random numbers separately. The N shard values ​​of each random number are then sent one by one to N running devices for encrypting the same variable on the N running devices.

[0237] After requesting a random number from a random number provider and assigning it to the variable, if the fragmented value of the variable needs to be encrypted with random numbers at least once more in the target program, the random number assigned to the variable can be stored locally. Reusing the random number assigned to the variable can specifically involve reusing the locally stored random number assigned to the variable.

[0238] Obviously, in this embodiment, by reusing random numbers for encryption in different calculation processes for the same variable or the result of mathematical transformation of the same variable, the data transmission between the running device and the random number provider can be reduced, thereby improving the calculation speed of the running device.

[0239] It should be noted that, in one optional embodiment, since the random number provider typically generates a set of random numbers for two pieces of data, when reusing data, if there are reusable random numbers for both pieces of data, at least the random number corresponding to one piece of data can be reused. This avoids using two completely identical sets of random numbers (each set containing 3 random numbers) in different operations, and further avoids the risk of cracking the random number encryption.

[0240] To make it easier to understand, an example is provided below.

[0241] For the first multiplication operation between data X and data Y, a random number provider can generate a set of random numbers (a, b, c) for (X, Y) such that a + b = c. After sharding a, b, and c, each running device uses the shard values ​​to encrypt random numbers.

[0242] For the second multiplication operation between data X and data Y, since the random numbers need to meet specific conditions, if a and b are reused, c must also be reused. To avoid reusing the entire set of random numbers (a, b, c), which could lead to the risk of cracking the random number encryption, only a or b can be reused, and the other random numbers can be regenerated to obtain, for example, (a, d, e) satisfying a + d = e; or (f, b, g) satisfying f + b = g, for random number encryption.

[0243] For the first multiplication operation between data X and data Z, a new set of random numbers can be requested; alternatively, the 'a' in the above random numbers can be reused to generate other random numbers, resulting in (a, x, y) that satisfies a + x = y for random number encryption.

[0244] For the first multiplication operation between data Y and data Z, a new set of random numbers can be requested; b or x from the above random numbers can be reused; or b and x from the above random numbers can be reused to obtain z = b + x. Since z has not been used in previous operations, the use of two completely identical sets of random numbers in different operations is avoided.

[0245] In addition, based on the above method and process, this specification also provides another optional embodiment, in which each running device can share the execution of the target program based on at least two threads, thereby improving the program execution efficiency of the running device.

[0246] Each running device has at least two threads, which can be multiple threads obtained by splitting threads. The overhead of splitting threads is small and can be ignored.

[0247] Distributing the execution of a target program can specifically involve distributing different tasks within that program, such as interactive tasks, computational tasks, and so on.

[0248] For ease of understanding, based on the specific sharding operation algorithm described above, when N running devices are running the target program, they may need to exchange shard values, which can be regarded as an interactive task; they may also need to perform operations based on shard values, which can be regarded as a computational task.

[0249] For interactive tasks, if N running devices need to interact with the fragment value of any variable in the target program, the fragment value of the variable stored locally is encrypted with a random number. Then the target program can contain at least two interactive tasks for interacting with the encrypted fragment value. At least two threads of each running device can share the different interactive tasks of the target program.

[0250] In this context, the thread identifier for each of the at least two threads on each running device can be specified by the target program. Since the target program is the same across N running devices, the thread identifiers for sharing the same interactive tasks are also the same across different running devices.

[0251] To make it easier to understand, an example is given below.

[0252] The target program involves an interactive task of exchanging encrypted fragmented values ​​for multiplication operations between data X and data Y. Based on the target program, a running device creates a thread to handle this interactive task, and designates the thread identifier as root1. Therefore, on each of the N running devices, there exists a thread identified as root1, and all of them handle this interactive task.

[0253] Similarly, for the multiplication operation between data Y and data Z, N running devices also create a thread root2 based on the target program to share this interaction task.

[0254] In other words, threads with the same identifier specified by the target program on different running devices share the same interactive tasks in the target program.

[0255] Furthermore, for different interactive tasks, N running devices can use the same channel to interact, which means it is necessary to differentiate between interactive tasks.

[0256] Therefore, in specific interactions, N running devices can exchange specific data; the specified data may include the variable fragment value to be exchanged (i.e., the fragment value encrypted with a random number) and the thread identifier that sent the variable fragment value, so as to determine that the thread with the same identifier in other running devices receives the variable fragment value.

[0257] The thread identifier carried in the specified data is used to distinguish threads in other devices that share the same interactive task.

[0258] For example, among N running devices, specified data containing the identifier "root1" and specified data containing the identifier "root2" can be exchanged. After receiving the specified data, a running device can determine the corresponding thread (i.e., threads with the same identifier) ​​to receive and process the specified data based on the thread identifier contained in the specified data. Specifically, after a running device receives specified data containing the identifier "root2", the thread on the running device identified as "root2" can receive and process the specified data.

[0259] Since threads with the same identifier specified by the target program share the same interaction tasks in the target program, different running devices do not need to exchange the thread identifiers that need to communicate before sending specified data. Instead, they can directly use their own thread identifiers as the receiving thread identifiers in other running devices, thereby reducing network overhead.

[0260] Furthermore, since N running devices use the same channel, and the same thread may share multiple interactive tasks, in order to further distinguish different interactive tasks in the same thread, the specified data can also carry an additional sequence identifier.

[0261] For example, in addition to carrying the thread identifier root1, the specified data can also carry the sequence identifier 3, indicating the third interactive task on thread root1. After receiving the specified data, other running devices can determine the thread sharing the same interactive task based on the thread identifier, and further determine the third interactive task on that thread. Thus, the variable fragment values ​​in the specified data can be used for the third interactive task to complete the calculation.

[0262] In this embodiment, without prior interaction between the two thread identifiers that need to communicate between different running devices, the threads that share the same interactive tasks between different running devices (i.e., the threads that need to communicate in other running devices) can be directly determined, reducing network communication overhead and improving the program running speed of the running devices.

[0263] To facilitate further understanding, an application example is provided below.

[0264] In a more specific model training scenario, there is a need for multiple data holders to jointly train a model to improve training effectiveness. This requires multiple data holders to combine their respective sample data to jointly train the model. Specifically, different data holders may store sample data from different users, or different data holders may store different sample feature data of the same user. To protect information security, each data holder does not want its stored user sample data (carrying sensitive information) to leave the domain, nor does it want the device running the model training program to obtain the plaintext user sample data.

[0265] Based on the above method and process, this embodiment can be implemented through the following steps. For example... Figure 5 The diagram shown is a flowchart illustrating a model training program execution method provided in this specification.

[0266] For ease of description, the number of data holders participating in model training is defined as N, and the target program to be run is called the model training program. Each data holder provides a running device that stores the user sample set of the data holder, resulting in a total of N running devices running the model training program. The original data set required for the successful execution of the model training program can include all user samples from the N data holders.

[0267] S201: N running devices perform sharding processing on the user samples stored locally, and exchange sharding processing results with each other, so that each running device can obtain the sharding value of each feature of each user sample in the original data set, i.e., the sharded data set.

[0268] To make it easier to understand, examples for two different scenarios are provided below.

[0269] Example 1: Different data holders store sample data for different users. For example, device 1 stores sample data for user 1, including feature X = a; device 2 stores sample data for user 2, including feature X = b.

[0270] The two operating devices then perform fragmentation processing on each feature of each sample data. Operating device 1 obtains a1 and a2, and operating device 2 obtains b1 and b2. Through mutual interaction, operating device 1 has a fragmented data set {X = a1 (user 1), X = b1 (user 2)}, and operating device 2 has a fragmented data set {X = a2, X = b2}.

[0271] Example 2: Different data holders store different sample feature data of the same user. For example, device 1 stores sample data of user 1, including feature X = a; device 2 stores sample data of user 1, including feature Y = b.

[0272] The two operating devices then perform fragmentation processing on each feature of each sample data. Operating device 1 obtains a1 and a2, and operating device 2 obtains b1 and b2. Through mutual interaction, operating device 1 has a fragmented data set {X = a1, Y = b1}, and operating device 2 has a fragmented data set {X = a2, Y = b2}.

[0273] Clearly, for both horizontal and vertical federated learning scenarios, sharding can be used to enable each running device to obtain the shard value of each feature of each user sample in the original dataset.

[0274] S202: Each running device runs the model training program based on the fragmented data set. Based on pre-configuration, the program execution results of multiple running devices based on fragmented data sets, after inverse fragmentation processing, yield an inverse fragmentation result equal to the program execution result based on the original data set.

[0275] The model training process may involve operations such as differentiation, summation, loss calculation, and parameter updating. Based on the above analysis, these operations can be broken down into multiple basic operations. Thus, based on the specific sharding operation algorithm mentioned above, the effect of "the inverse sharding result obtained after inverse sharding processing of the program running results of multiple devices based on sharded data sets is equal to the program running result based on the original data set" can be achieved.

[0276] While the fragmented dataset contains all samples (all data) from the original dataset, each feature value within each sample is a fragment value and has no inherent meaning. Therefore, the running device cannot access sensitive information (e.g., user privacy information) contained in the user samples.

[0277] S203: The specified device summarizes the running results of the model training program from N running devices, performs inverse sharding on the running results of the N model training programs, and uses the resulting processing result as the running result of the model training program based on the original dataset.

[0278] The specified device can be any of the N running devices, or any device other than the N running devices. The resulting inverse sharding process is the result obtained by training the model based on the original dataset (all user samples from the N data holders).

[0279] In this system, each of the N operating devices cannot obtain the plaintext feature data of any user sample in the original data set. Instead, it can only obtain feature data fragments that have no practical meaning and do not contain any information (such as sensitive information). The intermediate results obtained based on the fragments also have no practical meaning, thereby protecting the data security and sensitive information security of the original data set (protecting the user samples of each data holder).

[0280] This specification also provides a system embodiment.

[0281] like Figure 6 The diagram shown is a structural schematic of a program running system provided in this specification, which includes N running devices, namely running device 1, running device 2, running device 3, ..., running device N.

[0282] In this program execution system, the value of each data in the original data set can be pre-sharded to obtain N shard values ​​for each data; the original data set may include data used to assign values ​​to variables in the program.

[0283] You can also predetermine N data sets of shards; determining each data set of shards can include: reassigning a value to each data in the original data set using a shard value of that data; the value of the same data in the N data sets of shards corresponds one-to-one with the N shard values ​​of the same data.

[0284] Furthermore, through pre-configuration, the result of inputting any set of values ​​into the basic operation unit corresponding to the target program is equal to the result of inversely partitioning all the operation results after inputting each piece of the arbitrary set of values ​​into the basic operation unit for separate operation.

[0285] Each running device in the program's operating system can be used to run the target program based on a fragmented data set under specified conditions.

[0286] The functions of different basic arithmetic units are implemented by calling different arithmetic instructions in the system instruction set; the system instruction set is the instruction set of the operating system of the running device; pre-configuration may specifically include: for each basic arithmetic unit, determining the arithmetic instructions in the system instruction set corresponding to that basic arithmetic unit; and configuring the arithmetic logic corresponding to the determined arithmetic instructions in the operating system.

[0287] Among them, N running devices run the target program based on different fragmented data sets.

[0288] The specified conditions may include: consistency among the predefined sets of variable attributes of N running devices; a variable attribute includes a variable symbol and a variable data type.

[0289] When N running devices need to exchange fragment values ​​for any variable in the target program, each running device can also be used to encrypt the fragment value of the variable stored locally with a random number; during the process of the N running devices running the target program respectively, each running device is used to: for each variable in the target program, when encrypting the fragment value of the variable with a random number for the first time, request a random number from the random number provider and assign it to the variable; when encrypting the fragment value of the variable with a random number again, reuse the random number assigned to the variable.

[0290] Each running device can also be used to reuse the random number assigned to the variable when the transformation result obtained by mathematical transformation of the slice value of the variable is encrypted with a random number.

[0291] Each running device can also be used to: request a random number from a random number provider and assign it to the variable; if the fragmented value of the variable needs to be encrypted with random numbers at least once more in the target program, then store the random number assigned to the variable locally. When the fragmented value of the variable is encrypted with random numbers again, the locally stored random number assigned to the variable is reused.

[0292] When N running devices need to exchange fragment values ​​for any variable in the target program, each running device can also be used to encrypt the fragment value of the variable stored locally with random numbers; the target program can contain at least two interaction tasks for exchanging encrypted fragment values; at least two threads of each running device share different interaction tasks of the target program.

[0293] In this context, each thread in at least two threads of each running device is identified by the target program; threads with the same identifier specified by the target program in different running devices share the same interaction tasks in the target program; different interaction tasks can use the same channel to exchange specified data; the specified data may include the variable fragment value to be exchanged and the thread identifier that sends the variable fragment value, so as to determine the thread with the same identifier in other running devices that receives the variable fragment value.

[0294] The data in the original dataset can be distributed and stored on N running devices; the N running devices can be specifically used to: process the data values ​​stored locally on their own and interact with each other to process the results, so that each running device obtains a fragment value for each data in the original dataset.

[0295] The program's operating system may also include target devices; data in the original data set may be stored on the target device; the target device may be used to send N fragmented data sets to N operating devices respectively.

[0296] The original data set may also include data used to assign values ​​to constants in the program.

[0297] The program's operating system may also include designated devices; the designated devices can be used to: receive N sets of variable attributes predefined by N operating devices, and determine that the variable attributes contained in the N sets of variable attributes are the same.

[0298] The running device can also be specifically used to: receive N sets of variable attributes predefined by other N-1 running devices, and determine that the variable attributes contained in the N sets of variable attributes are the same.

[0299] The symbol table predefined by the running device may include at least the variable symbol, variable data type, and variable value storage address corresponding to the variables predefined by the running device; the variable attribute set may include the variable symbol and variable data type in the symbol table.

[0300] For an explanation of the above system embodiments, please refer to the above method flow.

[0301] The above description is merely a specific implementation of the embodiments of this specification. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principles of the embodiments of this specification, and these improvements and modifications should also be considered as protection of the embodiments of this specification.

Claims

1. A method for running a program, comprising: The value of each data in the original dataset is partitioned to obtain N partition values ​​for each data. The original data set includes data used to assign values ​​to variables in the program; Determine N data fragment sets; Determining each data set in the original data set includes: reassigning a value to each data in the original data set using a data set value; the values ​​of the same data in the N data sets correspond one-to-one with the N data set values ​​of the same data. Under specified conditions, N running devices run the same target program based on different sharded data sets; threads with the same identifier specified by the target program share the same interaction tasks in the target program among different running devices; the interaction tasks are used to exchange encrypted sharded values ​​with threads with the same identifier in other running devices for the same data. Specifically, through pre-configuration, the result of the operation obtained by inputting any set of values ​​into the basic operation unit before configuration for each basic operation unit corresponding to the target program is equal to the result obtained by performing inverse fragmentation on all the operation results after inputting each piece of the arbitrary set of values ​​into the basic operation unit after configuration for separate operation.

2. The method according to claim 1, wherein the functions of different basic arithmetic units are implemented by calling different arithmetic instructions in the system instruction set; the system instruction set is the instruction set of the operating system of the running device; The pre-configuration includes: For each basic arithmetic unit, determine the arithmetic instructions in the system instruction set corresponding to that basic arithmetic unit; In an operating system, the operational logic corresponding to specific operational instructions is configured.

3. The method according to claim 2, wherein the specified situation includes: The sets of predefined variable attributes for each of the N operating devices must be consistent. A variable attribute includes a variable symbol and a variable data type.

4. The method according to claim 2, wherein when the N running devices need to exchange fragment values ​​for any variable in the target program, the fragment values ​​of the variable stored locally are encrypted with random numbers respectively; The method further includes: During the execution of the target program by the N running devices, for each variable in the target program, when the fragment value of the variable is first encrypted with a random number, a random number is requested from the random number provider and assigned to the variable; when the fragment value of the variable is encrypted with a random number again, the random number assigned to the variable is reused.

5. The method according to claim 2, further comprising: Each running device is based on at least two threads, which share the execution of the target program.

6. The method according to claim 1, wherein the data in the original dataset is distributed and stored on N running devices; The process of partitioning the value of each data in the original dataset to obtain N partition values ​​for each data includes: The N operating devices each perform fragment processing on the locally stored data values ​​and interact with each other to process the results, so that each operating device obtains a fragment value for each data in the original data set.

7. The method according to claim 1, wherein the data in the original data set is stored on the target device; The method further includes: The target device sends N fragmented data sets to N running devices respectively.

8. The method according to claim 1, wherein the original data set further includes data for assigning values ​​to constants in the program.

9. A program execution system, wherein the value of each data in an original data set is pre-sliced ​​to obtain N slice values ​​for each data; the original data set includes data used to assign values ​​to variables in the program; Determine N data fragment sets; Determining each data set in the original data set includes: reassigning a value to each data in the original data set using a data set value; the values ​​of the same data in the N data sets correspond one-to-one with the N data set values ​​of the same data. The system includes N running devices, each running device being used to: run the same target program based on a sharded data set under specified conditions; and share the same interactive tasks in the target program between different running devices using threads with the same identifier specified by the target program; the interactive tasks are used to interact with encrypted sharded values ​​for the same data using threads with the same identifier in other running devices. Among them, N running devices run the target program based on different fragmented data sets; through pre-configuration, for each basic operation unit corresponding to the target program, the operation result obtained by inputting any set of values ​​into the basic operation unit before configuration is equal to the processing result obtained by inputting each fragment value of the arbitrary set of values ​​into the basic operation unit after configuration and performing separate operations, and then performing inverse fragmentation processing on all the operation results.

10. In the system according to claim 9, the functions of different basic computing units are implemented by calling different computing instructions in the system instruction set; the system instruction set is the instruction set of the operating system of the running device; The pre-configuration includes: For each basic arithmetic unit, determine the arithmetic instructions in the system instruction set corresponding to that basic arithmetic unit; In an operating system, the operational logic corresponding to specific operational instructions is configured.

11. The system of claim 10, wherein the specified conditions include: The sets of predefined variable attributes for each of the N operating devices must be consistent. A variable attribute includes a variable symbol and a variable data type.

12. The system according to claim 10, wherein when the N running devices need to exchange fragment values ​​for any variable in the target program, each running device is used to perform random number encryption on the fragment value of the variable stored locally; during the process of the N running devices running the target program respectively, each running device is used to: for each variable in the target program, when performing random number encryption on the fragment value of the variable for the first time, request a random number from the random number provider and assign it to the variable; when performing random number encryption on the fragment value of the variable again, reuse the random number assigned to the variable.

13. The system according to claim 10, wherein each running device is further configured to: share the execution of the target program based on at least two threads.

14. The system according to claim 9, wherein the data in the original data set is distributed and stored on N operating devices; The N operating devices are used to: perform fragment processing on the locally stored data values ​​respectively and interact with each other to process the results, so that each operating device obtains a fragment value for each data in the original data set.

15. The system according to claim 9, further comprising a target device; the data in the original data set is stored on the target device; The target device is used to send N fragmented data sets to N running devices respectively.

16. The system according to claim 9, wherein the original data set further includes data for assigning values ​​to constants in the program.

Citation Information

Patent Citations

  • Data processing method and apparatus

    CN106980538A

  • Data processing system and method

    CN112001475A

  • Information processing device, information processing system, and information processing method, and program

    US20180366227A1