Method, device, program product, and storage medium for constructing benes network

By constructing a target Benes network and removing redundant input locations and transmission paths, the problem of high computational overhead in existing Benes networks is solved, and more efficient data replacement is achieved.

CN119276733BActive Publication Date: 2025-11-25ANT BLOCKCHAIN TECHNOLOGY (SHANGHAI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing Benes networks incur significant computational overhead when permuting data locations, especially in scenarios requiring substantial computational resources, such as privacy-preserving computation.

Method used

By obtaining the amount of data N in the dataset to be permuted and the amount of permutation data T specified by the sub-permutation unit, a complete T-Benes network is constructed. Based on the difference k between N and T, unnecessary input positions, output positions, and transmission paths are removed to construct the target Benes network, thereby reducing the amount of data within the sub-permutation unit.

Benefits of technology

This reduces the computational cost of data permutation in the Benes network, minimizes unnecessary computational overhead, and improves computational efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119276733B_ABST
    Figure CN119276733B_ABST
Patent Text Reader

Abstract

Embodiments of the present specification provide a Benes network construction method, device, program product and storage medium. The method comprises: obtaining a data amount N of a to-be-permuted data set and a specified permutation data amount T of a sub-permutation unit in the Benes network; determining a corresponding complete T-Benes network according to N and T; determining k to-be-deleted input positions of a first column of sub-permutation units in the complete T-Benes network based on a difference k between N and T; and constructing a target Benes network by deleting input positions, output positions and transmission paths in the complete T-Benes network from the k to-be-deleted input positions of the first column of sub-permutation units to output positions of a last column of sub-permutation units. The Benes network of the present embodiment can retain a larger number of sub-permutation units, reduce the data amount of permutation in the sub-permutation units, reduce the data permutation calculation overhead of the sub-permutation units, and reduce the total permutation calculation overhead of the network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of Benes network technology, and in particular to methods, devices, program products and storage media for constructing Benes networks. Background Technology

[0002] Benes networks are well-known rearrangeable, non-blocking butterfly networks in circuit switching, capable of performing all permutations from input to output. As a non-blocking switching network, they were initially widely used in the communications field. Currently, Benes networks are also applied in scenarios such as privacy computing protection, where they are used to permutate the positions of data entries in a dataset to achieve data shuffling. However, the Benes networks constructed in related technologies require significant computational overhead when performing data permutations. Summary of the Invention

[0003] To overcome the problems existing in related technologies, this specification provides a method, device, program product and storage medium for constructing Benes networks.

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

[0005] Obtain the data size N of the dataset to be permuted and the permutation data size T specified for the sub-permutation unit in the Benes network; wherein, T is a power of 2;

[0006] Based on N and T, determine the corresponding complete T-Benes network; the complete T-Benes network includes... The transmission path between the input position of the first sub-permutation unit and the output position of the last sub-permutation unit in the sub-permutation unit; Each column of the sub-permutation unit contains Each sub-permutation unit comprises T input positions and T output positions, and is used to perform position permutation on 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 sub-permutation unit via the transmission path;

[0007] Based on the N and The difference k is used to determine the k input positions to be deleted for the first column of sub-permutation units in the complete T-Benes network;

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

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

[0010] Obtain the data size N of the dataset to be permuted and the permutation data size T specified by the user for the sub-permutation unit in the Benes network; wherein, T is a power of 2;

[0011] Based on the N and The difference k is used to construct the target Benes network;

[0012] The target Benes network, relative to the complete T-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 position of the last column of sub-permutation units;

[0013] The number of columns of the sub-permutation units in the complete T-Benes network is The number of sub-permutation units in each column is indivual, The complete T-Benes network contains T input positions and T output positions in its sub-permutation unit. The complete T-Benes network includes transmission paths between 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 receives T data points from the dataset through the T input positions and performs position permutations, then transmits the T permuted data points from the T output positions to the input positions of the next column of sub-permutation units via the transmission paths.

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

[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, which, when executed by a processor, implements the steps of the method embodiments described in the first aspect above.

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

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

[0018] In this embodiment, the data size N of the dataset to be permuted and the data size T 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-permutation unit In a complete T-Benes network, a sub-permutation unit comprises T input positions and T output positions. The complete T-Benes network includes transmission paths between 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 receives T data points from the dataset through the T input positions and performs position permutations, then transmits the T permuted data points from the T output positions to the input positions of the next column of sub-permutation units via the transmission paths. This embodiment is based on the relationship between N and... The difference k is used to construct a target Benes network. This target Benes network, relative to the complete T-Benes network, does not include the input positions, output positions, and transmission paths from the k input positions to be deleted in the first column of the complete T-Benes network to the output position of the last column of the sub-permutation unit. Based on this, the Benes network constructed in this embodiment reduces the amount of data to be permuted within each sub-permutation unit by retaining more sub-permutation units, thus reducing the computational load of data permutation in each sub-permutation unit and consequently reducing the overall computational load of the Benes network.

[0019] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0020] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this specification and, together with the specification, serve to explain the principles of the embodiments described herein.

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

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

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

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

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

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

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

[0028] Figure 5 This is a schematic diagram illustrating data shuffling based on an unintentional shuffling protocol within a sub-permutation unit according to an exemplary embodiment of this specification.

[0029] Figure 6 This is a hardware structure diagram of a computer device containing a Benes network construction apparatus according to an exemplary embodiment of this specification. Detailed Implementation

[0030] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this specification. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this specification as detailed in the appended claims.

[0031] The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of this specification. The singular forms “a,” “the,” and “the” as used in this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the 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 information of the same type from one another. For example, without departing from the scope of this specification, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."

[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, data stored, data displayed, etc.) involved in this manual are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.

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

[0035] like Figure 1 The image shown is a schematic diagram of a Benes network. Figure 1 Each rectangle with a black border is a sub-permutation unit. Each sub-permutation unit is used to permutate the positions of two input data points before outputting the result. The Benes network is a recursive structure. For example, each sub-permutation unit located in the third column of the diagram, within the green box, can be used to permutate the positions of two input data points before outputting the result; the six sub-permutation units within the blue box are used to permutate the positions of four input data points before outputting the result; and the 20 sub-permutation units within the red box are used to permutate the positions of eight input data points before outputting the result.

[0036] By changing the number of sub-permutation units in the network structure, a network structure can be achieved that allows the input data to be output in any order. For example, for a Benes network with N samples, it is necessary to construct... The layered network achieves N completely random permutations. Here, "layer" refers to... Figure 1 The vertically arranged columns are shown. Among them, the symbols... This indicates rounding up to the nearest integer.

[0037] Based on the Benes network, the T-Benes network was developed. The T-Benes network was initially designed to solve the end-to-end node connectivity problem, that is, by adjusting the connection method of each sub-permutation unit (T-switch) and the fixed physical connection lines (i.e., Figure 1The T-Benes network connects the sub-permutation units (connections between each other) to achieve interconnection between any two nodes at either end. In a T-Benes network, each sub-permutation unit has T input positions and T output positions, meaning each sub-permutation unit has an input size of T, where T is a power of 2. It can perform position permutations of T input data and then output from the T output positions. A T-Benes network can be considered a matrix composed of multiple sub-permutation units, with the matrix having a number of columns. 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] T-Benes networks can be applied in many fields, such as privacy computing. To illustrate the application of T-Benes networks in privacy computing, we will first explain some terminology in the field of privacy computing.

[0039] Unintentional shuffle: Unintentional shuffle is a protocol in which participating parties shuffle and scramble data from one party in a random order or an order specified by a non-data holder. This protocol allows both parties to secretly share the scrambled data. Unintentional shuffle is a fundamental component of many security protocols (such as random sorting, secure collaborative filtering, and hidden queries) to effectively disconnect the original data location from subsequent computational processes.

[0040] Oblivious Transfer (OT) is a type of protocol in cryptography that allows the sender to pass one of several potential messages to the receiver while remaining unaware of the message received.

[0041] Secret Sharing: Secret sharing is a cryptographic technique that secretly divides data and stores it among all participants to achieve the purpose of risk dispersion and tolerance for intrusion. It is an important means of information security and data confidentiality.

[0042] Privacy-preserving computation, as an information technology that balances privacy protection requirements with the utilization of data value, has experienced rapid development and attracted widespread attention in recent years. Unintentional data shuffling protocols, as protocols capable of severing data positional relationships, can solve the problem of data structure information being traced back and are widely used in the data initialization phase. Currently, mainstream unintentional data shuffling protocols utilize unintentional transmission and secret sharing for computation on top of a plaintext random shuffling network, achieving strong provable security. The industry typically optimizes and improves the structure of random shuffling networks for privacy-preserving computation scenarios to increase data shuffling efficiency and reduce the communication volume required by the shuffling protocol.

[0043] The existing Secret-Shared Shuffle computation method can be combined with Figure 2A To explain:

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

[0045] The non-data holder randomly generates a shuffling function π, which is generated by each sub-shuffling unit π within a special Benes network structure. i,j Generate, and based on the fixed connection layer τ in the network i It is determined by the random shuffling rules that combine the elements. For example, Figure 2A In the T-Benes network shown, T is 4, and each rounded rectangle is a sub-permutation unit, which can also be called a sub-shuffling unit in a data shuffling 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. Figure 2A The solid lines between each column of rounded rectangles and the next column of rounded rectangles represent the data. The dashed lines within the sub-permutation units represent the secret shuffling of the T input data by the sub-permutation unit. The specific rules for this shuffling are only known to the non-data holders and are unknown to the data holders. Therefore, the T-Benes network can achieve arbitrary sequence shuffling of data through random transformations of the sub-permutation units. In the unintentional shuffling protocol, each time data passes through a sub-permutation unit, a secret data shuffling occurs, and the secret sharing value of the data is updated, achieving the goal of completely hiding the data shuffling process from the data holders. Ultimately, both parties obtain π(X) = {x...} π(1) ,…,x π(n) The secret share of} is used to complete the agreement.

[0046] Taking the Oblivious Shuffle protocol, an example of a protocol where two parties accidentally mix and shuffle, as an example:

[0047] The input to the protocol refers to: P0 inputs plaintext data X = {x1, ..., x...} n}, P1 inputs the shuffling function π, where π is formed by each sub-permutation unit π within the T-Benes network structure. i,j and the fixed connection layer τ in the network i The combined random shuffling rules. τ i The layer is an open network structure, where both sides transmit data according to the specified connections, and each π i,j Only P1 knows.

[0048] The protocol output means that P0 and P1 respectively obtain the secret fragments <π(X)>0 and <π(X)>1 after data shuffling, where π(X) = {x π(1) ,…,x π(n)}. <π(X)>0 indicates that P0 obtains data fragments that are shuffled using the shuffling function π on the plaintext data X.

[0049] The protocol flow can be:

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

[0051] P0 will <x>0 is treated as plaintext 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, which will share π. i,j As input to the protocol, both parties will eventually receive a fragment <π. i,j ( <x>0)>0 and <π i,j ( <x>0)>1. P0 directly sets <π i,j ( <x>0)>0 is output as the sub-permutation unit; P1 then calculates π locally. i,j ( <x> 1)+<π i,j ( <x>0)>1, used as the fragmentation value of the protocol.

[0052] 2. Combining Figure 2A To explain, after P0 and P1 calculate the secret fragments of all numbers in layer π1 using the shuffling method of the sub-permutation units, they both transfer the fragments output by each node to designated locations locally, based on the publicly disclosed structure of layer τ1, and directly use them as the inputs to the next layer π2. This step is repeated until all Benes network layers have been calculated.

[0053] The study of the above process reveals that for constructing a Benes network connection layer τ that satisfies an arbitrary number of samples... i In terms of structure, the industry often adopts a network size of equal size and ensures that the sub-permutation units of each layer of the network are the same. Then, each sub-permutation unit of the upper layer is sequentially placed into the T parts of the lower layer.

[0054] For example, taking a dataset with T=4 and a data size N of 64 to be shuffled, the corresponding complete T-Benes network could be as follows: Figure 2B The network structure shown in the figure has each square representing a sub-permutation unit, and the number inside the square represents the amount of data input to that sub-permutation unit. Figure 2B For simplicity, the transmission path between sub-permutation units is not shown. In this example, the data volume 64 is exactly equal to T. 4 This just reaches the upper limit of the amount of input data that a complete T-Benes network can receive.

[0055] However, in practical applications, there are situations where the amount of data N to be shuffled does not reach the upper limit of the input data volume that a complete T-Benes network can accept. Take, for example, T=4 and the amount of data N in the dataset to be shuffled is 39. N is not a power of T, T... 3 <39<T 4 That is, the amount of data N to be shuffled has not reached the upper limit of the input data that a complete T-Benes network can receive (4 4 =64), such as Figure 2C The image shows a Benes network constructed using existing technologies. Figure 2C For the sake of simplicity, not all transmission paths are shown in the example. Figure 2C Each rounded square represents a sub-shuffle unit, and the number inside the square represents the amount of shuffled data in that sub-permutation unit.

[0056] The existing concept for constructing a Benes network involves determining the number of columns of sub-permutation units in the Benes network based on the amount of data to be shuffled N and the maximum amount of data to be shuffled T specified by the user for the sub-permutation unit. For the first sub-permutation unit, the shuffled data volume t is set from top to bottom. The t of the preceding sub-permutation units will reach the set value T, and the t of the last sub-permutation unit will be less than the value T, so that the total shuffled data volume of this column of sub-permutation units reaches N. For example... Figure 2C As shown, in the first column of sub-permutation units, the shuffled data volume t of each of the first 9 sub-permutation units reaches the set value T, which is 4; the shuffled data volume t of the last sub-permutation unit in this column is 3, and the total shuffled data volume of the sub-permutation units in this column reaches 39. The same applies to the other columns of sub-permutation units.

[0057] The above scheme constructs the Benes network based on the idea of ​​minimizing the number of sub-permutation units. Therefore, in a sequence of sub-permutation units, except for the last sub-shuffle unit where the shuffled data volume t does not reach the maximum value T, the shuffled data volume t of each of the preceding sub-permutation units reaches the maximum value T. In this way, the total number of sub-permutation units in the constructed Benes network can be compressed to a minimum. However, research has found that this type of Benes network actually introduces a large amount of computation when performing data shuffling.

[0058] In an unintentional shuffling protocol, during data shuffling, each sub-permutation unit needs to perform... This is an unintentional transmission of calculations. For example... Figure 2C In the Benes network shown, in a sequence of sub-permutation units, the shuffled data volume of each sub-permutation unit in the first 9 sub-permutation units is 4, therefore the number of computations for each sub-permutation unit is... That is, 4 × 2 = 8 times; the shuffling data volume of the last sub-permutation unit is 3, and the number of calculations for this sub-permutation unit is... That is, 3 × 2 = 6 times. The total number of calculations for this sub-permutation unit is 9 × 8 + 1 × 6 = 78 times; the same applies to other sub-permutation units. This Benes network has 5 sub-permutation units, so the total number of calculations for unintended transmissions in the Benes network is 78 × 5.

[0059] The existing technology's network construction concept, which minimizes the number of sub-permutation units, aims to maximize the data shuffling amount t of each sub-permutation unit to its maximum value T. However, this also increases the number of inadvertent transmission computations required by each sub-permutation unit. As we can see, when t reaches its maximum value T, the computational cost of unintentional transmission of sub-permutation units reaches its maximum, ultimately leading to a large computational cost for the Benes network.

[0060] Based on this, the embodiments of this specification provide an embodiment of a method for constructing a Benes network. When the Benes network is applied to scenarios such as data shuffling, by retaining more sub-permutation units, the amount of data shuffling within the sub-permutation units is reduced accordingly, thereby reducing the overall shuffling computation of the Benes network.

[0061] like Figure 3 The diagram shown is a flowchart illustrating a method for constructing a Benes network according to an exemplary embodiment of this specification, which may include the following steps:

[0062] In step 302, the amount of data N in the dataset to be permuted and the amount of data T to be permuted for the sub-permutation unit in the Benes network are obtained; wherein, T is a power of 2.

[0063] In step 304, based on N and T, the corresponding complete T-Benes network is determined; the complete T-Benes network includes data from... The transmission path between the input position of the first sub-permutation unit and the output position of the last sub-permutation unit in the sub-permutation unit; Each column of the sub-permutation unit contains Each sub-permutation unit comprises T input positions and T output positions, and is used to perform position permutation on 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 sub-permutation unit via the transmission path.

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

[0065] In step 308, the target Benes network is constructed by deleting the input positions, output positions, and transmission paths from the k input positions to be deleted of the first column sub-permutation unit to the output position of the last column sub-permutation unit 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, including but not limited to physical servers, server clusters, cloud servers, smartphones / mobile phones, tablet computers, personal digital assistants (PDAs), laptop computers, and desktop computers, etc.

[0067] The method for constructing a Benes network provided in this specification can be applied to various scenarios, such as the data shredding scenario mentioned above, where the constructed target Benes network can be used for data shredding. Alternatively, it can also be used in network connection scenarios, etc., and this embodiment does not limit it in this regard.

[0068] The amount of data in the dataset to be replaced In such cases, a complete T-Benes network can be used for data replacement. Therefore, this embodiment is applicable to situations involving large amounts of data. To construct a better Benes network under these circumstances.

[0069] As an example, in a complete T-Benes network, the number of columns of sub-permutation units... Each column includes The number of sub-permutation units, and the amount of input data that a complete T-Benes network can receive. like Figure 4A As shown, this represents a sample size N′ of 16 (i.e., 4). 2 The structural diagram of the 4-Benes network. Figure 4A Each rounded rectangle in the network is a sub-permutation unit. The network includes... Figure 4A The three sub-permutation units π1, π2, and π shown in the diagram; there is a transmission path between adjacent sub-permutation units in the network, i.e. Figure 4A The diagram shows τ1 and τ2. In a data shuffling scenario, τ (i.e., τ1 and τ2) can be a public plaintext network. 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 locations in a complete T-Benes network that do not require input data. For example, Figure 4A In the complete T-Benes network, the first sub-shuffle unit has 16 input positions, allowing for the permutation of up to 16 data positions. However, the dataset to be permuted in this case only has 13 data points, resulting in a difference of 3. This means that 3 input positions in the first sub-shuffle unit of the complete T-Benes network do not require input data.

[0071] K input positions can be arbitrarily selected from all input positions of the first sub-shuffle unit of the complete T-Benes network; the specific selection method is not limited in this embodiment. Furthermore, this embodiment does not limit whether the selected k input positions are consecutive. As an example, they can be the last k input positions or the first k positions of all input positions of the first sub-permutation unit. In both cases, after storing the constructed target Benes network, the continuity of data reading can be guaranteed when reading the input positions of the first sub-shuffle unit of the target Benes network. In other examples, such as data shuffling scenarios, the middle k input positions can also be selected.

[0072] Figure 4A Taking the selection of the last three input positions in a complete T-Benes network as an example, the input positions, output positions, and propagation paths between these k input positions to be deleted and the output position of the last column of sub-permutation units can be deleted, i.e. Figure 4A The input, output, and transmission paths corresponding to the sections marked with red lines can all be deleted. In practical applications, the structures that need to be deleted can be obtained in a complete T-Benes network in several other ways.

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

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

[0075] Based on the transmission path between the k output positions to be deleted of the first sub-permutation unit and the input positions of the second sub-permutation unit, the k input positions to be deleted of the second sub-permutation unit are obtained. Then, for each of the k input positions to be deleted of the second sub-permutation unit, the corresponding output position to be deleted in the second sub-permutation unit is determined. This process is repeated until the k output positions to be deleted of the last sub-permutation unit in the complete T-Benes network are determined, thus obtaining all input positions to be deleted and all output positions to be deleted in the complete T-Benes network.

[0076] The target Benes network is obtained by removing all input positions to be deleted, all output positions to be deleted, and the transmission paths between each input position to be deleted and each output position to be deleted from the complete T-Benes network.

[0077] Still with Figure 4A For example, first determine the k input positions to be deleted in the first column of sub-permutation units. Figure 4A The three input positions A1, A2, and A3 shown are located within the same sub-permutation unit. Within this sub-permutation unit, the three output positions corresponding to these three input positions to be deleted are determined. Here, multiple determination methods can be selected as needed. Figure 4A Taking A1, A2, and A3 as examples corresponding to B1, B2, and B3 respectively. Next, from these three output positions (B1, B2, and B3), in τ1, based on the transmission path between the first and second sub-permutation units, the three input positions (C1, C2, and C3 shown in the figure) of the second sub-permutation unit can be obtained from these three output positions (B1, B2, and B3). Figure 4A In this example, the three input positions are located in different sub-permutation units in the second column. Similarly, we obtain the corresponding output positions of C1, C2, and C3 within their respective sub-permutation units: D1, D2, and D3. This process continues until we obtain the output positions to be deleted in the sub-permutation units of the last column.

[0078] Taking T=4 and the data size N of the dataset to be shuffled as an example, Figure 4B The target Benes network constructed in this embodiment is shown. Figure 4B Each rounded square represents a sub-permutation unit, and the number inside the square represents the amount of shuffled data for that sub-permutation unit. Figure 4B For ease of illustration, not all transmission paths between adjacent sub-permutation units are shown. In this embodiment, k is 25; please see [link to example]. Figure 4B Taking the first sub-permutation unit as an example, with the 25 input positions to be deleted as the last 25 input positions, these 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 is 0.

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

[0080] It can be done Figure 2C and Figure 4B To compare the unintended computational load during data shuffling between the two Benes networks. As in the aforementioned embodiment, each sub-permutation unit needs to perform... This is an unintentional transmission of calculations. Figure 2C The total number of calculations for each sub-permutation unit is 78.

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

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

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

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

[0085] Therefore, the Benes network of this application can reduce computational overhead when applied to data shuffling scenarios, compared with the existing Benes network.

[0086] As an example, once the input position to be deleted of the sub-permutation unit is determined, there are multiple ways to determine the corresponding input position to be deleted of the sub-permutation unit.

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

[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 within each sub-permutation unit, while the remaining N input positions are still randomly arranged according to rules within the sub-permutation unit. Since a network with a sample size of N′ can satisfy any arrangement of outputs, the fixed transmission method of these k input positions to be deleted within the sub-permutation unit does not affect the arbitrary arrangement property of the remaining nodes. Therefore, the correctness of the scheme in this embodiment is easily proven.

[0089] The above embodiments construct the network based on fundamental principles: first, a complete T-Benes network is built, then the complete T-Benes network is compressed, and the target Benes network is constructed through deletion. In practical applications, the target Benes network of this embodiment can also be directly constructed based on the rules of the transmission paths between sub-permutation units in the target Benes network to be constructed.

[0090] In some examples, the method may further include: inputting each data point of the dataset to be permuted into the respective input positions of the first column of sub-permutation units in the constructed target Benes network, and having the target Benes network output the dataset after position permutation. Based on this, data permutation can be achieved using the target Benes network of this embodiment.

[0091] In some examples, the dataset to be permuted includes a dataset to be shuffled, and the target Benes network is used to shuffle the dataset to be shuffled. For example, the sub-permutation unit is used to receive t data points from the dataset through the t input positions and perform data shuffling, where t ≤ T. In this case, some sub-permutation units may have their T input positions not deleted, resulting in T input data points; others may have their input positions deleted, resulting in fewer than T input data points. In the data shuffling scenario, the target Benes network can perform data shuffling based on an unintentional shuffling protocol.

[0092] In some examples, the sub-permutation unit is used to receive t data points from the dataset at the t input locations and perform data shuffling based on an unintentional shuffling protocol.

[0093] As an example, such as Figure 5 The diagram shown is a schematic representation of data shuffling based on an unintentional shuffling protocol within a sub-permutation unit, according to an exemplary embodiment of this specification.

[0094] Figure 4A The N shown is 16(4) 2 In the structure diagram generated by the 4-Benes network, τ (τ1 and τ2 in the diagram) is a public plaintext network that can be generated locally by both the data holder and non-data holder based on set rules. It is used to represent the secret fragmentation information transmission path of the data when the data of both parties is shuffled.

[0095] In the unintentional shuffling protocol, the πth i The transmission rule from input position to output position within a sub-permutation unit is determined by the non-data holder P1, based on the random permutation rule π. i,j The synthesized rule is kept confidential from the data holder P0. For example... Figure 5 As shown, each sub-permutation unit uses a 2-to-1 OT protocol with Tlog2T iterations. This means that for each row of data P1, T-1 values ​​need to be randomly selected. This process requires a GGM-Tree (Goldreich-Goldwasser-Micali Tree) structure and requires log2T 2-to-1 OT iterations. The GGM-Tree structure will not be 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 receives a fragmented random matrix obtained through OT (using the random permutation array π). i,j Based on this, that is, the k-th row is missing the π-th row. i,j [k] elements). Final:

[0096] Data holder P0 obtains the output of the i-th layer: an XOR sum array for each row. XOR array with each column

[0097] Non-data holder P1 then obtains the data. (Because the black portion in matrix P1 is calculated twice to cancel each other out, therefore it has...) (Characteristics).

[0098] Subsequently, data side P0 sets array b 0 As a secret sharing shard of new data, and will Send to non-data holder P1;

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

[0100] Finally, both parties exchange new data to the designated location through layer τ, completing the shuffling operation of layer τ. The plaintext corresponding to the secret sharing value is the shuffled data obtained from this layer. i (x).

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

[0102] Since, in the worst case, the upper limit of the input data size N′ of the Benes network is T times the data size N, this embodiment focuses on... In the case of a complete T-Benes network, by removing k redundant input and output positions and redundant transmission paths, a compact and compressed arrangement of the complete T-Benes network is achieved, resulting in a Benes network with lower computational overhead.

[0103] As mentioned above Figure 2C and Figure 4B Comparing computational costs, in the Benes network, except for the first and last columns, the computational cost of the sub-permutation units in the middle columns decreases, with the reduction being more significant closer to the center of the network. For the entire network, this results in a substantial improvement in computational cost.

[0104] Based on 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 data shuffled by the sub-permutation units, thereby reducing the amount of computation required for unintentional transmission and reducing the total computational overhead of the Benes network during data shuffling.

[0105] Besides the data shuffling scenarios mentioned above, Benes networks are also widely used in the communications field. For example, in network connectivity scenarios, Benes networks can achieve pairwise connections between N network cables, and the sub-permutation units of a Benes network can be composed of one or more switches. In this field, the constructed Benes network, such as... Figure 2C As shown, this can also lead to a large number of switches required within sub-permutation units, resulting in a large total number of switches required for the Benes network. Therefore, the scheme in this embodiment can also be used to construct the Benes network, thereby reducing the number of switches required within sub-permutation units.

[0106] In some cases, after generating the target Benes network described above, the position permutation rules within the sub-shuffle units can be determined. For example, in a data shuffle scenario, the position permutation rules within the sub-shuffle units can be obtained as follows:

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

[0108] Based on the random numbers corresponding to each sub-wash unit and the preset mapping relationship, the target input position mapped to the random numbers is determined from the multiple input positions contained in each sub-wash unit;

[0109] Based on a preset random permutation algorithm, the multiple input positions are randomly arranged according to the target input position, and the position permutation rules between the multiple input positions and multiple output positions contained in each sub-washing unit are generated based on the random permutation results.

[0110] Based on the position permutation rules of each sub-shuffle unit, a Benes network is generated for shuffling the dataset to be shuffled; 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 embodiments, if some sub-permutation units have T input positions that are not deleted, then the number of input positions is T; if some sub-permutation units have input positions that are deleted, then the number of input positions is less than T.

[0112] Based on this, the dataset to be shuffled is divided into multiple data blocks to be shuffled, for example, by column. The generated target Benes network can be used to shuffle each of the data blocks to be shuffled separately.

[0113] In some examples, the random numbers corresponding to each sub-shuffle unit in the Benes network to be generated can be obtained in various ways. For example, a random number generation algorithm can be used to generate a random number separately for each sub-shuffle unit. Alternatively, after generating a large random number, random numbers can be obtained for each of the multiple sub-shuffle units from the large random number, for example, by splitting the large random number into multiple random numbers and distributing them 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 another server for use in generating the same Benes network.

[0114] The Benes network construction method based on this embodiment can be used among 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 the 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 another server so that each sub-shuffle unit can select a corresponding random number based on the random number seed and generate the same Benes network.

[0119] In this embodiment, a reproducible Benes network can be generated using a random number seed. As an example, random number seeds can be generated in various ways, and this embodiment does not limit the method of generating the random number seed. The length of the random number seed can also be arbitrary, and this embodiment does not limit it.

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

[0121] As an example, random numbers can be generated using complex mathematical algorithms, with the random number seed serving as the initial value for these random numbers. This embodiment can utilize the random number seed to generate a parent random number of a set length. For example, an existing random number generation algorithm can be used; this embodiment does not limit the specific algorithm. The random number seed and the set length can be used as input to the random number generation algorithm, which then generates the parent random number of the set length. The same random number seed, the same set length, and the same random number generation algorithm can produce the same parent random number.

[0122] As an example, the length of the parent random number can be determined as needed. For instance, the size of the Benes network to be generated, i.e., the number of sub-shuffle units in the network, can be determined based on the amount of data N in the dataset and the amount of data T to be permuted by the user for the sub-permutation units in the Benes network. The length of the random number selected for each sub-shuffle unit can be set, for example, all of them can be the same or other methods can be used. 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. According to a set selection rule, a corresponding random number is selected from the generated parent random number for each sub-shuffle unit. For example, the selection rule can specify the number of bits in the random number selected by each sub-shuffle unit, as well as the selection order of these multiple sub-shuffle units, etc. The selection rule can be flexibly configured according to actual needs; this embodiment does not impose any limitations on it.

[0124] As an example, suppose we generate the following 128-bit random number seed:

[0125] 0x9a4bca88f7dfe2c18c5320d6a5c9a7e1;

[0126] Using the above random number seed, generate the following 128-bit parent random number (in decimal):

[0127] 341763148512189086889825065239356835674.

[0128] Assuming 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 the selection rules, the number of bits of the random number selected for each sub-shuffle unit can be specified, and the selection order of selecting random numbers for each sub-shuffle unit in columns can be specified.

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

[0130] Based on this, each sub-shuffle unit obtains a corresponding random number. Furthermore, based on the random number corresponding to each sub-shuffle unit, the position permutation rule between the t (t≤T) input positions and the t output positions of the sub-shuffle unit can be determined. The position permutation rule means: the rule that each data in the t data is input from a certain input position of the sub-shuffle unit and then swapped from that input position to a certain output position.

[0131] The position permutation rules between the t input positions and t output positions within a sub-shuffle unit can be generated in various ways based on the random numbers in the sub-shuffle unit. For example, random permutation algorithms can be used, including but not limited to the Fisher-Yates algorithm (Gornad scrambling algorithm). The Fisher-Yates algorithm is an efficient and fair random permutation algorithm. Its basic idea is to start from the last element in the array and gradually swap the element at the current position with a random element from a previous position in the array until the first element is reached. This process ensures that each element has an equal chance of appearing in any position, thus achieving true randomness.

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

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

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

[0135] Step 3. Take the last position of the array [1,…,t] as the current position. Starting from the current position, swap the element at the current position with the element at the target input position.

[0136] Starting from the current position in the array, move one position back and repeat steps 2 and 3; continue in this manner until the first element of the array is reached, resulting in the shuffled array.

[0137] Based on this, the random permutation algorithm in this embodiment takes t input positions and a target input position mapped to a random number. The algorithm arranges the t input positions based on the target input position, resulting in t output positions corresponding to the t input positions. For example, taking t=4 as an example, the four input positions are numbered 1, 2, 3, 4 respectively. The algorithm arranges "1, 2, 3, 4", and the result is "4, 2, 1, 3". The order of the numbers corresponding to the input positions in the permutation result indicates the output position corresponding to the input position. For example, if the number of the first input position is "1", and it is in the 3rd position in the permutation result, then 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 realizing the reproduction of the position replacement rule of each sub-shuffle unit.

[0139] In practical applications, the above-mentioned preset mapping relationship can be achieved in various ways, as long as the random number can be mapped to one of the multiple input positions contained in the sub-shuffle unit.

[0140] As an example, determining the target input position mapped to the random number from multiple input positions contained in each sub-shuffle unit based on the random number corresponding to each sub-shuffle unit and the preset mapping relationship may include:

[0141] Obtain the remainder when the random number corresponding to each sub-shuffle unit is divided by the number of input positions of that sub-shuffle unit, and determine the target input position that maps to the remainder from the multiple input positions contained in each sub-shuffle unit.

[0142] In this embodiment, the position permutation rule is determined by dividing the random number corresponding to the sub-shuffle unit by the number of input positions of that sub-shuffle unit and taking the remainder. For example, in the previous embodiment, each input position of the sub-shuffle unit is numbered, and the remainder corresponds to the number. Therefore, the same random number can yield the same position permutation rule.

[0143] Based on this, using the same random numbers, the same number of input positions, and the same random permutation algorithm, the algorithm can generate the same permutation results for multiple input positions of the sub-shuffle units, thus obtaining the same position permutation rules for the sub-shuffle units. Combining the aforementioned characteristic of the random number seed in generating reproducible random numbers, and employing a defined selection rule, the position permutation rule for each sub-shuffle unit is reproducible, achieving the effect of reproducing the same Benes network. Therefore, it can support distributed shuffling or split shuffling of datasets.

[0144] In some examples, the plurality of data blocks to be shuffled are distributed and stored in multiple shuffle servers in a distributed system. The random number seed is generated by any shuffle server in the distributed system and transmitted to other shuffle servers in the distributed system, so that after any shuffle server storing the data blocks to be shuffled generates the Benes network, it can shuffle the stored data blocks to be shuffled.

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

[0146] The shuffling results of the dataset to be shuffled are obtained by concatenating the shuffling results of other shuffling servers obtained by any shuffling server in the distributed system.

[0147] In some examples, the data blocks to be shuffled stored in the shuffle server include: data blocks to be shuffled corresponding to plaintext data blocks provided by the data holder's data party server; and multiple plaintext data blocks divided from the data holder's plaintext dataset are distributed and stored in multiple data party servers of the data holder.

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

[0149] The data shuffling server in the distributed system sends the data shuffling result to the data party server that provides the data block to be shuffled. Then, any one of the multiple data party servers obtains the data shuffling results of the other data party servers and splices them together to obtain the shuffling result of the dataset to be shuffled.

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

[0151] As an example, a random number seed can be generated by one shuffle server in a distributed system and transmitted to other shuffle servers via broadcast or other means.

[0152] In this embodiment, only the random number seed needs to be transmitted among multiple shuffling servers. Other shuffling servers can generate the same Benes network based on the random number seed. Compared to transmitting the entire Benes network in a distributed system, the amount of communication between servers is significantly reduced, making it more efficient and secure.

[0153] In some examples, the method is applied to a server that stores multiple data blocks to be shuffled, divided from the dataset to be shuffled; the method further includes:

[0154] Each of the data blocks to be shuffled is input into the Benes network to obtain the shuffle result of each data block to be shuffled;

[0155] The shuffling results of each data block to be shuffled are spliced ​​together to obtain the shuffling result of the dataset to be shuffled.

[0156] As an example, this embodiment can divide the dataset to be shuffled into multiple data blocks to be shuffled. The server can shuffle each data block to be shuffled locally. It is necessary to load the data blocks to be shuffled from the hard disk into memory before performing the data shuffle operation. Compared with loading the entire dataset to be shuffled into memory, this embodiment significantly reduces the memory requirement.

[0157] In some examples, when shuffling data for each block to be shuffled, the Benes network generated in the aforementioned embodiment can be executed to shuffle the data block in this instance. The shuffling result of each data block can be stored on the hard drive. After shuffling all data blocks, the shuffling results of each data block stored on the hard drive are concatenated to obtain the shuffled result of the dataset. Since the Benes network in this embodiment is reproducible, it achieves the splitting and shuffling of the dataset to be shuffled.

[0158] In other examples, the Benes network can be generated and stored in memory during the initial shuffling, as described in the previous embodiment. Each time a data block to be shuffled is loaded into memory, the Benes network is read for data shuffling. The shuffling results can be stored on the hard drive. Finally, the shuffling results of each data block stored on the hard drive are concatenated to obtain the shuffled dataset. If memory data is lost, a random number seed can be read from non-volatile memory to regenerate the Benes network, and the data shuffling of the unshuffled data blocks can continue. In this embodiment, a random number seed, not the Benes network, is stored on the hard drive, thus ensuring the security of data shuffling while achieving the splitting and shuffling of the dataset to be shuffled.

[0159] In some instances, the dataset to be shuffled includes a dataset corresponding to the plaintext dataset provided by the data holder.

[0160] In some examples, the plaintext dataset includes a set of plaintext features used for machine learning training.

[0161] In some examples, the step of generating position permutation rules between multiple input positions and multiple output positions within each sub-shuffle unit by calling a preset random permutation algorithm based on the sub-random number corresponding to each sub-shuffle unit includes:

[0162] For each sub-shuffle unit, the sub-random number corresponding to the sub-shuffle unit is divided by the number of input positions of the sub-shuffle unit, and the remainder is obtained. Then, a preset random permutation algorithm is called so that the preset random permutation algorithm determines a random position among the multiple input positions of the sub-shuffle unit based on the remainder. Then, the multiple input positions of the sub-shuffle unit are randomly permuted to obtain the position permutation rules between the multiple input positions and 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 upon the original unintentional shuffling protocol, enabling it to process the protocol with less memory resources and further supporting distributed computing. This embodiment has strong decoupling and can be used for data shuffling in memory-constrained or distributed scenarios.

[0164] For example, in scenarios with insufficient single-machine memory, the main reason for memory shortages during unintentional data shuffling is that samples often carry massive amounts of data features that need to be shuffled together. This forces the entire data table to be read into memory for processing during the shuffling process. To address this, this embodiment can reproduce the Benes network. Therefore, the data can be split by column, and each block can be read into memory sequentially for shuffling. The shuffling results can then be output to a designated location on the hard drive, allowing for concatenation of each output block on the hard drive. Ultimately, both parties obtain a secret-sharing fragment carrying massive amounts of data features while completing the unintentional shuffling protocol. As long as the computational memory required for any feature of all samples is below a threshold, the unintentional shuffling of the entire data table can be completed by splitting data features by column.

[0165] This embodiment also provides a data shredding system, which includes multiple data party servers of the data holder and multiple shredding servers of the data shredding party; the multiple plaintext data blocks divided from the plaintext dataset of the data holder are respectively stored in the multiple data party servers;

[0166] After generating a random number seed, any one of the multiple shuffling servers transmits it to the other shuffling servers.

[0167] Each of the plurality of shuffling servers is used for:

[0168] Obtain the data block to be shuffled that corresponds to the plaintext data block provided by the corresponding data provider 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 rules, select the corresponding random numbers from the generated random numbers for each sub-shuffle unit contained in the Benes network to be generated;

[0171] Based on the random numbers corresponding to each sub-wash unit and the preset mapping relationship, the target input position mapped to the random numbers is determined from the multiple input positions contained in each sub-wash unit;

[0172] Based on a preset random permutation algorithm, the multiple input positions are randomly arranged according to the target input position, and the position permutation rules between the multiple input positions and multiple output positions contained in each sub-washing unit are generated based on the random permutation results.

[0173] A Benes network is generated based on the positional substitution rules of each sub-washing unit;

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

[0175] Corresponding to the aforementioned embodiments of the Benes network construction method, this specification also provides embodiments of the Benes network construction apparatus and the computer equipment used thereon.

[0176] The data shuffling system described in this specification includes multiple data party servers belonging to the data holder and multiple shuffling servers belonging to the data shuffling party. Multiple plaintext data blocks, divided from the plaintext dataset of the data holder, are stored in the multiple data party servers. Each shuffling server generates a random number seed and transmits it to the other shuffling servers. Each shuffling server can reproduce the effect of the same Benes network through the above embodiments. Therefore, the data party servers can perform distributed storage of the plaintext dataset and communicate with each shuffling server individually, sending the data blocks to be shuffled to the corresponding shuffling server for shuffling, thus achieving distributed shuffling of the dataset.

[0177] The embodiments of the Benes network construction apparatus described in this specification can be applied to computer devices, such as servers or terminal devices. The apparatus embodiments can be implemented in software, hardware, or a combination of both. Taking software implementation as an example, as a logically defined apparatus, it is formed by its processor reading the corresponding computer program instructions from non-volatile memory into memory and executing them. From a hardware perspective, such as... Figure 6 The diagram shown is a hardware structure diagram of a computer device housing the Benes network construction apparatus described in this specification, except... Figure 6 In addition to the processor 610, network interface 620, memory 630, and non-volatile memory 640 shown, the computer device in which the Benes network construction device is located in the embodiment may also include other hardware depending on the actual function of the computer device, which will not be described in detail here.

[0178] This specification provides an embodiment of a Benes network construction apparatus, the apparatus comprising:

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

[0180] Module for building upon the N and The difference k is used to construct the target Benes network;

[0181] The target Benes network, relative to the complete T-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 position of the last column of sub-permutation units;

[0182] The complete T-Benes network refers to a matrix composed of multiple sub-permutation units, wherein the number of columns in the matrix is... Each column of the matrix contains Sub-permutation unit The sub-permutation unit includes T input positions and T output positions; the complete T-Benes network includes: transmission paths 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 T data points from the dataset through the T input positions and perform position permutation, and transmit the T data points after position permutation from the T output positions to the input positions of the next column of sub-permutation units through the transmission paths.

[0183] In some examples, the building module is based on the N and the The difference k is used to construct the target Benes network, including:

[0184] Based on N and T, determine the corresponding complete T-Benes network;

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

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

[0187] The k input positions to be deleted in the first column of sub-permutation units are propagated along a straight line within their respective sub-permutation units to obtain the k output positions to be deleted in the first column of sub-permutation units.

[0188] Based on the transmission path between the k output positions to be deleted of the first sub-permutation unit and the input positions of the second sub-permutation unit, the k input positions to be deleted of the second sub-permutation unit are obtained. Then, within the corresponding sub-permutation unit, the k output positions to be deleted of the second sub-permutation unit are obtained based on the set position permutation rules. This process continues until the last sub-permutation unit in the complete T-Benes network, resulting in all input positions to be deleted and all output positions to be deleted in the complete T-Benes network.

[0189] The target Benes network is obtained by removing all input positions to be deleted, all output positions to be deleted, and the transmission paths between each input position to be deleted and each output position to be deleted from the complete T-Benes network.

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

[0191] Propagating along a straight line within the corresponding sub-permutation unit, we obtain the k output positions to be deleted in the second column of sub-permutation units.

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

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

[0194] In some examples, the device further includes a displacement module for:

[0195] Each data point of the dataset to be permuted is input into the input position of the first sub-permutation unit in the constructed target Benes network, and the target Benes network outputs the dataset after position permutation.

[0196] In some examples, the dataset to be permuted includes a dataset to be shuffled, and the sub-permutation unit is used to receive t data points from the dataset through the t input positions and perform data shuffling, where t≤T.

[0197] In some examples, the building module is also used for:

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

[0199] Based on the random numbers corresponding to each sub-wash unit and the preset mapping relationship, the target input position mapped to the random numbers is determined from the multiple input positions contained in each sub-wash unit;

[0200] Based on a preset random permutation algorithm, the multiple input positions are randomly arranged according to the target input position, and the position permutation rules between the multiple input positions and multiple output positions contained in each sub-washing unit are generated based on the random permutation results.

[0201] Based on the position permutation rules of each sub-shuffle unit, a Benes network is generated for shuffling the dataset to be shuffled; 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 specific implementation process of the functions and roles of each module in the Benes network construction device described above can be found in the implementation process of the corresponding steps in the Benes network construction method described above, and will not be repeated here.

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

[0204] Accordingly, embodiments of this specification also provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of an embodiment of a method for constructing a Benes network.

[0205] Accordingly, embodiments of this specification also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of an embodiment of a method for constructing a Benes network.

[0206] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of the solution in this specification according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0207] The above embodiments can be applied to one or more computer devices. 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, microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.

[0208] The computer device can be any electronic product that can interact with the user, such as a personal computer, tablet computer, smartphone, personal digital assistant (PDA), game console, interactive network television (IPTV), smart wearable device, etc.

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

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

[0211] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0212] The steps of the various methods described above are only for clarity. In practice, they can be combined into one step or some steps can be split into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this patent. Adding insignificant modifications or introducing insignificant designs to the algorithm or process, but without changing the core design of the algorithm and process, are also within the scope of protection of this application.

[0213] While this specification contains numerous specific implementation details, these should not be construed as limiting the scope of any invention or the scope of the claims, but rather are primarily intended to describe features of specific embodiments of a particular invention. Certain features described in the various embodiments herein may also be implemented in combination in a single embodiment. Conversely, various features described in a single embodiment may also be implemented separately in various embodiments or in any suitable sub-combination. Furthermore, while features may function in certain combinations as described above and even initially claimed in this way, one or more features from a claimed combination may be removed from that combination in some cases, and a claimed combination may refer to a sub-combination or a variation thereof.

[0214] The terms "specific example" or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with the embodiments or examples, which are included in at least one embodiment or example of this specification. In this specification, illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0215] Other embodiments of this specification will readily occur to those skilled in the art upon consideration of the specification and practice of the invention claimed herein. This specification is intended to cover any variations, uses, or adaptations that follow the general principles of this specification and include common knowledge or customary techniques in the art not claimed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this specification are indicated by the following claims.

[0216] It should be understood that this specification is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this specification is limited only by the appended claims.

[0217] The above description is merely 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 within 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: Obtain the data size N of the dataset to be permuted and the permutation data size T specified for the sub-permutation unit in the Benes network; wherein, T is a power of 2; Based on N and T, determine the corresponding complete T-Benes network; the complete T-Benes network includes... The transmission path between the input position of the first sub-permutation unit and the output position of the last sub-permutation unit in the sub-permutation unit; Each column of the sub-permutation unit contains Each sub-permutation unit comprises T input positions and T output positions, and is used to perform position permutation on 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 sub-permutation unit via the transmission path; Based on the N and The difference k is used to determine the k input positions to be deleted for the first column of sub-permutation units in the complete T-Benes network; The target Benes network is constructed by deleting the input positions, output positions, and transmission paths from the k input positions to be deleted in the first column of sub-permutation units to the output position of the last column of sub-permutation units in the complete T-Benes network.

2. The method according to claim 1, wherein constructing the target Benes network comprises: For the k input positions to be deleted in the first column of sub-permutation units, determine the corresponding output position to be deleted in the first column of sub-permutation units for each input position to be deleted, and obtain the k output positions to be deleted in the first column of sub-permutation units; Based on the transmission path between the k output positions to be deleted of the first sub-permutation unit and the input positions of the second sub-permutation unit, the k input positions to be deleted of the second sub-permutation unit are obtained. Then, for each of the k input positions to be deleted of the second sub-permutation unit, the corresponding output position to be deleted in the second sub-permutation unit is determined. This process is repeated until the k output positions to be deleted of the last sub-permutation unit in the complete T-Benes network are determined, thus obtaining all input positions to be deleted and all output positions to be deleted in the complete T-Benes network. The target Benes network is obtained by removing all input positions to be deleted, all output positions to be deleted, and the transmission paths between each input position to be deleted and each output position to be deleted from the complete T-Benes network.

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

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

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

6. The method according to claim 1, further comprising: Each data point of the dataset to be permuted is input into the input position of the first sub-permutation unit in the constructed target Benes network, and the target Benes network outputs the dataset after position permutation.

7. The method according to claim 1, wherein the dataset to be replaced includes a dataset to be shuffled, and the target Benes network is used to shuffle the dataset to be shuffled.

8. A method for constructing a Benes network, the method comprising: Obtain the data size N of the dataset to be permuted and the permutation data size T specified by the user for the sub-permutation unit in the Benes network; wherein, T is a power of 2; Based on the N and The difference k is used to construct the target Benes network; The target Benes network, relative to the complete T-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 position of the last column of sub-permutation units; The number of columns of the sub-permutation units in the complete T-Benes network is The number of sub-permutation units in each column is indivual, The complete T-Benes network contains T input positions and T output positions in its sub-permutation unit. The complete T-Benes network includes transmission paths between 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 receives T data points from the dataset through the T input positions and performs position permutations, then transmits the T permuted data points from the T output positions to the input positions of the next column of sub-permutation units via the transmission paths.

9. A computer program product comprising a computer program that, when executed by a processor, implements the steps of the method of any one of claims 1 to 8.

10. A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method of any one 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, it implements the steps of the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • 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