Data transmission method, device, electronic device and readable storage medium
By utilizing optimized transmission subnetworks and preset relationships in data calculation and processing, the problem of invalid operations in sparse data transmission and calculation processing is solved, and efficient data transmission and processing are achieved.
Patent Information
- Application Number
- CN201980098672.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-08-05
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2039-08-05
AI Technical Summary
In data calculation processing, the transmission and calculation processing of sparse data results in large transmission overhead and calculation overhead, especially the ineffective processing of 0-value data. How to reduce these overheads is an issue that needs to be solved urgently.
Adopting a data transmission method, by setting a specific preset relationship between the source address and the destination address, using an optimized transmission subnetwork for data transmission, reducing the number of switching nodes and uplink connection lines, avoiding data collisions, and improving transmission speed and efficiency .
It significantly reduces the transmission overhead and computing overhead of sparse data, improves data processing efficiency, has fast transmission speed and consumes less resources.
Smart Images

Figure CN114144793B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to computer technology, and more particularly to a data transmission method, device, electronic device, and readable storage medium. Background Art
[0002] In some fields involving data calculation and processing, data may have the characteristics of sparsity. Taking the neural network involving data calculation and processing as an example, the neural network generally has a sparse ratio in its feature map and parameters. Among them, there may be a sparse ratio of 20% to 80% in the feature map, and a sparse ratio of 50% to 90% in the parameter. The higher the sparse ratio, the more 0-value data there are in the data, and these 0-value data do not contribute to the final calculation result. Therefore, the transmission and calculation of these 0-value data are invalid operations. In a processor that performs data calculation and processing, data can be stored in a storage medium. When data calculation and processing is required, the data needs to be transferred from the storage medium to the calculation module of the processor for calculation and processing. If the aforementioned 0-value data is processed like other non-0-value data, the 0-value data needs to be transferred from the storage medium to the calculation module, and the calculation module needs to calculate and process the 0-value data, which will cause a large transmission overhead and calculation overhead.
[0003] Therefore, how to transmit and process sparse data to reduce invalid operations on zero-value data transmission and calculation and reduce transmission and calculation overhead is an urgent problem to be solved. Summary of the invention
[0004] Embodiments of the present application provide a data transmission method, device, electronic device, and readable storage medium for reducing data transmission overhead and computing overhead in an electronic device.
[0005] In a first aspect, an embodiment of the present application provides a data transmission method, in which at least one data to be transmitted is first obtained from a storage unit, wherein N source addresses are provided in the storage unit, and the data to be transmitted is dispersedly stored in the N source addresses, and then, based on a first preset relationship between the source address and the target address, the first transmission subnetwork is used to transmit the data to be transmitted stored in the 1st source address to the N / 2th source address to the corresponding target address. Wherein, the first preset relationship includes: when the source address is K, the corresponding target address is one of 0 to K starting from 0. In addition, the above-mentioned first transmission subnetwork includes multiple layers, each layer includes at least one switching node, and there is no switching node at the 2^(Y–1)+1th position to the 2^Yth position of layer Y, and when there is at least one switching node at the 1st position to the 2^Yth position in layer Y, each switching node in the at least one switching node does not include an uplink connection line.
[0006] In the method, based on the first preset relationship between the source address and the target address, a transmission network for transmitting data between the source address and the target address is proposed, in which in the first transmission subnetwork of the transmission network, there is no switching node from the 2^(Y–1)+1 position to the 2^Y position of layer Y, and when there is at least one switching node from the 1st position to the 2^Yth position in layer Y, each of the at least one switching node does not include an uplink connection line, and when data is transmitted through the transmission network, no collision will occur. At the same time, compared with the traditional network where no collision occurs, the number of switching nodes in the transmission network has been significantly reduced, and the complexity of the transmission network has been significantly reduced. Therefore, the transmission network has the advantages of fast transmission speed and less transmission resource occupation. When using the transmission network to transmit sparse data, the transmission overhead and the calculation overhead can be greatly reduced, and the processing efficiency of sparse data can be greatly improved.
[0007] In an optional implementation, the method further includes:
[0008] Based on the second preset relationship between the source address and the target address, the data to be transmitted stored in the N / 2+1th source address to the Nth source address is transmitted to the corresponding target address using the second transmission subnetwork. The second preset relationship includes: when the source address is L, the corresponding target address is one of M-1 to M-1-[L%(N / 2)] starting from M-1, M is the number of target addresses, and M is less than N. In addition, the second transmission subnetwork includes a plurality of layers, each layer includes at least one switching node, there is no switching node at the 2^(S–1)+1th position to the 2^Sth position of layer S, and when there is at least one switching node at the 1st position to the 2^Sth position in layer S, each of the at least one switching node does not include an uplink connection line.
[0009] In this method, based on the second preset relationship between the source address and the target address, a transmission network for transmitting data between the source address and the target address is proposed. In the second transmission subnetwork of the transmission network, there is no switching node from the 2^(S–1)+1th position to the 2^Sth position of layer S, and when there is at least one switching node from the 1st position to the 2^Sth position in layer S, each of the at least one switching node does not include an uplink connection line. When data is transmitted through the transmission network, no collision will occur. At the same time, compared with the traditional network where no collision occurs, the number of switching nodes in the transmission network has been significantly reduced, and the complexity of the transmission network has been significantly reduced. Therefore, the transmission network has the advantages of fast transmission speed and less transmission resource occupation. When using the transmission network to transmit sparse data, the transmission overhead and computing overhead can be greatly reduced, and the processing efficiency of sparse data can be greatly improved.
[0010] In an optional implementation, the number of layers of the first transmission subnetwork is log2(N)+1, and / or the number of layers of the second transmission subnetwork is log2(N)+1.
[0011] In an optional implementation, when using the first transmission subnetwork to transmit the data to be transmitted stored in the 1st source address to the N / 2th source address to the corresponding target address, the target address corresponding to the data transmission to be transmitted stored in the 1st source address to the N / 2th source address can be first obtained, and the target address is represented by a binary value. Then, starting from the LSB of the target address, the transmission path of the data to be transmitted in the first transmission subnetwork is determined according to the value of each bit in the target address, and the data to be transmitted is transmitted to the target address through the transmission path in the first transmission subnetwork.
[0012] In an optional implementation, when using the second transmission subnetwork to transmit the data to be transmitted stored in the N / 2+1th source address to the Nth source address to the corresponding target address, the target address corresponding to the data to be transmitted stored in the N / 2+1th source address to the Nth source address can be first obtained, and the target address is represented by a binary value. Then, starting from the LSB of the target address, the transmission path of the data to be transmitted in the second transmission subnetwork is determined according to the value of each bit in the target address, and the data to be transmitted is transmitted to the target address through the transmission path in the second transmission subnetwork.
[0013] In the above two optional methods, the data to be transmitted is routed to the target address according to the LSB by using the transmission network, which can further improve the speed of data transmission.
[0014] In an optional implementation, the target address is an address in a calculation module, and the calculation module includes at least M addresses.
[0015] In an optional implementation, based on a first preset relationship between the source address and the target address, using a first transmission sub-network, before transmitting the data to be transmitted stored in the 1st source address to the N / 2th source address to the corresponding target address, it can be first determined whether the amount of data to be transmitted is greater than M. If the amount of data to be transmitted is greater than M, at least one data to be transmitted is divided into multiple groups of sub-data, and each group of sub-data is transmitted under one transmission clock.
[0016] In this method, when the amount of data to be transmitted is greater than the number of target addresses, the data to be transmitted is divided into multiple groups of sub-data and each group of sub-data is transmitted at a different clock, thereby avoiding conflicts in data transmission and calculation and ensuring the correctness of data transmission and calculation.
[0017] In an optional implementation, N is 8 and M is 4.
[0018] In a second aspect, an embodiment of the present application provides a data transmission device, which includes: a storage unit, a target module, a transmission network, and a control module.
[0019] N source addresses are set in the storage unit, and multiple target addresses are set in the target module.
[0020] The transmission network is connected to the storage unit and the target module respectively.
[0021] The transmission network includes a first transmission subnetwork, which includes multiple layers, each layer includes at least one switching node, there is no switching node at the 2^(Y–1)+1th position to the 2^Yth position in layer Y, and when there is at least one switching node at the 1st position to the 2^Yth position in layer Y, each of the at least one switching node does not include an uplink connection line.
[0022] The control module is used to obtain at least one data to be transmitted from a storage unit, where the data to be transmitted is dispersedly stored in the above-mentioned N source addresses, and, based on a first preset relationship between the source address and the target address, use a first transmission subnetwork to transmit the data to be transmitted stored in the 1st source address to the N / 2th source address to the corresponding target address, wherein the first preset relationship includes: when the source address is K, the corresponding target address is one of 0 to K starting from 0.
[0023] In an optional implementation, the transmission network further includes a second transmission subnetwork.
[0024] The second transmission subnetwork includes multiple layers, each layer includes at least one switching node, there is no switching node at the 2^(S–1)+1th position to the 2^Sth position of layer S, and when there is at least one switching node at the 1st position to the 2^Sth position in layer S, each of the at least one switching node does not include an uplink connection line.
[0025] The control module is also used to transmit the data to be transmitted stored in the N / 2+1th source address to the Nth source address to the corresponding target address using a second transmission subnetwork based on a second preset relationship between the source address and the target address, wherein the second preset relationship includes: when the source address is L, the corresponding target address is one of M-1 to M-1-[L%(N / 2)] starting from M-1, M is the number of target addresses, and M is less than N.
[0026] In an optional implementation, the number of layers of the first transmission subnetwork is log2(N)+1, and / or the number of layers of the second transmission subnetwork is log2(N)+1.
[0027] In an optional implementation, the control module is specifically used for:
[0028] Obtain a target address corresponding to the data transmission to be transmitted stored in the 1st source address to the N / 2th source address, where the target address is represented by a binary value; and, starting from the LSB of the target address, determine a transmission path of the data to be transmitted in the first transmission subnetwork according to the value of each bit in the target address, and transmit the data to be transmitted to the target address through the transmission path in the first transmission subnetwork.
[0029] In an optional implementation, the control module is specifically used for:
[0030] Obtain a target address corresponding to the data to be transmitted stored in the N / 2+1th source address to the Nth source address, where the target address is represented by a binary value; and, starting from the LSB of the target address, determine a transmission path of the data to be transmitted in the second transmission subnetwork according to the value of each bit in the target address, and transmit the data to be transmitted to the target address via the transmission path in the second transmission subnetwork.
[0031] In each of the above optional implementations, the target module is a calculation module, and the calculation module includes at least M addresses.
[0032] In an optional implementation, the control module is further configured to:
[0033] When the number of data to be transmitted is greater than M, at least one data to be transmitted is divided into multiple groups of sub-data, and each group of sub-data is transmitted under one transmission clock.
[0034] In an optional implementation, N is 8 and M is 4.
[0035] In a third aspect, an embodiment of the present application provides an electronic device, including: a memory and a processor.
[0036] The processor is used to couple with the memory, read and execute instructions in the memory, so as to implement the method steps described in the first aspect above.
[0037] In a fourth aspect, an embodiment of the present application provides a computer program product, characterized in that the computer program product includes a computer program code, and when the computer program code is executed by a computer, the computer executes the method described in the first aspect above.
[0038] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, characterized in that the computer storage medium stores computer instructions, and when the computer instructions are executed by a computer, the computer executes the instructions of the method described in the first aspect above.
[0039] In a sixth aspect, an embodiment of the present application provides a chip, which is connected to a memory and is used to read and execute a software program stored in the memory to implement the method provided in the first aspect above. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 This is an example diagram of the process of performing convolution operations on a parameter (weight) and a feature map (feather map) in a neural network;
[0041] Figure 2 A flowchart of a data transmission method provided in an embodiment of the present application;
[0042] Figure 3 This is a schematic diagram of the structure of a traditional butterfly network;
[0043] Figure 4 This is a schematic diagram of the structure of the reverse butterfly network;
[0044] Figure 5(a) shows the evolution of the first half of the subnetwork;
[0045] Figure 5(b) is a diagram of the transmission network structure after evolution;
[0046] Figure 6(a) shows the evolution of the second half of the sub-network;
[0047] Figure 6(b) is the network structure diagram after evolution;
[0048] Figure 7This is a schematic diagram of the network structure obtained by using the two sub-network evolution methods shown above at the same time;
[0049] Figure 8 A flowchart of a data transmission method provided in an embodiment of the present application;
[0050] Fig. 9 A module structure diagram of a data transmission device provided in an embodiment of the present application;
[0051] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0052] First, the data sparsity ratio is explained through an example.
[0053] Figure 1 This is an example diagram of the process of performing convolution operations on a parameter (weight) and a feature map (feather map) in a neural network, such as Figure 1 As shown, the neural network contains a section of parameters and a section of feature maps. The section of parameters consists of multiple data, some of which are 0. The section of feature maps consists of multiple data, some of which are 0. When performing convolution operation on the section of parameters and the section of feature maps, it is necessary to multiply the feature map data and parameter data corresponding to the same subscript, and then accumulate the multiplication results. Since a section of feature maps and a section of parameters both contain 0, only the data corresponding to subscripts 2 and 7 are non-zero values after multiplication, and these data contribute to the final calculation result, while the data corresponding to the remaining subscripts do not contribute to the final calculation result. Figure 1 In the example shown, the data corresponding to the subscripts 2 and 7 contribute to the final calculation result, and the data corresponding to the other subscripts 0, 1, 3, 4, 5, and 6 do not contribute to the final calculation result, that is, the data sparsity ratio is 75%.
[0054] In an electronic device that performs computation, data is first stored in a storage medium before being processed, and then needs to be sent to a computing module for computation when the computation is performed. After the computation is performed by the computing module, the computation result may need to be sent to the next computing module, and so on.
[0055] For ease of description, in the embodiment of the present application, the address where the data before the operation is saved is called the source address, and the address of the data in the calculation module during the operation is called the target address. Data needs to be transferred from the source address to the target address and operated.
[0056] It is worth noting that in the embodiments of the present application, the source address may refer to an address in a storage medium, such as an address in a storage medium such as a static random access memory (SRAM) or a dynamic random access memory (DRAM), or the source address may refer to an address in a computing module. The target address may refer to an address in a computing module.
[0057] In addition, in the embodiments of the present application, "data" refers to data that can be used for calculation, such as half-precision floating point numbers, full-precision floating point numbers, integers, etc., and "data" can be represented in decimal or binary. The embodiments of the present application do not specifically limit the specific representation of data. Figure 1 Taking the parameters shown as an example, a parameter segment consists of 8 data: 0, 0, 1, 0, 0, 0, 0, -1. Each data is an integer expressed in decimal.
[0058] In the above Figure 1 In the example, a section of parameters and a section of feature graph can be respectively referred to as a data sequence. During calculation and processing, the data sequence is uniformly transmitted from the source address to the target address. Specifically, a data in the data sequence is stored in a source address, a source address corresponds to a target address, and the data in each source address is respectively transmitted to the corresponding target address.
[0059] In a possible design, before transmitting the data sequence from the source address to the target address, first filter out the valid data in the data sequence, wherein the valid data may refer to the data in the data sequence that contributes to the calculation result, and after filtering out the valid data, transmit the valid data through the transmission network between the source module where the source address is located and the target module where the target address is located. Among them, the source module includes multiple addresses, and the target module also includes multiple addresses. The data stored in each address of the source module is transmitted to each address of the target module through the transmission network between the source module and the target module. Exemplarily, assuming that the source module is SRAM, the target module is a certain computing module A, there are 8 addresses in SRAM, and there are 4 addresses in computing module A, then the data stored in the 8 addresses in SRAM can be transmitted to the 4 addresses of computing module A through the transmission network between SRAM and computing module A. On the basis of filtering out the valid data, if a transmission network with fast transmission speed and less transmission resource occupation can be provided, the transmission overhead and calculation overhead of sparse data can be greatly reduced.
[0060] The following embodiments of the present application are intended to provide a data transmission method based on a transmission network with fast transmission speed and small transmission resource occupation, so that the transmission overhead and computing overhead can be greatly reduced when sparse data is transmitted based on the network.
[0061] The method can be applied to any electronic device including a storage medium and a computing module. Exemplarily, the electronic device can be a communication device such as a terminal device, a network device, or a server.
[0062] Taking an electronic device as a terminal device as an example, the terminal device may also be called a terminal, user equipment (UE), mobile station (MS), mobile terminal (MT), etc. The terminal device may be a mobile phone, a tablet computer (pad), a computer with wireless transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in self driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, etc.
[0063] Taking an electronic device as a network device as an example, the network device can be a base station, for example, a base transceiver station (BTS) in a global system for mobile communication (GSM) or code division multiple access (CDMA), a base station (NodeB) in wideband code division multiple access (WCDMA), an evolved base station (eNB or e-NodeB, evolutionary Node B) in LTE, or a gNB in NR, etc. The base station can also be a wireless controller in a cloud radio access network (CRAN) scenario, or can be a relay station, access point, vehicle-mounted device, wearable device, and a network device in a 5G network or a network device in a future evolved PLMN network, etc.
[0064] Figure 2 A flow chart of a data transmission method provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, the method may include:
[0065] S201. Obtain at least one piece of data to be transmitted from a storage unit, wherein N source addresses are provided in the storage unit, and the data to be transmitted is dispersedly stored in the N source addresses.
[0066] The at least one data to be transmitted may be data in a data sequence, and the data sequence may be any data sequence in the electronic device that needs to be transmitted to the computing module for computing processing, for example, the at least one data to be transmitted may be data in a data sequence. Figure 1 A section of parameters or a section of feature graph, etc.
[0067] In the embodiment of the present application, the computing module may also be referred to as a computing unit.
[0068] Optionally, the storage unit may be an SRAM, a DRAM, etc. The storage unit includes a plurality of source addresses, and each source address may store a piece of data to be transmitted.
[0069] Optionally, the data to be transmitted may be valid data in the data sequence. Before storing the data to be transmitted in the storage unit, the electronic device may pre-mark the valid data in the data sequence. Exemplarily, the electronic device may determine the valid data in the data sequence and the other data according to another data sequence operated on the data sequence and the operation mode of the data sequence and the other data sequence, and mark the valid data. Figure 1 A section of the neural network in contains 0 parameters, and the other data sequence is the aforementioned Figure 1 For example, a segment of a feature graph containing 0 in a neural network in the electronic device first reads the segment of parameters and the segment of feature graph that needs to be operated with the segment of parameters, and learns that the segment of parameters and the segment of feature graph need to be multiplied. Then, the electronic device marks the data whose multiplication result between the segment of parameters and the segment of feature graph is not 0 as valid data. Specifically, Figure 1 The data corresponding to the subscripts 2 and 7 are marked as valid data, that is, Figure 1 In the example of a neural network parameter, the valid data is 1 and -1. Figure 1 In a data segment of the neural network of the example, the valid data are 3 and 5. After marking the valid data, the valid data are scattered and stored in N source addresses of the storage unit.
[0070] Optionally, the above-mentioned N source addresses may be all addresses in a module storing data to be transmitted, or the above-mentioned N source addresses may also be part of the addresses in a module storing data to be transmitted, which is not specifically limited in the embodiment of the present application.
[0071] Optionally, the above N is an even number.
[0072] Continue to refer to Figure 1 In the example of , a parameter includes 8 data, which are 0, 0, 1, 0, 0, 0, 0, -1, respectively. The 8 data are stored in 8 source addresses of the storage unit respectively. In this example, N is 8.
[0073] S202. Based on a first preset relationship between the source address and the target address, use the first transmission subnetwork to transmit the data to be transmitted stored in the 1st source address to the N / 2th source address to the corresponding target address, wherein the first preset relationship includes: when the source address is K, the corresponding target address is one of 0 to K starting from 0.
[0074] Optionally, the at least one data to be transmitted is transmitted to a target address in the computing module. The computing module where the target address is located may include at least M addresses. The data in the N source addresses are transmitted to the M addresses of the computing module. In the embodiment of the present application, M is less than N, that is, the number of data calculated by the computing module at a single time is less than the number of data stored in the module where the source address is located, so as to align the valid data.
[0075] When data of N source addresses are transmitted to M addresses of the computing module, on the one hand, the first source address among the N source addresses and the target address corresponding to the first source address satisfy a first preset relationship, and the first preset relationship includes: when the source address is K, the target address is one of 0 to K starting from 0. K is a number greater than or equal to 0. The above-mentioned first source address is any source address from the 1st source address to the N / 2th source address.
[0076] Exemplarily, the mapping relationship between the source address and the target address can be represented by a table management method. In a traditional network such as a Crossbar network, the mapping relationship between the source address and the target address is a fully connected relationship, that is, for a source address, the data stored therein may be transmitted to any target address, and in the embodiment of the present application, for a source address K among the 1st source address to the N / 2th source address, its corresponding target address is no longer any target address, but one from 0 to K. Such a design can simplify the complexity of the transmission network while ensuring normal data transmission.
[0077] It is worth noting that, for ease of description, in the embodiments of the present application, it is assumed that the source address and the target address are numbered from 0, so one of 0 to K represents the first target address to the K+1th target address. For example, assuming that the target address is an address in a computing module, the computing module includes M addresses, and the M addresses are numbered from 0, therefore, the target address 0 represents the first target address in the computing module, and the target address M-1 represents the Mth target address in the computing module.
[0078] For the first source address to the N / 2 source address in the module storing the transmission data, that is, the first half of the source addresses in the module storing the data to be transmitted, the data stored in these addresses are transmitted to the addresses starting from 0 in the calculation module, and the target address to which the data in the source address K is transmitted is one of 0 to K. For the first half of the source addresses, the corresponding target addresses are arranged in a forward direction.
[0079] The module where the source address is located and the computing module are transmitted through a specific transmission network.
[0080] In an embodiment of the present application, the above-mentioned transmission network includes a first transmission subnetwork, which is used to transmit the data to be transmitted stored in the 1st source address to the N / 2th source address, and the first transmission subnetwork includes multiple layers, each layer includes at least one switching node, and there is no switching node at the 2^(Y–1)+1th position to the 2^Yth position of layer Y, and when there is at least one switching node at the 1st position to the 2^Yth position in layer Y, each of the at least one switching node does not include an uplink connection line.
[0081] Among them, in the embodiments of the present application, the symbol "^" represents a power operation, for example, 2^Y represents 2 to the power of Y, and no further explanation will be given below.
[0082] It is worth noting that, in the embodiment of the present application, the switching node may be a logic device implemented by circuit logic. For example, the switching node may be a 2-2 multiplexer (MUX) or the like.
[0083] In the above transmission network, the first transmission subnetwork is used to transmit the data to be transmitted stored in the 1st source address to the N / 2th source address, that is, the first transmission subnetwork is used to transmit the data to be transmitted in the first half of the source addresses. In the embodiment of the present application, the number of layers of the transmission network can be flexibly set. As an optional implementation, the number of layers of the transmission network can be determined according to the number of source addresses. When the number of source addresses is N above, the number of layers of the transmission network can be the result of rounding up log2(N)+1.
[0084] During the specific implementation process, the transmission network of the embodiment of the present application can be evolved based on the traditional transmission network.
[0085] The following uses a traditional butterfly network as an example to illustrate the characteristics of the transmission network of the embodiment of the present application.
[0086] Figure 3 This is a schematic diagram of the structure of a traditional butterfly network. Figure 3 As shown in the figure, the butterfly network is responsible for transmitting data from 8 source addresses to 4 target addresses. Data from different source addresses may need to use the same transmission line for transmission, which may cause collisions. For example, data stored in source address 0 and data stored in address 4 may need to use the transmission line between node 1 and node 2 for transmission at the same time, resulting in collisions.
[0087] based on Figure 3 In the embodiment of the present application, a reverse butterfly network structure is first proposed. Figure 4 This is a schematic diagram of the structure of the reverse butterfly network. Figure 4 As shown, the network includes two transmission subnetworks, one transmission subnetwork (the first half transmission subnetwork) is responsible for transmitting the data in the first half source address to the target address, and the other transmission subnetwork (the second half transmission subnetwork) is responsible for transmitting the data in the second half source address to the target address. Among them, the first half source address and the second half source address respectively refer to: assuming that the network includes N source addresses, the first half source address refers to source addresses 0 to N / 2-1, and the second half source address refers to N / 2 to N-1. Both transmission subnetworks include multiple layers, and each layer includes multiple switching nodes. Each node in the first layer of each transmission subnetwork is respectively connected to each source address, and each node in the last layer of each transmission subnetwork is respectively connected to each target address. It is worth noting that in Figure 4 In the network structure shown, switching node A, switching node B, switching node C and switching node D connected to the target address belong to two transmission sub-networks at the same time.
[0088] exist Figure 4 On the basis of the network structure shown, based on the above-mentioned first preset relationship, the first half of the transmission subnetwork can be evolved to obtain the transmission network described in the above step S202. Figure 5(a) shows the evolution process of the first half of the subnetwork, and Figure 5(b) is a diagram of the transmission network structure after the evolution. As shown in Figures 5(a) and 5(b), the transmission network includes a first transmission subnetwork and a second transmission subnetwork. Among them, the first transmission subnetwork is responsible for transmitting the data in the first half of the source address to the target address, and the second transmission subnetwork is responsible for transmitting the data in the second half of the source address to the target address. Both subnetworks include multiple layers, and each layer includes multiple switching nodes. Each node in the first layer of each transmission subnetwork is respectively connected to each source address, and each node in the last layer of each subnetwork is respectively connected to each target address. It is worth noting that in the network structure shown in Figure 5(b), for the switching node connected to the target address, it belongs to two subnetworks at the same time. At the same time, based on the above-mentioned first preset relationship, the above Figure 4The first half of the sub-network in the reverse butterfly network shown is evolved.
[0089] For layer Y in the first transmission subnetwork, the evolution is as follows, where Y is greater than or equal to 0 and less than or equal to the difference between the number of layers of the transmission network and 1. For example, when the number of layers of the first transmission subnetwork can be the result of rounding up log2(N)+1, the value of Y is: greater than or equal to 0 and less than or equal to the result of rounding up log(N).
[0090] The number of layers of the first transmission subnetwork and the number of layers of the second transmission subnetwork are respectively the same as the number of layers of the transmission network. (1) In layer Y, the uplink connection line from switching node 0 to switching node 2^Y-1 is omitted.
[0091] Optionally, the switching nodes in each layer of the first transmission subnetwork may be numbered as follows:
[0092] A. The serial number of the switching node starts from 0. For example, the switching node 0 represents the first switching node, and the switching node 2^Y-1 represents the 2^Yth switching node.
[0093] B. In layer 0, the switching node connected to the smallest source address has the smallest number, and so on. For example, in the first transmission subnetwork shown in FIG5(a), the switching node in layer 0 connected to source address 0 is switching node 0, the switching node in layer 0 connected to source address 1 is switching node 1, and so on.
[0094] C. In other layers except layer 0 and the last layer of the first transmission subnetwork, the numbers of the switching nodes are respectively consistent with the numbers of the switching nodes in the first layer that have the same positions as the switching nodes. Exemplarily, layer 1 includes 4 switching nodes, and the lowest switching node has the same position as switching node 0 in layer 0, that is, both belong to the lowest switching node in the layer, and the lowest switching node in layer 1 is switching node 0. The next lowest switching node has the same position as switching node 1 in layer 0, that is, both belong to a switching node below the layer, and therefore, the next lowest switching node in layer 1 is switching node 1. By analogy, the numbers of each switching node in other layers except layer 0 and the last layer of the first transmission subnetwork can be obtained.
[0095] D. In the last layer, the switching node connected to the smallest target address has the smallest number, and so on. For example, in the first transmission subnetwork described in FIG5(a), the switching node in layer 3 connected to target address 0 is switching node 0, the switching node in layer 3 connected to target address 1 is switching node 1, and so on.
[0096] In addition, in the embodiment of the present application, the serial numbers of the source address and the target address also start from 0. For example, source address 0 represents the first source address, and so on.
[0097] Reference Figure 4 5(a) and 5(b), taking Y=1 as an example, since in the above-mentioned first preset relationship, the data in the source address K can only be transmitted to one of the target addresses 0 to K, then for layer 1, the data in the source address does not need to be transmitted upward when passing through switching node 0 or switching node 1 in layer 1. Therefore, omitting the uplink connection line between switching node 0 and switching node 1 in layer 1 will not affect the normal transmission of the data in the source address.
[0098] Wherein, upward transmission refers to the transmission of data from a switching node with a smaller number to a switching node with a larger number. For example, referring to FIG. 5( a ), when switching node 0 of layer 1 transmits data to switching node 2 of layer 2, it is upward transmission.
[0099] Correspondingly, an uplink connection line refers to a connection between a switching node with a smaller number in a layer with a smaller number and a switching node with a larger number in a layer with a larger number. Exemplarily, for layer 1 and layer 2, layer 1 is a layer with a smaller number and layer 2 is a layer with a larger number. For switching node 0 in layer 1 and switching node 2 in layer 2, switching node 0 in layer 1 is a switching node with a smaller number and switching node 2 in layer 2 is a switching node with a larger number, then the connection between switching node 0 in layer 1 and switching node 2 in layer 2 is an uplink connection line.
[0100] (2) In layer Y, delete the exchange nodes from the 2^(Y–1)+1th position to the 2^Yth position.
[0101] The layer Y is a layer other than the first layer and the last layer in the first transmission subnetwork.
[0102] It is worth noting that after deleting the exchange nodes at the 2^(Y–1)+1th position to the 2^Yth position, the 2^(Y–1)+1th position to the 2^Yth position still exist, and there are no exchange nodes at these positions.
[0103] The switching nodes deleted in this step include 2*2 switching nodes and 2*1 switching nodes. The 2*2 switching node refers to a node including 2 input connections and 2 output connections, and the 2*1 switching node refers to a node including 2 input connections and 1 output connection.
[0104] Continue to refer to Figure 4, Figure 5(a) and Figure 5(b), taking Y=1 as an example, after executing the above (1), the switching node 1 in layer 1 is only used to connect the switching node 1 in layer 0 and the switching node 1 in layer 2. Therefore, after deleting the switching node 1 in layer 1, the switching node 1 in layer 0 is directly connected to the switching node 1 in layer 2, which will not affect the normal transmission of the data in the source address. According to this principle, the switching nodes 2 and 3 in layer 2 are also deleted, and the switching node 3 in layer 1 is directly connected to the switching node 3 in layer 3; the switching node 2 in layer 1 is directly connected to the switching node 2 in layer 3.
[0105] (3) When Y>=1, the switching node 0 to the switching node 2^(Y-1)-1 are modified from 2x2 nodes to 2x1 nodes or 1x2 nodes.
[0106] Optionally, this step can be performed independently of the above (1) and (2), or, if the above (1) and (2) are performed, the result of this step can be satisfied.
[0107] After the above evolution, the Y layer of the obtained transmission network satisfies the following conditions:
[0108] (1) There are no exchange nodes from the 2^(Y–1)+1th position to the 2^Yth position in layer Y.
[0109] (2) When there is at least one switching node at the 1st position to the 2^Yth position in layer Y, each switching node in the at least one switching node does not include an uplink connection line.
[0110] Reference Figure 4 5(a) and 5(b), after the above evolution, in the first transmission subnetwork of the transmission network, the switching node 1 on layer 1, the switching node 2 and the switching node 3 on layer 2 are deleted.
[0111] Specifically, the transmission network in FIG5(b) is used to transmit data in 8 source addresses to 4 target addresses. The first transmission subnetwork in the transmission network is used to transmit data in source addresses 0 to 3. The first transmission subnetwork includes 4 layers, namely, layer 0, layer 1, layer 2, and layer 3. Layer 0 includes 4 switching nodes, namely, switching node 0, switching node 1, switching node 2, and switching node 3. Layer 1 includes 3 switching nodes, namely, node 0, node 2, and node 3. Layer 2 includes 2 switching nodes, namely, node 0 and node 1. Layer 3 includes 4 switching nodes. The connection method of each switching node in each layer can be referred to FIG5(b), which will not be described one by one here.
[0112] Since in the embodiment of the present application, the source address and the target address satisfy the above-mentioned first preset relationship, therefore, when the data in the first half of the source address is transmitted through the first transmission subnetwork shown in the above FIG5(b), no collision will occur. At the same time, compared with the traditional transmission network that does not collide, such as the crossbar network, the first transmission subnetwork shown in the above FIG5(b) has a significantly reduced number of switching nodes and a significantly reduced complexity of the transmission network.
[0113] In this embodiment, based on the first preset relationship between the source address and the target address, a transmission network for transmitting data between the source address and the target address is proposed. In the first transmission subnetwork of the transmission network, there is no switching node from the 2^(Y–1)+1 position to the 2^Y position of layer Y, and when there is at least one switching node from the 1st position to the 2^Yth position in layer Y, each of the at least one switching node does not include an uplink connection line, and when data is transmitted through the transmission network, no collision will occur. At the same time, compared with the traditional network where no collision occurs, the number of switching nodes in the transmission network has been significantly reduced, and the complexity of the transmission network has been significantly reduced. Therefore, the transmission network has the advantages of fast transmission speed and less transmission resource occupation. When using the transmission network to transmit sparse data, the transmission overhead and computing overhead can be greatly reduced, and the processing efficiency of sparse data can be greatly improved.
[0114] As an optional implementation, among the N source addresses mentioned above, the second source address and the target address corresponding to the second source address satisfy a second preset relationship, and the second preset relationship includes: when the source address is L, the target address is one of M-1 to M-1-[L%(N / 2)] starting from M-1, wherein the second source address is any one of the source addresses from the N / 2+1th source address to the Nth source address. L is a number greater than 0.
[0115] For the source addresses N / 2+1 to N in the module storing the data to be transmitted, that is, the second half of the source addresses in the module storing the data to be transmitted, the data stored in these addresses are transmitted to the addresses starting from M-1 in the calculation module, and the target address to which the data in the source address L is transmitted is one of M-1 to M-1-[L%(N / 2)]. For the second half of the source addresses, the corresponding target addresses are arranged in reverse order.
[0116] In an embodiment of the present application, the above-mentioned transmission network also includes a second transmission subnetwork, which is used to transmit the data to be transmitted stored in N / 2+1 source addresses to the Nth source address, and the second transmission subnetwork includes multiple layers, each layer includes at least one switching node, and there is no switching node at the 2^(S–1)+1th position to the 2^Sth position of layer S, and when there is at least one switching node at the 1st position to the 2^Sth position in layer S, each of the at least one switching node does not include an uplink connection line.
[0117] Based on the second preset relationship, the second transmission sub-network may be used to transmit the data to be transmitted stored in the N / 2+1th source address to the Nth source address to the corresponding target address.
[0118] Based on the above second preset relationship, in the aforementioned Figure 4 Based on the network structure shown in FIG. 6 , the aforementioned evolution process can be used to evolve the second transmission sub-network in the transmission network. FIG. 6( a ) is the evolution process of the second half of the sub-network, and FIG. 6( b ) is the network structure diagram after the evolution. Based on the aforementioned second preset relationship, the aforementioned Figure 4 The second half of the subnetwork of the reverse butterfly network shown in FIG. 6 undergoes the following evolution process. It is worth noting that in FIG. 6( a ) and FIG. 6( b ), the second transmission subnetwork is first connected in the reverse arrangement described above, specifically, node 0 of layer 2 is connected to node 3 of layer 3, node 1 of layer 2 is connected to node 2 of layer 3, and so on.
[0119] For the layer S in the second transmission subnetwork, the evolution is as follows, wherein S is greater than or equal to 0, and less than or equal to the difference between the number of layers of the second transmission subnetwork and 1. For example, when the number of layers of the second transmission subnetwork can be the result of rounding up log2(N)+1, the value of S is: greater than or equal to 0, and less than or equal to the result of rounding up log2(N).
[0120] (1) In layer S, the uplink connection from switching node 0 to switching node 2^S-1 is omitted.
[0121] Optionally, the switching nodes in each layer of the second transmission subnetwork may be numbered as follows:
[0122] A. The serial number of the switching node starts from 0. For example, the switching node 0 represents the first switching node, and the switching node 2^Y-1 represents the 2^Yth switching node.
[0123] B. In layer 0, the switching node connected to the smallest source address has the smallest number, and so on. For example, in the second transmission subnetwork shown in FIG5(a), the switching node in layer 0 connected to source address 0 is switching node 0, the switching node in layer 0 connected to source address 1 is switching node 1, and so on.
[0124] C. In other layers except layer 0 and the last layer of the second transmission subnetwork, the numbers of the switching nodes are respectively consistent with the numbers of the switching nodes in the first layer that have the same positions as the switching nodes. Exemplarily, layer 1 includes 4 switching nodes, and the lowest switching node has the same position as switching node 0 in layer 0, that is, both belong to the lowest switching node in the layer, and the lowest switching node in layer 1 is switching node 0. The next lowest switching node has the same position as switching node 1 in layer 0, that is, both belong to a switching node below the layer, and therefore, the next lowest switching node in layer 1 is switching node 1. By analogy, the numbers of each switching node in other layers except layer 0 and the last layer of the second transmission subnetwork can be obtained.
[0125] D. In the last layer, the switching node connected to the smallest target address has the smallest number, and so on. For example, in the second transmission subnetwork shown in FIG5(a), the switching node in layer 3 connected to target address 0 is switching node 0, the switching node in layer 3 connected to target address 1 is switching node 1, and so on.
[0126] Reference Figure 4 6(a) and 6(b), taking S=1 as an example, since in the above-mentioned second preset relationship, the data in the source address L can only be transmitted to one of the target addresses M-1 to M-1-[L%(N / 2)], then for layer 1, the data in the source address does not need to be transmitted upward when passing through switching node 0 or switching node 1 in layer 1. Therefore, omitting the uplink connection line between switching node 0 and switching node 1 in layer 1 will not affect the normal transmission of the data in the source address.
[0127] (2) In layer S, delete the exchange nodes from the 2^(S–1)+1th position to the 2^Sth position.
[0128] The layer S is a layer other than the first layer and the last layer in the second transmission subnetwork.
[0129] It is worth noting that after deleting the exchange nodes at the 2^(S–1)+1th position to the 2^Sth position, the 2^(S–1)+1th position to the 2^Sth position still exist, and there are no more exchange nodes at these positions.
[0130] The switching nodes deleted in this step include 2*2 switching nodes and 2*1 switching nodes.
[0131] Continue to refer to Figure 4 , Figure 6 (a) and Figure 6 (b), taking S = 1 as an example, after executing the above (1), the switching node 1 in layer 1 is only used to connect the switching node 1 of layer 0 and the switching node 1 of layer 2. Therefore, after deleting the switching node 1 of layer 1, the switching node 1 of layer 0 is directly connected to the switching node 1 of layer 2, which will not affect the normal transmission of data in the source address. According to this principle, the switching nodes 2 and 3 of layer 2 are also deleted, and the switching node 3 of layer 1 is directly connected to the switching node 0 of layer 3; the switching node 2 of layer 1 is directly connected to the switching node 1 of layer 3.
[0132] (3) When S>=1, the switching node 0 to the switching node 2^(S-1)-1 are modified from 2x2 nodes to 2x1 nodes or 1x2 nodes.
[0133] Optionally, this step can be performed independently of the above (1) and (2), or, if the above (1) and (2) are performed, the result of this step can be satisfied.
[0134] After the above evolution, the S layer of the obtained transmission network meets the following conditions:
[0135] (1) There are no exchange nodes from the 2^(S–1)+1th position to the 2^Sth position in layer S.
[0136] (2) When there is at least one switching node at the 1st position to the 2^Sth position in the layer S, each switching node in the at least one switching node does not include an uplink connection line.
[0137] Reference Figure 4 6(a) and 6(b), after the above evolution, in the second transmission subnetwork of the transmission network, the switching node 1 on layer 1, the switching node 2 and the switching node 3 on layer 2 are deleted.
[0138] Specifically, the transmission network in FIG6(b) is used to transmit data in 8 source addresses to 4 target addresses. The second transmission subnetwork in the transmission network is used to transmit data in source addresses 4 to 7. The second transmission subnetwork includes 4 layers, namely, layer 0, layer 1, layer 2, and layer 3. Layer 0 includes 4 switching nodes, namely, switching node 0, switching node 1, switching node 2, and switching node 3. Layer 1 includes 3 switching nodes, namely, node 0, node 2, and node 3. Layer 2 includes 2 switching nodes, namely, node 0 and node 1. Layer 3 includes 4 switching nodes. The connection method of each switching node in each layer can be referred to FIG6(b), which will not be described one by one here.
[0139] Since in the embodiment of the present application, the source address and the target address satisfy the above-mentioned second preset relationship, no collision will occur when the data in the second half of the source address is transmitted through the second transmission subnetwork shown in the above FIG6(b). At the same time, compared with the traditional transmission network that does not collide, such as the Crossbar network, the second transmission subnetwork shown in the above FIG6(b) has a significantly reduced number of switching nodes and a significantly reduced complexity of the transmission network.
[0140] In this embodiment, based on the second preset relationship between the source address and the target address, a transmission network for transmitting data between the source address and the target address is proposed. In the second transmission subnetwork of the transmission network, there is no switching node from the 2^(S–1)+1th position to the 2^Sth position of layer S, and when there is at least one switching node from the 1st position to the 2^Sth position in layer S, each of the at least one switching node does not include an uplink connection line. When data is transmitted through the transmission network, no collision will occur. At the same time, compared with the traditional network where no collision occurs, the number of switching nodes in the transmission network has been significantly reduced, and the complexity of the transmission network has been significantly reduced. Therefore, the transmission network has the advantages of fast transmission speed and less transmission resource occupation. When using the transmission network to transmit sparse data, the transmission overhead and computing overhead can be greatly reduced, and the processing efficiency of sparse data can be greatly improved.
[0141] In the specific implementation process, the transmission network may use the structure shown in FIG. 5(b) above, that is, only the first transmission sub-network uses the evolved network structure, or the transmission network may use the structure shown in FIG. 6(b) above, that is, only the second transmission sub-network uses the evolved network structure. Alternatively, the transmission network may also use the following Figure 7 The structure shown, Figure 7 This is a schematic diagram of the network structure obtained by using the two sub-network evolution methods shown above at the same time. Figure 7 In the figure, the structure of the first transmission subnetwork is the same as the first transmission subnetwork in FIG. 5( b ), and the structure of the second transmission subnetwork is the same as the first transmission subnetwork in FIG. 6( b ), which will not be described in detail here.
[0142] The following table 1 is a summary of the above FIG. 5(b) and the above Figure 7 An example of comparison with the traditional transmission network. As shown in Table 1, the above Figure 5(b) and the above Figure 7 Compared with the traditional Crossbar network, it greatly saves the number of 2*2 switching nodes and connecting lines. At the same time, compared with the traditional butterfly network, it can avoid the occurrence of collisions.
[0143] Table 1
[0144]
[0145] The following describes the specific process of performing data transmission in step S202 based on the above-mentioned transmission network.
[0146] Figure 8 A flow chart of a data transmission method provided in an embodiment of the present application is shown in FIG. Figure 8 As shown, the process of using the first transmission sub-network to transmit the data to be transmitted to the target address includes:
[0147] S801. Obtain a target address corresponding to the data transmission to be transmitted stored in the first source address to the N / 2th source address, where the target address is represented by a binary value.
[0148] Optionally, the target address of the data to be transmitted can be obtained according to the preset correspondence between the number of the data to be transmitted and the target address. For example, assuming that 8 data are stored in 8 source addresses, including 2 data to be transmitted, the target address of the first data to be transmitted is address 0, and the target address of the second data to be transmitted is address 1.
[0149] S802, starting from the least significant bit (LSB) of the target address, determine the transmission path of the data to be transmitted in the transmission network according to the value of each bit in the target address, and transmit the data to be transmitted to the target address through the transmission path.
[0150] Taking the data sequence as above Figure 1 A feature graph of the neural network shown in Figure 1. The transmission network is Figure 7 Taking the transmission network shown in FIG. 1 as an example, the feature graph includes two valid data, which are the data to be transmitted. The feature graph is stored in Figure 7 Among the 8 source addresses shown, data 5 is stored in source address 0, and so on, in sequence. As can be seen from the previous description, the valid data in this section of the feature map are 5 and 3, among which data 3 is stored in source address 5. Therefore, data 3 can be transmitted using the second transmission subnetwork. At the same time, according to the above-mentioned second preset relationship, data 3 can be transmitted to target address 2. The binary value of target address 1 is 001. Starting from the LSB of 001, data 3 is routed on the second transmission subnetwork. Specifically, if the LSB of 001 is 1, data 3 is routed from switching node 1 of layer 0 to switching node 1 of layer 2, and directly routed from switching node 1 of layer 2 to switching node 2 of layer 3, and then transmitted to target address 2.
[0151] In this embodiment, the above-mentioned transmission network is used to route the data to be transmitted to the target address according to LSB, which can further improve the speed of data transmission.
[0152] With the above Figure 8 Similar to the process shown, when using the second transmission sub-network to transmit data, the target address corresponding to the data to be transmitted stored in the N / 2+1th source address to the Nth source address can be first obtained, and the target address is represented by a binary value. Then, starting from the LSB of the target address, the transmission path of the data to be transmitted in the second transmission sub-network is determined according to the value of each bit in the target address, and the data to be transmitted is transmitted to the target address through the transmission path in the second transmission sub-network. The specific execution process is the same as above. Figure 8 The processing process of the first transmission subnetwork is the same as that of the first transmission subnetwork, which will not be repeated here.
[0153] In the above embodiments, the number of target addresses M is less than the number of source addresses N. Exemplarily, M can be 4 and N can be 8. In this way, if the number of data to be transmitted stored in the source address is greater than M, it is impossible to transmit all the data to be transmitted to the target address for processing at one time. Based on this problem, as an optional implementation, if the number of the above data to be transmitted is greater than M, the data to be transmitted can be divided into multiple groups of sub-data, and under one transmission clock, a group of sub-data can be transmitted to the corresponding target address using the above transmission network.
[0154] Optionally, the data to be transmitted may be divided according to the source address. For example, if the number of source addresses is 8 and the number of target addresses is 4, the data from source address 0 to source address 3 is used as the first group of sub-data, and the data from source address 4 to source address 7 is used as the second group of sub-data. Furthermore, the data to be transmitted in the first group of sub-data is transmitted to the target address through the above transmission network at one clock for calculation, and the data to be transmitted in the second group of sub-data is transmitted to the target address through the above transmission network at another clock for calculation.
[0155] In this embodiment, when the amount of data to be transmitted is greater than the number of target addresses, the data to be transmitted is divided into multiple groups of sub-data, and each group of sub-data is transmitted at a different clock, thereby avoiding conflicts in data transmission and calculation and ensuring the correctness of data transmission and calculation.
[0156] Fig. 9 This is a module structure diagram of a data transmission device provided in an embodiment of the present application. The device may be the electronic device described in the above embodiment, or may be a device in an electronic device that can implement the functions in the method provided in an embodiment of the present application. For example, the device may be a device or a chip system in an electronic device. Fig. 9 As shown, the device comprises:
[0157] Storage unit 901 , target module 902 , transmission network 903 and control module 904 .
[0158] Among them, N source addresses are set in the storage unit 901, and multiple target addresses are set in the target module 902.
[0159] The transmission network 903 is connected to the storage unit 901 and the target module 902 respectively.
[0160] The transmission network 903 includes a first transmission subnetwork, which includes multiple layers, each layer includes at least one switching node, there is no switching node at the 2^(Y–1)+1th position to the 2^Yth position in layer Y, and when there is at least one switching node at the 1st position to the 2^Yth position in layer Y, each of the at least one switching node does not include an uplink connection line.
[0161] The control module 904 may be connected to the storage unit 901 , the target module 902 , and the transmission network 903 , respectively.
[0162] The control module 904 is used to obtain at least one data to be transmitted from the storage unit 901, which is dispersedly stored in the above-mentioned N source addresses, and, based on a first preset relationship between the source address and the target address, use the first transmission subnetwork to transmit the data to be transmitted stored in the 1st source address to the N / 2th source address to the corresponding target address, wherein the first preset relationship includes: when the source address is K, the corresponding target address is one of 0 to K starting from 0.
[0163] In an optional implementation, the transmission network 903 further includes a second transmission subnetwork.
[0164] The second transmission subnetwork includes a plurality of layers, each layer includes at least one switching node, there is no switching node at the 2^(S–1)+1th position to the 2^Sth position of the layer S, and when there is at least one switching node at the 1st position to the 2^Sth position in the layer S, each of the at least one switching node does not include an uplink connection line;
[0165] The control module 904 is also used to transmit the data to be transmitted stored in the N / 2+1th source address to the Nth source address to the corresponding target address using a second transmission subnetwork based on a second preset relationship between the source address and the target address, wherein the second preset relationship includes: when the source address is L, the corresponding target address is one of M-1 to M-1-[L%(N / 2)] starting from M-1, M is the number of target addresses, and M is less than N.
[0166] In an optional implementation, the number of layers of the first transmission subnetwork is log2(N)+1, and / or the number of layers of the second transmission subnetwork is log2(N)+1.
[0167] In an optional implementation, the control module 904 is specifically configured to:
[0168] Obtain a target address corresponding to the data transmission to be transmitted stored in the 1st source address to the N / 2th source address, where the target address is represented by a binary value; and, starting from the LSB of the target address, determine a transmission path of the data to be transmitted in the first transmission subnetwork according to the value of each bit in the target address, and transmit the data to be transmitted to the target address through the transmission path in the first transmission subnetwork.
[0169] In an optional implementation, the control module 904 is specifically configured to:
[0170] Obtain a target address corresponding to the data to be transmitted stored in the N / 2+1th source address to the Nth source address, where the target address is represented by a binary value; and, starting from the LSB of the target address, determine a transmission path of the data to be transmitted in the second transmission subnetwork according to the value of each bit in the target address, and transmit the data to be transmitted to the target address via the transmission path in the second transmission subnetwork.
[0171] As an optional implementation, the target module 902 may be a calculation module, which includes at least M addresses.
[0172] When the amount of data to be transmitted is greater than M, the control module 904 is further configured to divide at least one data to be transmitted into multiple groups of sub-data, each group of sub-data being transmitted under one transmission clock.
[0173] The data transmission device provided in the embodiment of the present application can execute the method steps in the above method embodiment, and its implementation principle and technical effects are similar, which will not be repeated here.
[0174] It should be noted that it should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software called by processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. For example, the determination module can be a separately established processing element, or it can be integrated in a chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a processing element of the above device. The implementation of other modules is similar. In addition, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element described here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.
[0175] For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more microprocessors (digital signal processors, DSP), or one or more field programmable gate arrays (FPGA), etc. For another example, when a module above is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0176] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in accordance with the embodiment of the present application is generated in whole or in part. The above-mentioned computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable devices. The above-mentioned computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the above-mentioned computer instructions can be transmitted from a website site, computer, server or data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The above-mentioned computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, a data center, etc. that contains one or more available media integrations. The available media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVDs), or semiconductor media (eg, solid state disks (SSDs)).
[0177] Fig.10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Fig.10 As shown, the electronic device 1000 may include: a processor 101 (such as a CPU), a memory 102, and a transceiver 103; the transceiver 103 is coupled to the processor 101, and the processor 101 controls the transceiver 103. Various instructions may be stored in the memory 102 to complete various processing functions and implement the method steps performed by the electronic device in the embodiment of the present application. Optionally, the electronic device involved in the embodiment of the present application may also include: a power supply 104, a system bus 105, and a communication port 106. The transceiver 103 may be integrated in the transceiver of the electronic device, or it may be an independent transceiver antenna on the electronic device. The system bus 105 is used to realize the communication connection between components. The above-mentioned communication port 106 is used to realize the connection and communication between the electronic device and other peripherals.
[0178] In the embodiment of the present application, the processor 101 is used to couple with the memory 102, read and execute instructions in the memory 102, so as to implement the method steps performed by the electronic device in the above method embodiment. The implementation principle and technical effect are similar and will not be described in detail here.
[0179] Should Fig.10The system bus mentioned in the specification may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The system bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The communication interface is used to realize the communication between the database access device and other devices (such as clients, read-write libraries, and read-only libraries). The memory may include random access memory (RAM) and may also include non-volatile memory (non-volatile memory), such as at least one disk storage.
[0180] The above-mentioned processor can be a general-purpose processor, including a central processing unit CPU, a network processor (NP), etc.; it can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0181] Optionally, an embodiment of the present application further provides a computer-readable storage medium, which stores instructions, and when the storage medium is run on a computer, enables the computer to execute the processing process of the electronic device in the above embodiment.
[0182] Optionally, an embodiment of the present application further provides a chip for executing instructions, which is used to execute the processing process of the electronic device in the above embodiment.
[0183] An embodiment of the present application also provides a program product, which includes a computer program stored in a storage medium. At least one processor can read the computer program from the storage medium, and the at least one processor executes the processing process of the electronic device in the above embodiment.
[0184] In the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship; in the formula, the character " / " indicates that the previous and next associated objects are in a "division" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0185] It should be understood that the various numerical numbers involved in the embodiments of the present application are only used for the convenience of description and are not used to limit the scope of the embodiments of the present application.
[0186] It can be understood that in the embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
Claims
1. A data transmission method, characterized in that: include: Acquire at least one piece of data to be transmitted from a storage unit, wherein N source addresses are provided in the storage unit, and the piece of data to be transmitted is dispersedly stored in the N source addresses; Based on a first preset relationship between the source address and the target address, using the first transmission subnetwork, transmitting the to-be-transmitted data stored in the 1st source address to the N / 2th source address to the corresponding target address, wherein the first preset relationship includes: when the source address is K, the corresponding target address is one of 0 to K starting from 0; The first transmission subnetwork includes multiple layers, each layer includes at least one switching node, there is no switching node at the 2^(Y-1)+1th position to the 2^Yth position of layer Y, and when there is at least one switching node at the 1st position to the 2^Yth position in layer Y, each of the at least one switching node does not include an uplink connection line.
2. The method according to claim 1, characterized in that The method further comprises: Based on a second preset relationship between the source address and the target address, using a second transmission subnetwork, transmitting the data to be transmitted stored in the N / 2+1th source address to the Nth source address to the corresponding target address, wherein the second preset relationship includes: when the source address is L, the corresponding target address is one of M-1 to M-1-[L%(N / 2)] starting from M-1, M is the number of target addresses, and M is less than N; The second transmission subnetwork includes multiple layers, each layer includes at least one switching node, there is no switching node at the 2^(S-1)+1th position to the 2^Sth position in layer S, and when there is at least one switching node at the 1st position to the 2^Sth position in layer S, each of the at least one switching node does not include an uplink connection line.
3. The method according to claim 2, characterized in that The number of layers of the first transmission subnetwork is log2(N)+1, and / or the number of layers of the second transmission subnetwork is log2(N)+1.
4. The method according to any one of claims 1 to 3, characterized in that: The method of using the first transmission sub-network to transmit the data to be transmitted stored in the first source address to the N / 2th source address to the corresponding target address includes: Obtaining a target address corresponding to the data transmission to be transmitted stored in the first source address to the N / 2th source address, wherein the target address is represented by a binary value; Starting from the least significant bit LSB of the target address, the transmission path of the data to be transmitted in the first transmission subnetwork is determined according to the value of each bit in the target address, and the data to be transmitted is transmitted to the target address through the transmission path in the first transmission subnetwork.
5. The method according to claim 2 or 3, characterized in that: The method of using the second transmission sub-network to transmit the data to be transmitted stored in the N / 2+1th source address to the Nth source address to the corresponding target address includes: Obtaining a target address corresponding to the data to be transmitted stored in the N / 2+1th source address to the Nth source address, wherein the target address is represented by a binary value; Starting from the LSB of the target address, the transmission path of the data to be transmitted in the second transmission subnetwork is determined according to the value of each bit in the target address, and the data to be transmitted is transmitted to the target address through the transmission path in the second transmission subnetwork.
6. The method according to any one of claims 1 to 5, characterized in that: The target address is an address in a calculation module, and the calculation module includes at least M addresses.
7. The method according to claim 6, characterized in that Before transmitting the data to be transmitted stored in the first source address to the N / 2th source address to the corresponding target address using the first transmission sub-network based on the first preset relationship between the source address and the target address, the method further includes: If the number of the data to be transmitted is greater than M, the at least one data to be transmitted is divided into a plurality of groups of sub-data, and each group of sub-data is transmitted under one transmission clock.
8. A data transmission device, characterized in that: include: Storage unit, target module, transmission network and control module; The storage unit is provided with N source addresses; A plurality of target addresses are set in the target module; The transmission network is connected to the storage unit and the target module respectively; The transmission network includes a first transmission subnetwork, the first transmission subnetwork includes a plurality of layers, each layer includes at least one switching node, there is no switching node at the 2^(Y-1)+1th position to the 2^Yth position of layer Y, and when there is at least one switching node at the 1st position to the 2^Yth position in layer Y, each of the at least one switching node does not include an uplink connection line; The control module is used to obtain at least one data to be transmitted from the storage unit, the data to be transmitted is dispersedly stored in the N source addresses, and, based on a first preset relationship between the source address and the target address, uses the first transmission subnetwork to transmit the data to be transmitted stored in the 1st source address to the N / 2th source address to the corresponding target address, wherein the first preset relationship includes: when the source address is K, the corresponding target address is one of 0 to K starting from 0.
9. The device according to claim 8, characterized in that The transmission network also includes a second transmission subnetwork; The second transmission subnetwork includes a plurality of layers, each layer includes at least one switching node, there is no switching node at the 2^(S-1)+1th position to the 2^Sth position of layer S, and when there is at least one switching node at the 1st position to the 2^Sth position in layer S, each of the at least one switching node does not include an uplink connection line; The control module is also used to transmit the data to be transmitted stored in the N / 2+1th source address to the Nth source address to the corresponding target address using a second transmission subnetwork based on a second preset relationship between the source address and the target address, wherein the second preset relationship includes: when the source address is L, the corresponding target address is one of M-1 to M-1-[L%(N / 2)] starting from M-1, M is the number of target addresses, and M is less than N.
10. The device according to claim 9, characterized in that The number of layers of the first transmission subnetwork is log2(N)+1, and / or the number of layers of the second transmission subnetwork is log2(N)+1.
11. The device according to any one of claims 8 to 10, characterized in that: The control module is specifically used for: Obtaining a target address corresponding to the data transmission to be transmitted stored in the first source address to the N / 2th source address, wherein the target address is represented by a binary value; and Starting from the least significant bit LSB of the target address, the transmission path of the data to be transmitted in the first transmission subnetwork is determined according to the value of each bit in the target address, and the data to be transmitted is transmitted to the target address through the transmission path in the first transmission subnetwork.
12. The device according to claim 9 or 10, characterized in that The control module is specifically used for: Obtaining the target address corresponding to the data to be transmitted stored in the N / 2+1th source address to the Nth source address, wherein the target address is represented by a binary value; and Starting from the LSB of the target address, the transmission path of the data to be transmitted in the second transmission subnetwork is determined according to the value of each bit in the target address, and the data to be transmitted is transmitted to the target address through the transmission path in the second transmission subnetwork.
13. The device according to any one of claims 8 to 12, characterized in that: The target module is a calculation module, and the calculation module includes at least M addresses.
14. The device according to claim 13, characterized in that The control module is also used for: When the amount of the data to be transmitted is greater than M, the at least one data to be transmitted is divided into a plurality of groups of sub-data, and each group of sub-data is transmitted under one transmission clock.
15. An electronic device, characterized in that: include: Memory and processor; The processor is used to couple with the memory, read and execute instructions in the memory, so as to implement the method steps described in any one of claims 1-7.
16. A computer program product, characterized in that The computer program product comprises computer program codes, and when the computer program codes are executed by a computer, the computer is enabled to perform the method according to any one of claims 1 to 7.
17. A computer-readable storage medium, characterized in that: The computer storage medium stores computer instructions, which, when executed by a computer, enable the computer to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method and device for transmitting data in unidirectional network
CN101702640A
Methods, apparatuses and computer programs for providing a user plane address
CN107925872A
Data processing method and device
CN109214543A
Method and system for transmitting data between computing nodes and electronic equipment
CN109828843A
Memory-mapped interface for message passing computing systems
US20190121734A1
