WO2022142917A1 - 数据处理方法和装置 - Google Patents
数据处理方法和装置 Download PDFInfo
- Publication number
- WO2022142917A1 WO2022142917A1 PCT/CN2021/133506 CN2021133506W WO2022142917A1 WO 2022142917 A1 WO2022142917 A1 WO 2022142917A1 CN 2021133506 W CN2021133506 W CN 2021133506W WO 2022142917 A1 WO2022142917 A1 WO 2022142917A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- data
- level
- group
- selection unit
- output data
- Prior art date
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 11
- 238000000034 method Methods 0.000 claims abstract description 40
- 238000012545 processing Methods 0.000 claims description 34
- 238000004891 communication Methods 0.000 claims description 10
- 238000004590 computer program Methods 0.000 claims description 8
- 239000004744 fabric Substances 0.000 claims description 7
- 230000006870 function Effects 0.000 description 25
- 238000010586 diagram Methods 0.000 description 9
- 230000008569 process Effects 0.000 description 8
- 238000013075 data extraction Methods 0.000 description 5
- 230000001360 synchronised effect Effects 0.000 description 5
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000000605 extraction Methods 0.000 description 2
- 230000008707 rearrangement Effects 0.000 description 2
- 238000010187 selection method Methods 0.000 description 2
- 238000013473 artificial intelligence Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L49/00—Packet switching elements
- H04L49/10—Packet switching elements characterised by the switching fabric construction
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L49/00—Packet switching elements
- H04L49/10—Packet switching elements characterised by the switching fabric construction
- H04L49/109—Integrated on microchip, e.g. switch-on-chip
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L49/00—Packet switching elements
- H04L49/15—Interconnection of switching modules
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L49/00—Packet switching elements
- H04L49/20—Support for services
- H04L49/201—Multicast operation; Broadcast operation
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Definitions
- the present application relates to the technical field of artificial intelligence, and in particular, to a data processing method and apparatus.
- the data exchange network structure is often used in various data routing and data exchange scenarios.
- operations such as exchange and rearrangement between various data are usually involved.
- a dedicated data exchange structure which is a network structure (ie, a data exchange network structure) through which data exchange, rearrangement, and other operations can be implemented.
- the embodiments of the present application provide a data processing method and device, the data processing method adopts a simple data exchange network structure, and can also be implemented by hardware while being flexible.
- the present application provides a data processing method, the method comprising: inputting first-level input data into a first-level network switching structure to obtain first-level output data; the first-level input data includes N groups of first data, each group of the first data includes M pieces of first data, the first-level network switching structure includes N groups of first selection units, and each group of the first selection units includes M first selection units,
- the input data of the E(i)th first selection unit of the first-level network switching structure is N first data
- the E(i)th first selection unit is the N group of first selection units
- the output data of a selection unit is one of the N first data
- the output data of each group of the first selection unit is one of the N groups of first data
- the first-level output data includes N sets of second data, each set of second data includes M pieces of second data, and N, M, E and i are positive integers.
- the second-level network switching structure includes N groups of second selection units, and each group of the second selection units includes M a second selection unit, the input data of the F(j)th second selection unit in the second-stage network switching structure is the F-th group of second data in the first-stage output data, and the F-th second selection unit
- the output data of the (j) second selection units is one of the F groups of second data
- the F(j) th second selection unit is one of the F groups of the N groups of second selection units.
- the jth second selection unit, the second stage output data includes N groups of third data, each group of the third data includes M third data, and the output of the F(j)th second selection unit
- the data is the jth in the Fth group of the second-stage output data, and the F and j are positive integers.
- the data switching network structure used for data processing in the embodiments of the present application includes a first-level network switching structure and a second-level network switching structure, and the two-level network switching structures have the same architecture, and each level includes N* M parallel selection units, so its structure is simple and easy to implement on hardware; at the same time, the first-level network switching structure is used to realize the data exchange of the first-level input data as a whole, and the second-level network switching structure is used for data exchange.
- different functions are realized through the same two-level network switching structure, and then the input data can be processed differently according to different scenarios. Processing to obtain corresponding output data, with strong flexibility.
- the above method further includes: inputting the second-level output data into a third-level network switching structure to obtain third-level output data; the third-level network switching structure includes N groups of third-level output data. selection units, each group of the third selection units includes M third selection units; the input data and output data of the N*M third selection units in the third-level network switching structure are respectively equal to the second-level output data.
- the N*M third data in the third selection unit, or the input data and output data of the M third selection units in the third selection unit of the target group in the N groups of third selection units are respectively equal to the output data in the second level output data.
- the M first and third target data, the third selection unit of the target group is one of the N groups of third selection units, and the M first target data is the first level of input data. M.
- the data switching network structure used for data processing in the embodiments of the present application may further include a third-level network switching structure, and the architecture of the third-level network switching structure is the same as that of the first and second-level network switching structures.
- the structure is still relatively simple, which is convenient for hardware implementation; at the same time, the third-level network switching structure is used to realize the M data in the second-level output data. They are gathered into the same group of the third-level network switching structure for output.
- the data exchange network includes the above-mentioned three-level network switching structure, different functions can be realized through the above-mentioned three-level network switching structure, and then according to different scenarios,
- the above-mentioned three-level network switching structure is used to process the input data differently to obtain the corresponding output data, which has strong flexibility.
- the group number of the output data of the E(i)-th first selection unit in the first-stage input data is the same as the group number of the i-th in the M first target data
- the group number of a target data is the same; the group number of the output data of the F(j)th second selection unit in the first-stage output data is the same as that of the jth in the M first target data.
- the output data of the b-th third selection unit in the third selection unit of the target group is determined as any third data in the b-th group of the second-level output data, and the target group
- the three selection units are one of the N groups of third selection units.
- the corresponding selection unit is selected by setting different selection signals for the selection units in each level of the three-level network switching structure in the three-level network switching structure.
- Output data so as to extract the M first target data in the first-level input data, and gather them into the same group of the third-level output data for output, so as to realize the use of the above-mentioned data exchange network structure for the M first target data. Extraction function.
- the group number of the output data of the E(i)th first selection unit in the first-level input data and the second target data in the first-level input data is the same; the group number of the output data of the F(j)th second selection unit in the first-level output data is the same as the group number of the second target data in the first-level input data
- the numbers within the group are the same, and the second target data is one of the first-level input data.
- the corresponding selection signal is set for the selection unit in each level of the network switching structure in the two-level network switching structure.
- Output data, so as to broadcast the second target data in the first-stage input data, that is, the N*M third data in the second-stage output data are all the second target data, so as to realize the broadcast of the second target data.
- the function of data extraction or data broadcasting can be realized by setting the corresponding selection signal to the selection unit in each level of network switching structure in the data exchange network, which shows that the above-mentioned data exchange network has better flexibility.
- the above method includes: according to the group number, the number within the group, and the group number of the E(i)th first selection unit in the first-level input data according to the third target data Determine the group number of the output data of the E(i)th first selection unit in the first-level input data; according to the group number of the third target data in the first-level input data and The intra-group number of the F(j) th second selection unit determines the intra-group number of the output data of the F(j) th second selection unit in the first-stage output data, and the third The target data is one of the first level input data.
- the corresponding selection signal is set for the selection unit in each level of the network switching structure in the two-level network switching structure.
- Output data so as to rotate the third target data in the first-stage input data, that is, output the third target data in the first-stage input data to the corresponding position in the second-stage output data, so as to realize the third target data.
- the function of rotation in summary, the function of data extraction, or data broadcasting, or data rotation can be realized by setting the corresponding selection signal to the selection unit in each level of network switching structure in the data switching network, which shows the flexibility of the above data switching network. Sex is better.
- the above-mentioned determination of the said The group number of the output data of the E(i)th first selection unit in the first-stage input data includes: determining, according to formula (1), that the output data of the E(i)th first selection unit is in the group number in the first-level input data; the group number in the first-level input data according to the third target data and the group of the F(j)th second selection unit The number determines the group number of the output data of the F(j)th second selection unit in the first-stage output data, including: determining the F(j)th second selection according to formula (2). the group number of the output data of the unit in the first stage output data;
- X is the group number of the third target data in the first-level input data
- a is the group number of the third target data in the first-level input data
- the % represents taking two integers.
- the / represents the integer part of the quotient obtained after dividing two integers.
- each level of the network switching structure in the two-level network switching structure can be obtained.
- the selection unit in the device sets different selection signals to select the corresponding output data, so as to rotate the third target data in the input data of the first stage, that is, output the third target data in the input data of the first stage to the output data of the second stage Therefore, the rotation function of the third target data can be realized; in summary, data extraction, or data broadcasting, or The function of data rotation shows that the above-mentioned data exchange network has better flexibility.
- the present application provides a data processing device, the device comprising: a processing unit for inputting first-level input data into a first-level network switching structure for processing, wherein the first-level input data includes N groups of first data, each group of first data includes M pieces of first data, the first-level network switching structure includes N groups of first selection units, and each group of first selection units includes M first selection units unit, the input data of the E(i)th first selection unit of the first-level network switching structure is N first data, and the E(i)th first selection unit is the N group of first selection units The i-th first selection unit in the E-th group among the selection units, the N-th first data includes the i-th first data in each of the N-groups of first data, and the E(i) The output data of the first selection units is one of the N first data, and the output data of each group of the first selection units is one of the N groups of first data; The first-level output data is input to the second-level network switching structure for processing.
- the second-level network switching structure includes N groups of second selection units, and each group of the second selection units includes M second selection units.
- the input data of the F(j)th second selection unit in the second-stage network switching structure is the F-th group of second data in the first-stage output data, and the F(j)th second selection unit
- the output data is one of the F groups of second data, and the F(j) second selection unit is the jth second selection unit in the F group of the N groups of second selection units;
- the N, M, E, F, i and j are positive integers; an acquisition unit is used to acquire first-level output data and second-level output data, the first-level output data includes N groups of second data, each The second data set includes M second data; the second-stage output data includes N sets of third data, each set of third data includes M third data, and the F(j)th
- the output data of the second selection unit is the jth in the Fth group of the second-stage output data.
- the processing unit is further configured to: input the second-level output data into a third-level network switching structure for processing, where the third-level network switching structure includes N groups of third selection units , each group of the third selection units includes M third selection units, and the input data and output data of the N*M third selection units in the third-level network switching structure are respectively equal to the output data in the second-level output data.
- the acquiring unit is further configured to acquire third-level output data, where the third-level output data includes output data of each third selection unit in the third-level network switching structure.
- the present application provides a computer-readable storage medium, where the computer-readable medium stores program code for device execution, the program code comprising for executing the method described in any one of the above-mentioned first aspects.
- the present application provides a computer program product, when the computer program product runs on a computer, the computer executes the method described in any one of the above-mentioned first aspects.
- the present application provides a chip, the chip includes a processor and a communication interface, the processor reads an instruction stored in a memory through the communication interface, so as to execute the method described in any one of the above-mentioned first aspects.
- FIG. 1 is a schematic flowchart of a data processing method in an embodiment of the present application.
- FIG. 2 is a schematic structural diagram of a data exchange network in an embodiment of the present application.
- FIG. 3 is a schematic structural diagram of another data exchange network in an embodiment of the present application.
- FIG. 4 is a schematic structural diagram of a data processing apparatus in an embodiment of the present application.
- FIG. 5 is a schematic diagram of a hardware structure of a chip in an embodiment of the present application.
- FIG. 1 is a schematic flowchart of a data processing method 100 provided by an embodiment of the present application. As shown in FIG. 1 , the method 100 includes steps S110 and S120.
- Step S110 Input the first-level input data into the first-level network switching structure to obtain first-level output data; the first-level input data includes N groups of first data, and each group of the first data includes M number of first data.
- the input data of the first selection unit is N first data
- the E(i)th first selection unit is the i-th first selection unit in the Eth group in the N groups of first selection units, so
- the N pieces of first data include the i-th first data in each of the N groups of first data
- the output data of the E(i)-th first selection unit is one of the N pieces of first data.
- the output data of each group of the first selection unit is one of the N groups of first data
- the first-level output data includes N groups of second data
- each group of the second data includes M second data, the N,
- FIG. 2 is a schematic structural diagram of a data exchange network 200 according to an embodiment of the present application.
- the first-level input data includes N groups of first data, and each group of first data includes M pieces of data, that is, the first-level input data includes N*M pieces of data in total.
- the first-level network switch structure includes N groups of first selection units, and each group of first selection units includes M first selection units, that is, the first-level network switch structure includes N*M first selection units.
- any first selection unit E(i) in the first-level network switching structure its input data is the i-th data in each group in the first-level input data, a total of N; where, E is the any The group number of the first selection unit, i is the group number of any first selection unit, N and M are integers greater than or equal to zero, and i is a positive integer.
- the input data of the any first selection unit 3 (5) is each group of the first selection unit in the first-level input data.
- the fifth data in a data, a total of N data.
- the output data thereof is one of N first data.
- the output data of the M first selection units have the same group number in the first-level input data, that is, the M first selection units in the same group.
- the M output data of the first selection unit are derived from the same group of first data of the first-stage input data, that is to say, the output data of the first selection unit of each group of the first selection unit is any one of the N groups of first data.
- the function of the first-level network switching structure is to exchange N groups of first data in the first-level input data on a group-by-group basis.
- each first selection unit in the first-level network switching structure corresponds to one output data
- the number of first-level output data of the first-level network switching structure is N*M
- the N*M pieces of data include N
- each group of second data includes M pieces of second data.
- Step S120 inputting the first-level output data into a second-level network switching structure to obtain second-level output data;
- the second-level network switching structure includes N groups of second selection units, and each group of the second selection units
- the unit includes M second selection units, and the input data of the F(j)th second selection unit in the second-level network switching structure is the F-th group of second data in the first-level output data, so
- the output data of the F(j)th second selection unit is one of the F groups of second data, and the F(j)th second selection unit is the Fth in the N groups of second selection units
- the jth second selection unit in the group, the second stage output data includes N groups of third data, each group of the third data includes M third data, and the F(j)th second selection
- the output data of the unit is the j-th in the F-th group of the second-stage output data, and the F and j are positive integers.
- FIG. 2 is a schematic structural diagram of a data exchange network provided by an embodiment of the present application.
- the second-level network switch structure includes N groups of second selection units, and each group of second selection units includes M second selection units, that is, the second-level network switch structure includes N*M second selection units .
- any second selection unit F(j) in the second-level network switching structure its input data is the F-th group of second data in the first-level output data, a total of M; where, F is the any second data
- the group number of the selection unit, j is the group number of any second selection unit, F is an integer greater than or equal to zero and less than or equal to N, and j is an integer greater than or equal to zero and less than or equal to M.
- the input data of any second selection unit 6(4) is the sixth group in the output data of the first stage Second data, there are M second data in total.
- the output data thereof is one of M pieces of second data. It should be understood that, at this time, the function of the second-level network switching structure is to exchange intra-group data for N groups of second data in the first-level output data.
- each second selection unit in the second-level network switching structure corresponds to one output data
- the second-level output data of the second-level network switching structure is N*M
- the N*M data includes N Groups of third data
- each group of third data includes M third data.
- data exchange network shown in FIG. 2 may be a software execution unit or a hardware execution unit, which is not specifically limited in this application.
- the data switching network structure used for data processing in the embodiments of the present application includes a first-level network switching structure and a second-level network switching structure, and the two-level network switching structures have the same architecture, and each level includes N* M parallel selection units, so its structure is simple and easy to implement on hardware; at the same time, the first-level network switching structure is used to realize the data exchange of the first-level input data as a whole, and the second-level network switching structure is used for data exchange.
- different functions are realized through the same two-level network switching structure, and then the input data can be processed differently according to different scenarios. Processing to obtain corresponding output data, with strong flexibility.
- the above data processing method further includes: inputting the second-level output data into a third-level network switching structure to obtain third-level output data; the third-level network switching structure includes N groups of The third selection unit, each group of the third selection units includes M third selection units; the input data of the P(b)th third selection unit in the third-level network switching structure includes the second-level output data.
- the bth third data in the Pth group and the second stage output data any third data in the bth group
- the output data of the P(b)th third selection unit is the input of the third selection unit
- One of the data, the P(b)th third selection unit is the bth third selection unit in the Pth group of the third-level network switching structure
- the third-level output data includes the third-level
- the P is a positive integer less than or equal to N
- b is a positive integer less than or equal to M.
- FIG. 3 is a schematic structural diagram of another data exchange network 300 in an embodiment of the present application.
- the data switching network 300 in addition to the first-level network switching structure and the second-level network switching structure in the data switching network 200, the data switching network 300 also includes a third-level network switching structure as shown in FIG.
- the number and number of groups of the third selection units included in the third-level network switching structure are the same as the selection units in the first and second-level network switching structures, and will not be repeated here.
- the data exchange network shown in FIG. 3 may be a software execution unit or a hardware execution unit, which is not specifically limited in this application.
- the third-level network switching fabric may include the following functions:
- the output data of each third selection unit in the other N-1 groups of third selection units except the third selection unit of the target group may be the input data of each third selection unit. one or no output.
- the output data of each third selection unit in the other N-1 groups of third selection units except the third selection unit of the target group is empty.
- the third-level output data is the M output data of the third selection unit of the target group;
- the function of the third-level network switching structure is to gather the M data in the second-level output data into the third selection unit of the target group.
- the output is performed in the unit, and at this time, the output data of the third stage is the above-mentioned aggregated M data.
- the output data of each third selection unit in the third-level network switching structure can also be determined according to specific scenarios.
- the data switching network structure used for data processing in the embodiments of the present application may further include a third-level network switching structure, and the architecture of the third-level network switching structure is the same as that of the first and second-level network switching structures.
- the structure is still relatively simple, which is convenient for hardware implementation; at the same time, the third-level network switching structure is used to realize the M data in the second-level output data. They are gathered into the same group of the third-level network switching structure for output.
- the data exchange network includes the above-mentioned three-level network switching structure, different functions can be realized through the above-mentioned three-level network switching structure, and then according to different scenarios,
- the above-mentioned three-level network switching structure is used to process the input data differently to obtain the corresponding output data, which has strong flexibility.
- the group number of the output data of the E(i)-th first selection unit in the first-stage input data is the same as the group number of the i-th in the M first target data
- the group number of a target data is the same; the group number of the output data of the F(j)th second selection unit in the first-stage output data is the same as that of the jth in the M first target data.
- the group number of the target data is the same; the output data of the bth third selection unit in the third selection unit of the target group is determined as any third data in the bth group of the second-level output data, and the target group
- the three selection units are one of the N groups of third selection units.
- M pieces of first target data are first determined from the first-level input data, and the selection signal of the E(i)th first selection unit is determined as the i-th first target data among the M pieces of first target data (as shown in formula (3)), that is, from the input data of the E(i) first selection unit, select the same group number as the i-th first target data in the M first target data
- the first data of is used as the output data of the E(i)th first selection unit; then the selection signal of the F(j)th second selection unit is determined as the jth first target data in the M first target data (as shown in formula (3))), that is, from the input data of the F(j)th second selection unit, select the first target data that is the same as the jth first target data in the M first target data
- the data with the same number in the group is used as the output data of the F(j)th second selection unit; at this time, the M data in each group in the second-level output data are the same, and finally the third selection unit of
- the output data of the b third selection units is set to any third data in the bth group of the second-level output data, that is, the M first target data are gathered into the third selection unit of the target group for output.
- the third-level output data is M first target data.
- % represents the remainder of the division of two integers
- M(i%N) represents the i%Nth data in the M first target data
- formula (3) means that the first target data from E(i)th From the input data of the selection unit, the first data with the same group number as the i%Nth first target data among the M first target data is selected as the output data of the E(i)th first selection unit.
- formula (4) indicates that the same group number is selected from the input data of the F(j)th second selection unit as the M(j%N)th first target data in the M first target data. The data is used as the output data of the F(j)th second selection unit.
- the corresponding selection unit is selected by setting different selection signals for the selection units in each level of the three-level network switching structure in the three-level network switching structure.
- Output data so as to extract the M first target data in the first-level input data, and gather them into the same group of the third-level output data for output, so as to realize the use of the above-mentioned data exchange network structure for the M first target data. Extraction function.
- the group number of the output data of the E(i)th first selection unit in the first-level input data and the group number of the second target data in the first-level input data is the same; the group number of the output data of the F(j)th second selection unit in the first-level output data is the same as the group number of the second target data in the first-level input data
- the internal numbers are the same, and the second target data is one of the first-level input data.
- the second target data in the first-level input data can be broadcast through the data exchange network 200 shown in FIG. 2 , and the specific process is as follows:
- the selection signal of each second selection unit in the second-level network switching structure is set as the group number of the second target data, that is, the output data of each second selection unit in the second-level network switching structure is the first Two target data, the second-stage output data output from the second-stage network switching structure is N*M second target data.
- the second target data in the first-stage input data can be output to each of the second-stage output data through the signal selection mode of each selection unit in the first network switching structure and the second-level network switching structure.
- the function of data broadcasting is realized through the network structure in the embodiment of the present application and the above-mentioned signal selection method.
- the second target data in the first-level input data may also be broadcast through the data exchange network 300 shown in FIG. 3 .
- the selection signals of the first-level network switching structure and the second network switching structure are the same as the selection signals of the corresponding network switching structures in the data switching network 200 .
- the selection signal of the third-level network switching structure in the data switching network 300 is set to be the same as the group number and the intra-group number of each third selection unit, that is, the input data and output data of each third selection unit are in The group number and the intra-group number in the second-level output data are the same as the group number and the intra-group number of each third selection unit.
- the corresponding selection signal is set for the selection unit in each level of the network switching structure in the two-level network switching structure.
- Output data, so as to broadcast the second target data in the first-stage input data, that is, the N*M third data in the second-stage output data are all the second target data, so as to realize the broadcasting of the second target data.
- the function of data extraction or data broadcasting can be realized by setting the corresponding selection signal to the selection unit in each level of network switching structure in the data exchange network, indicating that the above-mentioned data exchange network Better flexibility.
- the first selection unit is determined.
- the intra-group number of the second selection unit determines the intra-group number of the output data of the F(j)th second selection unit in the first-stage output data, and the third target data is the one of the first-level input data described above.
- the third target data in the first-level input data can be rotated through the data exchange network 200 shown in FIG. 2 , and the specific process is as follows:
- the group number of the data in the first-level input data may include: determining the group number of the output data of the E(i)th first selection unit in the first-level input data according to formula (1).
- the intra-group number in the first-level output data may include: determining the intra-group number of the output data of the F(j)th second selection unit in the first-level output data according to formula (2).
- X is the group number of the third target data in the first-level input data
- a is the group number of the third target data in the first-level input data
- "%" represents the remainder after dividing two integers
- "/" represents the integer part of the quotient obtained after dividing two integers.
- the third target data in the first-stage input data can be output to the first group of the second-stage output data through the signal selection mode of each selection unit in the first-stage network switching structure and the second-stage network switching structure
- the first data in that is, the rotation function of data broadcasting is realized through the network structure in the embodiment of the present application and the above-mentioned signal selection method.
- the third target data in the first-level input data may also be broadcast through the data exchange network 300 shown in FIG. 3 .
- the selection signals of the first network switching structure and the second network switching structure are the same as the selection signals of the corresponding network switching structures in the data switching network 200 .
- the selection signal of the third-level network switching structure in the data switching network 300 is set to be the same as the group number and the intra-group number of each third selection unit, that is, the input data and output data of each third selection unit are in The group number and the intra-group number in the second-level output data are the same as the group number and the intra-group number of each third selection unit.
- each level of the network switching structure in the two-level network switching structure can be obtained.
- the selection unit in the device sets different selection signals to select the corresponding output data, so as to rotate the third target data in the input data of the first stage, that is, output the third target data in the input data of the first stage to the output data of the second stage Therefore, the rotation function of the third target data can be realized; in summary, data extraction, or data broadcasting, or The function of data rotation shows that the above-mentioned data exchange network has better flexibility.
- FIG. 4 is a schematic structural diagram of a data processing apparatus 400 according to an embodiment of the present application.
- the apparatus 400 includes a processing unit 410 and an obtaining unit 420 .
- the processing unit 410 is configured to input the first-level input data into the first-level network switching structure for processing, wherein the first-level input data includes N groups of first data, and each group of the first data includes M first data data, the first-level network switching structure includes N groups of first selection units, each group of the first selection units includes M first selection units, and the E(i)th first selection unit of the first-level network switching structure
- the input data of a selection unit is N pieces of first data
- the E(i)th first selection unit is the i-th first selection unit in the Eth group in the N groups of first selection units
- the The N pieces of first data include the i-th first data in each of the N groups of first data
- the output data of the E(i)-th first selection unit is one of the N pieces of first data.
- the output data of each group of the first selection unit is one of the N groups of first data; for inputting the first-level output data into the second-level network switching structure for processing, the The second-level network switch fabric includes N groups of second selection units, each group of the second selection units includes M second selection units, and the F(j)th second selection unit in the second-level network switch fabric
- the input data is the F-th group of second data in the first-stage output data
- the output data of the F(j)-th second selection unit is one of the F-th group of second data
- the The F(j) second selection units are the jth second selection units in the Fth group in the N groups of second selection units
- the N, M, E, F, i and j are positive integers.
- the acquiring unit 420 is configured to acquire first-level output data and second-level output data, the first-level output data includes N groups of second data, and each group of the second data includes M pieces of second data;
- the second-level output data includes N groups of third data, each group of the third data includes M third data, and the output data of the F(j)th second selection unit is the second-level output data Fth The jth in the group.
- the processing unit 410 is further configured to: input the second-level output data into a third-level network switching structure for processing, where the third-level network switching structure includes N groups of third selections unit, each group of the third selection units includes M third selection units, and the input data and output data of the N*M third selection units in the third-level network switching structure are respectively equal to the second-level output data.
- the N*M third data, or the input data and output data of the M third selection units in the third selection unit of the target group in the N groups of third selection units are respectively equal to the output data in the second-level output data.
- the acquiring unit 420 is further configured to acquire third-level output data, where the third-level output data includes output data of each third selection unit in the third-level network switching structure.
- FIG. 5 is a schematic diagram of a hardware structure of a chip 500 according to an embodiment of the present application.
- the chip 500 includes a communication interface 501 , a processor 502 , a memory 503 , and at least one communication bus 504 for connecting the communication interface 501 , the processor 502 , and the memory 503 .
- the memory 503 includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read only memory (EPROM), or A portable read-only memory (compact disc read-only memory, CD-ROM), the memory 503 is used for related instructions and data.
- RAM random access memory
- ROM read-only memory
- EPROM erasable programmable read only memory
- CD-ROM compact disc read-only memory
- the communication interface 501 is used to receive and transmit data.
- the processor 502 may be one or more central processing units (central processing units, CPUs).
- CPUs central processing units
- the CPU may be a single-core CPU or a multi-core CPU.
- the processor 502 in the chip 500 is configured to read one or more program codes stored in the memory 503 to execute the operations described in the method embodiments of the present application.
- Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed on a terminal, the method flow shown in the foregoing method embodiments is realized.
- the embodiments of the present application further provide a computer program product, when the computer program product runs on a terminal, the method flow shown in the above method embodiments is realized.
- processors mentioned in the embodiments of the present application may be a central processing unit (central processing unit, CPU), and may also be other general-purpose processors, digital signal processors (digital signal processors, DSP), application-specific integrated circuits ( application specific integrated circuit, ASIC), off-the-shelf programmable gate array (field programmable gate array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
- a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
- the memory mentioned in the embodiments of the present application may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory.
- the non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically programmable Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory.
- Volatile memory may be random access memory (RAM), which acts as an external cache.
- RAM random access memory
- DRAM dynamic random access memory
- SDRAM synchronous dynamic random access memory
- double data rate synchronous dynamic random access memory double data rate sdram, DDR SDRAM
- enhanced synchronous dynamic random access memory enhanced SDRAM, ESDRAM
- synchronous link dynamic random access memory direct rambus RAM, DR RAM
- the processor is a general-purpose processor, DSP, ASIC, FPGA or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components
- the memory storage module
- memory described herein is intended to include, but not be limited to, these and any other suitable types of memory.
- the size of the sequence numbers of the above-mentioned processes does not mean the sequence of execution, and the execution sequence of each process should be determined by its functions and internal logic, and should not be dealt with in the embodiments of the present application. implementation constitutes any limitation.
- the disclosed apparatus and method may be implemented in other manners.
- the apparatus embodiments described above are only illustrative.
- the division of units is only a logical function division.
- there may be other division methods for example, multiple units or components may be combined or integrated.
- the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
- the units described above as separate components may or may not be physically separated, and components shown as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
- each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
- the above functions are implemented in the form of software functional units and sold or used as independent products, they may be stored in a computer-readable storage medium.
- the technical solution of the present application can be embodied in the form of a software product in essence, or the part that contributes to the prior art or the part of the technical solution.
- the computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
- the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes .
- the modules in the apparatus of the embodiment of the present application may be combined, divided and deleted according to actual needs.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Facsimiles In General (AREA)
Abstract
本申请公开一种数据处理方法和装置,包括:将第一级输入数据输入第一级网络交换结构得到第一级输出数据;第一级输入数据包含N组,共N*M个第一数据,第一级网络交换结构包含N组,共N*M个第一选择单元,第E(i)个第一选择单元的输入数据包含N组第一数据中每组中第i个第一数据,输出数据为其输入数据中的一个,第一级输出数据包含N组,共N*M个第二数据;将第一级输出数据输入第二级网络交换结构得到第二级输出数据;第二级网络交换结构包含N组,共N*M个第二选择单元,第F(j)个第二选择单元的输入数据为第F组第二数据,其输出数据为输入数据中的一个。本申请实施例方法采用一种简单的网络结构,可用硬件实现且灵活性好。
Description
本申请要求于2020年12月30日提交中国专利局,申请号为202011643524.4、发明名称为“数据处理方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及人工智能技术领域,尤其涉及一种数据处理方法和装置。
数据交换网络结构常用于各种数据路由以及数据交换的场景中。在矢量处理中,由于要并行处理多个数据,所以通常会涉及到各个数据之间的交换、重排等操作。一般这种操作都是通过一个专用的数据交换结构实现的,这种专用的数据交换结构是一种网络结构(即数据交换网络结构),通过该结构可以实现数据的交换、重排等操作。
但是,目前现有的各种数据交换网络结构,例如CrossBar网络、Clos网络和Omega网络,虽然灵活性较高,但是都比较复杂,不太适合用硬件实现。
发明内容
本申请实施例提供了一种数据处理方法和装置,该数据处理方法采用了一种简单的数据交换网络结构,具有灵活性的同时也可以用硬件实现。
第一方面,本申请提供了一种数据处理方法,该方法包括:将第一级输入数据输入第一级网络交换结构中,得到第一级输出数据;所述第一级输入数据包含N组第一数据,每组所述第一数据包含M个第一数据,所述第一级网络交换结构包含N组第一选择单元,每组所述第一选择单元包含M个第一选择单元,所述第一级网络交换结构的第E(i)个第一选择单元的输入数据为N个第一数据,所述第E(i)个第一选择单元为所述N组第一选择单元中第E组中的第i个第一选择单元,所述N个第一数据包含所述N组第一数据中每组中的第i个第一数据,所述第E(i)个第一选择单元的输出数据为所述N个第一数据中的一个,每组所述第一选择单元的输出数据为所述N组第一数据中的一组,所述第一级输出数据包含N组第二数据,每组所述第二数据包含M个第二数据,所述N、M、E和i为正整数。将所述第一级输出数据输入第二级网络交换结构中,得到第二级输出数据;所述第二级网络交换结构包含N组第二选择单元, 每组所述第二选择单元包含M个第二选择单元,所述第二级网络交换结构中的第F(j)个第二选择单元的输入数据为所述第一级输出数据中的第F组第二数据,所述第F(j)个第二选择单元的输出数据为所述F组第二数据中的一个,所述第F(j)个第二选择单元为所述N组第二选择单元中第F组中的第j个第二选择单元,所述第二级输出数据包含N组第三数据,每组所述第三数据包含M个第三数据,所述第F(j)个第二选择单元的输出数据为所述第二级输出数据第F组中的第j个,所述F和j为正整数。
可以看出,本申请实施例中用来进行数据处理的数据交换网络结构包含第一级网络交换结构和第二级网络交换结构,且该两级网络交换结构的架构相同,每级包含N*M个并行的选择单元,因而其架构简单,便于在硬件上实现;同时,第一级网络交换结构用于实现对第一级输入数据以组为整体进行数据交换,第二级网络交换结构用于实现对第一级输出数据进行组内数据的交换,即通过上述两级相同的网络交换结构来实现不同的功能,进而可以根据不同场景,采用上述两级网络交换结构对输入数据进行不同地处理从而得到相应的输出数据,灵活性强。
在一种可行的实施方式中,上述方法还包括:将所述第二级输出数据输入第三级网络交换结构,得到第三级输出数据;所述第三级网络交换结构包含N组第三选择单元,每组所述第三选择单元包含M个第三选择单元;所述第三级网络交换结构中的N*M个第三选择单元的输入数据和输出数据分别等于第二级输出数据中的N*M个第三数据,或者所述N组第三选择单元中目标组第三选择单元中的M个第三选择单元的输入数据和输出数据分别等于所述第二级输出数据中的M个第一第三目标数据,所述目标组第三选择单元为所述N组第三选择单元中的一组,所述M个第一目标数据为所述第一级输入数据中的M个。
可以看出,本申请实施例中用来进行数据处理的数据交换网络结构还可以包含第三级网络交换结构,该第三级网络交换结构的架构与第一和第二级网络交换结构的架构相同,因而当上述数据交换网络中包含三级网络交换结构时,其结构依然较为简单,便于硬件实现;同时,该第三级网络交换结构用于实现将第二级输出数据中的M个数据聚拢到第三级网络交换结构的同一组中进行输出,因而,当数据交换网络包含上述三级网络交换结构时,可以通过上述三级网络交换结构分别实现不同的功能,进而可以根据不同场景,采用上述三级网络交换结构对输入数据进行不同地处理从而得到相应的输出数据,灵活性强。
在一种可行的实施方式中,所述第E(i)个第一选择单元的输出数据在所述第一级输入数据中的组号与所述M个第一目标数据中第i个第一目标数据的组号相同;所述第F(j)个第二选择单元的输出数据在所述第一级输出数据中的组内编号与所述M个第一目标数据中第j个第一目标数据的组内编号相同,将目标组第三选择单元中第b个第三选择单元的输出数据确定为第二级输出 数据第b组中的任一第三数据,所述目标组第三选择单元为所述N组第三选择单元中的一组。
可以看出,本申请实施例中,当数据交换网络结构包含三级网络交换结构时,通过对该三级网络交换结构中每级网络交换结构中的选择单元设置不同的选择信号来选择相应的输出数据,从而将第一级输入数据中M个第一目标数据进行抽取,聚拢到在第三级输出数据的同一组中进行输出,从而实现采用上述数据交换网络结构对M个第一目标数据进行抽取的功能。
在一种可行的实施方式中,所述第E(i)个第一选择单元的输出数据在所述第一级输入数据中的组号与第二目标数据在所述第一级输入数据中的组号相同;所述第F(j)个第二选择单元的输出数据在所述第一级输出数据中的组内编号与所述第二目标数据在所述第一级输入数据中的组内编号相同,所述第二目标数据为所述第一级输入数据中的一个。
可以看出,本申请实施例中,当数据交换网络结构包含两级网络交换结构时,通过对该两级网络交换结构中每级网络交换结构中的选择单元设置不同的选择信号来选择相应的输出数据,从而将第一级输入数据中第二目标数据进行广播,即第二级输出数据中的N*M个第三数据全都为该第二目标数据,从而实现对第二目标数据进行广播的功能;综上,可以通过对数据交换网络中每级网络交换结构中的选择单元设置相应的选择信号来实现数据抽取或数据广播的功能,表明上述数据交换网络的灵活性较好。
在一种可行的实施方式中,上述方法包括:根据第三目标数据在所述第一级输入数据中的组号、组内编号、所述第E(i)个第一选择单元的组号确定所述第E(i)个第一选择单元的输出数据在所述第一级输入数据中的组号;根据所述第三目标数据在所述第一级输入数据中的组内编号和所述第F(j)个第二选择单元的组内编号确定所述第F(j)个第二选择单元的输出数据在所述第一级输出数据中的组内编号,所述第三目标数据为所述第一级输入数据中的一个。
可以看出,本申请实施例中,当数据交换网络结构包含两级网络交换结构时,通过对该两级网络交换结构中每级网络交换结构中的选择单元设置不同的选择信号来选择相应的输出数据,从而将第一级输入数据中第三目标数据进行旋转,即将第一级输入数据中的第三目标数据输出到第二级输出数据中的相应位置,从而实现对第三目标数据进行旋转的功能;综上,可以通过对数据交换网络中每级网络交换结构中的选择单元设置相应的选择信号来实现数据抽取,或数据广播,或数据旋转的功能,表明上述数据交换网络的灵活性较好。
在一种可行的实施方式中,上述根据第三目标数据在所述第一级输入数据中的组号、组内编号、所述第E(i)个第一选择单元的组号确定所述第E(i)个第一选择单元的输出数据在所述第一级输入数据中的组号,包括:根据公式(1) 确定所述第E(i)个第一选择单元的输出数据在所述第一级输入数据中的组号;所述根据所述第三目标数据在所述第一级输入数据中的组内编号和所述第F(j)个第二选择单元的组内编号确定所述第F(j)个第二选择单元的输出数据在所述第一级输出数据中的组内编号,包括:根据公式(2)确定所述第F(j)个第二选择单元的输出数据在所述第一级输出数据中的组内编号;
组号=(E+X)%N+i/a (1)
组内编号=(j+a)%N (2)
其中,X为所述第三目标数据在第一级输入数据中的组号,a为所述第三目标数据在第一级输入数据中的组内编号,所述%表示取两个整数相除后的余数,所述/表示取两个整数相除后所得商的整数部分。
可以看出,本申请实施例中,当数据交换网络结构包含两级网络交换结构时,具体可通过根据上述公式(1)和公式(2)对该两级网络交换结构中每级网络交换结构中的选择单元设置不同的选择信号来选择相应的输出数据,从而将第一级输入数据中第三目标数据进行旋转,即将第一级输入数据中的第三目标数据输出到第二级输出数据中的相应位置,从而实现对第三目标数据的旋转功能;综上,可以通过对数据交换网络中每级网络交换结构中的选择单元设置相应的选择信号来实现数据抽取,或数据广播,或数据旋转的功能,表明上述数据交换网络的灵活性较好。
第二方面,本申请提供了一种数据处理装置,所述装置包括:处理单元,用于将第一级输入数据输入到第一级网络交换结构中进行处理,所述第一级输入数据包含N组第一数据,每组所述第一数据包含M个第一数据,所述第一级网络交换结构包含N组第一选择单元,每组所述第一选择单元包含M个第一选择单元,所述第一级网络交换结构的第E(i)个第一选择单元的输入数据为N个第一数据,所述第E(i)个第一选择单元为所述N组第一选择单元中第E组中的第i个第一选择单元,所述N个第一数据包含所述N组第一数据中每组中的第i个第一数据,所述第E(i)个第一选择单元的输出数据为所述N个第一数据中的一个,每组所述第一选择单元的输出数据为所述N组第一数据中的一组;用于将所述第一级输出数据输入到第二级网络交换结构中进行处理,所述第二级网络交换结构包含N组第二选择单元,每组所述第二选择单元包含M个第二选择单元,所述第二级网络交换结构中的第F(j)个第二选择单元的输入数据为所述第一级输出数据中的第F组第二数据,所述第F(j)个第二选择单元的输出数据为所述F组第二数据中的一个,所述第F(j)个第二选择单元为所述N组第二选择单元中第F组中的第j个第二选择单元;所述N、M、E、F、i和j为正整数;获取单元,用于获取第一级输出数据和第二级输出数据,所述第一级输出数据包含N组第二数据,每组所述第二数据包含M个第二数据;所述第二级输出数据包含N组第三数据,每组所述第三数据包含M个第三数据,所述第F(j)个第二选择单元的输出数据为所述第二级输出数据第F组中的第j个。
在一种可行的实施方式中,所述处理单元还用于:将所述第二级输出数据输入第三级网络交换结构进行处理,所述第三级网络交换结构包含N组第三选择单元,每组所述第三选择单元包含M个第三选择单元,所述第三级网络交换结构中的N*M个第三选择单元的输入数据和输出数据分别等于第二级输出数据中的N*M个第三数据,或者所述N组第三选择单元中目标组第三选择单元中的M个第三选择单元的输入数据和输出数据分别等于所述第二级输出数据中的M个第一目标数据,所述目标组第三选择单元为所述N组第三选择单元中的一组,所述M个第一目标数据为所述第一级输入数据中的M个;所述获取单元还用于:获取第三级输出数据,所述第三级输出数据包括所述第三级网络交换结构中每个第三选择单元的输出数据。
第三方面,本申请提供了一种计算机可读存储介质,该计算机可读介质存储用于设备执行的程序代码,该程序代码包括用于执行上述第一方面中任一项所述的方法。
第四方面,本申请提供了一种计算机程序产品,当该计算机程序产品在计算机上运行时,该计算机执行上述第一方面中任一项所述的方法。
第五方面,本申请提供了一种芯片,该芯片包括处理器与通讯接口,该处理器通过通讯接口读取存储器上存储的指令,以执行上述第一方面中任一项所述的方法。
图1是本申请实施例中一种数据处理方法的流程示意图;
图2是本申请实施例中一种数据交换网络的结构示意图;
图3是本申请实施例中另一种数据交换网络的结构示意图;
图4是本申请实施例中一种数据处理装置的结构示意图;
图5是本申请实施例中一种芯片的硬件结构示意图。
请参见图1,图1为本申请实施例提供的一种数据处理方法100的流程示意图。如图1所示,方法100包含步骤S110和步骤S120。
步骤S110,将第一级输入数据输入第一级网络交换结构中,得到第一级输出数据;所述第一级输入数据包含N组第一数据,每组所述第一数据包含M个第一数据,所述第一级网络交换结构包含N组第一选择单元,每组所述第一选择单元包含M个第一选择单元,所述第一级网络交换结构的第E(i)个第一选择单元的输入数据为N个第一数据,所述第E(i)个第一选择单元为所述N组第一选择单元中第E组中的第i个第一选择单元,所述N个第一数据包含所述N组第一数据中每组中的第i个第一数据,所述第E(i)个第一选择单元的 输出数据为所述N个第一数据中的一个,每组所述第一选择单元的输出数据为所述N组第一数据中的一组,所述第一级输出数据包含N组第二数据,每组所述第二数据包含M个第二数据,所述N、M、E和i为正整数。
具体地,请参阅图2,图2为本申请实施例提供的一种数据交换网络200的结构示意图。如图2所示,第一级输入数据包含N组第一数据,该每组第一数据包含M个数据,即第一级输入数据共包含N*M个数据。第一级网络交换结构包含N组第一选择单元,每组第一选择单元包含M个第一选择单元,即第一级网络交换结构包含N*M个第一选择单元。对于第一级网络交换结构中的任一第一选择单元E(i),其输入数据为第一级输入数据中每组中的第i个数据,共N个;其中,E为该任一第一选择单元的组号,i为该任一第一选择单元的组内编号,N和M为大于或等于零的整数,i为正整数。
举例来说,当该任一第一选择单元的组号和组内编号分别为3和5时,该任一第一选择单元3(5)的输入数据为第一级输入数据中每组第一数据中的第5个数据,共N个数据。
对于上述任一第一选择单元E(i),其输出数据为N个第一数据中的一个。同时,对于第一级网络交换结构中同一组内的M个第一选择单元,该M个第一选择单元的输出数据在第一级输入数据中的组号相同,即同一组内的M个第一选择单元的M个输出数据来源于第一级输入数据的同一组第一数据,也即是说上述每组第一选择单元第一选择单元的输出数据为N组第一数据中的任一组。应当理解,第一级网络交换结构的功能为对第一级输入数据中的N组第一数据以组为单位进行交换。
可以理解,第一级网络交换结构中的每个第一选择单元对应一个输出数据,该第一级网络交换结构的第一级输出数据数量为N*M个,该N*M个数据包含N组第二数据,每组第二数据中包含M个第二数据。
步骤S120,将所述第一级输出数据输入第二级网络交换结构中,得到第二级输出数据;所述第二级网络交换结构包含N组第二选择单元,每组所述第二选择单元包含M个第二选择单元,所述第二级网络交换结构中的第F(j)个第二选择单元的输入数据为所述第一级输出数据中的第F组第二数据,所述第F(j)个第二选择单元的输出数据为所述F组第二数据中的一个,所述第F(j)个第二选择单元为所述N组第二选择单元中第F组中的第j个第二选择单元,所述第二级输出数据包含N组第三数据,每组所述第三数据包含M个第三数据,所述第F(j)个第二选择单元的输出数据为所述第二级输出数据第F组中的第j个,所述F和j为正整数。
具体地,请参阅图2,图2为本申请实施例提供的一种数据交换网络的结构示意图。如图2所示,第二级网络交换结构包含N组第二选择单元,每组第二选择单元包含M个第二选择单元,即第二级网络交换结构包含N*M个第二选择单元。对于第二级网络交换结构中的任一第二选择单元F(j),其输入数据为第一级输出数据中第F组第二数据,共M个;其中,F为该任一第二选择单元的组号,j为该任一第二选择单元的组内编号,F为大于等于零且小于等于 N的整数,j为大于等于零且小于等于M的整数。
举例来说,当该任一第二选择单元的组号和组内编号分别为6和4时,该任一第二选择单元6(4)的输入数据为第一级输出数据中第6组第二数据,共M个第二数据。
对于上述任一第二选择单元F(j),其输出数据为M个第二数据中的一个。应当理解,此时第二级网络交换结构的功能为对第一级输出数据中的N组第二数据进行组内数据间的交换。
可以理解,第二级网络交换结构中的每个第二选择单元对应一个输出数据,该第二级网络交换结构的第二级输出数据数量为N*M个,该N*M个数据包含N组第三数据,每组第三数据中包含M个第三数据。
应当理解,图2所示的数据交换网络可以是软件执行单元或硬件执行单元,本申请对此不做具体限定。
可以看出,本申请实施例中用来进行数据处理的数据交换网络结构包含第一级网络交换结构和第二级网络交换结构,且该两级网络交换结构的架构相同,每级包含N*M个并行的选择单元,因而其架构简单,便于在硬件上实现;同时,第一级网络交换结构用于实现对第一级输入数据以组为整体进行数据交换,第二级网络交换结构用于实现对第一级输出数据进行组内数据的交换,即通过上述两级相同的网络交换结构来实现不同的功能,进而可以根据不同场景,采用上述两级网络交换结构对输入数据进行不同地处理从而得到相应的输出数据,灵活性强。
在一种可行的实施方式中,上述数据处理方法还包括:将所述第二级输出数据输入第三级网络交换结构,得到第三级输出数据;所述第三级网络交换结构包含N组第三选择单元,每组所述第三选择单元包含M个第三选择单元;所述第三级网络交换结构中第P(b)个第三选择单元的输入数据包括第二级输出数据中第P组中的第b个第三数据和第二级输出数据第b组中的任一第三数据,所述第P(b)个第三选择单元的输出数据为该第三选择单元输入数据中的一个,所述第P(b)个第三选择单元为第三级网络交换结构第P组中的第b个第三选择单元,所述第三级输出数据包括所述第三级网络交换结构中每个第三选择单元的输出数据,所述P为小于或等于N的正整数,b为小于或等于M的正整数。
其中,可参见图3,图3为本申请实施例中另一种数据交换网络300的结构示意图。如图3所示,数据交换网络300除包含数据交换网路200中的第一级网络交换结构和第二级网络交换结构外,还包含如图3所示的第三级网络交换结构,该第三级网络交换结构中所包含的第三选择单元的数量和组数与第一、第二级网络交换结构中的选择单元相同,此处不再赘述。应当理解,图3所示的数据交换网络可以是软件执行单元或硬件执行单元,本申请对此不做具体限定。
具体地,第三级网络交换结构可以包含以下功能:
(1)数据直通:第三级网络交换结构中的N*M个第三选择单元的输入和 输出数据分别等于第二级输出数据中的N*M个第三数据,也即是说第三级网络交换结构中的第P(b)个第三选择单元的输入和输出数据分别等于第二级输出数据中的第P(b)个第三数据;其中,第P(b)个第三选择单元指第三级网络结构中第P组中的第b个第三选择单元,第P(b)个第三数据指第二级输出数据中第P组中的第b个第三数据,P为小于或等于N的正整数,b为小于或等于M的正整数。
(2)数据聚拢:确定第三级网络交换结构中的目标组第三选择单元,将该目标组中的第b个第三选择单元的输出数据设置为第二级输出数据第b组中的任一第三数据,即将第二级输出数据中的不同组中的数据聚拢到第三级输出数据的同一组中。在第三级网络交换结构中,除目标组第三选择单元外的其它N-1组第三选择单元中每个第三选择单元的输出数据可以为该每个第三选择单元输入数据中的一个或不输出。可以理解,在一种可能的场景下,当第三级网络交换结构中,除目标组第三选择单元外的其它N-1组第三选择单元中每个第三选择单元的输出数据为空时,第三级输出数据为目标组第三选择单元的M个输出数据;此时,第三级网络交换结构的功能为将第二级输出数据中的M个数据聚拢到目标组第三选择单元中进行输出,此时第三级输出数据为上述聚拢后的M个数据。
(3)除上述两种功能外,还可以根据具体的场景确定第三级网络交换结构中每个第三选择单元的输出数据。
可以看出,本申请实施例中用来进行数据处理的数据交换网络结构还可以包含第三级网络交换结构,该第三级网络交换结构的架构与第一和第二级网络交换结构的架构相同,因而当上述数据交换网络中包含三级网络交换结构时,其结构依然较为简单,便于硬件实现;同时,该第三级网络交换结构用于实现将第二级输出数据中的M个数据聚拢到第三级网络交换结构的同一组中进行输出,因而,当数据交换网络包含上述三级网络交换结构时,可以通过上述三级网络交换结构分别实现不同的功能,进而可以根据不同场景,采用上述三级网络交换结构对输入数据进行不同地处理从而得到相应的输出数据,灵活性强。
在一种可行的实施方式中,所述第E(i)个第一选择单元的输出数据在所述第一级输入数据中的组号与所述M个第一目标数据中第i个第一目标数据的组号相同;所述第F(j)个第二选择单元的输出数据在所述第一级输出数据中的组内编号与所述M个第一目标数据中第j个第一目标数据的组内编号相同;将目标组第三选择单元中第b个第三选择单元的输出数据确定为第二级输出数据第b组中的任一第三数据,所述目标组第三选择单元为所述N组第三选择单元中的一组。
具体地,首先从第一级输入数据中确定M个第一目标数据,通过将第E(i)个第一选择单元的选择信号确定为M个第一目标数据中第i个第一目标数据的组号(如公式(3)所示),即从第E(i)个第一选择单元的输入数据中选择出与M个第一目标数据中第i个第一目标数据的组号相同的第一数据作为第E(i) 个第一选择单元的输出数据;然后将第F(j)个第二选择单元的选择信号确定为M个第一目标数据中第j个第一目标数据的组内编号((如公式(3)所示)),即从第F(j)个第二选择单元的输入数据中选择出与M个第一目标数据中第j个第一目标数据的组内编号相同的数据作为第F(j)个第二选择单元的输出数据;此时,第二级输出数据中每组组内的M个数据相同,最后将目标组第三选择单元中第b个第三选择单元的输出数据设置为第二级输出数据第b组中的任一第三数据,即可M个第一目标数据聚拢到目标组第三选择单元进行输出,此时,第三级输出数据为M个第一目标数据。
选择信号=M(i%N)的组号 (3)
选择信号=M(j%N)的组内编号 (4)
其中,“%”表示两整数相除的余数;M(i%N)表示M个第一目标数据中的第i%N个数据;公式(3)即表示从第E(i)个第一选择单元的输入数据中选择出与M个第一目标数据中第i%N个第一目标数据的组号相同的第一数据作为第E(i)个第一选择单元的输出数据。同理,公式(4)表示从第F(j)个第二选择单元的输入数据中选择出与M个第一目标数据中第M(j%N)个第一目标数据的组内编号相同的数据作为第F(j)个第二选择单元的输出数据。
可以看出,本申请实施例中,当数据交换网络结构包含三级网络交换结构时,通过对该三级网络交换结构中每级网络交换结构中的选择单元设置不同的选择信号来选择相应的输出数据,从而将第一级输入数据中M个第一目标数据进行抽取,聚拢到在第三级输出数据的同一组中进行输出,从而实现采用上述数据交换网络结构对M个第一目标数据进行抽取的功能。
在一种可行的实施方式中,上述第E(i)个第一选择单元的输出数据在所述第一级输入数据中的组号与第二目标数据在所述第一级输入数据中的组号相同;所述第F(j)个第二选择单元的输出数据在所述第一级输出数据中的组内编号与所述第二目标数据在所述第一级输入数据中的组内编号相同,所述第二目标数据为所述第一级输入数据中的一个。
具体地,可通过图2所示的数据交换网络200对第一级输入数据中的第二目标数据进行广播,具体过程如下:
(1)将第一级网络交换结构中每个第一选择单元的选择信号设为第二目标数据的组号,使得任一第一选择单元的输出数据在第一级输入数据中的组号与第二目标数据在第一级输入数据中的组号相同,即第一级网络交换结构中的每组第一选择单元的输出数据为第二目标数据所在组的M个第一数据,且每组第一选择单元内每个第一选择单元的输出数据在第一级输入数据中的组内编号与该每个第一选择单元的组内编号相同。应当理解,此时第一级输出数据为N组相同的第二数据。
(2)在得到上述N组相同的第一级输出数据后,将该第一级输出数据输入第二级网络交换结构,第二级网络交换结构中第F组中每个第二选择单元的 输入数据为第一级输出数据中的第F组,此时,由于第一级输出数据中所包含的N组第二数据相同,第二级网络交换结构中的各第二选择单元的输入数据相同,即为第二目标数据在第一级输入数据中所在组的M各第一数据。此时,将第二级网络交换结构中每个第二选择单元的选择信号设为第二目标数据的组内编号,即第二级网络交换结构中每个第二选择单元的输出数据为第二目标数据,从第二级网络交换结构输出的第二级输出数据为N*M个第二目标数据。
应该理解,通过上述第一网络交换结构和第二级网络交换结构中各选择单元的信号选择方式,可以将第一级输入数据中的第二目标数据输出到第二级输出数据中的每个位置上,即通过本申请实施例中的网络结构和上述的信号选择方式实现数据广播的功能。
可选地,也可通过图3所示的数据交换网络300对第一级输入数据中的第二目标数据进行广播。在采用数据交换网络300对第二目标数据进行广播时,第一级网络交换结构和第二网络交换结构的选择信号与数据交换网络200中的对应各级网络交换结构的选择信号相同。此时,数据交换网络300中第三级网络交换结构的选择信号设为与每个第三选择单元的组号和组内编号相同,即每个第三选择单元的输入数据和输出数据为在第二级输出数据中的组号和组内编号与该每个第三选择单元的组号和组内编号相同。
可以看出,本申请实施例中,当数据交换网络结构包含两级网络交换结构时,通过对该两级网络交换结构中每级网络交换结构中的选择单元设置不同的选择信号来选择相应的输出数据,从而将第一级输入数据中第二目标数据进行广播,即第二级输出数据中的N*M个第三数据全都为该第二目标数据,从而实现对第二目标数据的广播功能;综上,在本申请的上述实施中,可以通过对数据交换网络中每级网络交换结构中的选择单元设置相应的选择信号来实现数据抽取或数据广播的功能,表明上述数据交换网络的灵活性较好。
在一种可行的实施方式中,根据第三目标数据在所述第一级输入数据中的组号、组内编号、所述第E(i)个第一选择单元的组号确定所述第E(i)个第一选择单元的输出数据在所述第一级输入数据中的组号;根据所述第三目标数据在所述第一级输入数据中的组内编号和所述第F(j)个第二选择单元的组内编号确定所述第F(j)个第二选择单元的输出数据在所述第一级输出数据中的组内编号,所述第三目标数据为所述第一级输入数据中的一个。
具体地,可通过图2所示的数据交换网络200对第一级输入数据中的第三目标数据进行旋转,具体过程如下:
(1)上述根据第三目标数据在第一级输入数据中的组号、组内编号、第E(i)个第一选择单元的组号确定第E(i)个第一选择单元的输出数据在第一级输入数据中的组号,可以包括:根据公式(1)确定第E(i)个第一选择单元的输出数据在所述第一级输入数据中的组号。
(2)上述根据第三目标数据在第一级输入数据中的组内编号和第F(j)个第二选择单元的组内编号确定第F(j)个第二选择单元的输出数据在第一级输 出数据中的组内编号,可以包括:根据公式(2)确定所述第F(j)个第二选择单元的输出数据在所述第一级输出数据中的组内编号。
组号=(E+X)%N+i/a (1)
组内编号=(j+a)%N (2)
其中,X为第三目标数据在第一级输入数据中的组号,a为第三目标数据在第一级输入数据中的组内编号,“%”表示取两个整数相除后的余数,“/”表示取两个整数相除后所得商的整数部分。
应该理解,通过上述第一网络交换结构和第二级网络交换结构中各选择单元的信号选择方式,可以将第一级输入数据中的第三目标数据输出到第二级输出数据的第1组中的第1个数据,即通过本申请实施例中的网络结构和上述的信号选择方式实现数据广播的旋转功能。
可选地,也可通过图3所示的数据交换网络300对第一级输入数据中的第三目标数据进行广播。在采用数据交换网络300对第三目标数据进行广播时,第一级网络交换结构和第二网络交换结构的选择信号与数据交换网络200中的对应各级网络交换结构的选择信号相同。此时,数据交换网络300中第三级网络交换结构的选择信号设为与每个第三选择单元的组号和组内编号相同,即每个第三选择单元的输入数据和输出数据为在第二级输出数据中的组号和组内编号与该每个第三选择单元的组号和组内编号相同。
可以看出,本申请实施例中,当数据交换网络结构包含两级网络交换结构时,具体可通过根据上述公式(1)和公式(2)对该两级网络交换结构中每级网络交换结构中的选择单元设置不同的选择信号来选择相应的输出数据,从而将第一级输入数据中第三目标数据进行旋转,即将第一级输入数据中的第三目标数据输出到第二级输出数据中的相应位置,从而实现对第三目标数据的旋转功能;综上,可以通过对数据交换网络中每级网络交换结构中的选择单元设置相应的选择信号来实现数据抽取,或数据广播,或数据旋转的功能,表明上述数据交换网络的灵活性较好。
请参见图4,图4为本申请实施例提供的一种数据处理装置400的结构示意图。如图2所示,装置400包括处理单元410和获取单元420。
处理单元410,用于将第一级输入数据输入到第一级网络交换结构中进行处理,所述第一级输入数据包含N组第一数据,每组所述第一数据包含M个第一数据,所述第一级网络交换结构包含N组第一选择单元,每组所述第一选择单元包含M个第一选择单元,所述第一级网络交换结构的第E(i)个第一选择单元的输入数据为N个第一数据,所述第E(i)个第一选择单元为所述N组第一选择单元中第E组中的第i个第一选择单元,所述N个第一数据包含所述N组第一数据中每组中的第i个第一数据,所述第E(i)个第一选择单元的输出数据为所述N个第一数据中的一个,每组所述第一选择单元的输出数据为所述N组第一数据中的一组;用于将所述第一级输出数据输入到第二级网络交换结构中进行处理,所述第二级网络交换结构包含N组第二选择单元,每组所述第 二选择单元包含M个第二选择单元,所述第二级网络交换结构中的第F(j)个第二选择单元的输入数据为所述第一级输出数据中的第F组第二数据,所述第F(j)个第二选择单元的输出数据为所述F组第二数据中的一个,所述第F(j)个第二选择单元为所述N组第二选择单元中第F组中的第j个第二选择单元;所述N、M、E、F、i和j为正整数。
获取单元420,用于获取第一级输出数据和第二级输出数据,所述第一级输出数据包含N组第二数据,每组所述第二数据包含M个第二数据;所述第二级输出数据包含N组第三数据,每组所述第三数据包含M个第三数据,所述第F(j)个第二选择单元的输出数据为所述第二级输出数据第F组中的第j个。
在一种可行的实施方式中,所述处理单元410还用于:将所述第二级输出数据输入第三级网络交换结构进行处理,所述第三级网络交换结构包含N组第三选择单元,每组所述第三选择单元包含M个第三选择单元,所述第三级网络交换结构中的N*M个第三选择单元的输入数据和输出数据分别等于第二级输出数据中的N*M个第三数据,或者所述N组第三选择单元中目标组第三选择单元中的M个第三选择单元的输入数据和输出数据分别等于所述第二级输出数据中的M个第一目标数据,所述目标组第三选择单元为所述N组第三选择单元中的一组,所述M个第一目标数据为所述第一级输入数据中的M个;所述获取单元420还用于:获取第三级输出数据,所述第三级输出数据包括所述第三级网络交换结构中每个第三选择单元的输出数据。
请参见图5,图5为本申请实施例中一种芯片500的硬件结构示意图。如图5所示,芯片500包括通信接口501、处理器502、存储器503和至少一个用于连接通信接口501、处理器502、存储器503的通信总线504。
存储器503包括但不限于是随机存储记忆体(random access memory,RAM)、只读存储器(read-only memory,ROM)、可擦除可编程只读存储器(erasable programmable read only memory,EPROM)、或便携式只读存储器(compact disc read-only memory,CD-ROM),该存储器503用于相关指令及数据。
通信接口501用于接收和发送数据。
处理器502可以是一个或多个中央处理器(central processing unit,CPU),在处理器502是一个CPU的情况下,该CPU可以是单核CPU,也可以是多核CPU。
该芯片500中的处理器502用于读取存储器503中存储的一个或多个程序代码,执行本申请方法实施例中所描述的操作。
本申请实施例还提供一种计算机可读存储介质,计算机可读存储介质中存储有计算机程序,当其在终端上运行时,上述方法实施例中所示的方法流程得以实现。
本申请实施例还提供一种计算机程序产品,当计算机程序产品在终端上运行时,上述方法实施例中所示的方法流程得以实现。
应理解,本申请实施例中提及的处理器可以是中央处理单元(central processing unit,CPU),还可以是其他通用处理器、数字信号处理器(digital signal processor,DSP)、专用集成电路(application specific integrated circuit,ASIC)、现成可编程门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
还应理解,本申请实施例中提及的存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(read-only memory,ROM)、可编程只读存储器(programmable ROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(random access memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(dynamic RAM,DRAM)、同步动态随机存取存储器(synchronous dram,SDRAM)、双倍数据速率同步动态随机存取存储器(double data rate sdram,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(direct rambus RAM,DR RAM)。
需要说明的是,当处理器为通用处理器、DSP、ASIC、FPGA或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件时,存储器(存储模块)集成在处理器中。
应注意,本文描述的存储器旨在包括但不限于这些和任意其它适合类型的存储器。
应理解,在本申请的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可 以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
上述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
上述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
本申请实施例方法中的步骤可以根据实际需要进行顺序调整、合并和删减。
本申请实施例装置中的模块可以根据实际需要进行合并、划分和删减。
以上所述,以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。
Claims (10)
- 一种数据处理方法,其特征在于,所述方法包括:将第一级输入数据输入到第一级网络交换结构中进行处理,得到第一级输出数据;所述第一级输入数据包含N组第一数据,每组所述第一数据包含M个第一数据,所述第一级网络交换结构包含N组第一选择单元,每组所述第一选择单元包含M个第一选择单元,所述第一级网络交换结构的第E(i)个第一选择单元的输入数据为N个第一数据,所述第E(i)个第一选择单元为所述N组第一选择单元中第E组中的第i个第一选择单元,所述N个第一数据包含所述N组第一数据中每组中的第i个第一数据,所述第E(i)个第一选择单元的输出数据为所述N个第一数据中的一个,每组所述第一选择单元的输出数据为所述N组第一数据中的一组,所述第一级输出数据包含N组第二数据,每组所述第二数据包含M个第二数据,所述N、M、E和i为正整数;将所述第一级输出数据输入到第二级网络交换结构中进行处理,得到第二级输出数据;所述第二级网络交换结构包含N组第二选择单元,每组所述第二选择单元包含M个第二选择单元,所述第二级网络交换结构中的第F(j)个第二选择单元的输入数据为所述第一级输出数据中的第F组第二数据,所述第F(j)个第二选择单元的输出数据为所述F组第二数据中的一个,所述第F(j)个第二选择单元为所述N组第二选择单元中第F组中的第j个第二选择单元,所述第二级输出数据包含N组第三数据,每组所述第三数据包含M个第三数据,所述第F(j)个第二选择单元的输出数据为所述第二级输出数据第F组中的第j个,所述F和j为正整数。
- 根据权利要求1所述的方法,其特征在于,所述方法还包括:将所述第二级输出数据输入第三级网络交换结构,得到第三级输出数据;所述第三级网络交换结构包含N组第三选择单元,每组所述第三选择单元包含M个第三选择单元;所述第三级网络交换结构中第P(b)个第三选择单元的输入数据包括第二级输出数据中第P组中的第b个第三数据和第二级输出数据第b组中的任一第三数据,所述第P(b)个第三选择单元的输出数据为该第三选择单元输入数据中的一个,所述第P(b)个第三选择单元为第三级网络交换结构第P组中的第b个第三选择单元,所述第三级输出数据包括所述第三级网络交换结构中每个第三选择单元的输出数据,所述P为小于或等于N的正整数,b为小于或等于M的正整数。
- 根据权利要求2所述的方法,其特征在于,所述第E(i)个第一选择单元的输出数据在所述第一级输入数据中的组号与所述M个第一目标数据中第i个第一目标数据的组号相同;所述第F(j)个第二选择单元的输出数据在所述第一级输出数据中的组内编号与所述M个第一目标数据中第j个第一目标数据的组内编号相同,将目标组第三选择单元中第b个第三选择单元的输出数据确定为第二级输出数据第b组中的任一第三数据,所述目标组第三选择单元为所述N组第三选择单元中的一组。
- 根据权利要求1或2所述的方法,其特征在于,所述第E(i)个第一选择单元的输出数据在所述第一级输入数据中的组号与第二目标数据在所述第一 级输入数据中的组号相同;所述第F(j)个第二选择单元的输出数据在所述第一级输出数据中的组内编号与所述第二目标数据在所述第一级输入数据中的组内编号相同,所述第二目标数据为所述第一级输入数据中的一个。
- 根据权利要求1或2所述的方法,其特征在于,所述方法包括:根据第三目标数据在所述第一级输入数据中的组号、组内编号、所述第E(i)个第一选择单元的组号确定所述第E(i)个第一选择单元的输出数据在所述第一级输入数据中的组号;根据所述第三目标数据在所述第一级输入数据中的组内编号和所述第F(j)个第二选择单元的组内编号确定所述第F(j)个第二选择单元的输出数据在所述第一级输出数据中的组内编号,所述第三目标数据为所述第一级输入数据中的一个。
- 一种数据处理装置,其特征在于,所述装置包括:处理单元,用于将第一级输入数据输入到第一级网络交换结构中进行处理,所述第一级输入数据包含N组第一数据,每组所述第一数据包含M个第一数据,所述第一级网络交换结构包含N组第一选择单元,每组所述第一选择单元包含M个第一选择单元,所述第一级网络交换结构的第E(i)个第一选择单元的输入数据为N个第一数据,所述第E(i)个第一选择单元为所述N组第一选择单元中第E组中的第i个第一选择单元,所述N个第一数据包含所述N组第一数据中每组中的第i个第一数据,所述第E(i)个第一选择单元的输出数据为所述N个第一数据中的一个,每组所述第一选择单元的输出数据为所述N组第一数据中的一组;用于将所述第一级输出数据输入到第二级网络交换结构中进行处理,所述第二级网络交换结构包含N组第二选择单元,每组所述第二选择单元包含M个第二选择单元,所述第二级网络交换结构中的第F(j)个第二选择单元的输入数据为所述第一级输出数据中的第F组第二数据,所述第F(j)个第二选择单元的输出数据为所述F组第二数据中的一个,所述第F(j)个第二选择单元为所述N组第二选择单元中第F组中的第j个第二选择单元;所述N、M、E、F、i和j为正整数;获取单元,用于获取第一级输出数据和第二级输出数据,所述第一级输出数据包含N组第二数据,每组所述第二数据包含M个第二数据;所述第二级输出数据包含N组第三数据,每组所述第三数据包含M个第三数据,所述第F(j)个第二选择单元的输出数据为所述第二级输出数据第F组中的第j个。
- 根据权利要求6所述的装置,其特征在于,所述处理单元还用于:将所述第二级输出数据输入第三级网络交换结构进行处理,所述第三级网络交换结构包含N组第三选择单元,每组所述第三选择单元包含M个第三选择单元,所述第三级网络交换结构中的N*M个第三选择单元的输入数据和输出数据分别等于第二级输出数据中的N*M个第三数据,或者所述N组第三选择单元中目标组第三选择单元中的M个第三选择单元的输入数据和输出数据分别等于所述第二级输出数据中的M个第一目标数据,所述目标组第三选择单元为所述N组第三选择单元中的一组,所述M个第一目标数据为所述第一级输入数据中的M个;所述获取单元还用于:获取第三级输出数据,所述第三级输出数据包括所述第三级网络交换结构中每个第三选择单元的输出数据。
- 一种计算机可读存储介质,其特征在于,所述计算机可读介质存储用于设备执行的程序代码,所述程序代码包括用于执行如权利要求1至5中任一项所述的方法。
- 一种计算机程序产品,其特征在于,当所述计算机程序产品在计算机上运行时,所述计算机执行如权利要求1至5中任一项所述的方法。
- 一种芯片,其特征在于,所述芯片包括处理器与通讯接口,所述处理器通过所述通讯接口读取存储器上存储的指令,以执行如权利要求1至5中任一项所述的方法。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011643524.4 | 2020-12-30 | ||
CN202011643524.4A CN114697275B (zh) | 2020-12-30 | 2020-12-30 | 数据处理方法和装置 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2022142917A1 true WO2022142917A1 (zh) | 2022-07-07 |
Family
ID=82135544
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2021/133506 WO2022142917A1 (zh) | 2020-12-30 | 2021-11-26 | 数据处理方法和装置 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN114697275B (zh) |
WO (1) | WO2022142917A1 (zh) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103152281A (zh) * | 2013-03-05 | 2013-06-12 | 中国人民解放军国防科学技术大学 | 基于两级交换的负载均衡调度方法 |
CN104486237A (zh) * | 2014-12-18 | 2015-04-01 | 西安电子科技大学 | clos网络中无乱序分组路由及调度方法 |
US10097479B1 (en) * | 2012-03-29 | 2018-10-09 | Juniper Networks, Inc. | Methods and apparatus for randomly distributing traffic in a multi-path switch fabric |
CN109327409A (zh) * | 2017-07-31 | 2019-02-12 | 华为技术有限公司 | 数据中心网络dcn、dcn中传输流量的方法和交换机 |
CN111597141A (zh) * | 2020-05-13 | 2020-08-28 | 中国人民解放军国防科技大学 | 一种面向超高阶互连芯片的分级交换结构及死锁避免方法 |
Family Cites Families (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5469154A (en) * | 1991-02-19 | 1995-11-21 | Dva Ltd. | Multiconnection switching networks |
US7102999B1 (en) * | 1999-11-24 | 2006-09-05 | Juniper Networks, Inc. | Switching device |
US6992984B1 (en) * | 2000-03-07 | 2006-01-31 | Lucent Technologies Inc. | Credit-based adaptive flow control for multi-stage multi-dimensional switching architecture |
CN100397844C (zh) * | 2005-01-04 | 2008-06-25 | 华为技术有限公司 | 透传虚拟局域网数据的方法 |
CN101141374A (zh) * | 2006-09-05 | 2008-03-12 | 北京大学深圳研究生院 | 自路由集线器以分治网络构成交换结构的方法 |
JP4818249B2 (ja) * | 2007-12-14 | 2011-11-16 | アラクサラネットワークス株式会社 | ネットワーク中継システム、ネットワーク中継システムの制御方法、および、ネットワーク中継システムにおける管理装置 |
EP2557742A1 (en) * | 2008-09-11 | 2013-02-13 | Juniper Networks, Inc. | Systems, methods, and apparatus for a data centre |
US10009226B2 (en) * | 2013-04-12 | 2018-06-26 | International Business Machines Corporation | Software implementation of network switch/router |
CN109314658A (zh) * | 2016-06-27 | 2019-02-05 | 华为技术有限公司 | 网络交换设备及时隙交换的方法 |
CN107948102A (zh) * | 2016-10-12 | 2018-04-20 | 深圳市中兴微电子技术有限公司 | 一种矢量数据的并行排序网络及方法 |
CN110324265B (zh) * | 2018-03-29 | 2021-09-07 | 阿里巴巴集团控股有限公司 | 流量分发方法、路由方法、设备及网络系统 |
CN111814957B (zh) * | 2020-06-28 | 2024-04-02 | 深圳云天励飞技术股份有限公司 | 神经网络运算方法及相关设备 |
CN111951269B (zh) * | 2020-10-16 | 2021-01-05 | 深圳云天励飞技术股份有限公司 | 图像处理方法及相关设备 |
-
2020
- 2020-12-30 CN CN202011643524.4A patent/CN114697275B/zh active Active
-
2021
- 2021-11-26 WO PCT/CN2021/133506 patent/WO2022142917A1/zh active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10097479B1 (en) * | 2012-03-29 | 2018-10-09 | Juniper Networks, Inc. | Methods and apparatus for randomly distributing traffic in a multi-path switch fabric |
CN103152281A (zh) * | 2013-03-05 | 2013-06-12 | 中国人民解放军国防科学技术大学 | 基于两级交换的负载均衡调度方法 |
CN104486237A (zh) * | 2014-12-18 | 2015-04-01 | 西安电子科技大学 | clos网络中无乱序分组路由及调度方法 |
CN109327409A (zh) * | 2017-07-31 | 2019-02-12 | 华为技术有限公司 | 数据中心网络dcn、dcn中传输流量的方法和交换机 |
CN111597141A (zh) * | 2020-05-13 | 2020-08-28 | 中国人民解放军国防科技大学 | 一种面向超高阶互连芯片的分级交换结构及死锁避免方法 |
Also Published As
Publication number | Publication date |
---|---|
CN114697275A (zh) | 2022-07-01 |
CN114697275B (zh) | 2023-05-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2020029018A1 (zh) | 矩阵的处理方法、装置及逻辑电路 | |
GB2577017A (en) | Neural network classification | |
Chen et al. | A hybrid short read mapping accelerator | |
US11977902B2 (en) | Methods and systems for event reporting | |
EP4033440A1 (en) | Consensus method, apparatus and device of block chain | |
EP4071619A1 (en) | Address generation method, related device and storage medium | |
US20170193351A1 (en) | Methods and systems for vector length management | |
US11947979B2 (en) | Systems and devices for accessing a state machine | |
EP3955256A1 (en) | Non-redundant gene clustering method and system, and electronic device | |
AU2019241002B2 (en) | Transaction processing method and system, and server | |
EP3933743A1 (en) | Method and device for blockchain transaction tracing | |
WO2022142917A1 (zh) | 数据处理方法和装置 | |
CN111210004A (zh) | 卷积计算方法、卷积计算装置及终端设备 | |
CN111178513B (zh) | 神经网络的卷积实现方法、卷积实现装置及终端设备 | |
US10114853B2 (en) | Optimizing the initialization of a queue via a batch operation | |
CN111402958A (zh) | 一种建立基因比对表的方法、系统、设备及介质 | |
WO2019091443A1 (zh) | 一种基于神经网络的调整方法、装置及设备 | |
CN115543254A (zh) | 一种排序电路、排序方法及电子设备 | |
CN110134813B (zh) | 图像检索方法、图像检索装置及终端设备 | |
CN112948413A (zh) | 数据处理方法、装置、设备及存储介质 | |
US10176074B2 (en) | Computed call/jump target resolution via behavior computation | |
WO2018196246A1 (zh) | 一种快速sinc插值方法及系统 | |
US9602095B2 (en) | Multiplexer circuit, computer-readable recording medium having stored therein program for designing multiplexer circuit, and apparatus for designing multiplexer circuit | |
WO2024199297A1 (zh) | 数据的预处理方法及装置 | |
CN110910242B (zh) | 区块链生成方法、装置、终端设备及存储介质 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 21913659 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 21913659 Country of ref document: EP Kind code of ref document: A1 |