Benes network construction method and device, program product and storage medium

By building the target Benes network, reducing the amount of data shuffling in the sub-permutation unit, the problem of large computing overhead in the existing Benes network is solved, and a more efficient data permutation and shuffling process is achieved.

CN119276733AActive Publication Date: 2025-01-07ANT BLOCKCHAIN TECHNOLOGY (SHANGHAI) CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411329348.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-23
Publication Date
2025-01-07
Estimated Expiration
2044-09-23

AI Technical Summary

Technical Problem

The calculation overhead of existing Benes networks is high during data shuffling, especially when the amount of data to be shuffled does not reach the upper limit of the input data amount of the complete T-Benes network, the number of calculations of the sub-permutation unit is the largest, resulting in the overall calculation amount. Increase.

Method used

By building a target Benes network, multiple sub-permutation units are retained, and the amount of data shuffling in the sub-permutation unit is reduced, thereby reducing the amount of data permutation calculation of the entire network. 具体方法是获取待置换数据集的数据量N和子置换单元指定的置换数据量T,确定完整T-Benes网络,并基于差值k删除不必要的输入位置、输出位置和传输路径,构建出目标 Benes Network.

Benefits of technology

It effectively reduces the amount of data permutation calculation of the Benes network, reduces the number of calculations in the sub-permutation unit, and improves the efficiency of data shuffling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119276733A_ABST
    Figure CN119276733A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a construction method and device of a Benes network, a program product and a storage medium. The method comprises the steps that the data size N of a to-be-replaced data set and the replacement data size T specified for a sub-replacement unit in the Benes network are obtained; according to the N and the T, determining a corresponding complete T-Benes network; and determining k to-be-deleted input positions of a first column of sub-replacement units in the complete T-Benes network based on a difference value k of N and # imgabs0 #, and constructing a target Benes network by deleting input positions, output positions and transmission paths from the k to-be-deleted input positions of the first column of sub-replacement units to the output position of the last column of sub-replacement units in the complete T-Benes network. According to the Benes network provided by the embodiment of the invention, the number of the sub-permutation units can be more reserved, and the data permutation calculation overhead of the sub-permutation units is reduced and the total permutation calculation overhead of the network is also reduced by reducing the permutation data volume in the sub-permutation units.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this specification relate to the field of Benes network technology, and in particular to a method, device, program product, and storage medium for constructing a Benes network. Background Art

[0002] The Benes network is a well-known rearrangeable non-blocking butterfly network in circuit switching. It can realize all permutations from the input end to the output end. As a non-blocking switch network, it was originally widely used in the field of communications. At present, Benes networks are also used in scenarios such as privacy computing protection. Based on this network, the positions of each piece of data in the data set are permuted to achieve data shuffling. The Benes network constructed in the related technology requires a large computational overhead when performing data position permutation. Summary of the invention

[0003] To overcome the problems existing in the related art, the embodiments of this specification provide a method, device, program product and storage medium for constructing a Benes network.

[0004] According to a first aspect of an embodiment of this specification, a method for constructing a Benes network is provided, the method comprising:

[0005] Obtaining the data volume N of the data set to be replaced and the replacement data volume T specified for the sub-replacement unit in the Benes network; wherein T is a power of 2;

[0006] According to the N and the T, a corresponding complete T-Benes network is determined; the complete T-Benes network includes a transmission path from the input position of the first column sub-permutation unit in the column sub-permutation unit to the output position of the last column sub-permutation unit in sequence; Each column of the sub-permutation units in the column sub-permutation unit comprises sub-permutation units, each of which comprises T input positions and T output positions, and is used to perform position permutation on the T data received from the T input positions and then transmit the data from the T output positions to the input positions of the next column of the sub-permutation units via the transmission path;

[0007] Based on the N and The difference k of , determining the k input positions to be deleted of the first column sub-permutation unit in the complete T-Benes network;

[0008] A target Benes network is constructed by deleting input positions, output positions and transmission paths from the k to-be-deleted input positions of the first column of sub-permutation units to the output positions of the last column of sub-permutation units in the complete T-Benes network.

[0009] According to a second aspect of an embodiment of this specification, a method for constructing a Benes network is provided, the method comprising:

[0010] Obtaining the data volume N of the data set to be replaced and the replacement data volume T specified by the user for the sub-replacement unit in the Benes network; wherein T is a power of 2;

[0011] Based on the N and The difference k of , constructs the target Benes network;

[0012] Wherein, relative to the complete T-Benes network, the target Benes network does not include the input positions, output positions and transmission paths between the k input positions to be deleted of the first column of sub-permutation units in the complete T-Benes network and the output positions of the last column of sub-permutation units;

[0013] The number of columns of sub-permutation units in the complete T-Benes network is The number of sub-permutation units in each column is indivual, The sub-permutation unit in the complete T-Benes network includes T input positions and T output positions; the complete T-Benes network includes: a transmission path between two adjacent columns of sub-permutation units and between each output position of a sub-permutation unit and one of the input positions of the next column of sub-permutation units; the sub-permutation unit is used to receive the T data in the data set through the T input positions respectively and perform position permutation, and transmit the T data after position permutation from the T output positions to the input position of the next column of sub-permutation units through the transmission path.

[0014] According to a third aspect of the embodiments of this specification, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps of the method embodiment described in the first aspect are implemented.

[0015] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method embodiment described in the first aspect are implemented.

[0016] According to a fifth aspect of the embodiments of this specification, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the method embodiment described in the first aspect are implemented.

[0017] The technical solutions provided by the embodiments of this specification may have the following beneficial effects:

[0018] In the embodiment of this specification, the amount of data N of the data set to be replaced and the amount of data T to be replaced specified by the user for the sub-permutation unit in the Benes network are obtained, where T is a power of 2; the complete T-Benes network is a matrix composed of multiple sub-permutation units, and the number of columns in the matrix is Each column of the matrix contains Sub-replacement unit, In a complete T-Benes network, a sub-permutation unit includes T input positions and T output positions; the complete T-Benes network includes: a transmission path between two adjacent columns of sub-permutation units, and between each output position of a sub-permutation unit and one of the input positions of the next column of sub-permutation units; the sub-permutation unit is used to receive the T data in the data set through the T input positions and perform position permutation, and transmit the T data after position permutation from the T output positions to the input position of the next column of sub-permutation units through the transmission path. This embodiment is based on the N and The difference k is used to construct a target Benes network. Compared with the complete T-Benes network, the target Benes network does not include the input positions, output positions and transmission paths between the k input positions to be deleted of the first column of sub-permutation units in the complete T-Benes network and the output positions of the last column of sub-permutation units. Based on this, the Benes network constructed in this embodiment reduces the amount of data required to be permuted in the sub-permutation units by retaining more sub-permutation units, so that the amount of data permutation calculation of the sub-permutation units becomes smaller, thereby reducing the amount of data permutation calculation of the entire Benes network.

[0019] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The accompanying drawings herein are incorporated in and constitute a part of the specification, illustrate embodiments consistent with the specification, and together with the description, serve to explain the principles of the embodiments of the specification.

[0021] Figure 1 It is a schematic diagram of a Benes network shown in this specification according to an exemplary embodiment.

[0022] Figure 2A It is a schematic diagram of a T-Benes network shown in this specification according to an exemplary embodiment.

[0023] Figure 2B It is a schematic diagram of a complete T-Benes network shown in this specification according to an exemplary embodiment.

[0024] Figure 2C It is a schematic diagram of a T-Benes network shown in this specification according to an exemplary embodiment.

[0025] Figure 3 It is a flowchart of a method for constructing a Benes network according to an exemplary embodiment of this specification.

[0026] Figure 4A It is a schematic diagram of a 4-Benes network according to an exemplary embodiment of this specification.

[0027] Figure 4B It is a schematic diagram of a Benes network shown in this specification according to an exemplary embodiment.

[0028] Figure 5 The present specification is a schematic diagram of performing data shuffling based on an oblivious shuffle protocol within a sub-permutation unit according to an exemplary embodiment.

[0029] Figure 6 It is a hardware structure diagram of a computer device where a Benes network construction device is located according to an exemplary embodiment of this specification. DETAILED DESCRIPTION

[0030] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with this specification. Instead, they are merely examples of devices and methods consistent with some aspects of this specification as detailed in the appended claims.

[0031] The terms used in this specification are for the purpose of describing specific embodiments only and are not intended to limit this specification. The singular forms "a", "the" and "the" used in this specification and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0032] It should be understood that although the terms first, second, third, etc. may be used in this specification to describe various information, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this specification, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0033] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this manual are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0034] First, the Benes network is explained. The Benes network is a well-known rearrangeable non-blocking butterfly network in circuit switching. The network was originally designed in the communication field to build large-scale parallel computing systems. It can realize all permutations from input to output and is widely used in the communication field as a non-blocking switching network.

[0035] like Figure 1 As shown, this is a schematic diagram of the Benes network. Figure 1 Each rectangle formed by black edges is a sub-permutation unit, and each sub-permutation unit is used to permute the position of the two input data and then output them. The Benes network is a recursive structure. For example, each sub-permutation unit in the green box in the third column of the figure can be used to permute the position of the two input data and then output them, the 6 sub-permutation units in the blue box are used to permute the position of the four input data and then output them, and the 20 sub-permutation units in the red box are used to permute the position of the eight input data and then output them.

[0036] By changing the number of sub-permutation units in the network structure, we can achieve a network structure that allows the input data to be output in any order. For example, for a Benes network with N samples, we need to construct The network layer reaches N numbers of random permutations. The network layer here refers to Figure 1 The vertically arranged columns shown in . Indicates rounding up.

[0037] Based on the Benes network, the T-Benes network was derived. The T-Benes network was originally designed to solve the end-to-end node connection problem, that is, by adjusting the connection mode of each sub-permutation unit T-switch and the fixed physical connection line (i.e. Figure 1The connection between each sub-permutation unit in the network can achieve the purpose of interconnecting any two nodes at both ends. In the T-Benes network, each sub-permutation unit has T input positions and T output positions, that is, the input scale of each sub-permutation unit is T, T is a power of 2, and it can achieve the position permutation of T input data and then output from T output positions respectively. The T-Benes network can be considered as a matrix composed of multiple sub-permutation units, and the number of columns in the matrix is The number of sub-permutation units contained in each column of the matrix is It needs to be determined based on the number N to be replaced.

[0038] The T-Benes network can be applied in many fields, such as privacy computing. In order to illustrate the application of the T-Benes network in the field of privacy computing, some terms in the field of privacy computing are first explained.

[0039] Oblivious Shuffle: Oblivious Shuffle is a protocol in which one party shuffles or shuffles the data of the data party in a random order or an order specified by the non-data holder, so that both parties can finally share the secret results of the shuffled data. Oblivious Shuffle is used as a basic component by many security protocols (such as Oblivious Sorting, Secure Collaborative Filtering, and Hidden Query) to disconnect the original data location from the subsequent calculation process.

[0040] Oblivious Transfer (OT): It is a type of protocol in cryptography that enables the sender to pass one of multiple potential messages to the receiver, but the receiver remains unaware of the message received.

[0041] Secret Sharing: Secret sharing is a cryptographic technology that secretly divides data and stores it to all participants in order to disperse risks and tolerate intrusions. It is an important means of information security and data confidentiality.

[0042] As an information technology that takes into account both privacy protection requirements and data value utilization, privacy computing has developed rapidly in recent years and has received widespread attention. As a protocol that can disconnect the data location relationship, the data oblivious shuffling protocol can solve the problem of data structure information being traced back and is widely used in the data initialization stage. The current mainstream data oblivious shuffling protocol uses oblivious transmission and secret sharing to perform calculations on the basis of a plaintext random shuffling network to achieve data shuffling, which has extremely strong provable security. The industry usually optimizes and improves the structure of the random shuffling network for privacy computing scenarios, improves the efficiency of data shuffling, and reduces the amount of communication required for the shuffling protocol.

[0043] The existing oblivious shuffle protocol Secret-Shared Shuffle calculation method can be combined Figure 2A To illustrate:

[0044] The data holder inputs data X = {x1,…,x n}, Figure 2A x1 to x 16 For example.

[0045] The non-data holder randomly generates a shuffle function π, which is a special Benes network structure with each sub-shuffle unit π i,j Generate, and according to the fixed connection layer τ in the network i The random shuffle rule is determined by the combination. For example, Figure 2A In the T-Benes network shown in FIG, T is 4 as an example, and each rounded rectangle is the aforementioned sub-permutation unit, which can also be called a sub-shuffle unit in the data shuffle scenario. The output position of each sub-permutation unit in each column is connected to the input position of each sub-permutation unit in the next column through a transmission path, that is, Figure 2A The solid line between each column of rounded rectangles and the next column of rounded rectangles. The dotted line in the sub-permutation unit represents the secret shuffling of the T input data by the sub-permutation unit. The specific rules are only known to the non-data holder and are unknown to the data holder. Therefore, the T-Benes network can achieve the effect of shuffling data in any sequence through the random transformation of the sub-permutation unit. In the inadvertent shuffling protocol, each time the data passes through a sub-permutation unit, a secret data shuffle is performed, and the secret sharing value of the data is updated at the same time, so as to achieve the purpose of completely hiding the data shuffling process from the data holder. Finally, both parties obtain π(X)={x π(1) ,…,x π(n)}'s secret sharing share to complete the protocol.

[0046] Take the two-party oblivious shuffle protocol as an example. In this protocol:

[0047] The input of the protocol is: P0 inputs plaintext data X = {x1,…,x n}, P1 inputs the shuffle function π, π is composed of each sub-permutation unit π inside the T-Benes network structure i,j and the fixed connection layer τ in the network i The random shuffle rule is composed of τ. i The layer is an open network structure. Both parties transmit data according to the specified connection. i,j Only P1 knows.

[0048] The output of the protocol means that P0 and P1 obtain the shuffled secret fragments <π(X)>0, <π(X)>1, where π(X) = {x π(1) ,…,x π(n) <π(X)>0 represents the data fragmentation obtained by P0 by shuffling the plaintext data X using the shuffling function π.

[0049] The protocol flow could be:

[0050] 1. First, the sub-permutation unit T-switch in the T-Benes network is used as a black box protocol.

[0051] P0 <x>0 is regarded as plain text and used as protocol input; P1 holds the shuffling rule function π i,j and <x> 1, <x>1 refers to the secret sharing shard held by P1, and π i,j As the protocol input. Eventually both parties will get a shard <π i,j ( <x>0)>0 and <π i,j ( <x>0)>1. P0 directly <π i,j ( <x>0)>0 is output as a sub-permutation unit; P1 calculates π locally i,j ( <x> 1)+<π i,j ( <x>0)>1, as the fragmentation value of the protocol.

[0052] 2. Combination Figure 2A To illustrate, after P0 and P1 calculate the secret shards of all numbers in the π1 layer according to the shuffle method of the sub-permutation unit, both parties transfer the shards output by each node locally to the designated location according to the public τ1 layer structure, and directly use them as the inputs of the next layer π2. Repeat this step until all Benes network layers have completed the calculation.

[0053] Through the study of the above process, it is found that for constructing a Benes network connection layer τ that satisfies any number of samples i The industry often adopts the same network size and ensures that the sub-permutation units of each layer of the network are the same. Then, each sub-permutation unit of the previous layer is placed in the T parts of the next layer in turn.

[0054] For example, taking T=4 and the data size N of the data set to be shuffled as 64, the corresponding complete T-Benes network can be as follows: Figure 2B The network structure shown in FIG. 1 , each square represents a sub-permutation unit, and the number in the square represents the amount of data input to the sub-permutation unit. Figure 2B For the sake of convenience, the transmission paths between the sub-permutation units are not shown. In this example, the data volume 64 is exactly equal to T 4 , just reaching the upper limit of the amount of input data that the complete T-Benes network can receive.

[0055] However, in actual applications, there are cases where the amount of data to be shuffled N does not reach the upper limit of the amount of input data that the complete T-Benes network can accept. Take T = 4 and the amount of data N of the data set to be shuffled as 39 as an example. N is not a power of T, T 3 <39<T 4 , that is, the amount of data to be shuffled N does not reach the upper limit of the input data that the complete T-Benes network can receive (4 4 =64), such as Figure 2C As shown, it is the Benes network constructed in the prior art ( Figure 2C For the sake of convenience in illustration, not all transmission paths are shown). Figure 2C Each rounded square in the figure represents a sub-shuffle unit, and the number in the square represents the amount of shuffled data of the sub-permutation unit.

[0056] The idea of ​​constructing the Benes network in the prior art is to determine the number of columns of the sub-permutation unit in the Benes network according to the amount of data to be shuffled N and the maximum amount of shuffled data T specified by the user for the sub-permutation unit. For the first column of sub-permutation units, the shuffled data volume t of the sub-permutation units is set from top to bottom. The t of the previous sub-permutation unit will reach the set T value, and the t of the last sub-permutation unit will be less than the T value, so that the total shuffled data volume of the sub-permutation unit in this column reaches N. Figure 2C As shown in , the first 9 sub-permutation units in the first column of sub-permutation units, the shuffled data amount t of each sub-permutation unit reaches the set T value, that is, 4; the shuffled data amount t of the last sub-permutation unit in the column is 3, and the total shuffled data amount of the sub-permutation units in the column reaches 39. The same is true for the sub-permutation units in other columns.

[0057] In the above scheme, the Benes network is constructed based on the idea of ​​minimizing the number of sub-permutation units in the network. Therefore, in a column of sub-permutation units, except for the last sub-shuffle unit whose shuffled data volume t does not reach the maximum value T, the shuffled data volume t of each of the previous sub-permutation units reaches the maximum value T. In the Benes network constructed in this way, the total number of sub-permutation units can be compressed to the minimum value. However, it has been found that the Benes network constructed in this way actually brings a large amount of calculation when performing data shuffling.

[0058] In the oblivious shuffle protocol, when shuffling data, each sub-permutation unit needs to execute Oblivious transfer calculation. Figure 2C In the Benes network shown, in a column of sub-permutation units, the amount of shuffled data for each of the first 9 sub-permutation units is 4, so the number of calculations for each sub-permutation unit is That is, 4×2=8 times; the amount of shuffled data in the last sub-permutation unit is 3, and the number of calculations of this sub-permutation unit is That is, 3×2=6 times. The total number of calculations of this column sub-permutation unit is 9×8+1×6=78 times; the same is true for other column sub-permutation units. This Benes network has 5 columns of sub-permutation units, so the total number of calculations of the oblivious transmission of the Benes network is 78×5.

[0059] The prior art network construction concept based on the minimum number of sub-permutation units will try to maximize the data shuffling amount t of the sub-permutation unit to T. However, the number of oblivious transfer calculations that need to be performed by the sub-permutation unit is From the perspective of t, when t reaches its maximum value T, the computational complexity of the inadvertent transmission of the sub-permutation unit will reach the maximum, which will eventually lead to a large computational complexity of the Benes network.

[0060] Based on this, an embodiment of this specification provides an embodiment of a method for constructing a Benes network. When the Benes network is applied to scenarios such as data shuffling, more sub-permutation units are retained to reduce the amount of data shuffling in the sub-permutation units accordingly, thereby reducing the total shuffling calculation amount of the Benes network as a whole.

[0061] like Figure 3 FIG. 1 is a flowchart of a method for constructing a Benes network according to an exemplary embodiment of the present specification, which may include the following steps:

[0062] In step 302, the data volume N of the data set to be replaced and the data volume T to be replaced specified for the sub-replacement unit in the Benes network are obtained; wherein T is a power of 2.

[0063] In step 304, a corresponding complete T-Benes network is determined according to N and T; the complete T-Benes network includes a transmission path from the input position of the first column sub-permutation unit in the column sub-permutation unit to the output position of the last column sub-permutation unit in sequence; Each column of the sub-permutation units in the column sub-permutation unit comprises sub-permutation units, each of which includes T input positions and T output positions, and is used to permute the T data received from the T input positions and then transmit them from the T output positions to the input positions of the next column of the sub-permutation units via the transmission path.

[0064] In step 306, based on the N and The difference k of is used to determine the k input positions to be deleted of the first column sub-permutation unit in the complete T-Benes network.

[0065] In step 308, a target Benes network is constructed by deleting input positions, output positions and transmission paths from the k to-be-deleted input positions of the first column of sub-permutation units to the output positions of the last column of sub-permutation units in the complete T-Benes network.

[0066] The method for constructing a Benes network provided in the embodiments of this specification can be executed by a computer device, which includes but is not limited to physical servers, server clusters, cloud servers, smart phones / mobile phones, tablet computers, personal digital assistants (PDAs), laptop computers, desktop computers and other devices with computing functions.

[0067] The method for constructing a Benes network provided in the embodiments of this specification can be applied to a variety of scenarios, such as the above-mentioned data shuffling scenario, where the constructed target Benes network can be used for data shuffling. Alternatively, it can also be a network connection scenario, etc., which is not limited in this embodiment.

[0068] The amount of data in the dataset to be replaced In the case of data volume, a complete T-Benes network can be used for data replacement. Therefore, this embodiment can be applied to To build a better Benes network under the circumstances.

[0069] As an example, the number of columns of sub-permutation units in a complete T-Benes network is Each column contains Sub-permutation units, the amount of input data that a complete T-Benes network can receive like Figure 4A As shown, it indicates that the number of samples N' is 16 (i.e. 4 2 )'s 4-Benes network structure diagram, Figure 4A Each rounded rectangle in is a sub-permutation unit. The network includes Figure 4A There are three columns of sub-permutation units π1, π2 and π shown in the figure; there is a transmission path between two adjacent columns of sub-permutation units in the network, that is, Figure 4A τ1 and τ2 are shown in FIG. In the data shuffle scenario, τ (i.e., τ1 and τ2) can be a public plaintext network, and these transmission paths have fixed generation rules and can be determined based on the specific values ​​of N and T.

[0070] because That is, N and With a difference of k, there are k input positions in the complete T-Benes network that do not require input data. For example, Figure 4A In the example, the first sub-shuffle unit of the complete T-Benes network has 16 input positions, which can perform a maximum of 16 data position permutations. However, there are only 13 data sets to be permuted this time, so there is a difference of 3, that is, there are 3 input positions in the first sub-shuffle unit of the complete T-Benes network that do not require input data.

[0071] K input positions can be arbitrarily selected from all input positions of the first column sub-shuffle unit of the complete T-Benes network, and the specific selection method is not limited in this embodiment. In addition, this embodiment does not limit whether the selected k input positions are continuous. As an example, it can be the last k input positions of all input positions of the first column sub-permutation unit, or it can be the first k positions. Under these two methods, after storing the constructed target Benes network, when it is necessary to read the input position of the first column sub-shuffle unit of the target Benes network, the continuity of data reading can be guaranteed. In other examples, such as data shuffling scenarios, k input positions located in the middle can also be selected.

[0072] Figure 4A In the example of selecting the last three input positions in the complete T-Benes network, the input positions, output positions and transmission paths between the k input positions to be deleted and the output positions of the last column of sub-permutation units can be deleted, that is, Figure 4A The input position, output position and transmission path corresponding to the red line can be deleted. In practical applications, there are many other ways to obtain the above structures that need to be deleted in the complete T-Benes network.

[0073] As an example, constructing a target Benes network may include:

[0074] For the k to-be-deleted input positions of the first column sub-permutation unit, determine the output position to be deleted corresponding to each to-be-deleted input position in the first column sub-permutation unit to which it belongs, and obtain the k to-be-deleted output positions of the first column sub-permutation unit;

[0075] After obtaining the k to-be-deleted input positions of the second column sub-permutation unit based on the transmission path between the k to-be-deleted output positions of the first column sub-permutation unit and the input positions of the second column sub-permutation unit, respectively determine the output position to be deleted corresponding to each to-be-deleted input position in the second column sub-permutation unit to which it belongs, and so on, until the k to-be-deleted output positions of the last column sub-permutation unit in the complete T-Benes network are determined, and all the to-be-deleted input positions and all the to-be-deleted output positions in the complete T-Benes network are obtained;

[0076] All input positions to be deleted, all output positions to be deleted, and transmission paths between each input position to be deleted and each output position to be deleted are deleted from the complete T-Benes network to obtain a target Benes network.

[0077] Still Figure 4A For example, first determine the k input positions to be deleted in the first column sub-permutation unit can be Figure 4A The three input positions A1, A2 and A3 shown in the figure are located in the same sub-permutation unit. In the sub-permutation unit, the three output positions corresponding to the three input positions to be deleted are determined. Here, multiple determination methods can be selected as needed. Figure 4A In the example, A1, A2 and A3 correspond to B1, B2 and B3 respectively. Then, from the three output positions B1, B2 and B3, in τ1, according to the transmission path between the first column sub-permutation unit and the second column sub-permutation unit, the three output positions (B1, B2 and B3) to the three input positions of the second column sub-permutation unit (i.e., C1, C2 and C3 shown in the figure) can be obtained. Figure 4A In the example, these three input positions are located in different sub-permutation units in the second column. Similarly, the corresponding output positions of C1, C2 and C3 in their respective sub-permutation units are obtained again: D1, D2 and D3; and so on, until the output positions to be deleted in the sub-permutation units in the last column are obtained.

[0078] Take T=4 and the data size N of the data set to be shuffled as 39 as an example. Figure 4B The target Benes network constructed in this embodiment is shown. Figure 4B Each rounded square in the figure represents a sub-permutation unit, and the number in the square represents the amount of shuffled data of the sub-permutation unit. Figure 4B For the sake of convenience, all transmission paths between two adjacent columns of sub-permutation units are not shown. In this embodiment, the value of k is 25. Figure 4B In the first column of sub-permutation units, take the 25 input positions to be deleted as the last 25 input positions as an example. The 25 deleted input positions correspond to: the last input position of the 10th sub-permutation unit, and all input positions from the 11th to the 16th sub-permutation units. It can be seen that the data shuffling amount t of the 10th sub-permutation unit is 3, and the data shuffling amount t of the 6 sub-permutation units from the 11th to the 16th sub-permutation units is 0.

[0079] Based on the above embodiment, all input positions to be deleted, all output positions to be deleted, and the transmission paths between the input positions to be deleted and the output positions to be deleted in the network can be deleted. After the deletion, the amount of shuffled data of each sub-permutation unit in the target Benes network constructed is as follows: Figure 4B as shown in .

[0080] Can be Figure 2C and Figure 4B To compare the amount of inadvertent transmission computation of the two Benes networks when performing data shuffling. As in the above embodiment, each sub-permutation unit needs to execute Oblivious transfer calculations. Figure 2C The total number of calculations for each sub-permutation unit in the table is 78.

[0081] exist Figure 4B In the example, the number of calculations of the first and last columns of sub-permutation units is the same as Figure 2C Each column of sub-permutation units is the same; but in the second to fourth columns of sub-permutation units, each column of sub-permutation units is relative to Figure 2C The number of calculations for the network is reduced:

[0082] The total number of calculations of the sub-permutation unit in the second column is: Second-rate;

[0083] The total number of calculations of the sub-permutation unit in the third column is: Second-rate;

[0084] The total number of calculations of the sub-permutation units in the fourth column is the same as that in the second column, which is also 70 times.

[0085] Therefore, compared with the Benes network of the prior art, the Benes network of the present application can reduce the computational overhead when applied in data shuffling scenarios.

[0086] As an example, after determining the input position to be deleted of the sub-permutation unit, there are multiple implementations of how to determine the input position to be deleted of the sub-permutation unit corresponding to the input position to be deleted.

[0087] The output position to be deleted corresponding to the input position to be deleted in the corresponding sub-permutation unit may include: the output position corresponding to the input position to be deleted after being transmitted along a straight line in the corresponding sub-permutation unit. Figure 4A As shown in FIG. 1 , when determining the corresponding output position to be deleted for each sub-permutation unit, the output position to be deleted is determined along a straight line transmission, for example, Figure 4A The input position A1 to be deleted shown in the figure is transmitted along a straight line within the sub-permutation unit to the corresponding output position B1 to be deleted.

[0088] Using the target Benes network of this embodiment, the k input positions to be deleted that exceed the data volume N in the complete T-Benes network are configured to propagate in a straight line in each sub-permutation unit, while the remaining N input positions are still randomly arranged according to the rules in the sub-permutation unit. Since the network with a sample number of N' can satisfy the output of any arrangement, these k input positions to be deleted adopt a fixed transmission method in the sub-permutation unit and will not affect the arbitrary arrangement properties of the remaining nodes. Therefore, the correctness of the solution of this embodiment is easy to prove.

[0089] The above embodiment constructs the network based on the basic principle, that is, first constructs a complete T-Benes network, then compresses the complete T-Benes network, and constructs the target Benes network by deleting it. In practical applications, the target Benes network of this embodiment can also be directly constructed according to the rules of the transmission paths between the sub-permutation units in the target Benes network to be constructed.

[0090] In some examples, the method may further include: inputting each data of the data set to be replaced into each input position of the first column sub-replacement unit in the constructed target Benes network, and the target Benes network outputs the data set after position replacement. Based on this, the target Benes network of this embodiment can be used to implement data replacement.

[0091] In some examples, the data set to be replaced includes a data set to be shuffled, and the target Benes network is used to perform data shuffling on the data set to be shuffled. For example, the sub-permutation unit is used to receive t data in the data set through the t input positions respectively and perform data shuffling, t≤T. Among them, the T input positions of some sub-permutation units are not deleted, then the input data is T; some sub-permutation units may have their input positions deleted, then the input data is less than T. In the data shuffling scenario, the target Benes network can perform data shuffling based on the inadvertent shuffling protocol.

[0092] In some examples, the sub-permutation unit is configured to respectively receive t data in the data set through the t input positions and perform data shuffling based on an oblivious shuffle protocol.

[0093] As an example, Figure 5 , which is a schematic diagram of data shuffling based on an oblivious shuffle protocol within a sub-permutation unit according to an exemplary embodiment of the present specification.

[0094] Figure 4A The N shown is 16 (4 2 ) is a public plaintext network, which can be generated locally by both data holders and non-data holders based on set rules. It is used to represent the transmission path of the secret sharding information of the data when the data of both parties are shuffled.

[0095] In the oblivious shuffle protocol, the πth i The transmission rule from the input position to the output position in the sub-permutation unit is that the non-data holder P1, based on the random permutation rule π i,j The rule synthesized is kept confidential to the data holder P0. Figure 5 As shown, each sub-permutation unit uses Tlog2T times 2-to-1 OT protocol, that is, for each row of data P1, it needs to inadvertently take T-1 values. This process needs to be implemented based on the GGM-Tree (Goldreich-Goldwasser-Micali Tree) structure, which requires log2T times 2-to-1 OT. The GGM-Tree structure is not explained in detail here. In this way, the data holder P0 can randomly generate the entire random number matrix, while the non-data holder P1 only has the incomplete random matrix obtained through OT (with the random permutation array π i,j Based on this, the kth row is missing the πth row. i,j [k] elements). Finally:

[0096] Data holder P0 obtains the output of layer i: each row is XORed and arrayed XOR each column with the array

[0097] Non-data holder P1 obtains data (Since the black part in the P1 matrix is ​​calculated twice to cancel it out, characteristics).

[0098] Then, data party P0 makes array b 0 As the secret sharing shard of the new data, Sent to non-data holder P1;

[0099] Non-data holder P1 uses the formula Calculate the new secret sharing value in The secret sharing value obtained after calculating the previous layer of network for the non-data holder P1, the permutation function Π i =π i,j .τ i-1 .Π i-1 (·) / / .

[0100] Finally, the two parties exchange the new data to the designated location through the τ layer, completing the shuffling operation of a layer of the network. The plaintext corresponding to the secret sharing value is the π after the shuffle of this layer. i (x).

[0101] The above embodiment is described by taking Boolean secret sharing as an example, but this embodiment is also applicable to addition and subtraction calculations to obtain arithmetic secret sharing fragments.

[0102] Since in the worst case, the amount of data of the upper limit value N′ of the input data amount of the Benes network is T times the amount of data N, therefore, this embodiment is aimed at In the case of a complete T-Benes network, k redundant input positions and output positions, as well as redundant transmission paths, are removed from the network to achieve compact compression and arrangement of the complete T-Benes network, and a Benes network with lower computational overhead is obtained.

[0103] As mentioned above Figure 2C and Figure 4B Compared with the computational overhead of the Benes network, except for the first and last columns, the computational overhead of the sub-permutation units in the middle columns will be reduced. The closer the column is to the middle of the network, the more significant the reduction in computational overhead. For the entire network, the computational overhead can be greatly improved.

[0104] According to the characteristics of the Benes network, the target Benes network constructed in this embodiment, while satisfying the correctness of the random permutation property, retains as many sub-permutation units in the network as possible and reduces the amount of shuffled data of the sub-permutation units, thereby reducing the amount of calculation required for inadvertent transmission and reducing the total calculation overhead of the Benes network during data shuffling.

[0105] In addition to the above data shuffling scenarios, Benes networks are also widely used in the communication field. For example, Benes networks can realize the connection of N network cables in a network connection scenario. The sub-permutation unit of the Benes network can be composed of one or more switches. In this field, the constructed Benes network, such as Figure 2C As shown, it will also cause the problem of a large number of switches required in the sub-permutation unit, resulting in a large total number of switches required for the Benes network. Therefore, the solution of this embodiment can also be used to construct a Benes network, so that the number of switches required in the sub-permutation unit is reduced.

[0106] In some examples, after generating the target Benes network, the position replacement rules inside the sub-shuffle unit can be determined. For example, in the data shuffle scenario, the position replacement rules inside the sub-shuffle unit can be obtained by:

[0107] Obtaining random numbers corresponding to each sub-shuffle unit contained in the Benes network to be generated; wherein the sub-shuffle unit includes multiple input positions and multiple output positions; the random numbers are used to generate the Benes network;

[0108] According to the random numbers respectively corresponding to the sub-shuffle units and the preset mapping relationship, determining the target input position mapped to the random number from the multiple input positions included in each sub-shuffle unit;

[0109] Randomly arranging the multiple input positions according to the target input position based on a preset random arrangement algorithm, and generating position replacement rules between the multiple input positions and the multiple output positions included in each sub-shuffling unit based on the random arrangement result;

[0110] According to the position replacement rule of each sub-shuffle unit, a Benes network for shuffling the data set to be shuffled is generated; wherein the random numbers corresponding to each sub-shuffle unit are stored in a preset storage location or transmitted to other servers to generate the same Benes network.

[0111] For example, in the aforementioned embodiment, T input positions of some sub-permutation units are not deleted, so the number of input positions is T; input positions of some sub-permutation units may be deleted, so the number of input positions is less than T.

[0112] Based on this, the data set to be shuffled is divided into a plurality of data blocks to be shuffled, for example, divided by columns, and the generated target Benes network can be used to perform data shuffling on each of the data blocks to be shuffled.

[0113] In some examples, the random numbers corresponding to the sub-shuffle units included in the Benes network to be generated can be obtained in a variety of ways, for example, a random number generation algorithm can be used to generate random numbers for each sub-shuffle unit separately. It can also be that after a large random number is generated, a random number is obtained for each sub-shuffle unit in a plurality of sub-shuffle units from the generated large random number, for example, the large random number is divided into a plurality of random numbers and assigned to each sub-shuffle unit. The random number corresponding to each sub-shuffle unit can be stored in a preset storage location, or transmitted to other servers, for generating the same Benes network.

[0114] Based on the construction method of the Benes network of this embodiment, the same Benes network can be used between distributed servers, or applied in scenarios where the same Benes network needs to be used multiple times.

[0115] In some examples, obtaining the random number corresponding to each sub-shuffle unit in the Benes network to be generated includes:

[0116] Obtain a random number seed, and generate a parent random number based on the random number seed;

[0117] According to the set selection rules, select corresponding random numbers from the generated parent random numbers for each sub-shuffle unit contained in the Benes network to be generated;

[0118] The random number seed is stored in a preset storage location or transmitted to other servers, so that each sub-shuffling unit selects a corresponding random number based on the random number seed to generate the same Benes network.

[0119] In this embodiment, a random number seed can be used to generate a reproducible Benes network. As an example, the random number seed can be generated in a variety of ways, and this embodiment does not limit the generation method of the random number seed. The length of the random number seed can also be arbitrary, and this embodiment does not limit this.

[0120] As an example, the generated random number seed can be stored in a non-volatile memory, and the Benes network can be reproduced through the random number seed. On the one hand, the amount of data of the random number seed is significantly reduced relative to the Benes network, achieving the purpose of compressing the storage space. On the other hand, it also solves the security problem of storing or transmitting the Benes network.

[0121] As an example, the random numbers may be generated by some complex mathematical algorithms, and the random number seed is the initial value of these random numbers. In this embodiment, the random number seed may be used to generate a parent random number of a set length. For example, an existing random number generation algorithm may be used, and this embodiment does not limit the specific algorithm. The random number seed and the set length may be used as inputs to the random number generation algorithm, and the random number generation algorithm may be used to generate a parent random number of a set length. The same random number seed, the same set length, and the same random number generation algorithm may generate the same parent random number.

[0122] As an example, the length of the parent random number can be determined as needed. For example, the scale of the benes network to be generated, that is, the number of sub-shuffle units in the network, can be determined according to the data volume N of the data set and the amount of data to be replaced T specified by the user for the sub-permutation unit in the Benes network; the length of the random number selected for each sub-shuffle unit can be set, for example, all the same or in other ways, etc. In this way, after the number of random numbers and the length of each random number are determined, the total length of the parent random number can be obtained.

[0123] As an example, the Benes network is a matrix composed of multiple sub-shuffle units, and a corresponding random number can be selected for each sub-shuffle unit from the generated parent random number according to a set selection rule. As an example, the selection rule can specify the number of bits of the random number selected by each sub-shuffle unit, the selection order of the multiple sub-shuffle units, etc. The selection rule can be flexibly configured according to actual needs, and this embodiment does not limit this.

[0124] As an example, assume that the following 128-bit random seed is generated:

[0125] 0x9a4bca88f7dfe2c18c5320d6a5c9a7e1;

[0126] The following 128-bit parent random number (in decimal) is generated using the above random number seed:

[0127] 341763148512189086889825065239356835674.

[0128] Assume that the number of sub-shuffle units in the Benes network to be generated is 12, for example, it can be a 3*4 matrix composed of 12 sub-shuffle units; in setting the selection rule, the number of bits of the random number selected by each sub-shuffle unit can be specified, and the selection order of selecting random numbers for each sub-shuffle unit in sequence by column can be specified;

[0129] Therefore, the above 128-bit parent random number can be used as the child shuffle unit π 1,1 The random number selected is: 341; for the next sub-shuffle unit π 1,2 The random number selected is: 763; for the next sub-shuffle unit π 1,3 The selected random number is: 148; and so on, until corresponding random numbers are selected for all sub-shuffle units.

[0130] Based on this, each sub-shuffle unit obtains a corresponding random number. Further, based on the random number corresponding to each sub-shuffle unit, a position permutation rule between t (t≤T) input positions and t output positions of the sub-shuffle unit can be determined. The position permutation rule represents a rule that after each of the t data is input from a certain input position of the sub-shuffle unit, it is exchanged from the input position to a certain output position for output.

[0131] The position permutation rules between the t input positions and the t output positions within the sub-shuffle unit can be generated based on the random number of the sub-shuffle unit in a variety of ways, such as by using a random permutation algorithm, including but not limited to the Fisher-Yates algorithm (Gonader scrambling algorithm), etc. The Fisher-Yates algorithm is an efficient and fair random permutation algorithm, and its basic idea is to start from the last element in the array and gradually exchange the element at the current position with a random element in the previous position in the array until the first element. This process ensures that each element has an equal chance of appearing in any position, thereby achieving true randomness.

[0132] In this embodiment, based on the random number corresponding to the sub-shuffle unit and the preset mapping relationship, after determining the target input position mapped to the random number from the multiple input positions included in the sub-shuffle unit, the preset random permutation algorithm randomly arranges the multiple input positions according to the target input position, and generates a position permutation rule between the multiple input positions and the multiple output positions included in each sub-shuffle unit based on the random permutation result. For example:

[0133] Step 1. Number the t input positions of the sub-shuffle unit, taking 1, 2, 3, ..., t as an example, and obtain the array [1, ..., t].

[0134] Step 2. Determine the corresponding target input position based on the random number; assuming it is the second input position;

[0135] Step 3. Take the end position of the array [1,…,t] as the current position, and starting from the current position, exchange the element at the current position in the array with the element at the target input position.

[0136] From the current position of the array to the previous position, execute steps 2 and 3 again; and so on, until you reach the first element of the array and get the shuffled array.

[0137] Based on this, the random permutation algorithm of this embodiment inputs t input positions and the target input position mapped to the random number, and the algorithm arranges the t input positions based on the target input position, and obtains t output positions corresponding to the t input positions after arrangement. For example, taking t=4 as an example, the four input positions are numbered 1, 2, 3, and 4 respectively, and the algorithm arranges "1, 2, 3, 4", and the arrangement result is "4, 2, 1, 3". The order of the numbers corresponding to the input positions in the arrangement result indicates the output positions corresponding to the input positions; for example, the number of the first input position is "1", which is located in the third position in the arrangement result, and the first input position corresponds to the third output position.

[0138] In this embodiment, the random position selected by the existing random permutation algorithm is set, and the fixed target input position is determined by the random number of the sub-shuffle unit, thereby achieving the reproduction of the position replacement rule of each sub-shuffle unit.

[0139] In practical applications, the above-mentioned preset mapping relationship can be implemented in a variety of ways, as long as the random number can have a mapping relationship with an input position among the multiple input positions included in the sub-shuffling unit.

[0140] As an example, determining, from a plurality of input positions included in each sub-shuffle unit according to the random numbers respectively corresponding to each sub-shuffle unit and the preset mapping relationship, a target input position mapped to the random number may include:

[0141] Obtain a remainder of a random number corresponding to each sub-shuffle unit divided by the number of input positions of the sub-shuffle unit, and determine a target input position mapped to the remainder from the multiple input positions included in each sub-shuffle unit.

[0142] This embodiment uses the remainder obtained by dividing the random number corresponding to the sub-shuffle unit by the number of input positions of the sub-shuffle unit, for example, in the above embodiment, each input position of the sub-shuffle unit is numbered, and the remainder and the number have a corresponding relationship. Therefore, the same random number can obtain the same position replacement rule.

[0143] Based on this, with the same random number, the same number of input positions and the same random permutation algorithm, the algorithm can produce the same permutation results for multiple input positions of the sub-shuffle unit, thereby obtaining the same position replacement rule for the sub-shuffle unit. Combined with the aforementioned characteristics of random number seeds that can generate reproducible random numbers, and the use of set selection rules, the position replacement rule of each sub-shuffle unit can be reproduced, and the effect of reproducing the same Benes network can be achieved. Therefore, support can be provided for the distributed shuffling of data sets or the split shuffling of data sets.

[0144] In some examples, the multiple data blocks to be shuffled are distributed and stored in multiple shuffling servers in a distributed system, and the random number seed is generated by any shuffling server in the distributed system and transmitted to other shuffling servers in the distributed system, so that any shuffling server storing the data blocks to be shuffled generates the Benes network and then shuffles the stored data blocks to be shuffled.

[0145] In some examples, the method further comprises:

[0146] Any shuffling server in the distributed system obtains data shuffling results of other shuffling servers and then performs splicing to obtain the shuffling result of the data set to be shuffled.

[0147] In some examples, the data blocks to be shuffled stored by the shuffling server include: data blocks to be shuffled corresponding to plaintext data blocks provided by a data party server of a data holder; and multiple plaintext data blocks divided from a plaintext data set of the data holder are distributedly stored in multiple data party servers of the data holder.

[0148] In some examples, the method further comprises:

[0149] Any shuffling server in the distributed system sends the data shuffling result to the data cube server that provides the data blocks to be shuffled, and any data cube server among the multiple data cube servers obtains the data shuffling results of other data cube servers and then splices them to obtain the shuffling result of the data set to be shuffled.

[0150] As an example, each shuffle server may execute the process of generating a Benes network in the aforementioned embodiment, and each shuffle server may reproduce the same Benes network and perform data shuffling on the stored data blocks.

[0151] As an example, the random number seed may be generated by a shuffle server in a distributed system and may be transmitted to other shuffle servers by broadcasting or the like.

[0152] In this embodiment, only the random number seeds need to be transmitted among multiple shuffling servers, and other shuffling servers can generate the same Benes network based on the random number seeds. Compared with transmitting the entire Benes network in a distributed system, the communication volume between servers is significantly reduced, which is more efficient and secure.

[0153] In some examples, the method is applied to a server, the server storing a plurality of to-be-shuffled data blocks divided from the to-be-shuffled data set; the method further includes:

[0154] Inputting each of the to-be-shuffled data blocks into the Benes network to obtain a shuffling result for each of the to-be-shuffled data blocks;

[0155] The shuffling results of the data blocks to be shuffled are concatenated to obtain the shuffling result of the data set to be shuffled.

[0156] As an example, this embodiment can divide the data set to be shuffled into multiple data blocks to be shuffled, and the server can shuffle each data block to be shuffled locally. The data blocks to be shuffled need to be loaded from the hard disk to the memory and then the data shuffling operation is performed. Compared with the method of loading the entire data set to be shuffled into the memory, the memory requirement of this embodiment is significantly reduced.

[0157] In some examples, when shuffling data for each data block to be shuffled, the aforementioned embodiment can be executed to generate a Benes network, and data shuffling can be performed on the data block to be shuffled this time. The shuffling results of the data blocks to be shuffled each time can be stored in the hard disk. After the data shuffling of all the data blocks to be shuffled is completed, the shuffling results of the data blocks to be shuffled stored in the hard disk are spliced ​​to obtain the shuffling results of the data set. Since the Benes network of this embodiment is reproducible, the segmentation and shuffling of the data set to be shuffled is achieved.

[0158] In other examples, it can also be the first time to shuffle, execute the above-mentioned embodiment to generate a Benes network and store it in the memory, each time after loading the data block to be shuffled into the memory, read the Benes network to perform data shuffling, the data shuffling result can be stored in the hard disk, and finally the shuffling results of each data block to be shuffled stored in the hard disk are spliced ​​to obtain the shuffling result of the data set. If the memory data is lost, the random number seed can be read from the non-volatile memory, the Benes network can be regenerated, and the data shuffling can be continued for the data blocks to be shuffled that have not been shuffled. In this embodiment, what is stored in the hard disk is the random number seed instead of the Benes network, so on the basis of realizing the segmentation and shuffling of the data set to be shuffled, the safety of data shuffling can be guaranteed.

[0159] In some examples, the to-be-shuffled data set includes: a to-be-shuffled data set corresponding to the plaintext data set provided by a data holder.

[0160] In some examples, the plaintext data set includes: a plaintext feature set for machine learning training.

[0161] In some examples, based on the sub-random numbers corresponding to each sub-shuffle unit, calling a preset random permutation algorithm to generate position permutation rules from multiple input positions to multiple output positions within each sub-shuffle unit includes:

[0162] For each sub-shuffle unit, after dividing the sub-random number corresponding to the sub-shuffle unit by the number of input positions of the sub-shuffle unit and taking the remainder to obtain the remainder, calling a preset random permutation algorithm, so that the preset random permutation algorithm determines a random position among multiple input positions of the sub-shuffle unit based on the remainder, and then randomly permutes the multiple input positions of the sub-shuffle unit to obtain a position permutation rule between the multiple input positions to the multiple output positions inside the sub-shuffle unit.

[0163] As can be seen from the above embodiments, the data shuffling method of this embodiment improves the original inadvertent shuffling protocol, so that it can use less memory resources to process the protocol, and further enables the protocol to support distributed computing. This embodiment has strong decoupling and can be used for data shuffling in memory-constrained or distributed scenarios.

[0164] For example, for the scenario of insufficient memory of a single machine, the main reason for insufficient memory due to inadvertent shuffling of data is that samples often carry a large amount of data features that need to be shuffled together, which causes the data to have to read the entire data table into memory for processing during the shuffling process. In view of this situation, the present embodiment can reproduce the benes network, so the data can be split by column, and each piece of data can be read into memory in turn for shuffling operations, and then the shuffled results can be output to the specified position of the hard disk, so that each output result can be spliced ​​on the hard disk. Finally, the two parties obtain secret sharing fragments carrying massive data features while completing the inadvertent shuffling protocol. As long as the computing memory required for a certain feature of all samples is lower than the threshold, the calculation of the inadvertent shuffling of the entire data table can be completed by splitting the data features by column.

[0165] This embodiment further provides a data shuffling system, the data shuffling system comprising a plurality of data cube servers of a data holder and a plurality of shuffling servers of a data shuffling party; a plurality of plaintext data blocks divided from a plaintext data set of the data holder are respectively stored in the plurality of data cube servers;

[0166] Any shuffle server among the plurality of shuffle servers transmits the generated random number seed to other shuffle servers;

[0167] Each of the plurality of shuffle servers is configured to:

[0168] Obtain the data block to be shuffled corresponding to the plaintext data block provided by the corresponding data party server;

[0169] Obtain a random number seed, and generate a parent random number based on the random number seed;

[0170] According to the set selection rule, a corresponding random number is selected from the generated random numbers for each sub-shuffle unit included in the Benes network to be generated;

[0171] According to the random numbers respectively corresponding to the sub-shuffle units and the preset mapping relationship, determining the target input position mapped to the random number from the multiple input positions included in each sub-shuffle unit;

[0172] Randomly arranging the multiple input positions according to the target input position based on a preset random arrangement algorithm, and generating position replacement rules between the multiple input positions and the multiple output positions included in each sub-shuffling unit based on the random arrangement result;

[0173] Generate a Benes network according to the position replacement rules of each sub-shuffle unit;

[0174] The Benes network is used to perform data shuffling on the data blocks to be shuffled.

[0175] Corresponding to the above-mentioned embodiment of the method for constructing a Benes network, this specification also provides an embodiment of an apparatus for constructing a Benes network and a computer device used therein.

[0176] The data shuffling system of the embodiment of the present specification comprises a plurality of data party servers of a data holder and a plurality of shuffling servers of a data shuffling party; a plurality of plaintext data blocks divided from a plaintext data set of a data holder are respectively stored in the plurality of data party servers; any shuffling server among the plurality of shuffling servers transmits a random number seed after generating it to other shuffling servers; each shuffling server among the plurality of shuffling servers can reproduce the effect of the same Benes network through the above embodiment, so that the data party server can perform distributed storage of the plaintext data set, and can communicate with the shuffling server one by one, and shuffle the corresponding shuffling server through the data blocks to be shuffled, thereby realizing distributed shuffling of the data set.

[0177] The embodiments of the device for constructing the Benes network in this specification can be applied to computer devices, such as servers or terminal devices. The device embodiments can be implemented by software, hardware, or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by the processor in which it is located reading the corresponding computer program instructions in the non-volatile memory into the memory and running them. From the hardware level, if Figure 6 The figure is a hardware structure diagram of the computer device where the Benes network construction device of this manual is located, except Figure 6 In addition to the processor 610, network interface 620, memory 630, and non-volatile memory 640 shown, the computer device where the Benes network construction device is located in the embodiment may also include other hardware according to the actual function of the computer device, which will not be described in detail.

[0178] The embodiment of this specification provides a device for constructing a Benes network, the device comprising:

[0179] The acquisition module is used to: acquire the data volume N of the data set to be replaced and the data volume T to be replaced specified by the user for the sub-replacement unit in the Benes network; wherein T is a power of 2;

[0180] Building blocks for: Based on the N and The difference k of , constructs the target Benes network;

[0181] Wherein, relative to the complete T-Benes network, the target Benes network does not include the input positions, output positions and transmission paths between the k input positions to be deleted of the first column of sub-permutation units in the complete T-Benes network and the output positions of the last column of sub-permutation units;

[0182] The complete T-Benes network refers to a matrix composed of multiple sub-permutation units, and the number of columns in the matrix is Each column of the matrix contains Sub-replacement unit, The sub-permutation unit includes T input positions and T output positions; the complete T-Benes network includes: a transmission path between two adjacent columns of sub-permutation units and between each output position of a sub-permutation unit and one of the input positions of the next column of sub-permutation units; the sub-permutation unit is used to receive the T data in the data set through the T input positions respectively and perform position permutation, and transmit the T data after position permutation from the T output positions to the input position of the next column of sub-permutation units through the transmission path.

[0183] In some examples, the building block, based on the N and the The difference k of , constructs the target Benes network, including:

[0184] According to the N and the T, determine a corresponding complete T-Benes network;

[0185] Based on the N and the After determining the k input positions to be deleted of the first column sub-permutation unit in the complete T-Benes network, the target Benes network is constructed.

[0186] In some examples, the building module constructs a target Benes network, including:

[0187] The k input positions to be deleted in the first column of sub-permutation units are propagated along straight lines inside the corresponding sub-permutation units to obtain k output positions to be deleted in the first column of sub-permutation units;

[0188] After obtaining the k to-be-deleted input positions of the second column of sub-permutation units based on the transmission path between the k to-be-deleted output positions of the first column of sub-permutation units and the input positions of the second column of sub-permutation units, the k to-be-deleted output positions of the second column of sub-permutation units are obtained based on the set position permutation rule inside the corresponding sub-permutation units, and so on, until the last column of sub-permutation units in the complete T-Benes network, all the to-be-deleted input positions and all the to-be-deleted output positions in the complete T-Benes network are obtained;

[0189] All input positions to be deleted, all output positions to be deleted, and transmission paths between each input position to be deleted and each output position to be deleted are deleted from the complete T-Benes network to obtain a target Benes network.

[0190] In some examples, obtaining k output positions to be deleted of the second column of sub-permutation units based on a set position exchange rule within the corresponding sub-permutation unit includes:

[0191] Propagate along a straight line inside the corresponding sub-permutation unit to obtain k output positions to be deleted of the second column of sub-permutation units.

[0192] In some examples, the k input positions to be deleted of the first column of sub-permutation units in the complete T-Benes network include the last k input positions of all input positions of the first column of sub-permutation units.

[0193] In some examples, the target Benes network is used for data shuffling, and the k input positions to be deleted of the first column of sub-permutation units in the complete T-Benes network include: k input positions located in the middle of all input positions of the first column of sub-permutation units.

[0194] In some examples, the apparatus further comprises a replacement module for:

[0195] Each data of the data set to be replaced is input into each input position of the sub-replacement unit in the first column of the constructed target Benes network, and the target Benes network outputs the data set after position replacement.

[0196] In some examples, the data set to be replaced includes a data set to be shuffled, and the sub-permutation unit is used to receive t data in the data set through the t input positions respectively and perform data shuffling, t≤T.

[0197] In some examples, the building blocks are also used to:

[0198] Obtaining random numbers corresponding to each sub-shuffle unit contained in the Benes network to be generated; wherein the sub-shuffle unit includes multiple input positions and multiple output positions; the random numbers are used to generate the Benes network;

[0199] According to the random numbers respectively corresponding to the sub-shuffle units and the preset mapping relationship, determining the target input position mapped to the random number from the multiple input positions included in each sub-shuffle unit;

[0200] Randomly arranging the multiple input positions according to the target input position based on a preset random arrangement algorithm, and generating position replacement rules between the multiple input positions and the multiple output positions included in each sub-shuffling unit based on the random arrangement result;

[0201] According to the position replacement rule of each sub-shuffle unit, a Benes network for shuffling the data set to be shuffled is generated; wherein the random numbers corresponding to each sub-shuffle unit are stored in a preset storage location or transmitted to other servers to generate the same Benes network.

[0202] The implementation process of the functions and effects of each module in the above-mentioned Benes network construction device is specifically described in the implementation process of the corresponding steps in the above-mentioned Benes network construction method, which will not be repeated here.

[0203] Accordingly, an embodiment of the present specification also provides a computer program product, including a computer program, which implements the steps of the aforementioned Benes network construction method embodiment when executed by a processor.

[0204] Accordingly, an embodiment of the present specification also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the embodiment of the method for constructing a Benes network are implemented.

[0205] Accordingly, an embodiment of the present specification also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the embodiment of the method for constructing a Benes network are implemented.

[0206] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this specification. A person of ordinary skill in the art can understand and implement it without paying creative labor.

[0207] The above embodiments can be applied to one or more computer devices, where the computer device is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions. The hardware of the computer device includes but is not limited to a microprocessor, an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a digital signal processor (DSP), an embedded device, etc.

[0208] The computer device may be any electronic product that can perform human-computer interaction with a user, such as a personal computer, a tablet computer, a smart phone, a personal digital assistant (PDA), a game console, an interactive network television (IPTV), a smart wearable device, etc.

[0209] The computer device may also include a network device and / or a user device, wherein the network device includes, but is not limited to, a single network server, a server group consisting of multiple network servers, or a cloud consisting of a large number of hosts or network servers based on cloud computing.

[0210] The network where the computer device is located includes but is not limited to the Internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (VPN), etc.

[0211] The above is a description of a specific embodiment of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0212] The step division of the above methods is only for clear description. When implemented, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are all within the protection scope of this patent; adding insignificant modifications to the algorithm or process or introducing insignificant designs without changing the core design of the algorithm and process are all within the protection scope of this application.

[0213] Although this specification includes many specific implementation details, these should not be interpreted as limiting the scope of any invention or the scope of protection claimed, but are mainly used to describe the features of the specific embodiments of specific inventions. Certain features described in multiple embodiments in this specification may also be implemented in combination in a single embodiment. On the other hand, the various features described in a single embodiment may also be implemented separately in multiple embodiments or in any suitable sub-combination. In addition, although features may work in certain combinations as described above and even initially claim protection, one or more features from the claimed combination may be removed from the combination in some cases, and the claimed combination may point to a sub-combination or a variation of a sub-combination.

[0214] The description of "specific examples" or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of this specification. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0215] Those skilled in the art will readily appreciate other embodiments of the specification after considering the specification and practicing the invention claimed herein. The specification is intended to cover any variations, uses or adaptations of the specification that follow the general principles of the specification and include common knowledge or customary techniques in the art that are not claimed in the specification. The specification and examples are to be considered exemplary only, and the true scope and spirit of the specification are indicated by the following claims.

[0216] It should be understood that the present description is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present description is limited only by the appended claims.

[0217] The above description is only a preferred embodiment of this specification and is not intended to limit this specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this specification should be included in the scope of protection of this specification.< / x> < / x> < / x> < / x> < / x> < / x> < / x> < / x>

Claims

1. A method for constructing a Benes network, the method comprising: Obtaining the data volume N of the data set to be replaced and the replacement data volume T specified for the sub-replacement unit in the Benes network; wherein T is a power of 2; According to the N and the T, a corresponding complete T-Benes network is determined; the complete T-Benes network includes a transmission path from the input position of the first column sub-permutation unit in the column sub-permutation unit to the output position of the last column sub-permutation unit in sequence; Each column of the sub-permutation units in the column sub-permutation unit comprises sub-permutation units, each of which comprises T input positions and T output positions, and is used to perform position permutation on the T data received from the T input positions and then transmit the data from the T output positions to the input positions of the next column of the sub-permutation units via the transmission path; Based on the N and The difference k of , determining the k input positions to be deleted of the first column sub-permutation unit in the complete T-Benes network; A target Benes network is constructed by deleting input positions, output positions and transmission paths from the k to-be-deleted input positions of the first column of sub-permutation units to the output positions of the last column of sub-permutation units in the complete T-Benes network.

2. According to the method of claim 1, constructing the target Benes network comprises: For the k to-be-deleted input positions of the first column sub-permutation unit, determine the output position to be deleted corresponding to each to-be-deleted input position in the first column sub-permutation unit to which it belongs, and obtain the k to-be-deleted output positions of the first column sub-permutation unit; After obtaining the k to-be-deleted input positions of the second column sub-permutation unit based on the transmission path between the k to-be-deleted output positions of the first column sub-permutation unit and the input positions of the second column sub-permutation unit, respectively determine the output position to be deleted corresponding to each to-be-deleted input position in the second column sub-permutation unit to which it belongs, and so on, until the k to-be-deleted output positions of the last column sub-permutation unit in the complete T-Benes network are determined, and all the to-be-deleted input positions and all the to-be-deleted output positions in the complete T-Benes network are obtained; All input positions to be deleted, all output positions to be deleted, and transmission paths between each input position to be deleted and each output position to be deleted are deleted from the complete T-Benes network to obtain a target Benes network.

3. The method according to claim 2, wherein the output position to be deleted corresponding to the input position to be deleted in the sub-permutation unit to which it belongs comprises: The output position corresponding to the input position to be deleted after being transmitted along a straight line in the corresponding sub-permutation unit.

4. The method according to claim 1, wherein the k input positions to be deleted of the first column sub-permutation unit in the complete T-Benes network include: The first column of sub-permutation units is located at the last k input positions of all input positions.

5. The method according to claim 1, wherein the k input positions to be deleted of the first column sub-permutation unit in the complete T-Benes network include: The k input positions in the middle of all the input positions of the sub-permutation units in the first column.

6. The method according to claim 1, further comprising: Each data of the data set to be replaced is input into each input position of the sub-replacement unit in the first column of the constructed target Benes network, and the target Benes network outputs the data set after position replacement.

7. The method according to claim 1, wherein the data set to be replaced comprises a data set to be shuffled, and the target Benes network is used to perform data shuffling on the data set to be shuffled.

8. A method for constructing a Benes network, the method comprising: Obtaining the data volume N of the data set to be replaced and the replacement data volume T specified by the user for the sub-replacement unit in the Benes network; wherein T is a power of 2; Based on the N and The difference k of , constructs the target Benes network; Wherein, relative to the complete T-Benes network, the target Benes network does not include the input positions, output positions and transmission paths between the k input positions to be deleted of the first column of sub-permutation units in the complete T-Benes network and the output positions of the last column of sub-permutation units; The number of columns of sub-permutation units in the complete T-Benes network is The number of sub-permutation units in each column is indivual, The sub-permutation unit in the complete T-Benes network includes T input positions and T output positions; the complete T-Benes network includes: a transmission path between two adjacent columns of sub-permutation units and between each output position of a sub-permutation unit and one of the input positions of the next column of sub-permutation units; the sub-permutation unit is used to receive the T data in the data set through the T input positions respectively and perform position permutation, and transmit the T data after position permutation from the T output positions to the input position of the next column of sub-permutation units through the transmission path.

9. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of any one of the methods of claims 1 to 8.

11. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • A parallel computing system

    CN109445752A

  • Assembly line type BENES network routing solution hardware acceleration device

    CN115379316A

  • Data processing method and device based on privacy protection, equipment and storage medium

    CN116915405A

  • Method and system for performing permutations using permutation instructions based on butterfly networks

    US20020031220A1

  • Permutation network designing method, and permutation circuit of QC-LDPC decoder

    US20190036548A1