The present invention relates to a cumulative calculation device, a cumulative calculation method, and a program.
As a method of obtaining a specific calculation result without restoring an encrypted numerical value, a method called secret calculation is known from the related art. For example, NPL 1 discloses a three-party secret sharing technique.
A technique for totalizing grouped data is known as one of the data processing techniques in the related art. For example, NPL 2 discloses a method of calculating statistical values (an average value, a maximum value, totalization, and the like) of grouped data for each group through secret calculation. Note that these statistical values are implemented by cumulating associative binary operations.
However, the conventional method is designed exclusively to perform calculation of statistical values for an individual group (that is, calculation of accumulation of binary arithmetic operations) while concealing the group for secret calculation, and the efficiency is low because the accumulation calculation method used in normal data processing, which is not secret calculation, cannot be used as it is for secret calculation.
An embodiment of the present invention has been made in view of the foregoing points, and an object of the present invention is to perform cumulative calculation for an individual group efficiently.
in order to achieve the foregoing object, a cumulative calculation device according to an embodiment is a cumulative calculation device that, with respect to a column v=(v1, . . . , vn) of n values divided into groups, calculates cumulation for each of the groups through an associative binary operation. The cumulative calculation device includes: a value conversion unit configured to convert v into v′=(v1′, . . . , vn′) (where v1′=(vi, ci)) when c=(c1, . . . , cn) is a column of values in which 1 corresponds to a head element of the group and 0 corresponds to elements other than the head element among elements v1, . . . , vn of v; a binary operation generation unit configured to generate a new binary operation for calculating a new pair (p, q) for two pairs (w, x) and (y, z) (where x, z∈{0, 1}) using the binary operation; a cumulative calculation unit configured to calculate cumulation si′ (where si′ is cumulation from vi′ to vi′ through the new binary operation) through the new binary operation for i=1, . . . , n; and an output unit configured to extract a column u=(u1, . . . , un) of values indicating the cumulation for said each of the groups from each si′ (where i=1, . . . , n) and output the extracted u. The new binary operation sets an operation result of w and y by the binary operation to p when z=0, sets y to p when z=1, and sets a logical sum of x and z to q.
it is possible to perform the cumulative calculation for each group efficiently.
Hereinafter, an embodiment of the present invention will be described. In the embodiment, a cumulative calculation device 10 capable of performing cumulative calculation for each group efficiently will be described.
Here, a column of n values is denoted as v=(v1, . . . , vn), and each element vi (where i=1, . . . , n) of v is divided into several groups. It is assumed that elements in the same group are arranged to have consecutive indexes (element numbers).
For example, when the column is divided into three groups, there are certain i′ and i″ (where 1≤i′<i″<n), v1 to v1′ form a first group, vi′+1 to vi″ form a second group, and vi″+1 to vn form a third group.
The above expression is assumed to be a binary operation.
At this time, when the cumulative calculation is performed by the binary operation in each group, the cumulative calculation device 10 according to the present embodiment generates a new binary operation in which cumulation for each group can be calculated by the foregoing binary operation by cumulative calculation on the entire data (that is, all n values v1′, . . . , vn′ to be described later) and calculates cumulation of the entire data by the new binary operation. Since the cumulative calculation of the entire data is used in normal data processing, the cumulative calculation device 10 according to the present embodiment can perform the calculation efficiently, for example, even when the cumulative calculation for each group is performed by secret calculation.
The input device 101 is, for example, a keyboard, a mouse, a touch panel, various physical buttons, or the like. The display device 102 is, for example, a display or the like. Note that the cumulative calculation device 10 may not include, for example, at least one of the input device 101 and the display device 102.
The external I/F 103 is an interface with an external device such as the recording medium 103a. The cumulative calculation device 10 can perform reading or writing of the recording medium 103a via the external I/F 103. Note that examples of the recording medium 103a include a compact disc (CD), a digital versatile disk (DVD), a secure digital memory card (SD memory card), and a Universal Serial Bus (USB) memory card.
The communication I/F 104 is an interface that connects the cumulative calculation device 10 to a communication network. The processor 105 is, for example, any of various calculation devices such as a central processing unit (CPU) and a graphics processing unit (GPU). The memory device 106 is, for example, any of various storage devices such as a hard disk drive (HDD), a solid-state drive (SSD), a flash memory, a random access memory (RAM), and a read-only memory (ROM).
The cumulative calculation device 10 according to the embodiment has the hardware configuration illustrated in
The value conversion unit 201 converts v into v′=(v1′, . . . , vn′) (where v1′=(vi, ci)) when c=(c1, . . . , cn) is a column of values in which 1 corresponds to the head element of a group and 0 corresponds to elements other than the head element among elements v1, . . . , vn of v.
The binary operation generation unit 202 generates a new binary operation capable of calculating cumulation for each group through an original binary operation by cumulative calculation on the entire data.
The cumulative calculation unit 203 performs cumulative calculation by the new binary operation on all v′=(v1′, . . . , vn′).
The output unit 204 extracts a result of the cumulative calculation for each group by the original binary operation from the result of the cumulative calculation by the new binary operation and outputs the extracted result.
The storage unit 205 stores a column v=(v1, . . . , vn) of n values as cumulative calculation targets, intermediate results of the cumulative calculation, a cumulative calculation result, and the like.
A flow of the cumulative calculation processing according to the embodiment will be described with reference to
First, the value conversion unit 201 converts a column of values in which 1 corresponds to the head element in a group and 0 corresponds to other elements among elements of v into c=(c1, . . . , cn), and converts v into v′=(v1′, . . . , vn′) (where v1′=(v1, ci) (step S101)).
Subsequently, the binary operation generation unit 202 generates a new binary operation denoted as follows that is capable of calculating cumulation for each group by the original binary operation by cumulative calculation on the entire data (that is, all n values v1′, . . . , vn′).
The binary operation is defined as follows (step S102).
where w and y are variables which can have any values, x and z are variables which can have values of 0 or 1, and OR is an operator which is 1 when at least one of x and z is 1 and 0 otherwise (that is, an operator indicating a logical sum).
Subsequently, the cumulative calculation unit 203 calculates cumulation by the new binary operation on all v′=(v1′, . . . , vn′) (step S103). That is, the cumulative calculation unit 203 calculates the cumulation s′=(s1′, . . . , sn′) of v′ by the new binary operation. Here, for i=1, . . . , n, the following cumulation is obtained.
Then, with setting each si′ as si′=(ui, di), the output unit 204 extracts a column u=(u1, . . . , un) of the values, and outputs the column u as a cumulative result of the original binary operation (step S104). At this time, each ui is the result of the cumulative calculation of v1, . . . , vi by the original binary operation. For each i=1, . . . , n, di=1.
Note that although the output destination for the output unit 204 may be set discretionarily, for example, the output may be stored in the storage unit 205, or may be transmitted to another device or apparatus, or the like can be considered.
Hereinafter, examples of the foregoing cumulative calculation processing will be described.
In this example, a case will be described in which a column v=(3, 5, 1, 2, 4, 6, 1, 3, 2, 8) of values that is divided into four groups of four, two, one, and three elements from the head is given, and cumulative calculation for each group is performed through a binary operation max(x, y).
Note that max(x, y) is a binary operation of outputting the maximum values of x and y.
First, in the foregoing step S101, a column c=(1, 0, 0, 0, 1, 0, 1, 1, 0, 0) of values in which 1 corresponds to the head element of the group and 0 corresponds to the other elements is generated, and v is converted into the following v′.
v′=((v1, c1), . . . , (v10, c10)=((3, 1), (5, 0), (1, 0), (2, 0), (4, 1), (6, 0) (1, 1), (3, 1), (2, 0), (8, 0)) In the foregoing step S102, a new binary operation defined by the foregoing Math. 3 is generated. In the foregoing step S103, cumulation is calculated on all v′=((v1, ci), . . . , (v10, c10)) by the new binary operation.
For example,
By using a cumulative calculation method of calculating the above expression in order from the left, s′=(s1′, . . . , s10′) can be calculated as follows.
Accordingly, in the foregoing step S104, u=(3, 5, 5, 5, 4, 6, 1, 3, 3, 8) is extracted and output. From this u, it can be understood that the cumulative calculation for each group by the original binary operation max(x, y) (that is, the calculation of a maximum value of the cumulation until each element in the group) is performed.
In the foregoing Example 1, s1′, . . . , s10′ are calculated in order from the left by the new binary operation in step S103. However, instead, s1′, . . . , s10′ are calculated in parallel in this embodiment. Accordingly, it is possible to execute cumulative calculation more efficiently than in Example 1.
Note that it has been known that an associative binary operation can be calculated in parallel.
As described above, the cumulative calculation device 10 according to the present embodiment assigns flags in which a head element of a group is 1 and other elements are 0 to values to be cumulated when cumulative calculation is executed by the binary operation in each group, defines a new binary operation, and performs cumulative calculation on the entire data (that is, all the pairs of values and flags) by the new binary operation. This new binary operation uses the fact that the value of cumulation has already been calculated for the head element of a group to regard the flag as indicating whether the calculation has been done, and thereby, is an extension of the original binary operation to a binary operation for the pairs of values and flags.
Accordingly, the cumulative calculation device 10 according to the embodiment can perform secret calculation efficiently even when cumulative calculation is performed for each group by, for example, secret calculation (including secret sharing). This is because by using any method of applying binary operations with which the cumulative calculation is desired in a determined order, the cumulative calculation for each group can be performed by secret calculation in the same order. Therefore, for example, by using max or min as the binary operation, a group by max or a group by min s or the like in the secret calculation can be efficiently implemented.
Accordingly, the cumulative calculation device 10 according to the embodiment is not only used for normal data processing but is also applicable to, for example, a case where data processing and data analysis are performed while keeping data contents secret. As a specific example, the cumulative calculation device 10 according to the embodiment can generate training data of a machine learning model that implements a predetermined task (for example, certain prediction, classification, or the like) while keeping data contents secret. In addition, the cumulative calculation device 10 according to the embodiment may be able to perform various predictions and classifications by a machine learning model learned by the training data, and also control another device, apparatus, system, and the like based on results of the predictions or classifications.
The present invention is not limited to the specifically disclosed embodiments, and various modifications, changes, combinations with known techniques, and the like can be made without departing from the scope of the claims.
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/JP2021/022586 | 6/14/2021 | WO |