A program running method and system

By segmenting the data and encrypting it with random numbers, the problem of sensitive information leakage during program execution is solved, and a secure program execution method is achieved.

CN112818337BActive Publication Date: 2026-02-17ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

During program execution, when the device acquires user samples and tags, there is a risk of sensitive information leakage, and there is an urgent need for a program execution method that ensures information security.

Method used

By fragmenting the original data set, N fragmented data sets are generated. The target program is then run on N devices. By using a specific fragmentation algorithm and random number encryption technology, each device can only obtain the fragmented values ​​and cannot obtain the plaintext data of the original data set.

Benefits of technology

By obtaining the results of the target program's execution, sensitive information was protected from leakage, thus achieving information security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112818337B_ABST
    Figure CN112818337B_ABST
Patent Text Reader

Abstract

The specification discloses a program running method and system. The method comprises: performing sharding processing on the value of each data in an original data set to obtain N sharding values of each data; determining N sharding data sets; under a specified condition, N running devices run a target program based on different sharding data sets respectively; through pre-configuration, for each basic operation unit corresponding to the target program, the operation result obtained by inputting an arbitrary group of values into the basic operation unit for operation is equal to: the processing result obtained by performing inverse sharding processing on all operation results obtained by respectively inputting each group of sharding values of the arbitrary group of values into the basic operation unit for respective operation; when performing random number encryption on the sharding value of the variable for the first time, a random number is requested from a random number provider and assigned to the variable; when performing random number encryption on the sharding value of the variable again, the random number assigned to the variable is reused.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

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

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

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

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

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

[0006] A program running method, comprising:

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

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

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

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

[0011] In the case that the N running devices need to interact the slice values of any variable in the target program, the slice values of the variable stored locally are encrypted by random numbers respectively; in the process of respectively running the target program, for each variable in the target program, when the slice values of the variable are encrypted by random numbers for the first time, a random number is requested from a random number provider and assigned to the variable; when the slice values of the variable are encrypted by random numbers again, the random number assigned to the variable is reused.

[0012] A program running system, which pre-processes the values of each data in an original data set to obtain N slice values of each data; the original data set includes data used for assigning values to variables in a program; N slice data sets are determined; each slice data set is determined by re-assigning one slice value of each data in the original data set to the data; the values of the same data in the N slice data sets correspond to the N slice values of the same data one by one.

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

[0014] The N running devices run the target program based on different slice 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 for operation is equal to the processing result obtained by inversely processing all the operation results obtained by respectively inputting each set of slice values of the any set of values into the basic operation unit for operation;

[0015] In the case that the N running devices need to interact the slice values of any variable in the target program, each running device is configured to encrypt the slice values of the variable stored locally by random numbers; in the process of respectively running the target program, each running device is configured to: for each variable in the target program, when the slice values of the variable are encrypted by random numbers for the first time, a random number is requested from a random number provider and assigned to the variable; when the slice values of the variable are encrypted by random numbers again, the random number assigned to the variable is reused.

[0016] The above technical solution enables the N running devices to run the target program based on the slice data sets and obtain the target program running result based on the original data set. Therefore, under the premise of obtaining the target program running result based on the original data set, each running device can only obtain the slice values in the slice data set and cannot obtain any plaintext data in the original data set, so as to prevent the sensitive information in the original data set from being obtained, thereby protecting information security. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the drawings used in the description of the embodiments or 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 those skilled in the art, other drawings can be obtained based on these drawings.

[0018] Figure 1 This is a flowchart illustrating a program execution method provided in an embodiment of this specification;

[0019] Figure 2 This is a schematic diagram illustrating the principle of a method for determining a fragmented data set provided in the embodiments of this specification;

[0020] Figure 3 This is a schematic diagram illustrating the principle of another method for determining a fragmented data set provided in the embodiments of this specification;

[0021] Figure 4 This is a schematic diagram of the structure of a virtual operating device provided in the embodiments of this specification;

[0022] Figure 5 This is a flowchart illustrating a model training program execution method provided in the embodiments of this specification;

[0023] Figure 6 This is a schematic diagram of the structure of a program running system provided in the embodiments of this specification. Detailed Implementation

[0024] 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 with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art should fall within the scope of disclosure.

[0025] When a device runs a program, it typically performs calculations on a data set according to the program's operational logic, obtaining the results as the program's output. This data set includes, at a minimum, data used to assign values ​​to program variables.

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

[0027] For example, in a model training scenario, a device running a model training program needs to obtain a plurality of user samples and corresponding labels for operation, which means that the device can obtain user privacy information based on the plurality of user samples and the corresponding labels.

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

[0029] The present specification provides a program running method. Since a single device usually obtains all plaintext data in a data set operated by a program (for the sake of description, the data set containing all plaintext data is referred to as an original data set) when running the program, the program running method provided by the present specification can perform sharding processing on the value of each plaintext data in the original data set to obtain a plurality of sharded values. Then, a plurality of sharded data sets containing all data (values being sharded values) in the original data set can be obtained, and the obtained plurality of sharded data sets can be deployed on a plurality of devices respectively, so that the devices can run the same program based on the sharded data sets.

[0030] When running the program specifically, the program can be executed by a specific sharding operation algorithm for the sharded data sets, so that the program running results of the plurality of devices based on the sharded data sets after inverse sharding processing are equal to the program running result based on the original data set.

[0031] For the sake of understanding, a specific example is given below.

[0032] The original data set contains data X with a value of a. Sharding processing on data X can be to split the value a into N parts, specifically a1, a2, a3,..., aN. N . Among them,

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

[0034] And the program to be run is F(X), which is configured and modified based on a specific sharding operation algorithm to obtain F'(X), so that Where each device can calculate F'(a i ) based on the local data sharded value a i .

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

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

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

[0038] When executing the program, any operation can be included in the program, such as addition, subtraction, multiplication, division, derivation, square root, etc. Each operation needs to be performed on the device running the program, which can be executed by the computing unit of the device, such as the central processing unit (CPU).

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

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

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

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

[0043] Premise 2: Any operation included in the program will be decomposed into basic operation operations that can be executed by the computing unit.

[0044] The computing unit of the device can usually only execute part of the basic operation operations, such as addition, multiplication, and logical operations such as and or not. Any operation included in the program needs to be executed by the computing unit, which is to convert any operation into one or more basic operation operations that the computing unit can implement.

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

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

[0047] For more complex operations, they can be converted into one or more basic operation operations by some approximation methods, such as Newton iteration method, dichotomy method, Taylor expansion formula, etc. Since the precision of the data stored in the device itself is limited, the precision of the approximation value can be improved to be higher than the precision of the operation result on the device by using these approximation methods, so as to reduce the precision of the operation result; or in the case of using the original data for forward operation, the difference between the inverse operation result of the approximation value and the original data cannot be represented by the device, so as to use the approximation value as the forward operation result.

[0048] The following gives two specific examples of complex operations.

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

[0050] It should be noted that the derivative value obtained by this calculation method is an approximation value, but since the precision of the data on the device itself is limited, the precision of the derivative value obtained by this calculation method can be higher than the precision of the derivative value on the device by controlling the size of Δx.

[0051] For example, in the case where the precision of the derivative value data is 0.1, by continuously reducing Δx and calculating multiple times, the derivative value can be calculated to be The first decimal of the multiple operation results remains unchanged, so that the derivative value with a precision of 0.1 can be obtained.

[0052] In the second example, the square root operation can be calculated by using the dichotomy method. In a specific calculation In the operation of the square root of 2, the following calculation can be performed.

[0053] 1*1=1<2

[0054] 1.5*1.5=2.25>2

[0055] 1.25*1.25=1.5625<2

[0056] 1.375*1.375=1.890625<2

[0057] 1.4375*1.4375=2.06640625>2

[0058] 1.40625*1.40625=1.9775390625<2

[0059] 1.421875*1.421875=2.021728515625>2

[0060] 1.4140625*1.4140625=1.9995727539062...

[0061] In the case where the difference between the product and 2 is less than the precision 0.01 of the operation result, the device cannot represent the error value 0.00042... for the operation result, and the square operation result of 1.4140625 can actually be represented as 2, so it can be determined that the operation result is 1.41.

[0062] Through the analysis of the above two premises, any operation included in the program can be converted into one or more basic operation operations that can be executed by the calculation unit if the operation can be executed by the device.

[0063] If each basic operation operation of the calculation unit satisfies "the inverse slicing processing result of multiple basic operation results based on the sliced data set is equal to the basic operation result based on the original data set" based on a specific slicing operation algorithm, since any operation operation in the program is implemented by one or more basic operation operations, any operation operation in the program also satisfies "the inverse slicing processing result of multiple operation results based on the sliced data set is equal to the operation result based on the original data set".

[0064] Further, the final running result of the program is obtained through a plurality of operation operations in the program, and the program running result also satisfies "the inverse sharding processing result obtained after the plurality of program running results of the plurality of devices based on the plurality of sharded data sets is subjected to inverse sharding processing is equal to the program running result based on the original data set".

[0065] Therefore, if "the inverse sharding processing result obtained after the plurality of program running results of the plurality of devices based on the plurality of sharded data sets is subjected to inverse sharding processing is equal to the program running result based on the original data set", it is necessary to make each basic operation operation of the calculation unit satisfy "the inverse sharding processing result obtained after the plurality of basic operation results based on the plurality of sharded data sets is subjected to inverse sharding processing is equal to the basic operation result based on the original data set".

[0066] Before explaining the configuration of the basic operation operation based on the specific sharding operation algorithm, it is first necessary to explain the specific operation of the sharding processing. When performing sharding processing, it is necessary to distinguish between two cases of participating in arithmetic operation and participating in logical operation.

[0067] For the value of the same data (for the convenience of description, referred to as the initial value), in the case of needing to participate in arithmetic operation, the split sharded values need to satisfy "the sum of each sharded value is equal to the initial value"; and in the case of needing to participate in logical operation, the split sharded values need to satisfy "the result of exclusive or of each sharded value is equal to the initial value".

[0068] For example, for data X with a value of a, in the case of needing to participate in arithmetic operation, the split sharded values a1, a2, a3,..., a N need to satisfy And in the case of needing to participate in logical operation, the split sharded values a N+1 , a N+2 , a N+3 ,..., a 2N need to satisfy In this specification represents an exclusive or operation.

[0069] The above sharding processing 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 a N is calculated again so as to satisfy the above condition Or

[0070] In addition, the sharded values satisfying different conditions can be converted to each other based on existing manners. Therefore, in the case of containing arithmetic operations and logical operations in the program, the sharded values can be converted in real time according to the requirements, and two different sharding processes are not required to obtain two different sets of sharded values.

[0071] The inverse sharding processes corresponding to the two sharding processes are also different. The addition operation is for the arithmetic operation, and the XOR operation is for the logical operation.

[0072] Since the sharding process is a desensitization process, the device cannot obtain the sensitive information contained in the sharded data under the premise of completing the calculation. Therefore, the sharding process can be performed on data that needs to hide sensitive information and protect information security, such as the input of the program, part of the constant, and the value of part of the variable.

[0073] However, there are also data in the program that do not need to protect information security, such as part of the constant, part of the weight, and part of the fixed value. These data do not contain sensitive information, and therefore do not need to be sharded.

[0074] Therefore, the data participating in the operation in the program includes data that have been sharded and data that have not been sharded.

[0075] For ease of understanding, the following configurations of basic operation operations are for two data. It can be understood that for operations including more than two data, the operations can be split into multiple groups of two data basic operations.

[0076] 1. Addition operation.

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

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

[0079] For X+Y performed in the program, device i specifically performs a i +b iAnd based on the following derivation, the sum of the N addition operation results of all N devices is equal to a+b (i.e., the inverse slicing processing result of the N addition operation results based on the sliced data set is equal to the addition operation result based on the original data set).

[0080]

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

[0082] Similarly, based on the following derivation, A is the initial value of the data without slicing processing, and the sum of the N addition operation results of all N devices is equal to a+b (i.e., the inverse slicing processing result of the N addition operation results based on the sliced data set is equal to the addition operation result based on the original data set).

[0083]

[0084] For the addition operation between two data without slicing processing, since neither involves slicing processing nor inverse slicing processing, the addition operation can be normally performed.

[0085] 2. Multiplication operation.

[0086] For the multiplication operation between two data with slicing processing, a set of random numbers can be agreed between the N devices, the sliced values of the two data are encrypted by the random numbers, so that the encrypted data sliced values can be exchanged without leaking the original values and sensitive information of the data, and further specified operations are performed, so that the sum of the specified operation results based on the sliced values of the N devices is equal to the multiplication operation result of the initial values of the two data. The sum of the specified operation results based on the sliced values of all devices is equal to the multiplication operation result based on the initial values.

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

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

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

[0090] The 3 random numbers are also processed by fragmentation, and the following is obtained Where i = 1, 2, 3, …, N, and each fragment value is deployed to N devices, so that device i has α i , β i , δ i .

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

[0092] Step two: each device i performs the specified operation and can use this specified operation result as the multiplication operation result of data X and data Y on this device.

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

[0094]

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

[0096] For multiplication operation between one data without slicing processing and one data with slicing processing, each device can directly determine the product of data value without slicing processing and slicing value as multiplication operation result, based on the following derivation, for example, A is data value without slicing processing, for all N devices, the sum of N multiplication operation results of N devices equals Ab.

[0097]

[0098] Of course, the data value without slicing processing can also be sliced immediately, so that multiplication operation result can be obtained based on the above steps one and two.

[0099] For multiplication operation between two data without slicing processing, since neither involves slicing processing, nor inverse slicing processing, multiplication operation can be executed normally.

[0100] 3, XOR operation.

[0101] For logical operation, slicing value obtained by slicing processing can specifically satisfy "the result of XOR operation between each slicing value equals initial value".

[0102] For XOR operation between two data with slicing processing, each device can directly perform XOR operation on slicing values of two data, to obtain XOR operation execution result. For all devices, the result of XOR operation between XOR operation execution results based on slicing values equals XOR operation execution result based on initial value.

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

[0104] Based on the following derivation, for all N devices, the result of XOR operation between N XOR operation execution results equals (that is, the inverse slicing processing result of N XOR operation execution results based on sliced data set after inverse slicing processing (XOR operation) equals XOR operation execution result based on original data set).

[0105]

[0106] For the exclusive-OR operation between one data without sharding processing and one data with sharding processing, one device can determine the exclusive-OR operation result of the data value without sharding processing and the local shard value, and the other N-1 devices do not perform the operation and directly take the shard value as the exclusive-OR operation result. The exclusive-OR operation result between all devices based on the exclusive-OR operation execution result of the shard value is equal to the exclusive-OR operation execution result based on the initial value.

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

[0108] Based on the following derivation, A is the initial value of the data without sharding processing, and for all N devices, the exclusive-OR operation result of the N exclusive-OR operation execution results is equal to (that is, the exclusive-OR operation execution result based on the shard data set, after inverse sharding processing (exclusive-OR operation), the inverse sharding processing result is equal to the exclusive-OR operation execution result based on the original data set).

[0109]

[0110] Of course, A can also be sharded immediately, and the exclusive-OR operation is directly performed on the shard values of the two data to obtain the exclusive-OR operation execution result.

[0111] For the exclusive-OR operation between two data without sharding processing, since neither of them involves sharding processing, nor inverse sharding processing, the exclusive-OR operation can be normally performed.

[0112] 4. AND operation.

[0113] For the AND operation between two data with sharding processing, a group of random numbers can be agreed between N devices, and the shard values of the two data are encrypted based on the group of random numbers, so that the encrypted data shard values can be interacted without leaking the original value and sensitive information of the data, and further specified operation is performed, so that the specified operation execution result based on the shard value of the N devices after mutual exclusive-OR operation (inverse sharding processing) is equal to the AND operation execution result of the initial values of the two data.

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

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

[0116] Step one: N devices need to agree on a set of random numbers for the AND operation between this data X and data Y, which contains 3 random numbers a, b, d, where a ^ b = d.

[0117] The 3 random numbers are also shard processed to obtain and and each shard value is deployed to N devices, so that device i has a i , b i , d i .

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

[0119] Step two: specify a device to calculate as the AND operation execution result, and the other N-1 devices can calculate as the AND operation execution result.

[0120] Based on the following derivation, for all N devices, the results obtained by the N AND operation execution results after mutual XOR operation are equal to a ^ b (i.e., the inverse shard processing result obtained after the inverse shard processing (XOR operation) of the N specified operation execution results (AND operation execution results for devices) based on the shard data set is equal to the AND operation execution result based on the original data set).

[0121]

[0122] For the AND operation between the unshard processed data and the shard processed data, each device can directly determine the AND operation execution result between the unshard processed data value and the shard value as the AND operation execution result, based on the following derivation, for example, A is the unshard processed data value, for all N devices, the results obtained by the N AND operation execution results after mutual XOR operation are equal to A ^ b (i.e., the inverse shard processing result obtained after the inverse shard processing (XOR operation) of the N specified operation execution results (AND operation execution results for devices) based on the shard data set is equal to the AND operation execution result based on the original data set).

[0123]

[0124] Of course, the data that is not processed by slicing can also be sliced immediately, so that the operation execution result can be obtained based on the above steps one and two.

[0125] For the AND operation between two data that is not processed by slicing, since neither involves slicing processing, nor inverse slicing processing, the AND operation can be executed normally.

[0126] 5. NOT operation.

[0127] The NOT operation can be regarded as an operation on a single data, so for the NOT operation on a data processed by slicing, one device can be designated among the N devices, and the designated device can execute the NOT operation on the sliced value to obtain the NOT operation execution result, and the other N-1 devices can directly take the sliced value as the NOT operation execution result.

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

[0129] Based on the following derivation, for all N devices, the result obtained by performing the XOR operation on the N NOT operation execution results of the N devices is equal to (that is, the inverse slicing processing result obtained by performing the inverse slicing processing (XOR operation) on the N specified operation execution results (NOT operation execution results for devices) based on the sliced data set is equal to the NOT operation execution result based on the original data set).

[0130]

[0131] For the NOT operation on a data that is not processed by slicing, since neither involves slicing processing, nor inverse slicing processing, the NOT operation can be executed normally.

[0132] 6. OR operation.

[0133] For the OR operation between two data processed by slicing, a set of random numbers can be agreed among the N devices, and the sliced values of the two data are encrypted by the random numbers, so that the encrypted data sliced values can be exchanged without leaking the original value and sensitive information of the data, and further specified operation is performed, so that the result obtained by performing the XOR operation (inverse slicing processing) on the specified operation execution results of the N devices based on the sliced values is equal to the OR operation execution result of the initial values of the two data.

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

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

[0136] Step 1: A set of random numbers needs to be agreed upon between N devices for the or operation between data X and data Y this time, which contains 3 random numbers α, β, δ, where α ∧ β = δ.

[0137] The 3 random numbers are also subjected to sharding to obtain and and each shard value is deployed to N devices, so that device i has α i , β i , and δ i .

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

[0139] Step 2: 1 device calculates as the or operation execution result of the specified device, while the other N-1 devices can calculate as the or operation execution result.

[0140] Based on the following derivation, for all N devices, the results of N or operation execution results obtained by mutual XOR operation are equal to a ∨ b (i.e., the inverse sharding processing result obtained after the specified operation execution results of N devices based on shard data sets (or operation execution results for devices) are subjected to inverse sharding processing (XOR operation) is equal to the or operation execution result based on the original data set).

[0141]

[0142] For the or operation between one data without sharding and one data with sharding, each device can perform the specified operation so that the results of the specified operation execution results of N devices based on shard values obtained by mutual XOR operation (inverse sharding processing) are equal to the or operation execution result of the initial values of the two data.

[0143] For example, for data X with value a, after the slicing, the value of data X on device i is a i where i = 1, 2, 3,..., N. The slicing values satisfy The value of the data without slicing is A.

[0144] One device can be designated to perform And the other N-1 devices can perform

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

[0146]

[0147] Of course, the slicing of the data value without slicing can also be performed in real time, so that the or operation execution result can be obtained based on steps one and two above.

[0148] For the or operation between two data without slicing, since neither involves slicing, nor inverse slicing, the or operation can be normally performed.

[0149] Through the above explanation of the specific slicing operation algorithm, for addition operation, multiplication operation, and operation and non-operation, as well as XOR operation, the "inverse slicing result of the multiple basic operation results based on the sliced data set is equal to the basic operation result based on the original data set" can be achieved through the corresponding specified operation or specified operation, so as to achieve "the inverse slicing result of the multiple program running results based on the sliced data set of multiple devices is equal to the program running result based on the original data set".

[0150] The program running method provided in the specification will be explained in detail below in combination with the drawings.

[0151] As shown in Figure 1 , it is a flowchart of a program running method provided in the specification. The method can at least include the following steps S101-S103.

[0152] S101: Slice the value of each data in the original data set to obtain N slicing values of each data.

[0153] The original data set can include data that protects sensitive information requirements, such as data for assigning values to variables in a program, data for assigning values to constants in a program, input data of the program, and the like. The sensitive information contained in the data values can be hidden through the slicing process.

[0154] N is a preset number of devices participating in program execution. N≥2. For ease of description, the device to be involved in program execution is referred to as a running device.

[0155] S102: Determine N slice data sets; determine each slice data set, including: for each data in the original data set, reassign a slice value of the data; the value of the same data in the N slice data sets corresponds to the N slice values of the same data one by one.

[0156] The above S101 and S102 are explained comprehensively.

[0157] The storage location of the original data set can have at least two embodiments, and the specific way of determining N slice data sets is also different.

[0158] Embodiment one: the original data set can be stored on a target device other than the N running devices.

[0159] The target device can be any storage device other than the N running devices, which stores all data in the original data set. The target device can perform slicing processing on each data in the original data set to obtain N slice values, thereby creating N slice data sets, wherein each slice data set can contain all data in the original data set, and the N slice values are re-assigned to the data in the N slice data sets, so that the value of the same data in the N slice data sets corresponds to the N slice values of the same data one by one.

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

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

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

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

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

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

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

[0167] For ease of understanding, in an optional embodiment, as shown in Figure 3 Another principle diagram of a shard data set determination method provided by the present specification is provided, which includes device 1 and device 2.

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

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

[0170] For the above case two, the present specification further provides a specific embodiment, which specifically limits the interaction between the running devices and the form of the shard data set.

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

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

[0173] In a case where any one of the running devices creates a variable in the symbol table according to local data, the running device can generate a corresponding variable name, a variable data type, and a variable value storage address. Meanwhile, the data can be processed by slicing, one of the sliced values is selected to assign to the variable in the symbol table, and the variable name, the variable data type, and the other N-1 sliced values of the variable are sent to the other N-1 running devices, so that each of the other N-1 running devices can obtain the variable name, the variable data type, and one sliced value, so as to create a variable with the same variable name and the same variable data type in the local symbol table, and assign the obtained one sliced value.

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

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

[0176] The device 1 can create a variable X in the local symbol table according to the local stored data X, the variable name is X, the variable data type is integer data, and the variable value storage address can be specified by the device. The device 1 can process a by slicing to obtain sliced values a1 and a2, and assign a1 to the variable X in the symbol table, specifically, a1 can be written back to the variable value storage address corresponding to the variable X.

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

[0178] Similarly, the device 2 creates a variable Y in the local symbol table, and assigns a value b2 to the variable Y; the device 1 creates a variable Y in the local symbol table according to the information sent by the device 2, and assigns a value b1 to the variable Y.

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

[0180] It should be noted that there cannot be two variables with the same name in the same symbol table. Therefore, before actual interaction, a variable name conflict check needs to be performed between the N running devices, so that after interaction, there will be no two variables with the same name in the symbol table of any running device.

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

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

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

[0184] After S102, the N running devices respectively deploy fragmented data sets, and can run the program according to the locally deployed fragmented data sets.

[0185] The S103 will be explained from four aspects respectively.

[0186] 1. Specified condition.

[0187] The specified condition can be a condition in which the premise condition for the N running devices to run the target program specified by the method flow is met.

[0188] In an alternative embodiment, the specified condition can be that N running devices complete deployment of the sharded data set and the target program. For example, after determining that each running device is deployed with the sharded data set and the target program, the target program can be run based on the sharded data set.

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

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

[0191] Therefore, in order to ensure that the N running devices can successfully run the target program, and that there is a sharded value of each variable on each running device, the specified condition can be that the consistency between the variable attribute sets predefined by the N running devices is met. One variable attribute can include a variable symbol and a variable data type. Specifically, the specified device can receive N variable attribute sets predefined by the N running devices, and determine that the variable attributes contained in the N variable attribute sets are the same; or any running device can receive N-1 variable attribute sets predefined by other N-1 running devices, and determine that the variable attributes contained in the N variable attribute sets are the same; or each running device can receive N-1 variable attribute sets predefined by other N-1 running devices, and determine that the variable attributes contained in the N variable attribute sets are the same.

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

[0193] 2. The target program.

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

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

[0196] For ease of understanding, a specific example can be given.

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

[0198] Therefore, any running device can run the target program based on the data shard value in the shard data set (which contains all the data in the original data set).

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

[0200] For ease of understanding, a specific example can be given.

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

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

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

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

[0205] 3. Pre-configuration.

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

[0207] For example, for multiplication operation, it can be regarded as a multiplication operation unit. Based on the above-mentioned specific slice operation algorithm, any group of values is input into the multiplication operation unit configured with the specific slice operation algorithm to perform operation, and the obtained operation result is output, which is equal to: each group of slice values of the any group of values is input into the multiplication operation unit configured with the specific slice operation algorithm to perform operation respectively, and then the processing result obtained by performing inverse slice processing on all the output operation results is obtained.

[0208] Among them, in the configured multiplication operation unit, for the input of two slice-processed data, steps one and two corresponding to multiplication operation in the above-mentioned specific slice operation algorithm can be specifically performed. For other cases, for example, inputting two data without slice processing or inputting one slice-processed data and one data without slice processing, multiplication operation can be directly performed.

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

[0210] Embodiment one: configuring the operation logic corresponding to the base operation in the instruction set of the running device.

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

[0212] Therefore, the pre-configuration can specifically be that for each base operation unit, the operation instruction corresponding to the base operation unit in the system instruction set is determined; and in the operating system, the operation logic corresponding to the determined operation instruction is configured based on the above-mentioned specific slice operation algorithm.

[0213] In the process of specifically running the target program, for any base operation unit corresponding to the target program, the operation instruction corresponding to the base operation unit in the configured instruction set of the running device can be determined in the compilation process to obtain the operation logic corresponding to the base operation unit in the above-mentioned specific slice operation algorithm.

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

[0215] Embodiment two: configuring the operation logic corresponding to the basic operation in the computing unit of the running device.

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

[0217] Therefore, the pre-configuration can be to configure the operation logic corresponding to each basic operation in the computing unit of the running device based on the specific slicing operation algorithm. For example, for the configured computing unit, the multiplication operation logic in the computing unit is configured to: for the input of two data processed by slicing, the first step and the second step corresponding to the multiplication operation in the specific slicing operation algorithm can be executed; for the input of two data not processed by slicing, or the input of one data processed by slicing and one data not processed by slicing, the multiplication operation can be directly executed.

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

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

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

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

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

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

[0224] Variables that have not undergone fragmentation are not of type ashr, so there is no need to determine the variable based on the symbol table, and the value is the initial value, thus distinguishing between unfragmented and fragmented variables.

[0225] 4. Program execution results.

[0226] After the target program is run on N running devices based on the fragmented data set and the program execution results are obtained for each device, the target program can be considered to have completed execution. However, it should be noted that when it is necessary to obtain the program execution results of the target program based on the original data set, it is necessary to obtain the program execution results of the N running devices and then perform inverse fragmentation processing.

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

[0228] For ease of understanding, such as Figure 4 The diagram shown is a structural schematic of a virtual operating device provided in this specification. It includes three operating devices: operating device 1, operating device 2, and operating device 3.

[0229] The original dataset is fragmented to obtain fragmented dataset 1, fragmented dataset 2, and fragmented dataset 3. Running device 1 runs the target program based on fragmented dataset 1 to obtain program execution result 1; running device 2 runs the target program based on fragmented dataset 2 to obtain program execution result 2; and running device 3 runs the target program based on fragmented dataset 3 to obtain program execution result 3. After inverse fragmentation, program execution results 1, 2, and 3 can be used to obtain the program execution result obtained by a virtual running device running the target program based on the original dataset.

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

[0231] And to the actual running equipment, each running equipment cannot obtain the plaintext data in the original data set required by the running target program, and thus will not leak any sensitive information.

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

[0233] Since there is a fragmented value in the above specific fragmentation operation algorithm that requires N running devices to interact with random number encryption in the operation logic corresponding to part of the basic operation, based on the above method flow, the present specification also provides an optional embodiment.

[0234] In the case where N running devices need to interact with the fragmented value of any variable in the target program, the fragmented value of the variable stored locally can be encrypted with a random number.

[0235] Therefore, based on the above method flow, during the process of N running devices running the target program respectively, for each variable in the target program, when the fragmented 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 fragmented value of the variable is encrypted with a random number again, the random number assigned to the variable can be reused; when the transformed result obtained by mathematical transformation of the fragmented value of the variable is encrypted with a random number, the random number assigned to the variable can also be reused.

[0236] When the transformed result obtained by mathematical transformation of the fragmented value of the variable is encrypted with a random number, the random number assigned to the variable can be reused, the same mathematical transformation can be performed on the random number, and the transformed random number can be used to encrypt the transformed result of the fragmented value; or the random number assigned to the variable can be directly reused to encrypt the transformed result of the fragmented value. The mathematical transformation can be transposition, matrix cutting, multiplication by a coefficient, etc.

[0237] The random number provider can be a trusted third party providing the random numbers. Based on the specific slicing operation algorithm, the random number provider can specifically generate a set of random numbers, wherein three random numbers satisfy a specific condition, and the three random numbers are respectively sliced, and the N sliced values of each random number are respectively sent to the N running devices for encryption of the same variable on the N running devices.

[0238] After requesting a random number from the random number provider and assigning the random number to the variable, if the sliced value of the variable still needs to be encrypted by at least one random number 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.

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

[0240] It should be noted that in an optional embodiment, since the random number provider usually generates a set of random numbers for two sliced data, when the random numbers can be reused, at least the random number corresponding to one of the two data can be reused to avoid using two sets of the same random numbers (each set containing three random numbers) in different operations, and further avoid the risk of cracking the random number encryption.

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

[0242] 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) to satisfy a+b=c. After slicing a, b, and c, each running device uses the sliced value for random number encryption.

[0243] For the second multiplication operation between data X and data Y, since the random number needs to satisfy a specific condition, if a and b are reused, c must be reused. To avoid reusing the entire set of random numbers (a, b, c) and causing the risk of cracking the random number encryption, only a or b can be reused, and the other random numbers are regenerated, for example, (a, d, e) satisfies a+d=e; or (f, b, g) satisfies f+b=g for random number encryption.

[0244] For the first multiplication operation between data X and data Z, a set of random numbers can be requested again; or a can be reused from the above random numbers, and the other random numbers are regenerated to obtain (a, x, y) that satisfies a+x=y for random number encryption.

[0245] And for the first multiplication operation between data Y and data Z, a set of random numbers can be requested again; b or x in the random numbers above can be reused; b and x in the random numbers above can be reused to obtain z = b + x, since z is not used in the previous operation, thus avoiding using exactly the same two sets of random numbers in different operations.

[0246] In addition, based on the above method process, the specification also provides another alternative embodiment, wherein each running device can share the execution of the target program based on at least two threads, so as to improve the program execution efficiency of the running device.

[0247] The at least two threads on each running device can be a plurality of threads obtained by splitting threads. The overhead of splitting threads is small and can be ignored.

[0248] Sharing the execution of the target program can be sharing different tasks in the target program, such as interaction tasks, operation tasks, etc.

[0249] For ease of understanding, based on the above specific slicing operation algorithm, the N running devices may need to interact with the slicing values when running the target program, which can be regarded as interaction tasks; or may need to operate based on the slicing values, which can be regarded as operation tasks.

[0250] And for the interaction task, in the case where the N running devices need to interact with the slicing values of any variable in the target program, the slicing values of the variable stored locally are encrypted by random numbers; the target program can include at least two interaction tasks for interacting with the encrypted slicing values; at least two threads of each running device can share different interaction tasks of the target program.

[0251] Each thread identifier in the at least two threads of each running device can be specified by the target program. Since the N running devices run the same target program, the thread identifier sharing the same interaction task is also the same for different running devices.

[0252] For ease of understanding, an example is given below.

[0253] For the multiplication operation between data X and data Y in the target program, there is an interaction task for interacting with the encrypted slicing values. Based on the target program, the running device creates a thread to share the interaction task, and specifies the thread identifier as root1. There is a thread identified as root1 on each of the N running devices, and all of them share the interaction task.

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

[0255] That is, different running devices specify the same thread by the target program, and share the same interactive task in the target program.

[0256] In addition, for different interactive tasks, N running devices can use the same channel interaction, which requires distinguishing between interactive tasks.

[0257] Therefore, in specific interaction, N running devices can specifically interact with specified data; the specified data can include the variable shard value to be interacted (i.e. the shard value after random number encryption) and the thread identifier sending the variable shard value, so as to determine that the same thread in other running devices receives the variable shard value.

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

[0259] Because different running devices specify the same thread 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 interact with the thread identifier in advance, but can directly use the identifier of the thread itself as the thread identifier received by other running devices, thereby reducing network overhead.

[0260] For example, between N running devices, specified data containing root1 identifier and specified data containing root2 identifier can be interacted. After receiving the specified data, the running device can determine the thread corresponding to receiving and processing the specified data (i.e. the same thread) according to the thread identifier contained in the specified data. Specifically, after receiving the specified data containing the root2 identifier, the running device can receive and process the specified data by the thread identified as root2 on the running device.

[0261] In addition, because N running devices use the same channel, and the same thread can share multiple interactive tasks, in order to further distinguish different interactive tasks in the same thread, the specific specified data can additionally carry a sequence identifier.

[0262] For example, in addition to carrying the thread identifier root1, the specified data can also carry the sequence identifier 3, indicating the 3rd interactive task on the thread root1. After receiving the specified data, other running devices can determine the thread sharing the same interactive task according to the thread identifier, and further determine the 3rd interactive task on the thread, so that the variable shard value in the specified data can be used for the 3rd interactive task to complete the operation.

[0263] In the embodiment, the threads of the same interactive task shared by different running devices (i.e., the threads of other running devices requiring communication) can be directly determined without the prior interaction between different running devices and the identification of two threads requiring communication, thereby reducing the overhead of network communication and improving the program running speed of the running device.

[0264] For further understanding, an application embodiment is provided below.

[0265] In a more specific model training scenario, there is a demand for multiple data holders to jointly train a model to improve training effect, and multiple data holders need to jointly train a model by integrating their respective sample data. Specifically, different data holders can store sample data of different users, or different data holders can store different sample feature data of the same user. In order to protect information security, each data holder does not want to export the user sample data (carrying sensitive information) stored by itself, and does not want the device running the model training program to obtain the plaintext user sample data.

[0266] Based on the above method flow, the embodiment can be implemented by the following steps. As shown in Figure 5 FIG. 1 is a flowchart of a model training program running method provided by the present specification.

[0267] For ease of description, the number of data holders participating in model training is determined as N, and the target program to be run is a model training program. Each data holder provides a running device, which stores a user sample set of the data holder, and then N running devices run the model training program. The original data set required for successful running of the model training program can include all user samples of N data holders.

[0268] S201: The N running devices respectively perform sharding processing on the locally stored user samples, and interact 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, i.e., a sharding data set.

[0269] For ease of understanding, examples in two cases are provided below.

[0270] 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.

[0271] Then the two running devices perform sharding processing on each feature of each sample data, and the running device 1 obtains a1 and a2, and the running device 2 obtains b1 and b2. After interaction with each other, the running device 1 has a sharded data set {X=a1 (user 1), X=b1 (user 2)}, and the running device 2 has a sharded data set {X=a2, X=b2}.

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

[0273] Then the two running devices perform sharding processing on each feature of each sample data, and the running device 1 obtains a1 and a2, and the running device 2 obtains b1 and b2. After interaction with each other, the running device 1 has a sharded data set {X=a1, Y=b1}, and the running device 2 has a sharded data set {X=a2, Y=b2}.

[0274] Obviously, for the scenarios of horizontal federated learning or vertical federated learning, each running device can obtain the sharded value of each feature of each user sample in the original data set through sharding processing.

[0275] S202: Each running device runs a model training program based on the sharded data set. Based on the pre-configuration, the running results of the multiple programs based on the sharded data sets of the multiple running devices, after inverse sharding processing, are equal to the running result of the program based on the original data set.

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

[0277] And in the sharded data set, although all samples (all data) in the original data set are included, each feature value in each sample is a sharded value and does not have any meaning. Therefore, the running device cannot obtain sensitive information (such as user privacy information) contained in the user sample.

[0278] S203: The specified device aggregates the model training program running results of the N running devices, performs inverse sharding processing on the N model training program running results, and takes the processing result as the running result of the model training program based on the original data set.

[0279] The designated device can be any of the N running devices or any device other than the N running devices. The resulting inverse slicing processing result is the result obtained based on the original data set (all user samples of the N data holders) for model training.

[0280] Each of the N running devices cannot obtain the plaintext feature data of any user sample in the original data set, but can only obtain a feature data slice value that has no actual meaning and does not contain any information (such as sensitive information). The intermediate result obtained based on the slice value also has no actual meaning, thereby protecting the data security and sensitive information security of the original data set (protecting the user samples of each data holder).

[0281] The present specification also provides a system embodiment.

[0282] As shown in Figure 6 The present specification also provides a system embodiment.

[0283] In the program running system, the values of each data in the original data set can be pre-sliced to obtain N slice values of each data. The original data set can include data used to assign values to variables in the program.

[0284] N slice data sets can also be determined in advance. Determining each slice data set can include: for each data in the original data set, reassigning a slice value of the data. The values of the same data in the N slice data sets correspond one-to-one to the N slice values of the same data.

[0285] In addition, by pre-configuration, for each basic operation unit corresponding to the target program, the operation result obtained by inputting any group of values into the basic operation unit for operation is equal to: the processing result obtained by performing inverse slicing processing on all operation results obtained by respectively inputting each group of slice values of the any group of values into the basic operation unit for respective operation.

[0286] Each running device in the program running system can be used to run the target program based on the slice data set under a specified condition.

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

[0288] The N devices run the target program based on different sets of fragmented data respectively.

[0289] The specified condition can include that consistency is met between a set of variable attributes respectively predefined by the N devices; one variable attribute includes a variable symbol and a variable data type.

[0290] In the case where the N devices need to interact fragmented values of any variable in the target program, each device can also be configured to perform random number encryption on the locally stored fragmented value of the variable; in the process of respectively running the target program, each device is configured to: for each variable in the target program, when performing random number encryption on the fragmented value of the variable for the first time, request a random number from a random number provider and assign the random number to the variable; when performing random number encryption on the fragmented value of the variable again, reuse the random number assigned to the variable.

[0291] Each device can also be configured to: when performing random number encryption on a transformed result obtained by mathematically transforming the fragmented value of the variable, reuse the random number assigned to the variable.

[0292] Each device can also be configured to: after requesting a random number from a random number provider and assigning the random number to the variable, if the fragmented value of the variable still needs to be encrypted at least once in the target program, locally store the random number assigned to the variable. When performing random number encryption on the fragmented value of the variable again, reuse the locally stored random number assigned to the variable.

[0293] In the case where the N devices need to interact fragmented values of any variable in the target program, each device can also be configured to respectively perform random number encryption on the locally stored fragmented value of the variable; the target program can include at least two interaction tasks for interacting encrypted fragmented values; at least two threads of each device share different interaction tasks of the target program.

[0294] Each thread of the at least two threads of each running device is identified by the target program; the threads identified by the target program are the same between different running devices and share the same interaction task in the target program; different interaction tasks can use the same channel to interact with specified data; the specified data can include a variable slice value to be interacted and a thread identifier of a thread sending the variable slice value, so as to determine that the same thread in other running devices receives the variable slice value.

[0295] The data in the original data set can be stored in the N running devices in a distributed manner; the N running devices can be specifically configured to respectively perform slice processing on the locally stored data values and interact with each other to process the results, so that each running device obtains a slice value of each data in the original data set.

[0296] The program running system can further include a target device; the data in the original data set can be stored in the target device; and the target device can be configured to send the N slice data sets to the N running devices, respectively.

[0297] The original data set can further include data for assigning values to constants in the program.

[0298] The program running system can further include a specifying device; and the specifying device can be configured to receive N variable attribute sets respectively predefined by the N running devices and determine that the variable attributes contained in the N variable attribute sets are the same.

[0299] The running device can be further configured to receive N variable attribute sets respectively predefined by the other N-1 running devices and determine that the variable attributes contained in the N variable attribute sets are the same.

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

[0301] The above system embodiments can be explained with reference to the above method flow.

[0302] The above is only a specific implementation of the embodiments of the present specification, and it should be noted that, for those skilled in the art, without departing from the principles of the embodiments of the present specification, a number of improvements and refinements can be made, and these improvements and refinements should also be considered as the protection of the embodiments of the present specification.

Claims

1. A method for program execution, comprising: sharding values of each data in an original data set to obtain N shard values of each data; the original data set comprising data for assigning values to variables in a program; determining N shard data sets; determining each shard data set comprising: re-assigning one shard value of each data in the original data set; values of the same data in the N shard data sets corresponding to the N shard values of the same data one by one; under a specified condition, N execution devices respectively execute a same target program based on different shard data sets; threads identified by the target program are the same among different execution devices, and the same threads share the same interactive tasks in the target program; the interactive tasks are used for interacting with the same threads in other execution devices on the same data on encrypted shard values; wherein, through pre-configuration, for each basic operation unit corresponding to the target program, an operation result obtained by inputting an arbitrary group of values into the basic operation unit before configuration for operation is equal to a processing result obtained by inversely sharding all operation results obtained by respectively inputting each group of shard values of the arbitrary group of values into the basic operation unit after configuration for respective operation; in a case where the N execution devices need to interact on shard values of any variable in the target program, the shard values of the variable stored locally are encrypted by a random number; in a process of respectively executing the target program, for each variable in the target program, when the shard values of the variable are encrypted by a random number for the first time, a random number is requested from a random number provider and assigned to the variable; when the shard values of the variable are encrypted by a random number again, the random number assigned to the variable is reused. 2.The method of claim 1, wherein data in the original data set is distributed and stored on N execution devices; the sharding values of each data in the original data set, comprising: the N execution devices respectively sharding values of data stored locally and interacting processing results with each other, so that each execution device obtains one shard value of each data in the original data set. 3.The method of claim 1, wherein data in the original data set is stored on a target device; the method further comprising: the target device sending the N shard data sets to the N execution devices respectively. 4.The method of claim 1, wherein the original data set further comprises data for assigning values to constants in a program. 5.The method of claim 1, further comprising: when a transformed result of the shard values of the variable obtained by mathematical transformation is encrypted by a random number, reusing the random number assigned to the variable, performing the same mathematical transformation on the random number, and encrypting the transformed result of the shard values of the variable by the transformed random number. 6.The method of claim 1, after requesting a random number from a random number provider and assigning the random number to the variable, the method further comprising: if the slice value of the variable still needs to be encrypted by at least one random number in the target program, then a random number assigned to the variable is stored locally; the random number assigned to the variable is reused.

7. A program running system, which performs sharding on a value of each data in an original data set in advance to obtain N sharded values of each data; the original data set comprising data for assigning values to variables in a program. determining N slice data sets; each slice data set is determined by reassigning each data in the original data set with a slice value of the data; the value of the same data in the N slice data sets corresponds to the N slice values of the same data one by one; the system comprises N running devices, each of which is configured to run the same target program based on a slice data set under a specified condition; different running devices share the same interactive task in the target program by identifying the same thread specified by the target program; the interactive task is used to interact with the same thread in other running devices for the same data after encryption; wherein the N running devices run the target program based on different slice data sets respectively; through pre-configuration, the operation result obtained by inputting an arbitrary group of values into the basic operation unit before configuration is equal to the processing result obtained by inversely slicing all operation results after separately operating each slice value of the arbitrary group of values into the basic operation unit after configuration; in the case that the N running devices need to interact with the slice values of any variable in the target program, each running device is configured to encrypt the slice value of the variable stored locally with a random number; during the process of running the target program respectively, each running device is configured to: for each variable in the target program, when encrypting the slice value of the variable with a random number for the first time, request a random number from a random number provider and assign the random number to the variable; when encrypting the slice value of the variable with a random number again, reuse the random number assigned to the variable.

8. The system of claim 7, wherein the data in the original data set is distributed and stored in the N running devices; the N running devices are configured to slice the data values stored locally respectively and interact with each other to obtain one slice value of each data in the original data set.

9. The system of claim 7, further comprising a target device; the data in the original data set is stored in the target device; the target device is configured to send the N slice data sets to the N running devices respectively.

10. The system of claim 7, wherein the original data set further comprises data for assigning values to constants in the program.

11. The system of claim 7, wherein each running device is further configured to: when the slice value of the variable is encrypted with a random number after mathematical transformation, reuse the random number assigned to the variable, perform the same mathematical transformation on the random number, and encrypt the transformed slice value of the variable with the transformed random number.

12. The system of claim 7, each runtime device is further configured to: after requesting a random number from a random number provider and assigning the random number to the variable, if the sharded value of the variable still needs at least one more random number encryption in the target program, then locally store the random number assigned to the variable; when the sharded value of the variable is encrypted with a random number again, reuse the locally stored random number assigned to the variable.

Citation Information

Patent Citations

  • Method and device for carrying out security operation on private data

    CN111539026A

  • Privacy protection data processing method, device and equipment and machine learning system

    CN112000990A

  • Multi-party joint security statistics method and device

    CN112084384A

  • Data processing system and method

    CN112001475A

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

    US20180366227A1