Program running method and system

By performing sharding processing of the original data set and specific sharding algorithms, the problem of information leakage during program operation is solved, and information security protection is achieved in a multi-device environment.

CN114692133BActive Publication Date: 2025-08-29ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210280620.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-22
Publication Date
2025-08-29
Estimated Expiration
2041-01-22

AI Technical Summary

Technical Problem

During the program operation, the device obtains sensitive information in the data collection, resulting in information leakage, and an urgent need for a program operation method to ensure information security.

Method used

The original data set is sharded, N sharded data sets are generated, and the same target program is run on N devices. Through a specific sharding operation algorithm, it is ensured that each device can only obtain the shard value and cannot obtain the plaintext data in the original data set.

Benefits of technology

On the premise of obtaining the target program running results of the original data set, each device can only obtain the shard value in the sharded data set, protecting information security and avoiding sensitive information leakage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114692133B_ABST
    Figure CN114692133B_ABST
Patent Text Reader

Abstract

This specification discloses a program running method and system. The method includes: slicing the value of each data in the original data set to obtain N slicing values ​​for each data; determining N slicing data sets; the value of the same data in the N slicing data sets corresponds one-to-one to the N slicing values ​​of the same data; under specified circumstances, N running devices respectively run the target program based on different slicing data sets; each running device shares the execution of the target program based on at least two threads; wherein, 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 for operation is equal to the processing result obtained by inputting each set of slicing values ​​of the arbitrary set of values ​​into the basic operation unit for operation, and performing inverse slicing on all the obtained operation results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this specification relate to the field of computers, and more particularly, to a program execution method and system. Background Art

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

[0003] In some scenarios, for information security reasons, it is not desirable to leak sensitive information contained in a data set to the device running the program. For example, in a model training scenario, the device running the model training program needs to obtain multiple user samples and corresponding labels for calculation. However, this means that the device can obtain user privacy information based on the multiple user samples and corresponding labels.

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

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

[0006] A program running method, comprising:

[0007] Slice the value of each data in the original data set to obtain N slice values ​​of each data; the original data set includes data used to assign values ​​to variables in the program;

[0008] Determining N shard data sets; determining each shard data set, including: reassigning a value to each data in the original data set using a shard value of the data; the value of the same data in the N shard data sets corresponds one-to-one to the N shard values ​​of the same data;

[0009] Under specified circumstances, N running devices respectively run the same target program based on different shard data sets; the specified circumstances include: the variable attribute sets predefined by the N running devices are consistent; a variable attribute includes a variable symbol and a variable data type; threads with the same identifier specified by the target program between different running devices share the same interactive task in the target program; the interactive task is used to exchange encrypted shard values ​​for the same data with threads with the same identifier in other running devices;

[0010] Among them, 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 for operation is equal to: after each group of slice values ​​of the arbitrary set of values ​​are input into the basic operation unit after configuration for separate operation, the processing result obtained after inverse slicing processing is performed on all the obtained operation results.

[0011] A program execution system pre-slices the value of each data item in an original data set to obtain N slice values ​​for each data item; the original data set includes data used to assign values ​​to variables in the program; the N slice data sets are determined; and each slice data set is determined, comprising: re-assigning a value to each data item in the original data set using a slice value of the data item; and the values ​​of the same data item in the N slice data sets correspond one-to-one to the N slice values ​​of the same data item.

[0012] The system includes N running devices, each of which is configured to: run the same target program based on a sharded data set under specified circumstances, wherein the specified circumstances include: consistency between sets of variable attributes predefined by the N running devices; a variable attribute includes a variable symbol and a variable data type; threads with the same identifier specified by the target program between different running devices share the same interactive task in the target program; the interactive task is used to exchange encrypted shard values ​​for the same data with threads with the same identifier in other running devices;

[0013] Among them, N running devices run the target program based on different sharded data sets respectively; 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 for operation is equal to: after each group of sharded values ​​of the arbitrary set of values ​​are input into the basic operation unit after configuration for separate operation, the processing result is obtained after inverse sharding processing is performed on all the obtained operation results.

[0014] The above technical solution, through preconfiguration, enables N execution devices to run the target program based on the sharded data set and obtain the target program execution results based on the original data set. Therefore, while being able to obtain the target program execution results based on the original data set, each execution device can only obtain the shard values ​​within the sharded data set and cannot obtain any plaintext data in the original data set, thereby preventing access to sensitive information in the original data set, thus protecting information security. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of this specification. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0016] Figure 1 This is a flowchart of a program running method provided in an embodiment of this specification;

[0017] Figure 2 This is a schematic diagram of the principle of a method for determining a sharded data set provided in an embodiment of this specification;

[0018] Figure 3 This is a schematic diagram of the principle of another method for determining a sharded data set provided in an embodiment of this specification;

[0019] Figure 4 This is a schematic diagram of the structure of a virtual operation device provided in an embodiment of this specification;

[0020] Figure 5 This is a flowchart of a method for running a model training program provided in an embodiment of this specification;

[0021] Figure 6 It is a structural diagram of a program running system provided in an embodiment of this specification. DETAILED DESCRIPTION

[0022] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of this specification, the technical solutions in the embodiments of this specification will be described in detail below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by those of ordinary skill in the art should fall within the scope of the disclosure.

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

[0024] In some scenarios, for information security reasons, it is not desirable to leak sensitive information carried by the data set to the device running the program.

[0025] For example, in a model training scenario, the device running the model training program needs to obtain multiple user samples and corresponding labels for calculation. 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] This specification provides a method for running a program. Since a single device, when running a program, typically 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), the program running method provided in this specification can perform sharding processing on the value of each plaintext data in the original data set to obtain multiple shard values; thereby, multiple shard data sets containing all the data in the original data set (the values ​​are shard values) can be obtained, and the obtained multiple shard data sets are respectively deployed on multiple devices, so that these devices can run the same program based on the shard data sets.

[0028] When the program is actually run, the operations on the sharded data set in the program can be executed through a specific sharding operation algorithm, so that the program running results based on the sharded data set of multiple devices are equal to the program running results based on the original data set after inverse sharding processing.

[0029] To facilitate understanding, a specific example is given below.

[0030] The original data set contains data X, whose value is a. Slicing data X can be done by splitting the value a into N parts, specifically a1, a2, a3, ..., a N .in,

[0031] Determine N shard data sets, all of which contain data X. For shard data set i, the value of the data X is a i , i=1, 2, 3, ..., N.

[0032] The program to be run is F(X). Based on a specific sharding algorithm, F(X) is configured and modified to obtain F'(X), so that Among them, each device can be based on the local data shard value a i Calculate F'(a i ).

[0033] In the above method embodiment, due to the use of a specific sharding operation algorithm, multiple devices can obtain multiple program running results based on the sharded data set. After inverse sharding processing, the program running results based on the original data set can still be obtained. Therefore, under the premise of being able to obtain the actual required program running results (that is, the program running results based on the original data set), sharding processing is performed on the value of each data in the original data set, and multiple sharding values ​​that have no actual meaning can be obtained, and do not contain any information (including sensitive information), thereby removing the sensitive information contained in the data and realizing desensitization processing. Each device cannot obtain any sensitive information based on the obtained data sharding value.

[0034] In other words, the data set (i.e., the sharded data set) calculated by each device running the program in multiple devices does not contain sensitive information. The sensitive information carried by the original data set is not leaked to any device running the program during the program running process, thereby protecting the security of sensitive information.

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

[0036] When a program is executed, it may include any operations, such as addition, subtraction, multiplication, division, derivatives, square roots, etc. Each operation needs to be performed on the device running the program, specifically by the computing unit of the device, such as the central processing unit (CPU).

[0037] To better understand the specific sharding algorithm described above, two noteworthy premises are introduced below.

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

[0039] It's important to note that when a device performs operations on data, each individual piece of data is subject to storage space limitations, as well as limitations on data size and precision. For example, integer data typically occupies 4 bytes of device storage, has a limit on the size of data that can be represented, and a precision of 1. Double-precision floating-point data typically occupies 8 bytes of device storage, but has a limit on the precision that can be represented.

[0040] Based on this, when a program runs a calculation on data, if the result cannot be accurately represented due to data storage space limitations, the device uses an approximate value as the result. For example, when using double-precision floating-point data to represent 1 / 3, the device typically represents it as 0.333333, rather than as an infinite repeating decimal.

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

[0042] A device's computational unit typically only performs a subset of basic operations, such as addition, multiplication, and logical operations like AND, OR, and NOT. However, any operations included in a program must be executed by the computational unit, specifically by converting them into one or more basic operations that the computational unit can implement.

[0043] Since any logical operation can be expressed using the XOR operation, the AND operation, and the NOT operation, any logical operation can be converted into basic operations.

[0044] Arithmetic operations can obviously be converted into basic operations. For example, a subtraction operation between two data can be converted into an addition operation between one data and the opposite number of the other data, and a division operation between two data can be converted into a multiplication operation between the dividend and the reciprocal of the divisor.

[0045] For more complex calculations, some approximation methods can be used to convert them into one or more basic operations. For example, Newton's iteration method, bisection method, Taylor expansion formula, etc. Due to the limitations on the accuracy of the data stored in the device itself, these approximation methods can be used to increase the accuracy of the approximation to a level higher than the accuracy of the calculation result on the device, thereby reducing the accuracy of the calculation result. It is also possible to use the original data for the forward operation so that the difference between the reverse calculation result of the approximation and the original data cannot be represented by the device, thereby using the approximation as the forward operation result.

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

[0047] In the first example, the derivative value can be directly calculated according to the definition of the derivative value. Δx can take an extremely small value. Because the device itself has strong computing power and can perform complex numerical calculations quickly, it can directly calculate the derivative value, thus converting this complex operation into a subtraction and a division operation, that is, an addition and a multiplication operation.

[0048] It should be noted that the derivative value obtained by this calculation method is an approximation. However, due to the limitations on the accuracy of the data on the device itself, the accuracy of the derivative value obtained by this calculation method can be higher than the accuracy of the derivative value on the device by controlling the size of Δx.

[0049] For example, when the accuracy of the derivative value data is 0.1, we can continuously reduce Δx and substitute it into the calculation multiple times to make The first decimal place of the multiple calculation results remains unchanged, so that the derivative value with an accuracy of 0.1 can be obtained.

[0050] In the second example, the square root operation can be calculated using the bisection method. The following calculations 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] If the difference between the product and 2 is less than the precision of the calculation result, 0.01, the device cannot represent the error value of 0.00042... for the calculation result. The square of 1.4140625 can actually be represented as 2. Therefore, the calculation result can be determined to be 1.41.

[0060] Through the analysis of the above two premises, 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 can be executed by the computing unit.

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

[0062] Furthermore, the final running result of the program is obtained through multiple calculation operations in the program, and the program running result also satisfies "the inverse sharding processing results of multiple program running results based on sharded data sets of multiple devices are equal to the program running results based on the original data set after inverse sharding processing."

[0063] Therefore, if "the inverse sharding processing results of multiple program running results based on sharded data sets on multiple devices are equal to the program running results based on the original data sets after inverse sharding processing", then each basic operation of the computing unit needs to satisfy "the inverse sharding processing results of multiple basic operation results based on sharded data sets are equal to the basic operation results based on the original data sets after inverse sharding processing".

[0064] Before explaining how to configure basic operations based on a specific sharding algorithm, we first need to explain the specific operations of sharding. When performing sharding, it is necessary to distinguish between arithmetic operations and logical operations.

[0065] For the value of the same data (referred to as the initial value for the sake of ease of description), if it needs to participate in arithmetic operations, the split slice values ​​need to satisfy "the sum of the slice values ​​is equal to the initial value"; and if it needs to participate in logical operations, the split slice values ​​need to satisfy "the result of the XOR of the slice values ​​is equal to the initial value".

[0066] For example, for data X with value a, when arithmetic operations are required, the fragment values ​​a1, a2, a3, ..., a N Needs to be satisfied In the case of logical operations, the split value a N+1 , a N+2 , a N+3 ,...,a 2N Needs to be satisfied In this manual Represents the exclusive OR operation.

[0067] The above sharding process can be specifically: sharding based on a random algorithm. For example, based on a random algorithm, N-1 random numbers are obtained as a1, a2, a3, ..., a N-1 , and then calculate a N So that the above conditions are met or

[0068] Furthermore, shard values ​​that meet different conditions can be converted to each other using existing methods. Therefore, if a program contains arithmetic and logical operations, the shard values ​​can be converted on the fly as needed, without having to perform two separate sharding operations and obtain two different sets of shard values.

[0069] The inverse sharding processing corresponding to the two sharding processing situations is also different. For arithmetic operations, it is an addition operation, and for logical operations, it is an exclusive-OR operation.

[0070] Because sharding is a form of desensitization, it prevents devices from accessing sensitive information contained in the sharded data while completing computations. Therefore, sharding can be used for data that requires concealment and security, such as program inputs, some constants, and variable values.

[0071] However, there are also some data in the program that do not need to be protected, such as some constants, some weights, some fixed values, etc. These do not contain sensitive information and therefore do not need to be sharded.

[0072] Therefore, the data involved in the calculation in the program includes data that has been processed by sharding and data that has not been processed by sharding.

[0073] For ease of understanding, the following configurations for basic calculation operations are all for two data. It can be understood that operations involving more than two data can be divided into multiple groups of basic operations of two data.

[0074] 1. Addition operation.

[0075] For addition operations between two data items processed in shards, each device can directly add the shard values ​​of the two data items to obtain the addition result. The sum of the addition results based on the shard values ​​of all devices is equal to the addition result based on the initial values.

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

[0077] For X+Y executed in the program, device i specifically executes a i +b iBased on the following derivation, for all N devices, the sum of the N addition results is equal to a + b (that is, the N addition results based on the sharded data set, after the inverse sharding process (addition operation), the inverse sharding result obtained is equal to the addition result based on the original data set).

[0078]

[0079] For the addition operation between an unsharded data and a sharded data, one device can be selected from N devices to perform the addition operation, while the other N-1 devices do not perform the operation; each device can also shard the unsharded data in real time, for example, dividing the value of the data into N equal parts, and then adding the shard values ​​of the two data to obtain the addition result.

[0080] Similarly, based on the following derivation, A is the initial value of the unsharded data. For all N devices, the sum of the N addition operation results is equal to a+b (that is, the N addition operation results based on the sharded data set are inversely sharded (addition operation) and the inversely sharded results obtained are equal to the addition operation results based on the original data set).

[0081]

[0082] For the addition operation between two unsharded data, since neither sharding nor inverse sharding is involved, the addition operation can be performed normally.

[0083] 2. Multiplication operation.

[0084] For multiplication operations between two pieces of data processed in shards, N devices can agree on a set of random numbers and encrypt the shard values ​​of the two pieces of data based on this set of random numbers. This allows them to exchange the encrypted shard values ​​without leaking the original data values ​​or sensitive information. Furthermore, they can perform specified operations so that the sum of the specified operation results based on the shard values ​​by the N devices equals the multiplication result of the initial values ​​of the two pieces of data. The sum of the specified operation results based on the shard values ​​by all devices equals the multiplication result based on the initial values.

[0085] To facilitate 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, the value of data X on device i is a. i , the value of data Y is b i , where i = 1, 2, 3, ..., N. The fragment value satisfies and

[0087] Step 1: N devices need to agree on a set of random numbers for the multiplication operation between data X and data Y, which includes three random numbers α, β, and δ, where αβ=δ.

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

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

[0090] Step 2: Each device i performs the specified operation The specified operation result can be used as the multiplication result of data X and data Y on the device.

[0091] Based on the following derivation, for all N devices, the sum of the N multiplication results of the N devices is equal to ab (that is, the N specified operation results based on the sharded data set (for the device, they are multiplication results) are equal to the multiplication results based on the original data set after inverse sharding (addition operation)).

[0092]

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

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

[0095]

[0096] Of course, the unsharded data values ​​can also be sharded immediately, so that the multiplication result can be obtained based on the above steps one and two.

[0097] For the multiplication operation between two unsharded data, since neither sharding nor inverse sharding is involved, the multiplication operation can be performed normally.

[0098] 3. XOR operation.

[0099] For logical operations, the shard values ​​obtained by shard processing can specifically satisfy "the result of the XOR of each shard value is equal to the initial value".

[0100] For the XOR operation between two pieces of data processed in shards, each device can directly perform the XOR operation on the shard values ​​of the two pieces of data to obtain the XOR operation result. The XOR results of the XOR operation on the shard values ​​of all devices are equal to the XOR results of the initial value.

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

[0102] Based on the following derivation, for all N devices, the result of N XOR operations is equal to (That is, after the inverse sharding process (XOR operation) of N XOR operation execution results based on the sharded data set, the inverse sharding process result obtained is equal to the XOR operation execution result based on the original data set).

[0103]

[0104] For an XOR operation between an unsharded piece of data and a sharded piece of data, one device can XOR the unsharded data value with the local shard value. The other N-1 devices do not perform the XOR operation and directly use the shard value as the XOR result. The XOR results of the XOR operations performed on the shard values ​​by all devices are equal to the XOR results performed on the initial values.

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

[0106] Based on the following derivation, A is the initial value of the unfragmented data. For all N devices, the result of the N XOR operations is equal to (That is, after the inverse sharding process (XOR operation) of N XOR operation execution results based on the sharded data set, the inverse sharding process result obtained is equal to the XOR operation execution result based on the original data set).

[0107]

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

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

[0110] 4. And operation.

[0111] For the AND operation between two data in shard processing, N devices can agree on a set of random numbers, and encrypt the shard values ​​of the two data based on this set of random numbers, so that the encrypted data shard values ​​can be exchanged without leaking the original value and sensitive information of the data, and further perform specified operations, so that the results of the specified operation execution of the N devices based on the shard value are equal to the results of the AND operation execution of the initial values ​​of the two data after the mutual XOR operation (inverse sharding processing).

[0112] To facilitate explanation of the specified operation, a specific example is given below.

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

[0114] Step 1: N devices need to agree on a set of random numbers for the AND operation between data X and data Y, which includes three random numbers α, β, and δ, where α∧β=δ.

[0115] These three random numbers are also sharded to obtain and And deploy each shard value to N devices respectively, so that for device i, there is α i , β i , δ i .

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

[0117] Step 2: Specify a device to calculate As a result of the AND operation, the other N-1 devices can calculate As the result of the AND operation.

[0118] Based on the following derivation, for all N devices, the results of the N AND operation execution results obtained through mutual XOR operations are equal to a∧b (that is, the N specified operation execution results based on the sharded data set (for the device, the AND operation execution results) are equal to the AND operation execution results based on the original data set after inverse sharding processing (XOR operation)).

[0119]

[0120] For the AND operation between an unsharded data and a sharded data, each device can directly determine the AND operation execution result between the unsharded data value and the sharded 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 AND operation execution results after mutual XOR operation are equal to A∧b (that is, the N specified operation execution results based on the sharded data set (for the device, the AND operation execution results) are equal to the inverse sharding processing results obtained after inverse sharding processing (XOR operation) based on the sharded data set. The original data set is based on the AND operation execution result).

[0121]

[0122] Of course, the unsharded data values ​​can also be sharded immediately, so that the results of the operations can be obtained based on the above steps one and two.

[0123] For AND operations between two unsharded data, since neither involves sharding nor reverse sharding, the AND operation can be performed normally.

[0124] 5. Non-operation.

[0125] The non-operation can be regarded as an operation on a single data. Therefore, for the non-operation of a data processed by the shard, one device can be designated among N devices. The designated device can perform the non-operation on the shard value to obtain the non-operation execution result. The other N-1 devices can directly use the shard value as the non-operation execution result.

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

[0127] Based on the following derivation, for all N devices, the result of the N non-operation execution results of N devices after the mutual XOR operation is equal to (That is, after the inverse sharding processing (XOR operation) of N specified operation execution results based on the sharded data set (non-operation execution results for the device), the inverse sharding processing results obtained are equal to the non-operation execution results based on the original data set).

[0128]

[0129] For a non-operation on unsharded data, since it does not involve sharding and will not be desharded, the non-operation can be performed normally.

[0130] 6. Or operation.

[0131] For the OR operation between two data in shard processing, N devices can agree on a set of random numbers, and encrypt the shard values ​​of the two data based on this set of random numbers, so that the encrypted data shard values ​​can be exchanged without leaking the original value and sensitive information of the data, and further perform specified operations, so that the results of the specified operation execution of the N devices based on the shard value are equal to the results of the OR operation execution of the initial values ​​of the two data after mutual XOR operation (inverse sharding processing).

[0132] To facilitate explanation of the specified operation, a specific example is given below.

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

[0134] Step 1: N devices need to agree on a set of random numbers for the OR operation between data X and data Y, which includes three random numbers α, β, and δ, where α∧β=δ.

[0135] These three random numbers are also sharded to obtain and And deploy each shard value to N devices respectively, so that for device i, there is α i , β i , δ i .

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

[0137] Step 2: 1 device calculation As a result of the OR operation on the specified device, the other N-1 devices can calculate As the result of an OR operation.

[0138] Based on the following derivation, for all N devices, the result obtained by mutually exclusive-ORing the N OR operation execution results is equal to a∨b (that is, the N specified operation execution results based on the sharded data set (for the device, the OR operation execution results) are equal to the OR operation execution results based on the original data set after inverse sharding processing (exclusive-OR operation)).

[0139]

[0140] For the OR operation between an unsharded data and a sharded data, each device can perform a specified operation so that the results of the specified operation execution based on the sharded value of N devices after mutual XOR operation (inverse sharding processing) are equal to the results of the OR operation execution of the initial values ​​of the two data.

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

[0142] You can specify a device to execute The other N-1 devices can execute

[0143] Based on the following derivation, for all N devices, the results of the N OR operation execution results after the mutual XOR operation are equal to A∨b (that is, the N specified operation execution results based on the sharded data set (for the device, the AND operation execution results) after the inverse sharding processing (XOR operation) are equal to the OR operation execution result based on the original data set).

[0144]

[0145] Of course, the unsharded data values ​​can also be sharded immediately, so that the execution results can be obtained or operated based on the above steps one and two.

[0146] For the OR operation between two unsharded data, since neither involves sharding processing and no desharding processing will be performed, the OR operation can be executed normally.

[0147] Through the above explanation of the specific sharding operation algorithm, for operations including addition, multiplication, AND / NOR, and XOR, corresponding specified operations or specified operations can be used to achieve "multiple basic operation results based on sharded data sets, after inverse sharding processing, the obtained inverse sharding processing results are equal to the basic operation results based on the original data set", thereby achieving "multiple program running results based on sharded data sets of multiple devices, after inverse sharding processing, the obtained inverse sharding processing results are equal to the program running results based on the original data set".

[0148] A program running method provided in this specification is explained in detail below with reference to the accompanying drawings.

[0149] like Figure 1 FIG. 1 is a flow chart of a program running method provided in this specification. The method may include at least the following steps S101-S103.

[0150] S101: Slice the value of each data in the original data set to obtain N slice values ​​of each data.

[0151] The original data set may include data that needs to protect sensitive information, such as data used to assign values ​​to program variables, data used to assign values ​​to program constants, program input data, etc. Slicing can hide sensitive information contained in the data values.

[0152] N is the number of devices that are expected to participate in the program execution. N ≥ 2. For ease of description, the devices to be involved in the program execution are referred to as running devices.

[0153] S102: Determine N shard data sets; determine each shard data set, including: reassigning each data in the original data set using a shard value of the data; the value of the same data in the N shard data sets corresponds one-to-one to the N shard values ​​of the same data.

[0154] The above S101 and S102 are explained in combination.

[0155] There are at least two embodiments for the storage location of the original data set, and correspondingly, the specific methods for determining the N sharded data sets are also different.

[0156] Embodiment 1: The original data set may be stored on a target device other than the N running devices.

[0157] The target device can be any storage device other than the N running devices, storing all the data in the original data set. The target device can perform sharding on each data item in the original data set to obtain N shard values, thereby creating N shard data sets, each of which can contain all the data in the original data set. The N shard values ​​are then reassigned to the data in the N shard data sets, ensuring that the values ​​of the same data item in the N shard data sets correspond one-to-one to the N shard values ​​of the same data item.

[0158] The target device may send the created N shard data sets to the N running devices respectively, so that the N running devices correspond one to one with the N shard data sets.

[0159] For ease of understanding, in an optional embodiment, as Figure 2 , which is a schematic diagram of the principle of a method for determining a sharded data set provided in this specification, including a target device, device 1 and device 2, wherein the target device stores an original data set {X=a, Y=b}.

[0160] For the original data set {X = a, Y = b}, the devices participating in the program execution include device 1 and device 2. The target device performs sharding on each data point in the original data set, obtaining a1, a2, b1, and b2, and creates two sharded data sets. The sharding values ​​are reassigned to each sharded data set, resulting in the sharded data sets {X = a1, Y = b1} and {X = a2, Y = b2}.

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

[0162] Embodiment 2: The original data set may be specifically stored in a distributed manner on N running devices.

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

[0164] To obtain N shard values ​​for each data and determine N shard data sets, specifically, N running devices can perform shard processing on the locally stored data values ​​(data values ​​stored by the running devices and belonging to the original data set) respectively, and exchange the shard processing results with each other, so that each running device can obtain a shard value for each data in the original data set, that is, a shard data set.

[0165] For ease of understanding, in an optional embodiment, as Figure 3 , which is a schematic diagram of the principle of another method for determining a sharded data set provided in this specification, including device 1 and device 2.

[0166] For the original data set {X = a, Y = b}, the devices participating in the program execution include device 1 and device 2. Device 1 stores data X with the value a, and device 2 stores data Y with the value b. Device 1 shards the locally stored data X, obtaining shard values ​​a1 and a2, and sends a2 to device 2. Device 2 shards the locally stored data Y, obtaining shard values ​​b1 and b2, and sends b1 to device 1.

[0167] Device 1 uses a1 to reassign data X to create data Y, and uses b1 to reassign data Y to obtain the sharded data set {X=a1, Y=b1}; Device 2 can similarly obtain the sharded data set {X=a2, Y=b2}.

[0168] In response to the second situation above, this specification also provides a specific embodiment, which specifically defines the interaction between running devices and the form of sharded data sets.

[0169] N operating devices can pre-create a symbol table. The symbol table can be used to store at least the variables pre-defined by the operating devices. The symbol table can specifically include the variable name, variable data type, and variable value storage address.

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

[0171] When any running device creates a variable in the symbol table based on 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 sliced, and one of the slice values ​​can be selected to assign a value to the variable in the symbol table. The variable name, variable data type, and other N-1 slice values ​​of this variable are sent to the other N-1 running devices respectively, so that each of the other N-1 running devices can obtain the variable name, variable data type, and one slice value, so that the other N-1 running devices can create variables with the same variable name and variable data type in the local symbol table, and use the obtained one slice value to assign values.

[0172] N running devices create variables in the symbol table and perform sharding processing based on the locally stored data values ​​(data values ​​stored by the running device and belonging to the original data set), and interact with each other so that the symbol table of each running device contains the variables corresponding to each data in the original data set and the sharding value of each data.

[0173] For ease of understanding, in an optional embodiment, for the original data set {X=a, Y=b}, the devices involved in the program execution include device 1 and device 2. Device 1 stores data X with a value of a, and device 2 stores data Y with a value of b.

[0174] Device 1 can create a variable X in its local symbol table based on locally stored data X. The variable name is X, the variable data type is integer, and the variable value storage address can be specified by the device. Device 1 can slice a to obtain slice values ​​a1 and a2, and use a1 to assign the value of variable X in the symbol table. Specifically, a1 can be written back to the variable value storage address corresponding to variable X.

[0175] At the same time, device 1 can send the variable name X, the variable data type of integer data, and the slice value a2 to device 2. Based on the received information, device 2 can create a variable X with the same variable name and variable data type in its local symbol table and assign a value to variable X using a2.

[0176] Similarly, device 2 creates variable Y in the local symbol table and assigns a value to variable Y using b2. Based on the information sent by device 2, device 1 creates variable Y with the same name and data type in the local symbol table and assigns a value to variable Y using b1.

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

[0178] It is important to note that two variables with the same name cannot appear in the same symbol table. Therefore, before actual interaction, variable name conflicts need to be checked between N running devices to ensure that no two variables with the same name exist in the symbol table of any running device after interaction.

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

[0180] In addition, the symbol table can also be used to store constants predefined by the operating devices, and the constants are also subjected to the above-mentioned slicing process and mutual interaction, so that N operating devices can synchronize the constants in the symbol table.

[0181] S103: Under specified circumstances, N execution devices each execute the target program based on a different set of sharded data. Pre-configured, for each basic operation unit corresponding to the target program, a result obtained by inputting any set of values ​​into the basic operation unit for operation is equal to a result obtained by performing inverse sharding on all the obtained results after inputting each set of sharded values ​​of the arbitrary set into the basic operation unit for operation.

[0182] After S102 , the N running devices are respectively deployed with the shard data sets, and the program can be run according to the locally deployed shard data sets.

[0183] The following explains S103 from four perspectives.

[0184] 1. Specified circumstances.

[0185] The specified situation may be a situation where a prerequisite that the N running devices specified by the method flow can run the target program is met.

[0186] In an optional embodiment, the specified situation may be that N running devices have completed the deployment of the shard data set and the target program. For example, if it is determined that each running device has deployed the shard data set and the target program, the target program may be run based on the shard data set.

[0187] In another optional embodiment, the target program requires one or more data in the original data set to run. The specified condition may be that the sharded data set deployed by each running device contains all data in the original data set, thereby ensuring that any running device can run the target program normally, and that a running device will not be unable to run the target program due to the lack of any data in the original data set. Based on the above-mentioned symbol table embodiment, the specified condition may specifically be that the symbol table of each running device contains variables created based on all data in the original data set.

[0188] In one specific embodiment, before running a target program, it is necessary to ensure consistency among the variable attribute sets predefined on each of the N running devices. This ensures that the same variable is defined across all N running devices and can store shard values. If a shard value for a variable does not exist on any running device, the target program may not run successfully on that device.

[0189] Therefore, in order to ensure that N running devices can successfully run the target program, there are slice values ​​of all variables on each running device. The specified situation can be that the variable attribute sets predefined by the N running devices are consistent. One of the variable attributes can include a variable symbol and a variable data type. Specifically, it can be that the designated device receives the N variable attribute sets predefined by the N running devices, and determines that the variable attributes contained in the N variable attribute sets are the same; it can also be that any running device receives the N variable attribute sets predefined by the other N-1 running devices, and determines that the variable attributes contained in the N variable attribute sets are the same; it can also be that each running device receives the N variable attribute sets predefined by the other N-1 running devices, and determines that the variable attributes contained in the N variable attribute sets are the same.

[0190] Furthermore, the variable attribute set predefined by the operating device may be specifically obtained based on a predefined symbol table. The symbol table predefined by the operating device may include at least variable symbols, variable data types, and variable value storage addresses corresponding to the variables predefined by the operating device; the variable attribute set may include the variable symbols and variable data types in the symbol table.

[0191] 2. Target program.

[0192] In the process of this method, the relationship between the target program and the original data set can exist in at least the following two embodiments.

[0193] Embodiment 1: The target program can be written based on the data in the original data set.

[0194] To facilitate understanding, a specific example can be given.

[0195] For example, the original data set is {X=1, Y=2, Z=3}. When writing a target program, you can write it based on one or more data in the original data set. Specifically, you can use X, Y, or Z to write the target program, so that the target program can run successfully according to the data values ​​used (initial values ​​or slice values) and get the program running results. In a specific example, you can use X and Y to write the target program, specifically, you can calculate (X+Y 2 ), so that the target program can run successfully with the values ​​of X and Y, and the program running result (1+2 2 )=5.

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

[0197] Embodiment 2: The original data set can be created based on the data required for running the target program.

[0198] To facilitate understanding, a specific example can be given.

[0199] For example, for the target program written, calculate (X+Y 2 ), which involves variables X and Y. The target program can be run only with the values ​​of X and Y. Therefore, an original data set can be constructed, containing X and Y, and values ​​for X and Y in the original data set can be assigned according to actual needs.

[0200] For the sharded data set that contains all the data in the original data set, it is also possible to assign values ​​to variables X and Y in the target program and run the target program.

[0201] Therefore, in the process of this method, it is not limited to how the target program is written, as long as the target program can successfully run based on the data values ​​in the original data set, that is, the target program can successfully run based on the shard values ​​in the sharded data set.

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

[0203] 3. Pre-configuration.

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

[0205] For example, for multiplication operations, it can be regarded as a multiplication operation unit. Based on the above-mentioned specific sharding operation algorithm, any group of values ​​is input into the multiplication operation unit before the specific sharding operation algorithm is configured for operation, and the output operation result is equal to: each group of shard values ​​of the arbitrary group of values ​​is input into the multiplication operation unit after the specific sharding operation algorithm is configured for operation, and then all the output operation results are inversely sharded to obtain the processing result.

[0206] The configured multiplication unit can specifically execute steps 1 and 2 corresponding to the multiplication operation in the above-mentioned specific sharding operation algorithm for two pieces of data that have been input. In other cases, for example, when two pieces of data that have not been input, or one piece of data that has been input and one piece of data that has not been input, the multiplication operation can be directly performed.

[0207] Regarding the specific configuration method, there may be at least the following two embodiments.

[0208] Example 1: Configuring the operation logic corresponding to the basic operation in the instruction set of the running device.

[0209] In a running device, different basic operations are implemented by calling corresponding arithmetic instructions from the system instruction set. The system instruction set is the instruction set of the operating system running the device. For example, for a multiplication operation, a multiplication instruction from the system instruction set can be called. The computing unit of the running device then executes the arithmetic logic corresponding to the multiplication instruction to complete the multiplication operation.

[0210] Therefore, the pre-configuration can specifically be to determine the operation instructions corresponding to each basic operation unit in the system instruction set; and in the operating system, configure the operation logic corresponding to the determined operation instructions based on the above-mentioned specific slicing operation algorithm.

[0211] During the specific process of running the target program, for any basic operation unit corresponding to the target program, the instruction set after the running device configuration can be called during the compilation process to determine the operation instructions corresponding to the basic operation unit, and obtain the operation logic corresponding to the basic operation unit in the above-mentioned specific slicing operation algorithm.

[0212] For example, for the multiplication operation unit corresponding to the target program, when the input is two sliced ​​data, it can be compiled based on the configured instruction set to obtain steps one and two corresponding to the multiplication operation in the above-mentioned specific slice operation algorithm, and then use the input to execute steps one and two to obtain the output.

[0213] Embodiment 2: Configuring the operation logic corresponding to the basic operation in the computing unit of the running device.

[0214] In the running device, for each basic operation unit corresponding to the target program, the computing unit calls its own basic operation logic to perform the operation. For example, for multiple multiplication operation units corresponding to the target program, the CPU of the running device calls its own multiplier to perform the operation.

[0215] Therefore, the pre-configuration can specifically be to configure the operation logic corresponding to each basic operation in the computing unit of the running device based on the above-mentioned specific sharding operation algorithm. For example, for the configured computing unit, the multiplication operation logic therein is configured to: for two input data that have been processed by sharding, specifically, step 1 and step 2 corresponding to the multiplication operation in the above-mentioned specific sharding operation algorithm can be executed; for two input data that have not been processed by sharding, or one input data that has been processed by sharding and one input data that has not been processed by sharding, specifically, the multiplication operation can be directly executed.

[0216] Furthermore, based on the aforementioned specific sharding algorithm, a distinction is made between unsharded and sharded data, and the same basic operation can correspond to different operational logic for different situations. Therefore, in the target program, unsharded and sharded data can be distinguished by specifying identifiers.

[0217] For example, if you set a new data type to a shard type, you can specify the variable data type as the shard type for the variable being processed. The shard type does not distinguish between integer, floating-point, or other data types.

[0218] After the target program is deployed to the running device, for the slice type variable, the variable with the same variable name as the slice type in the symbol table can be determined based on the symbol table predefined on the running device, and the slice type variable can be redefined as the variable determined in the symbol table.

[0219] To facilitate understanding, a specific example is provided below.

[0220] In the target program, you can use ashr to represent a slice type. You can create a variable X of the slice type in the target program.

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

[0222] Variables that have not been fragmented are not of ashr type, so there is no need to determine the variable based on the symbol table, and the value is also the initial value, so that variables that have not been fragmented can be distinguished from variables that have been fragmented.

[0223] 4. Program running results.

[0224] After N running devices have each run the target program based on the sharded data set and obtained their respective program execution results, the target program can be considered to have completed execution. However, it should be noted that to obtain the program execution results of the target program based on the original data set, the program execution results of N running devices must be obtained before desharding.

[0225] Since the N running devices are running the same target program, although they are running based on different sharded data sets, for each operation in the target program, the operation results obtained on the N running devices based on the sharded data sets are equal to the operation results obtained by a single running device based on the original data set after inverse sharding. Therefore, the N running devices can be regarded as a virtual running device as a whole, and the target program can be run based on the original data set.

[0226] For ease of understanding, Figure 4 FIG. 1 is a schematic diagram of a virtual operation device provided in this specification, which includes three operation devices, namely operation device 1, operation device 2 and operation device 3.

[0227] The original data set is subjected to sharding processing to obtain sharded data set 1, sharded data set 2, and sharded data set 3. Here, running device 1 runs the target program based on sharded data set 1 to obtain program running result 1, running device 2 runs the target program based on sharded data set 2 to obtain program running result 2, and running device 3 runs the target program based on sharded data set 3 to obtain program running result 3. After program running result 1, program running result 2, and program running result 3 are subjected to inverse sharding processing, a program running result obtained by a virtual running device running the target program based on the original data set can be obtained.

[0228] Therefore, the operating device 1 , the operating device 2 , and the operating device 3 that run the same program can be regarded as one virtual operating device.

[0229] Specifically on the actual running device, each running device cannot obtain the plaintext data in the original data set required to run the target program, and no sensitive information will be leaked.

[0230] It is understandable that, in order to protect the security of sensitive information and prevent devices from obtaining plaintext data, the above method process fragments the original data set, and N running devices respectively run the same target program based on different fragmented data sets. Under the premise that the target program can run normally and obtain the correct target program running results, each running device actually running the target program cannot obtain any plaintext data in the original data set, and can only obtain the fragment value. The fragment value itself has no actual meaning and does not contain any information (for example, sensitive information). The intermediate running results of the target program obtained based on the fragment value also have no actual meaning and do not contain any information.

[0231] Since in the above-mentioned specific sharding operation algorithm, there are some basic operations corresponding to the operation logic that require N running devices to interact with random numbers to encrypt the sharding value, therefore, based on the above-mentioned method flow, this specification also provides an optional embodiment.

[0232] In the case that N running devices need to exchange shard values ​​for any variable in the target program, the shard values ​​of the variable stored locally can be encrypted with random numbers respectively.

[0233] Therefore, based on the above method flow, in the process of N running devices running the target program respectively, for each variable in the target program, when the shard value of the variable is encrypted with a random number for the first time, a random number can be requested from the random number provider and assigned to the variable; when the shard value of the variable is encrypted with a random number again, the random number assigned to the variable can be reused; when the shard value of the variable is subjected to a mathematical transformation and the transformation result is encrypted with a random number, the random number assigned to the variable can also be reused.

[0234] When performing random number encryption on the transformed result of the mathematical transformation of the slice value of the variable, the random number assigned to the variable may be reused, the same mathematical transformation performed on the random number, and the transformed random number used to encrypt the transformed result of the slice value. Alternatively, the random number assigned to the variable may be directly reused to encrypt the transformed result of the slice value. Mathematical transformations may include transposition, matrix slicing, multiplication by coefficients, and the like.

[0235] 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 specifically generate a set of random numbers, including three random numbers that meet specific conditions, shard each of the three random numbers, and send each of the N shard values ​​of each random number to N running devices, respectively, for encryption of the same variable on the N running devices.

[0236] After requesting a random number from a random number provider and assigning it to a variable, if the variable's slice value requires at least one random number encryption 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 reuse the locally stored random number assigned to the variable.

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

[0238] It should be noted that, in an optional embodiment, since the random number provider usually generates a set of random numbers for two sharded data, therefore, when reused, if there are reusable random numbers for both data, the random number corresponding to at least one of the data can be reused, avoiding the use of two exactly the same sets of random numbers (each set contains 3 random numbers) in different operations, further avoiding the risk of cracking random number encryption.

[0239] To facilitate understanding, an example is provided below.

[0240] For the first multiplication operation between data X and data Y, the 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 value to perform random number encryption.

[0241] For the second multiplication between data X and data Y, the random numbers must meet specific conditions. If a and b are reused, c must also be reused. To avoid the risk of cracking the random number encryption by reusing the entire set of random numbers (a, b, c), only a or b can be reused, and the other random numbers can be regenerated. For example, (a, d, e) satisfies a+d=e; or (f, b, g) satisfies f+b=g for random number encryption.

[0242] For the first multiplication operation between data X and data Z, a new set of random numbers can be requested; or a in the above random number can be reused to regenerate other random numbers to obtain (a, x, y) satisfying a+x=y for random number encryption.

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

[0244] In addition, based on the above method flow, 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.

[0245] The at least two threads on each running device may be multiple threads obtained by splitting the threads. The overhead of splitting the threads is small and can be ignored.

[0246] Sharing the execution of the target program may specifically involve sharing different tasks in the target program, such as interactive tasks, computational tasks, and the like.

[0247] For ease of understanding, based on the above-mentioned specific sharding operation algorithm, when running the target program, N running devices may need to interact with sharding values, which can be regarded as an interactive task; they may also need to perform operations based on sharding values, which can be regarded as an operation task.

[0248] For interactive tasks, when N running devices need to interact with the shard values ​​of any variable in the target program, the locally stored shard values ​​of the variable are encrypted with random numbers respectively; the target program can include at least two interactive tasks for interacting with the encrypted shard values; and at least two threads of each running device can share different interactive tasks of the target program.

[0249] The thread identifiers of the at least two threads of each running device may be specified by the target program. Since the target program run by the N running devices is the same, the thread identifiers of the threads sharing the same interactive task for different running devices are also the same.

[0250] To facilitate understanding, an example is given below.

[0251] In the target program, for the multiplication operation between data X and data Y, there is an interactive task involving encrypted slice values. Based on the target program, the execution device creates a thread to share this interactive task and designates the thread as root1. Each of the N execution devices then has a thread identified as root1 and shares this interactive task.

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

[0253] That is to say, threads with the same identifier specified by the target program between different running devices share the same interactive tasks in the target program.

[0254] In addition, for different interactive tasks, N running devices can use the same channel to interact with each other, which requires differentiation of the interactive tasks.

[0255] Therefore, during specific interaction, N running devices can specifically interact with each other to specify data; the specified data may include the variable shard value to be interacted (i.e., the shard value encrypted with a random number) and the thread identifier that sends the variable shard value, so as to determine whether the thread with the same identifier in other running devices receives the variable shard value.

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

[0257] For example, N running devices can exchange designated data containing the root1 identifier and designated data containing the root2 identifier. After receiving the designated data, the running device can determine the thread that receives and processes the designated data (i.e., the thread with the same identifier) ​​based on the thread identifier contained in the designated data. Specifically, after the running device receives the designated data containing the root2 identifier, the thread identified as root2 on the running device receives and processes the designated data.

[0258] Since different running devices have the same thread identifier specified by the target program and share the same interactive task in the target program, before sending the specified data, different running devices do not need to exchange the thread identifiers that need to be communicated in advance. Instead, they can directly use their own thread identifiers as the thread identifiers received in other running devices, thereby reducing network overhead.

[0259] In addition, 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 specific specified data may also carry an additional sequence identifier.

[0260] For example, the specified data may carry not only the thread identifier root1 but also the sequence identifier 3, indicating the third interactive task on thread root1. After receiving the specified data, other running devices can use the thread identifier to determine the thread that shares the same interactive task and further determine the third interactive task on the thread. They can then use the variable slice values ​​in the specified data for the third interactive task to complete the operation.

[0261] In this embodiment, there is no need to interact in advance 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, which reduces the network communication overhead and improves the program running speed of the running devices.

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

[0263] In a more specific model training scenario, there is a need for multiple data holders to jointly train the model to improve training effectiveness. This requires multiple data holders to combine their own sample data to jointly train the model. Specifically, different data holders can store sample data for different users, or different data holders can store different sample feature data for the same user. To protect information security, each data holder does not want their stored user sample data (which carries sensitive information) to be transferred out of the domain, nor does they want the device running the model training program to be able to obtain the plaintext user sample data.

[0264] Based on the above method flow, this embodiment can be implemented through the following steps. Figure 5 The figure shows a flow chart of a method for running a model training program provided in this specification.

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

[0266] S201: N running devices perform sharding processing on the locally stored user samples respectively, and exchange the 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, that is, the sharded data set.

[0267] To facilitate understanding, two examples are provided below.

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

[0269] The two running devices then perform sharding on each feature of each sample data. Running device 1 obtains a1 and a2, and running device 2 obtains b1 and b2. After interaction, running device 1 has the sharded data set {X = a1 (user 1), X = b1 (user 2)}, and running device 2 has the sharded data set {X = a2, X = b2}.

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

[0271] The two running devices then perform sharding on each feature of each sample data. Running device 1 obtains a1 and a2, and running device 2 obtains b1 and b2. After interaction, running device 1 has the sharded data set {X = a1, Y = b1}, and running device 2 has the sharded data set {X = a2, Y = b2}.

[0272] Obviously, for both horizontal federated learning 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 data set.

[0273] S202: Each running device runs a model training program based on the sharded data set. Based on pre-configuration, after the program running results based on the sharded data set of the multiple running devices are desharded, the desharded processing results obtained are equal to the program running results based on the original data set.

[0274] Among them, the model training program may involve operations such as derivation, summation, loss calculation, and parameter update. Based on the above analysis, these operations can be split into multiple basic operations, so that the above-mentioned specific sharding operation algorithm can be used to achieve the effect of "the program running results of multiple devices based on sharded data sets are equal to the program running results based on the original data set after inverse sharding processing."

[0275] While the sharded data set contains all samples (all data) from the original data set, each feature value in each sample is a shard value and has no meaning. Therefore, the running device cannot obtain sensitive information (e.g., user privacy information) contained in the user sample.

[0276] S203: The designated device aggregates the model training program running results of N running devices, performs inverse sharding processing on the N model training program running results, and uses the obtained processing results as the running results obtained by the model training program based on the original data set.

[0277] The designated device can be any one of the N running devices, or any device outside the N running devices. The inverse sharding processing result is the result of model training based on the original data set (all user samples of the N data holders).

[0278] Among them, each of the N running devices cannot obtain the plaintext feature data of any user sample in the original data set, and can only obtain the feature data shard value that has no practical meaning and does not contain any information (such as sensitive information). The intermediate results obtained based on the shard value 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).

[0279] This specification also provides a system embodiment.

[0280] like Figure 6 , which is a structural diagram of a program running system provided in this specification, including N running devices, namely running device 1, running device 2, running device 3, . . . , running device N.

[0281] In the program running system, the value of each data in the original data set may be sliced ​​in advance to obtain N slice values ​​of each data; the original data set may include data used to assign values ​​to variables in the program.

[0282] N shard data sets can also be determined in advance; determining each shard data set can include: reassigning each data in the original data set using a shard value of the data; the value of the same data in the N shard data sets corresponds one-to-one to the N shard values ​​of the same data.

[0283] In addition, 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 for operation is equal to: after each group of slice values ​​of the arbitrary set of values ​​are input into the basic operation unit for separate operation, the processing result is obtained after inverse slicing processing is performed on all the obtained operation results.

[0284] Each running device in the program running system can be used to run the target program based on the sharded data set under specified circumstances.

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

[0286] Among them, N running devices respectively run the target program based on different shard data sets.

[0287] The specified situation may include: the variable attribute sets predefined by N operating devices respectively meet consistency; a variable attribute includes a variable symbol and a variable data type.

[0288] In the case where N running devices need to exchange shard values ​​for any variable in the target program, each running device can also be used to encrypt the shard value of the variable stored locally with a random number; when the N running devices are running the target program respectively, each running device is used to: for each variable in the target program, when the shard value of the variable is encrypted with a random number for the first time, request a random number from the random number provider and assign it to the variable; when the shard value of the variable is encrypted with a random number again, reuse the random number assigned to the variable.

[0289] Each operating device may also be configured to reuse the random number assigned to the variable when performing random number encryption on a transformation result obtained by mathematically transforming the slice value of the variable.

[0290] Each running device may also be configured to: after requesting a random number from a random number provider and assigning it to the variable, if the variable's slice value needs to be encrypted with a random number at least once in the target program, locally store the random number assigned to the variable. When the variable's slice value is encrypted with a random number again, the locally stored random number assigned to the variable is reused.

[0291] When N running devices need to interact with shard values ​​for any variable in the target program, each running device can also be used to encrypt the shard values ​​of the variable stored locally with random numbers; the target program can include at least two interactive tasks for interacting with the encrypted shard values; and at least two threads of each running device share different interactive tasks of the target program.

[0292] Among them, each thread identifier in at least two threads of each running device is specified by the target program; threads with the same identifier specified by the target program between different running devices share the same interactive task in the target program; different interactive tasks can use the same channel to interact with specified data; the specified data may include the variable slice value to be interacted and the thread identifier that sends the variable slice value, so as to facilitate determining whether the thread with the same identifier in other running devices receives the variable slice value.

[0293] The data in the original data set can be distributedly stored on N running devices; the N running devices can be specifically used to: perform sharding processing on the locally stored data values ​​respectively and interact with each other to process the results, so that each running device obtains a shard value for each data in the original data set.

[0294] The program execution system may further include a target device; data in the original data set may be stored on the target device; and the target device may be used to send the N fragmented data sets to the N execution devices respectively.

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

[0296] The program running system may further include a designated device; the designated device may be configured to receive N variable attribute sets predefined by N running devices, and determine that the variable attributes included in the N variable attribute sets are the same.

[0297] The operating device may also be specifically configured to: receive N variable attribute sets predefined by other N-1 operating devices, and determine that the variable attributes included in the N variable attribute sets are the same.

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

[0299] The explanation of the above system embodiment can be found in the above method flow.

[0300] The above is only a specific implementation of the embodiment of this specification. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the embodiment of this specification. These improvements and modifications should also be regarded as protection for the embodiment of this specification.

Claims

1. A program running method, comprising: Shard the value of each data in the original data set to obtain N shard values ​​for each data; The original data set includes data used to assign values ​​to variables in the program; Determine N shard data sets; Determining each shard data set includes: re-assigning a value to each data in the original data set using a shard value of the data; the values ​​of the same data in the N shard data sets correspond one to one with the N shard values ​​of the same data; Under specified circumstances, N running devices respectively run the same target program based on different shard data sets; the specified circumstances include: consistency between variable attribute sets predefined by the N running devices; a variable attribute includes a variable symbol and a variable data type; different running devices use their own thread identifiers as thread identifiers received by other running devices, and threads with the same identifier specified by the target program between different running devices share the same interactive task in the target program; the interactive task is used to exchange encrypted shard values ​​for the same data with threads with the same identifier in other running devices; Among them, 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 for operation is equal to: after each group of slice values ​​of the arbitrary set of values ​​are input into the basic operation unit after configuration for separate operation, the processing result obtained after inverse slicing processing is performed on all the obtained operation results.

2. The method according to claim 1, wherein the data in the original data set is distributedly stored on N running devices; The sharding process is performed on the value of each data in the original data set to obtain N shard values ​​of each data, including: The N running devices respectively perform sharding processing on the locally stored data values ​​and exchange processing results with each other, so that each running device obtains a shard value for each data in the original data set.

3. The method according to claim 1, wherein the data in the original data set is stored on the target device; The method further comprises: The target device sends N sharded data sets to N running devices respectively. 4 . The method according to claim 1 , wherein the original data set further includes data used to assign values ​​to constants in a program. 5 . The method according to claim 1 , wherein each running device shares the execution of the target program based on at least two threads.

6. The method according to claim 5, further comprising: When the N running devices need to exchange slice values ​​for any variable in the target program, encrypt the slice values ​​of the variable stored locally with random numbers respectively; The target program includes at least two interactive tasks for exchanging encrypted slice values; at least two threads of each running device share different interactive tasks of the target program; wherein each thread identifier of at least two threads of each running device is specified by the target program; Threads with the same identifier specified by the target program between different running devices share the same interactive task in the target program; the different interactive tasks use the same channel to interact with designated data; the designated data includes the variable slice value to be interacted and the thread identifier that sends the variable slice value, so as to facilitate determining whether the thread with the same identifier in other running devices receives the variable slice value.

7. The method according to claim 1, determining whether the variable attribute sets predefined by the N operating devices are consistent with each other, comprises: The designated device receives N variable attribute sets predefined by N running devices respectively, and determines that the variable attributes included in the N variable attribute sets are the same; or Any running device receives N variable attribute sets predefined by other N-1 running devices, and determines that the variable attributes included in the N variable attribute sets are the same.

8. The method according to claim 7, wherein the symbol table predefined by the running device at least includes variable symbols, variable data types, and variable value storage addresses corresponding to the variables predefined by the running device; and the variable attribute set includes the variable symbols and variable data types in the symbol table.

9. A program execution system that pre-slices the value of each data item in an original data set to obtain N slice values ​​for each data item; the original data set includes data used to assign values ​​to variables in the program; Determine N shard data sets; Determining each shard data set includes: re-assigning a value to each data in the original data set using a shard value of the data; the values ​​of the same data in the N shard data sets correspond one to one with the N shard values ​​of the same data; The system includes N running devices, each of which is configured to: run the same target program based on a sharded data set under specified circumstances, wherein the specified circumstances include: consistency between sets of variable attributes predefined by the N running devices; a variable attribute includes a variable symbol and a variable data type; different running devices use their own thread identifiers as thread identifiers received by other running devices, and threads with the same identifier specified by the target program between different running devices share the same interactive task in the target program; the interactive task is used to exchange encrypted shard values ​​for the same data with threads with the same identifier in other running devices; Among them, N running devices run the target program based on different sharded data sets respectively; 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 for operation is equal to: after each group of sharded values ​​of the arbitrary set of values ​​are input into the basic operation unit after configuration for separate operation, the processing result is obtained after inverse sharding processing is performed on all the obtained operation results.

10. The system according to claim 9, wherein the data in the original data set is distributedly stored on N operating devices; The N running devices are used to: respectively perform sharding processing on the locally stored data values ​​and exchange processing results with each other, so that each running device obtains a shard value for each data in the original data set.

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