[go: up one dir, main page]

CN114079627B - Data transmission device and method - Google Patents

Data transmission device and method Download PDF

Info

Publication number
CN114079627B
CN114079627B CN202010820611.6A CN202010820611A CN114079627B CN 114079627 B CN114079627 B CN 114079627B CN 202010820611 A CN202010820611 A CN 202010820611A CN 114079627 B CN114079627 B CN 114079627B
Authority
CN
China
Prior art keywords
network interface
data packet
network
subnet
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010820611.6A
Other languages
Chinese (zh)
Other versions
CN114079627A (en
Inventor
李鸽子
李�诚
杨伟
虞志益
李润峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202010820611.6A priority Critical patent/CN114079627B/en
Publication of CN114079627A publication Critical patent/CN114079627A/en
Application granted granted Critical
Publication of CN114079627B publication Critical patent/CN114079627B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/16Multipoint routing
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/16Arrangements for providing special services to substations
    • H04L12/18Arrangements for providing special services to substations for broadcast or conference, e.g. multicast

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Theoretical Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Biomedical Technology (AREA)
  • Molecular Biology (AREA)
  • Biophysics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application discloses a data transmission device and a data transmission method, relates to the technical field of data transmission, and is beneficial to improving the data transmission efficiency. The data transmission device comprises a router, a first network interface and a plurality of second network interfaces. After the first network interface receives the data packet including the identifiers of the plurality of destination network interfaces sent by the router, the first network interface may broadcast the data packet in a first subnet, where the first subnet includes the first network interface and a plurality of second network interfaces, and the plurality of second network interfaces includes the plurality of destination network interfaces. After the plurality of second network interfaces in the first subnet receive the data packet sent by the first network interface, the plurality of destination network interfaces can forward the data packet to the corresponding processing node according to the identifiers of the destination network interfaces in the data packet, and other network interfaces except the plurality of destination network interfaces in the plurality of second network interfaces can discard the data packet according to the identifiers of the plurality of destination network interfaces.

Description

数据传输装置和方法Data transmission device and method

技术领域Technical Field

本申请涉及数据传输技术领域,尤其涉及数据传输装置和方法。The present application relates to the technical field of data transmission, and in particular to a data transmission device and method.

背景技术Background technique

近年来,神经网络(neural network)技术迅速发展,已经在模式识别、预测估计、图像处理等众多领域取得了广泛的成功,随着越来越复杂的计算任务,神经网络的处理节点的规模逐步扩大,如何实现各个节点之间的高效通信成为急需解决的重要任务。In recent years, neural network technology has developed rapidly and has achieved widespread success in many fields such as pattern recognition, prediction and estimation, and image processing. With the increasing complexity of computing tasks, the scale of neural network processing nodes has gradually expanded. How to achieve efficient communication between nodes has become an important task that needs to be solved urgently.

卷积神经网络是一种更适合进行图像处理、模式识别的网络结构。随着卷积神经网络研究热潮的兴起,卷积神经网络的模型深度不断被加深用以获得更高的算法性能。但与此同时,卷积神经网络的局部数据量大、数据传输密集等问题也开始逐渐的浮现。该情况下,如何快速、高效地进行数据传输,以提升卷积神经网络的计算速度成为亟待解决的技术问题。Convolutional neural network is a network structure that is more suitable for image processing and pattern recognition. With the rise of the research boom of convolutional neural network, the model depth of convolutional neural network has been continuously deepened to obtain higher algorithm performance. But at the same time, problems such as large local data volume and intensive data transmission of convolutional neural network have gradually emerged. In this case, how to quickly and efficiently transmit data to improve the computing speed of convolutional neural network has become a technical problem that needs to be solved urgently.

发明内容Summary of the invention

本申请实施例提供了一种数据传输装置和方法,有助于提高数据传输效率。该技术方案应用于神经网络系统时,有助于提升神经网络系统的数据传输效率和计算速度。这里的神经网络系统例如可以是卷积神经网络。The embodiment of the present application provides a data transmission device and method, which helps to improve the data transmission efficiency. When the technical solution is applied to a neural network system, it helps to improve the data transmission efficiency and calculation speed of the neural network system. The neural network system here can be, for example, a convolutional neural network.

为了达到上述目的,本申请实施例提供了以下技术方案:In order to achieve the above objectives, the present application provides the following technical solutions:

第一方面,提供了一种数据传输装置,该数据传输装置包括:路由器,用于向第一网络接口发送数据包,该数据包中包括多个目的网络接口的标识。第一网络接口,用于:接收路由器发送的数据包,并在第一子网中广播该数据包,其中,第一子网包括第一网络接口和多个第二网络接口,该多个第二网络接口包括多个目的网络接口。该多个第二网络接口,用于接收第一网络接口发送的数据包,其中,该多个目的网络接口还用于根据数据包中的目的网络接口的标识,将该数据包转发给对应的处理节点,该多个第二网络接口中除该多个目的网络接口之外的其他网络接口还用于根据该多个目的网络接口的标识丢弃数据包。In a first aspect, a data transmission device is provided, the data transmission device comprising: a router, configured to send a data packet to a first network interface, the data packet including identifiers of multiple destination network interfaces. The first network interface, configured to: receive a data packet sent by the router, and broadcast the data packet in a first subnet, wherein the first subnet comprises a first network interface and multiple second network interfaces, the multiple second network interfaces comprising multiple destination network interfaces. The multiple second network interfaces are configured to receive a data packet sent by the first network interface, wherein the multiple destination network interfaces are further configured to forward the data packet to a corresponding processing node according to the identifier of the destination network interface in the data packet, and the other network interfaces among the multiple second network interfaces except the multiple destination network interfaces are further configured to discard the data packet according to the identifier of the multiple destination network interfaces.

该技术方案中,以广播方式发送数据包,以多播方式处理接收到的数据包。由于以广播方式发送数据包,在数据包由发送端传输到目的端的过程中,不需要进行路径选择,因此,有助于节省数据包传输过程中的数据处理复杂度,从而节省数据传输时间。而以多播方式处理该数据包,可以使该数据包发往可选择的目的端(即上述多个目的网络接口),而非广播方式下的所有目的端(即上述第一子网中的所有第二网络接口)。因此,结合广播方式和多播方式各自的特点,在传输多播数据包的场景下,以广播方式发送数据包,以多播方式处理接收到的数据包,有助于在保证数据包传输到正确的目的端的前提下,提高数据传输效率。这里的正确的目的端(即上述目的网络接口)可以基于网络拓扑预先配置。当本技术方案应用于神经网络系统时,有助于提升神经网络系统的数据传输效率以及计算速度。In this technical solution, data packets are sent in a broadcast mode, and received data packets are processed in a multicast mode. Since data packets are sent in a broadcast mode, no path selection is required during the transmission of data packets from the sending end to the destination end. Therefore, it helps to save the complexity of data processing during data packet transmission, thereby saving data transmission time. Processing the data packet in a multicast mode allows the data packet to be sent to a selectable destination (i.e., the above-mentioned multiple destination network interfaces) rather than all destinations in a broadcast mode (i.e., all second network interfaces in the above-mentioned first subnet). Therefore, combining the respective characteristics of the broadcast mode and the multicast mode, in the scenario of transmitting multicast data packets, sending data packets in a broadcast mode and processing received data packets in a multicast mode can help to improve data transmission efficiency while ensuring that the data packets are transmitted to the correct destination. The correct destination here (i.e., the above-mentioned destination network interface) can be pre-configured based on the network topology. When this technical solution is applied to a neural network system, it helps to improve the data transmission efficiency and calculation speed of the neural network system.

在一种可能的设计中,第一网络接口用于根据多个目的网络接口的标识,向第一子网中的多个第二网络接口广播数据包。例如,如果第一网络接口201解析数据包的包头部分后,确定该数据包中包含多个目的网络接口的标识,则向第一子网广播该数据包。In one possible design, the first network interface is used to broadcast a data packet to multiple second network interfaces in the first subnet according to the identifiers of multiple destination network interfaces. For example, if the first network interface 201 parses the header of the data packet and determines that the data packet contains the identifiers of multiple destination network interfaces, the data packet is broadcast to the first subnet.

在一种可能的设计中,第一网络接口用于根据数据包中包括的广播标识,向第一子网中的多个第二网络接口广播数据包。例如,如果第一网络接口201解析数据包的包头部分后,确定该数据包中包含广播标识,则向第一子网广播该数据包。In one possible design, the first network interface is used to broadcast the data packet to multiple second network interfaces in the first subnet according to the broadcast identifier included in the data packet. For example, if the first network interface 201 parses the header of the data packet and determines that the data packet contains a broadcast identifier, the data packet is broadcast to the first subnet.

在一种可能的设计中,数据包还包括第一子网的标识。路由器用于根据第一子网标识向第一网络接口发送数据包。这为“路由器连接多个子网,并在多个子网之间传输数据包”创造了条件。也就是说,该路由器还可以连接其他子网,从而基于其他子网标识向其他子网发送数据包。In a possible design, the data packet also includes an identifier of the first subnet. The router is used to send the data packet to the first network interface according to the identifier of the first subnet. This creates a condition for "the router to connect multiple subnets and transmit data packets between multiple subnets". That is, the router can also connect to other subnets, thereby sending data packets to other subnets based on other subnet identifiers.

在一种可能的设计中,数据传输装置还包括第三网络接口,路由器还用于与第三网络接口通信,其中,第三网络接口为第二子网中的网络接口,第二子网包括第三网络接口以及多个第四网络接口。该可能的设计,提供了一个路由器连接多个子网的具体实现方式。其中,第三网络接口的功能可以参考第一子网中的第一网络接口的功能。第四网络接口的功能可以参考第一子网中的第二网络接口的功能。此处不再赘述。In a possible design, the data transmission device also includes a third network interface, and the router is also used to communicate with the third network interface, wherein the third network interface is a network interface in the second subnet, and the second subnet includes the third network interface and multiple fourth network interfaces. This possible design provides a specific implementation method for connecting multiple subnets to a router. The function of the third network interface can refer to the function of the first network interface in the first subnet. The function of the fourth network interface can refer to the function of the second network interface in the first subnet. No further details are given here.

在一种可能的设计中,第一子网中的部分网络接口也属于第二子网。In a possible design, some network interfaces in the first subnet also belong to the second subnet.

在一种可能的设计中,数据传输装置还包括多个配置交换器。该多个配置交换器中的第一配置交换器连接第一网络接口,并用于接收第一网络接口发送的数据包,并向第一子网内连接多个第二网络接口的其他配置交换器发送数据包。In one possible design, the data transmission device further includes a plurality of configuration switches. A first configuration switch among the plurality of configuration switches is connected to the first network interface and is used to receive data packets sent by the first network interface and to send data packets to other configuration switches connected to a plurality of second network interfaces in the first subnet.

在一种可能的设计中,多个配置交换器中的每个配置交换器包括多个端口,该多个端口中的第一端口用于连接一个网络接口,多个端口中的其他网络接口用于连接其他配置交换器。该多个配置交换器中的每个配置交换器,还用于基于配置信息,控制自身的多个端口之间的连通或断开状态。In one possible design, each of the multiple configuration switches includes multiple ports, a first port of the multiple ports is used to connect to a network interface, and other network interfaces of the multiple ports are used to connect to other configuration switches. Each of the multiple configuration switches is also used to control the connection or disconnection status between its own multiple ports based on configuration information.

通过设置配置交换器,有助于通过控制配置交换器控制子网中的网络接口之间的连通或断开状态以及数据传输方向。类似的,在不同子网中均设置配置交换器,有助于通过控制配置交换器控制子网之间的网络接口之间的联通或断开状态,从而实现数据传输装置中的子网是可配置的,以及子网中的网络接口之间的数据传输方向是可配置的。这样,使用数据传输装置的一套硬件系统,可以支持多种网络拓扑。By setting up a configuration switch, it is helpful to control the connected or disconnected state between network interfaces in the subnet and the data transmission direction by controlling the configuration switch. Similarly, setting up configuration switches in different subnets helps to control the connected or disconnected state between network interfaces between subnets by controlling the configuration switch, thereby realizing that the subnets in the data transmission device are configurable, and the data transmission direction between network interfaces in the subnets is configurable. In this way, a hardware system using a data transmission device can support multiple network topologies.

在一种可能的设计中,数据传输装置是神经网络芯片,处理节点是神经网络中的处理节点。In one possible design, the data transmission device is a neural network chip, and the processing node is a processing node in the neural network.

在一种可能的设计中,第一子网中的网络接口包括:连接神经网路芯片中第一神经网络层的第一处理节点的网络接口以及连接第二神经网络层的多个第二处理节点的网络接口,其中,第一处理节点用于向多个第二处理节点传输数据。例如,第一网络接口包括连接神经网路芯片中第一神经网络层的第一处理节点的网络接口,多个第二网络接口包括连接第二神经网络层的多个第二处理节点的网络接口。该可选的实现方式提供了基于神经网络的网络拓扑,确定子网中的网络接口的方法。这有助于提高神经网络层之间的数据传输效率。In one possible design, the network interface in the first subnet includes: a network interface connecting a first processing node of a first neural network layer in a neural network chip and a network interface connecting a plurality of second processing nodes of a second neural network layer, wherein the first processing node is used to transmit data to the plurality of second processing nodes. For example, the first network interface includes a network interface connecting a first processing node of a first neural network layer in a neural network chip, and the plurality of second network interfaces include a network interface connecting a plurality of second processing nodes of a second neural network layer. This optional implementation provides a method for determining a network interface in a subnet based on a network topology of a neural network. This helps to improve the efficiency of data transmission between neural network layers.

在一种可能的设计中,第一子网中的网络接口之间传输的数据包的数据量大于第一阈值。该可选的实现方式提供了将传输的数据包的数据量较大的网络接口作为一个子网的方式。这样,有助于提高数据传输效率。In one possible design, the amount of data packets transmitted between network interfaces in the first subnet is greater than the first threshold. This optional implementation provides a method of using a network interface with a larger amount of data packets transmitted as a subnet. This helps to improve data transmission efficiency.

第二方面,提供了一种数据传输方法,该方法包括:第一网络接口接收路由器发送的数据包,该数据包中包括多个目的网络接口的标识。然后,第一网络接口在第一子网中广播数据包,其中,第一子网包括第一网络接口和多个第二网络接口,该多个第二网络接口包括多个目的网络接口。该多个目的网络接口根据该数据包中的目的网络接口的标识,将该数据包转发给对应的处理节点;该多个第二网络接口中除多个目的网络接口之外的其他网络接口根据该数据包中的目的网络接口的标识丢弃该数据包。In a second aspect, a data transmission method is provided, the method comprising: a first network interface receives a data packet sent by a router, the data packet including identifiers of multiple destination network interfaces. Then, the first network interface broadcasts the data packet in a first subnet, wherein the first subnet includes a first network interface and multiple second network interfaces, the multiple second network interfaces including multiple destination network interfaces. The multiple destination network interfaces forward the data packet to a corresponding processing node according to the identifiers of the destination network interfaces in the data packet; and the other network interfaces among the multiple second network interfaces except the multiple destination network interfaces discard the data packet according to the identifiers of the destination network interfaces in the data packet.

在一种可能的设计中,第一网络接口向第一子网中广播数据包,包括:第一网络接口根据多个目的网络接口的标识,向第一子网中的多个第二网络接口广播数据包。In one possible design, the first network interface broadcasts the data packet to the first subnet, including: the first network interface broadcasts the data packet to multiple second network interfaces in the first subnet according to identifiers of multiple destination network interfaces.

在一种可能的设计中,第一网络接口向第一子网中广播数据包,包括:第一网络接口根据数据包中的广播标识向第一子网中的多个第二网络接口广播数据包。In one possible design, the first network interface broadcasts a data packet to a first subnet, including: the first network interface broadcasts the data packet to multiple second network interfaces in the first subnet according to a broadcast identifier in the data packet.

第三方面,提供了一种数据传输方法,该方法包括:第二网络接口接收第一网络接口广播的数据包,该数据包中包括多个目的网络接口的标识;然后,第二网络接口在确定该数据包中的目的网络接口的标识包括第二网络接口的标识时,将该数据包转发给对应的处理节点;或第二网络接口在确定该数据包中的目的网络接口的标识不包括第二网络接口的标识时,丢弃该数据包。In a third aspect, a data transmission method is provided, the method comprising: a second network interface receives a data packet broadcasted by a first network interface, the data packet including identifiers of multiple destination network interfaces; then, when the second network interface determines that the identifier of the destination network interface in the data packet includes the identifier of the second network interface, the data packet is forwarded to a corresponding processing node; or when the second network interface determines that the identifier of the destination network interface in the data packet does not include the identifier of the second network interface, the second network interface discards the data packet.

第四方面,提供了一种网络接口,包括:接收单元,用于接收第一网络接口广播的数据包,该数据包中包括多个目的网络接口的标识。处理单元,用于在确定该数据包中的目的网络接口的标识包括第二网络接口的标识时,将该数据包转发给对应的处理节点;或在确定该数据包中的目的网络接口的标识不包括第二网络接口的标识时,丢弃该数据包。In a fourth aspect, a network interface is provided, comprising: a receiving unit, configured to receive a data packet broadcasted by a first network interface, the data packet including identifiers of multiple destination network interfaces; a processing unit, configured to forward the data packet to a corresponding processing node when determining that the identifier of the destination network interface in the data packet includes the identifier of the second network interface; or to discard the data packet when determining that the identifier of the destination network interface in the data packet does not include the identifier of the second network interface.

第五方面,提供了一种网络接口。In a fifth aspect, a network interface is provided.

在一种可能的设计中,该网络接口包括:存储器和一个或多个处理器,该存储器用于存储计算机指令,该处理器用于调用所述计算机指令,以执行第四方面提供的方法。In one possible design, the network interface includes: a memory and one or more processors, the memory is used to store computer instructions, and the processor is used to call the computer instructions to execute the method provided in the fourth aspect.

在另一种可能的设计中,该网络接口包括:用于实现上述第四方面提供的方法的控制电路,以及一个或多个端口。In another possible design, the network interface includes: a control circuit for implementing the method provided in the fourth aspect above, and one or more ports.

第六方面,提供了一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,当该计算机程序在计算机上运行时,使得该计算机执行第四方面提供的方法。In a sixth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is run on a computer, the computer executes the method provided in the fourth aspect.

第七方面,提供了一种计算机程序产品,当其在计算机上运行时,使得第四方面提供的方法被执行。In a seventh aspect, a computer program product is provided, which, when executed on a computer, enables the method provided in the fourth aspect to be executed.

可以理解的是,上述提供的任一种数据传输方法、网络接口、计算机存储介质、计算机程序产品或芯片系统等均可以应用于上文所提供的对应的数据传输装置,因此,其所能达到的有益效果可参考对应的数据传输装置中的有益效果,此处不再赘述。It can be understood that any of the data transmission methods, network interfaces, computer storage media, computer program products or chip systems provided above can be applied to the corresponding data transmission devices provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding data transmission devices and will not be repeated here.

在本申请中,上述数据传输装置的名字对设备或功能模块本身不构成限定,在实际实现中,这些设备或功能模块可以以其他名称出现。只要各个设备或功能模块的功能和本申请类似,属于本申请权利要求及其等同技术的范围之内。In this application, the name of the above data transmission device does not limit the device or functional module itself. In actual implementation, these devices or functional modules may appear with other names. As long as the functions of each device or functional module are similar to those of this application, they fall within the scope of the claims of this application and their equivalent technologies.

本申请的这些方面或其他方面在以下的描述中会更加简明易懂。These and other aspects of the present application will become more apparent from the following description.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1为本申请实施例提供的一种神经网络系统的结构示意图;FIG1 is a schematic diagram of the structure of a neural network system provided in an embodiment of the present application;

图2为本申请实施例提供的一种神经网络芯片中的计算节点的结构示意图;FIG2 is a schematic diagram of the structure of a computing node in a neural network chip provided in an embodiment of the present application;

图3为本申请实施例提供的一种数据传输装置的结构示意图;FIG3 is a schematic diagram of the structure of a data transmission device provided in an embodiment of the present application;

图4为本申请实施例提供的另一种数据传输装置的结构示意图;FIG4 is a schematic diagram of the structure of another data transmission device provided in an embodiment of the present application;

图5为本申请实施例提供的又一种数据传输装置的结构示意图;FIG5 is a schematic diagram of the structure of another data transmission device provided in an embodiment of the present application;

图6为本申请实施例提供的一种数据传输方法的交互示意图;FIG6 is an interactive schematic diagram of a data transmission method provided in an embodiment of the present application;

图7为本申请实施例提供的一种数据包的格式示意图;FIG7 is a schematic diagram of a format of a data packet provided in an embodiment of the present application;

图8为本申请实施例提供的一种数据传输装置中所涉及的节点及其之间的连接关系示意图;FIG8 is a schematic diagram of nodes involved in a data transmission device and connection relationships therebetween provided in an embodiment of the present application;

图9为本申请实施例提供的一种数据传输装置的基本单元的结构示意图;FIG9 is a schematic diagram of the structure of a basic unit of a data transmission device provided in an embodiment of the present application;

图10为本申请实施例基于图9所示的基本单元提供的一种数据传输装置的结构示意图;FIG10 is a schematic structural diagram of a data transmission device provided by an embodiment of the present application based on the basic unit shown in FIG9 ;

图11为本申请实施例提供的一种配置交换器的结构示意图;FIG11 is a schematic diagram of the structure of a configuration switch provided in an embodiment of the present application;

图12为本申请实施例提供的一种配置交换器中的配置寄存器存储的配置信息的结构示意图;12 is a schematic diagram of the structure of configuration information stored in a configuration register in a configuration switch provided in an embodiment of the present application;

图13为本申请实施例提供的另一种配置交换器中的配置寄存器所存储的配置信息的结构示意图;13 is a schematic diagram of the structure of configuration information stored in a configuration register in another configuration switch provided in an embodiment of the present application;

图14为本申请实施例提供的一种配置交换器的状态总线的数据传输方法的流程示意图;14 is a flow chart of a data transmission method for configuring a state bus of a switch provided in an embodiment of the present application;

图15为本申请实施例提供的一种配置交换器的数据总线的数据传输方法的流程示意图;15 is a flow chart of a data transmission method for configuring a data bus of a switch provided in an embodiment of the present application;

图16为本申请实施例提供的一种网络接口的结构示意图;FIG16 is a schematic diagram of the structure of a network interface provided in an embodiment of the present application;

图17为本申请实施例提供的一种网络接口中的配置寄存器存储的配置信息的格式的示意图;17 is a schematic diagram of a format of configuration information stored in a configuration register in a network interface provided by an embodiment of the present application;

图18为本申请实施例提供的一种网络接口的工作流程的方法示意图;FIG18 is a schematic diagram of a method of a workflow of a network interface provided in an embodiment of the present application;

图19为本申请实施例提供的另一种数据传输装置的结构示意图;FIG19 is a schematic diagram of the structure of another data transmission device provided in an embodiment of the present application;

图20为本申请实施例提供的一种配置交换器的配置结果示意图;FIG20 is a schematic diagram of a configuration result of a configuration switch provided in an embodiment of the present application;

图21为本申请实施例提供的一种数据包的结构示意图;FIG21 is a schematic diagram of the structure of a data packet provided in an embodiment of the present application;

图22为本申请实施例提供的一种网络接口中的配置寄存器中存储的配置信息的示意图;22 is a schematic diagram of configuration information stored in a configuration register in a network interface provided in an embodiment of the present application;

图23为本申请实施例提供的一种网络接口的结构示意图。FIG. 23 is a schematic diagram of the structure of a network interface provided in an embodiment of the present application.

具体实施方式Detailed ways

本申请实施例提供的技术方案可以应用于人工神经网络(artificial neuralnetwork,ANN)。人工神经网络,简称为神经网络(neural network,NN)或类神经网络,在机器学习和认知科学领域,是一种模仿生物神经网络(如动物的中枢神经系统,特别是大脑)的结构和功能的数学模型或计算模型,用于对函数进行估计或近似。人工神经网络可以包括卷积神经网络(convolutional neural network,CNN)、深度神经网络(deep neuralnetwork,DNN)、时延神经网络(time delay neural network,TDNN)和多层感知器(multilayer perceptron,MLP)等神经网络。The technical solution provided in the embodiment of the present application can be applied to artificial neural network (ANN). Artificial neural network, referred to as neural network (NN) or quasi-neural network, is a mathematical model or computational model that imitates the structure and function of biological neural network (such as the central nervous system of animals, especially the brain) in the field of machine learning and cognitive science, and is used to estimate or approximate functions. Artificial neural network can include convolutional neural network (CNN), deep neural network (DNN), time delay neural network (TDNN) and multilayer perceptron (MLP) and other neural networks.

图1为本申请实施例提供的一种神经网络系统的结构示意图。如图1所示,神经网络系统100可以包括主机105以及神经网络电路110。神经网络电路110通过主机接口与主机105连接。主机接口可以包括标准的主机接口以及网络接口(network interface)。例如,主机接口可以包括快捷外设互联标准(peripheral component interconnect express,PCIE)接口。如图1所示,神经网络电路110可以通过PCIE总线106与主机105连接。因此,数据可以通过PCIE总线106输入至神经网络电路110中,并通过PCIE总线106接收神经网络电路110处理完成后的数据。并且,主机105也可以通过主机接口监测神经网络电路110的工作状态。FIG1 is a schematic diagram of the structure of a neural network system provided in an embodiment of the present application. As shown in FIG1 , the neural network system 100 may include a host 105 and a neural network circuit 110. The neural network circuit 110 is connected to the host 105 via a host interface. The host interface may include a standard host interface and a network interface. For example, the host interface may include a peripheral component interconnect express (PCIE) interface. As shown in FIG1 , the neural network circuit 110 may be connected to the host 105 via a PCIE bus 106. Therefore, data may be input into the neural network circuit 110 via the PCIE bus 106, and data processed by the neural network circuit 110 may be received via the PCIE bus 106. In addition, the host 105 may also monitor the working status of the neural network circuit 110 via the host interface.

主机105可以包括处理器1052以及内存1054。需要说明的是,除了图1所示的器件外,主机105还可以包括通信接口以及作为外存的磁盘等其他器件,在此不做限制。The host 105 may include a processor 1052 and a memory 1054. It should be noted that, in addition to the components shown in FIG1 , the host 105 may also include other components such as a communication interface and a disk as an external memory, which are not limited here.

处理器(processor)1052是主机105的运算核心和控制核心(control unit)。处理器1052中可以包括多个处理器核(core)。处理器1052可以是一块超大规模的集成电路。在处理器1052中安装有操作系统和其他软件程序,从而处理器1052能够实现对内存1054、缓存、磁盘及外设设备(如图1中的神经网络电路)的访问。可以理解的是,在本发明实施例中,处理器1052中的Core例如可以是中央处理器(central processing unit,CPU),还可以是其他特定集成电路(application specific integrated circuit,ASIC)。Processor 1052 is the computing core and control unit of host 105. Processor 1052 may include multiple processor cores. Processor 1052 may be a very large scale integrated circuit. An operating system and other software programs are installed in processor 1052, so that processor 1052 can access memory 1054, cache, disk and peripheral devices (such as the neural network circuit in Figure 1). It can be understood that in an embodiment of the present invention, the Core in processor 1052 may be, for example, a central processing unit (CPU) or other application specific integrated circuits (ASIC).

内存1054是主机105的主存。内存1054通过双倍速率(double data rate,DDR)总线和处理器1052相连。内存1054通常用来存放操作系统中各种正在运行的软件、输入和输出数据以及与外存交换的信息等。为了提高处理器1052的访问速度,内存1054需要具备访问速度快的优点。在传统的计算机系统架构中,通常采用动态随机存取存储器(dynamicrandom access memory,DRAM)作为内存1054。处理器1052能够通过内存控制器(图1中未示出)高速访问内存1054,对内存1054中的任意一个存储单元进行读操作和写操作。The memory 1054 is the main memory of the host 105. The memory 1054 is connected to the processor 1052 via a double data rate (DDR) bus. The memory 1054 is usually used to store various running software in the operating system, input and output data, and information exchanged with external memory. In order to improve the access speed of the processor 1052, the memory 1054 needs to have the advantage of fast access speed. In the traditional computer system architecture, dynamic random access memory (DRAM) is usually used as the memory 1054. The processor 1052 can access the memory 1054 at high speed through the memory controller (not shown in FIG. 1), and perform read and write operations on any storage unit in the memory 1054.

神经网络电路110是由多个神经网络芯片(chip)组成的芯片阵列。例如,如图1所示,神经网络电路110包括多个进行数据处理的神经网络芯片115和多个路由器120。为了描述方便,本发明实施例将申请中的神经网络芯片115简称为芯片115。在一个示例中,所述多个芯片115可以通过路由器120相互连接。例如,一个芯片115可以与一个或多个路由器120连接。多个路由器120可以组成一种或多种网络拓扑。芯片115之间可以通过所述多种网络拓扑进行数据传输。在另一个示例中,所述多个芯片115之间可以通过PCIE总线相互连接。The neural network circuit 110 is a chip array composed of multiple neural network chips (chips). For example, as shown in FIG1 , the neural network circuit 110 includes multiple neural network chips 115 for data processing and multiple routers 120. For the convenience of description, the neural network chip 115 in the application is referred to as chip 115 in the embodiment of the present invention. In one example, the multiple chips 115 can be interconnected through a router 120. For example, a chip 115 can be connected to one or more routers 120. Multiple routers 120 can form one or more network topologies. Data can be transmitted between chips 115 through the multiple network topologies. In another example, the multiple chips 115 can be connected to each other through a PCIE bus.

图2为本申请实施例提供的一种神经网络芯片中的计算节点的结构示意图。如图2所示,芯片115中包括多个路由器120,每个路由器可以连接一个tile(瓦片)125。实际应用中,一个路由器120还可以连接多个tile 125,其中,每个tile125中可以包括一个或多个用于对数据进行神经网络计算的计算单元。为描述方便,在本申请实施例中,也可以将芯片115或tile 125称为计算节点。FIG2 is a schematic diagram of the structure of a computing node in a neural network chip provided in an embodiment of the present application. As shown in FIG2, the chip 115 includes multiple routers 120, each of which can be connected to a tile 125. In practical applications, a router 120 can also be connected to multiple tiles 125, wherein each tile 125 can include one or more computing units for performing neural network calculations on data. For ease of description, in the embodiment of the present application, the chip 115 or tile 125 may also be referred to as a computing node.

片上系统(system-on-a-chip,SoC)是指在单个芯片上集成一个完整的系统,对所有或部分必要的电子电路进行包分组的技术。应用于本申请实施例时,SoC是芯片115上的系统。System-on-a-chip (SoC) refers to a technology that integrates a complete system on a single chip and groups all or part of the necessary electronic circuits. When applied to the embodiment of the present application, SoC is a system on chip 115.

图3、图4和图5为本申请实施例提供的数据传输装置20的结构示意图。数据传输装置20可以包括路由器200和至少一个子网。子网是网络接口构成的集合。Figures 3, 4 and 5 are schematic diagrams of the structure of a data transmission device 20 provided in an embodiment of the present application. The data transmission device 20 may include a router 200 and at least one subnet. A subnet is a collection of network interfaces.

如图3所示,至少一个子网包括第一子网,第一子网包括第一网络接口201和多个第二网络接口202。第一网络接口201是第一子网中广播数据包的网络接口。一个第一网络接口201可以连接至少一个处理节点205。第二网络接口202是第一子网中接收广播的数据包的网络接口。一个第二网络接口202可以连接至少一个处理节点205。As shown in FIG3 , at least one subnet includes a first subnet, and the first subnet includes a first network interface 201 and a plurality of second network interfaces 202. The first network interface 201 is a network interface for broadcasting data packets in the first subnet. One first network interface 201 can be connected to at least one processing node 205. The second network interface 202 is a network interface for receiving broadcast data packets in the first subnet. One second network interface 202 can be connected to at least one processing node 205.

可选的,数据传输装置20可以是神经网络芯片(如图1中的芯片115),在该情况下,可以将如图2中的tile125称为神经网络中的处理节点。在另一种情况下,数据传输装置20也可以是指包括多个神经网络芯片的神经网络电路(如图1中的神经网络电路110),在这种情况下,可以将神经网络芯片115作为神经网络中的处理节点。Optionally, the data transmission device 20 may be a neural network chip (such as the chip 115 in FIG. 1 ), in which case the tile 125 in FIG. 2 may be referred to as a processing node in the neural network. In another case, the data transmission device 20 may also refer to a neural network circuit including a plurality of neural network chips (such as the neural network circuit 110 in FIG. 1 ), in which case the neural network chip 115 may be used as a processing node in the neural network.

路由器200,用于向第一网络接口201发送数据包,该数据包中包括多个目的网络接口的标识。可选的,该数据包还包括第一子网标识。路由器200用于根据第一子网标识向第一网络接口201发送该数据包。The router 200 is used to send a data packet to the first network interface 201. The data packet includes identifiers of multiple destination network interfaces. Optionally, the data packet also includes a first subnet identifier. The router 200 is used to send the data packet to the first network interface 201 according to the first subnet identifier.

第一网络接口201,用于:接收路由器200发送的该数据包,并在第一子网中广播该数据包,其中,第一子网包括第一网络接口201和多个第二网络接口202,多个第二网络接口202包括该多个目的网络接口。其中,该多个网络接口可以是部分或全部第二网络接口202,具体是哪些网络接口是基于网络拓扑确定的。The first network interface 201 is used to receive the data packet sent by the router 200 and broadcast the data packet in the first subnet, wherein the first subnet includes the first network interface 201 and multiple second network interfaces 202, and the multiple second network interfaces 202 include the multiple destination network interfaces. The multiple network interfaces may be part or all of the second network interfaces 202, and which network interfaces are specifically determined based on the network topology.

在一种实现方式中,第一网络接口201用于根据该多个目的网络接口的标识,向第一子网中的多个第二网络接口202广播数据包。例如,如果第一网络接口201解析数据包的包头部分后,确定该数据包中包含多个目的网络接口的标识,则向第一子网广播该数据包。In one implementation, the first network interface 201 is used to broadcast the data packet to the multiple second network interfaces 202 in the first subnet according to the identifiers of the multiple destination network interfaces. For example, if the first network interface 201 parses the header of the data packet and determines that the data packet contains the identifiers of multiple destination network interfaces, the data packet is broadcast to the first subnet.

在另一种实现方式中,第一网络接口201用于根据该数据包中包括的广播标识,向第一子网中的多个第二网络接口202广播该数据包。例如,如果第一网络接口201解析数据包的包头部分后,确定该数据包中包含广播标识,则向第一子网广播该数据包。另外,如果第一网络接口201确定该数据包中不包含广播标识,或者包含另一标识(如非广播标识等),则将该数据包发往与第一网络接口201连接的处理节点。In another implementation, the first network interface 201 is used to broadcast the data packet to multiple second network interfaces 202 in the first subnet according to the broadcast identifier included in the data packet. For example, if the first network interface 201 parses the header of the data packet and determines that the data packet contains a broadcast identifier, the data packet is broadcast to the first subnet. In addition, if the first network interface 201 determines that the data packet does not contain a broadcast identifier, or contains another identifier (such as a non-broadcast identifier, etc.), the data packet is sent to a processing node connected to the first network interface 201.

多个第二网络接口202,用于接收第一网络接口201发送的该数据包。其中,该多个目的网络接口还用于根据该数据包中的目的网络接口的标识,将该数据包转发给对应的处理节点205,该多个第二网络接口中除该多个目的网络接口之外的其他网络接口还用于根据该多个目的网络接口的标识丢弃该数据包。The plurality of second network interfaces 202 are used to receive the data packet sent by the first network interface 201. The plurality of destination network interfaces are also used to forward the data packet to the corresponding processing node 205 according to the identifier of the destination network interface in the data packet, and the other network interfaces among the plurality of second network interfaces except the plurality of destination network interfaces are also used to discard the data packet according to the identifier of the plurality of destination network interfaces.

具体的,对于任一个第二网络接口202来说,在接收到第一网络接口201发送的数据包之后,可以解析该数据包的包头部分,以得到该数据包中包括的目的网络接口的标识。如果确定自身的标识包含在该数据包中的目的网络接口的标识中,说明该第二网络接口202是目的网络接口,则将该数据包转发给自身连接的一个或多个处理节点。其中,可以通过进一步解析该数据包(如该数据包的包头部分)获知将数据包转发给哪些处理节点。对于任一个第二网络接口来说,如果确定自身的标识没有包含在该数据包中的目的网络接口的标识中,说明该第二网络接口202不是目的网络接口,则丢弃该数据包。Specifically, for any second network interface 202, after receiving the data packet sent by the first network interface 201, the header portion of the data packet can be parsed to obtain the identifier of the destination network interface included in the data packet. If it is determined that its own identifier is included in the identifier of the destination network interface in the data packet, it means that the second network interface 202 is the destination network interface, and the data packet is forwarded to one or more processing nodes connected to itself. Among them, it can be known to which processing nodes the data packet is forwarded to by further parsing the data packet (such as the header portion of the data packet). For any second network interface, if it is determined that its own identifier is not included in the identifier of the destination network interface in the data packet, it means that the second network interface 202 is not the destination network interface, and the data packet is discarded.

本实施例提供的数据传输装置20中,以广播方式发送数据包,以多播方式处理接收到的数据包。需要说明的是,传统广播方式下,数据包中不会携带目的端的标识,而本申请实施例提供的技术方案中,广播方式下传输的数据包中携带目的端的标识,这样,接收到该数据包的第二网络接口可以以多播方式对数据包进行处理。In the data transmission device 20 provided in this embodiment, data packets are sent in a broadcast mode, and received data packets are processed in a multicast mode. It should be noted that in the traditional broadcast mode, the data packet does not carry the identifier of the destination end, while in the technical solution provided in the embodiment of the present application, the data packet transmitted in the broadcast mode carries the identifier of the destination end, so that the second network interface that receives the data packet can process the data packet in a multicast mode.

由于以广播方式发送数据包,在数据包由发送端传输到目的端的过程中,不需要进行路径选择,因此,有助于节省数据包传输过程中的数据处理复杂度,从而节省数据传输时间。而以多播方式处理该数据包,可以使该数据包发往可选择的目的端(即上述多个目的网络接口),而非广播方式下的所有目的端(即上述第一子网中的所有第二网络接口)。因此,结合广播方式和多播方式各自的特点,在传输多播数据包的场景下,以广播方式发送数据包,以多播方式处理接收到的数据包,有助于在保证数据包传输到正确的目的端的前提下,提高数据传输效率。这里的正确的目的端(即上述目的网络接口)可以基于网络拓扑预先配置。Since the data packet is sent in a broadcast mode, no path selection is required during the transmission of the data packet from the sender to the destination, which helps to save the complexity of data processing during the data packet transmission, thereby saving data transmission time. Processing the data packet in a multicast mode allows the data packet to be sent to a selectable destination (i.e., the above-mentioned multiple destination network interfaces) rather than all destinations in the broadcast mode (i.e., all second network interfaces in the above-mentioned first subnet). Therefore, combining the respective characteristics of the broadcast mode and the multicast mode, in the scenario of transmitting multicast data packets, sending data packets in a broadcast mode and processing received data packets in a multicast mode can help improve data transmission efficiency while ensuring that the data packets are transmitted to the correct destination. The correct destination here (i.e., the above-mentioned destination network interface) can be pre-configured based on the network topology.

对于神经网络芯片来说,多播流量较多,因此,上述技术方案尤其适用于神经网络芯片。For neural network chips, there is a lot of multicast traffic, so the above technical solution is particularly suitable for neural network chips.

一个子网中用于广播数据包的网络接口可以认为是该子网的入口,由外界(如主机或其他子网)传输给该子网的数据包,均由与该网络接口连接的路由器发送给该网络接口。例如,第一网络接口可以认为是第一子网的入口,由主机或其他子网传输给第一子网的数据,首先由与第一网络接口连接的路由器发送给第一网络接口。The network interface used to broadcast data packets in a subnet can be considered as the entrance of the subnet. Data packets transmitted to the subnet from the outside (such as a host or other subnet) are sent to the network interface by the router connected to the network interface. For example, the first network interface can be considered as the entrance of the first subnet. Data transmitted to the first subnet from a host or other subnet is first sent to the first network interface by the router connected to the first network interface.

一个子网中的其中一个网络接口可以作为该子网的出口,由该子网传输给外界(如主机或其他子网)的数据包,均由该网络接口发送给与该网路接口连接的路由器,并由该路由器直接或间接发往主机或其他子网。例如,第一网络接口或任意一个第二网络接口可以作为第一子网的出口,由第一子网传输给主机或其他子网的数据包,均由第一网络接口发送给与第一网络接口连接的路由器,并由该路由器直接或间接发往主机或其他子网。具体哪个网络接口作为第一子网的出口可以是基于网络拓扑确定的。One of the network interfaces in a subnet can be used as the exit of the subnet. Data packets transmitted from the subnet to the outside world (such as a host or other subnets) are sent by the network interface to the router connected to the network interface, and are directly or indirectly sent by the router to the host or other subnets. For example, the first network interface or any second network interface can be used as the exit of the first subnet. Data packets transmitted from the first subnet to the host or other subnets are sent by the first network interface to the router connected to the first network interface, and are directly or indirectly sent by the router to the host or other subnets. Which network interface is used as the exit of the first subnet can be determined based on the network topology.

可选的,每个网路接口(包括第一网络接口201和第二网络接口202)均可以与同一路由器连接,或者可以与不同路由器连接,该不同路由器之间直接或间接连接。这样,有助于支持每个网络接口均可以作为子网的入口或出口,从而使得数据传输装置20支持多种网络拓扑,或支持多种神经网络业务。Optionally, each network interface (including the first network interface 201 and the second network interface 202) can be connected to the same router, or can be connected to different routers, and the different routers are directly or indirectly connected to each other. In this way, it is helpful to support that each network interface can be used as the entrance or exit of the subnet, so that the data transmission device 20 supports multiple network topologies or supports multiple neural network services.

如图4所示,数据传输装置20的至少一个子网包括第一子网和第二子网。图4是基于图3进行绘制的。第二子网可以包含一个第三网络接口203和多个第四网络接口204。第三网络接口203是第二子网中广播数据包的网络接口。一个第三网络接口203可以连接至少一个处理节点205。第四网络接口204是第二子网中接收广播的数据包的网络接口。一个第四网络接口204可以连接至少一个处理节点205。其中,第三网络接口203的功能与第一网络接口201的功能相同或类似,第四网络接口204的功能与第二网络接口202的功能相同或类似,此处不再赘述。As shown in FIG4 , at least one subnet of the data transmission device 20 includes a first subnet and a second subnet. FIG4 is drawn based on FIG3 . The second subnet may include a third network interface 203 and multiple fourth network interfaces 204. The third network interface 203 is a network interface for broadcasting data packets in the second subnet. A third network interface 203 can be connected to at least one processing node 205. The fourth network interface 204 is a network interface for receiving broadcast data packets in the second subnet. A fourth network interface 204 can be connected to at least one processing node 205. Among them, the function of the third network interface 203 is the same as or similar to that of the first network interface 201, and the function of the fourth network interface 204 is the same as or similar to that of the second network interface 202, which will not be repeated here.

不同子网之间通过路由器传输数据。不同子网中用于广播数据包的网路接口之间可以连接同一路由器或者不同路由器。例如,第一网络接口201与第三网络接口203连接同一个路由器200,如图4所示。又如,第一网络接口201与第三网络接口203分别连接不同的路由器,且二者所连接的路由器之间直接连接,或者通过其他路由器间接连接。Data is transmitted between different subnets through routers. Network interfaces used to broadcast data packets in different subnets can be connected to the same router or different routers. For example, the first network interface 201 and the third network interface 203 are connected to the same router 200, as shown in FIG4. For another example, the first network interface 201 and the third network interface 203 are respectively connected to different routers, and the routers to which they are connected are directly connected, or indirectly connected through other routers.

不同网络接口连接的处理节点的个数可以相同,也可以不同。The number of processing nodes connected to different network interfaces may be the same or different.

数据传输装置20中的哪些网络接口构成一个子网,一个子网中的哪个网络接口作为用于广播数据包的网络接口,哪个或哪些网络接口作为用于接收广播的数据包的网络接口等,均可以是预配置的,下文中进行具体说明。Which network interfaces in the data transmission device 20 constitute a subnet, which network interface in a subnet is used as a network interface for broadcasting data packets, which network interface or network interfaces are used as network interfaces for receiving broadcast data packets, etc. can all be pre-configured, which will be described in detail below.

以下,说明本申请实施例提供的几种第一子网中的网络接口的具体实现方式:The following describes several specific implementations of the network interface in the first subnet provided in the embodiments of the present application:

在一种实现方式中,第一子网中的网络接口包括:连接神经网路芯片中第一神经网络层的第一处理节点的网络接口以及连接第二神经网络层的多个第二处理节点的网络接口,其中,第一处理节点用于向该多个第二处理节点传输数据。例如,所述第一网络接口包括连接所述神经网路芯片中第一神经网络层的第一处理节点的网络接口,所述多个第二网络接口包括连接第二神经网络层的多个第二处理节点的网络接口。该可选的实现方式提供了基于神经网络的网络拓扑,确定子网中的网络接口的方法。这有助于提高神经网络层之间的数据传输效率。In one implementation, the network interface in the first subnet includes: a network interface connecting a first processing node of a first neural network layer in a neural network chip and a network interface connecting a plurality of second processing nodes of a second neural network layer, wherein the first processing node is used to transmit data to the plurality of second processing nodes. For example, the first network interface includes a network interface connecting a first processing node of a first neural network layer in the neural network chip, and the plurality of second network interfaces include a network interface connecting a plurality of second processing nodes of a second neural network layer. This optional implementation provides a method for determining a network interface in a subnet based on a network topology of a neural network. This helps to improve the efficiency of data transmission between neural network layers.

例如,假设第一神经网络层包括处理节点11、12、13,第二神经网络层包括处理节点21、22、23、24,且处理节点13用于向处理节点21、22和23分别传输数据,则分别用于连接处理节点13、21、22和23的网络接口作为一个子网中的网络接口。For example, assuming that the first neural network layer includes processing nodes 11, 12, and 13, the second neural network layer includes processing nodes 21, 22, 23, and 24, and processing node 13 is used to transmit data to processing nodes 21, 22, and 23 respectively, then the network interfaces used to connect processing nodes 13, 21, 22, and 23 respectively are used as network interfaces in a subnet.

在另一种实现方式中,第一子网中的网络接口之间传输的数据包的数据量大于第一阈值。该可选的实现方式提供了将传输的数据包的数据量较大的网络接口作为一个子网的方式。这样,有助于提高数据传输效率。In another implementation, the amount of data packets transmitted between network interfaces in the first subnet is greater than the first threshold. This optional implementation provides a method of using the network interface with a larger amount of data packets transmitted as a subnet. This helps to improve data transmission efficiency.

需要说明的是,具体实现时,上述两种实现方式可以结合使用,从而得到新的技术方案。具体的,如果第一处理节点和该多个第二处理节点之间传输的数据包的数据量大于第一阈值,则将上述第一处理节点和该多个第二处理节点作为第一子网中的网络接口。It should be noted that, in a specific implementation, the above two implementation methods can be used in combination to obtain a new technical solution. Specifically, if the amount of data packets transmitted between the first processing node and the plurality of second processing nodes is greater than a first threshold, the above first processing node and the plurality of second processing nodes are used as network interfaces in the first subnet.

如图5所示,数据传输装置20还可以包括多个配置交换器206。该多个配置交换器206中的第一配置交换器连接第一网络接口201,并用于接收第一网络接口201发送的数据包,并向第一子网内连接多个第二网络接口202的其他配置交换器206发送该数据包。As shown in Fig. 5, the data transmission device 20 may further include a plurality of configuration switches 206. A first configuration switch among the plurality of configuration switches 206 is connected to the first network interface 201, and is used to receive a data packet sent by the first network interface 201, and to send the data packet to other configuration switches 206 connected to the plurality of second network interfaces 202 in the first subnet.

通过在数据传输装置20中设置配置交换器,有助于通过控制配置交换器控制子网中的网络接口之间的连通或断开状态以及数据传输方向。类似的,在不同子网中均设置配置交换器,有助于通过控制配置交换器控制子网之间的网络接口之间的联通或断开状态,从而实现数据传输装置20中的子网是可配置的,以及子网中的网络接口之间的数据传输方向是可配置的。这样,使用数据传输装置20的一套硬件系统,可以支持多种网络拓扑。应用于神经网络系统时,该网络拓扑是指神经网络拓扑。也就是说,本申请实施例提供的技术数据传输装置20支持处理不同的神经网络业务。By setting a configuration switch in the data transmission device 20, it is helpful to control the connectivity or disconnection status between the network interfaces in the subnets and the direction of data transmission by controlling the configuration switch. Similarly, setting configuration switches in different subnets helps to control the connectivity or disconnection status between the network interfaces between the subnets by controlling the configuration switches, thereby achieving that the subnets in the data transmission device 20 are configurable, and the data transmission direction between the network interfaces in the subnets is configurable. In this way, a set of hardware systems using the data transmission device 20 can support multiple network topologies. When applied to a neural network system, the network topology refers to a neural network topology. That is to say, the technical data transmission device 20 provided in the embodiment of the present application supports processing different neural network services.

对于神经网络芯片来说,通过配置配置交换器中的配置信息,可以实现将局部流量密集的神经网络节点所连接的网络接口构成一个子网,从而在该子网中使用广播方式传输多播数据包,以提高数据传输效率。由于配置交换器中的配置信息可以预先配置,该预先配置的信息已经设定了数据包在网络接口之间的传输路径,因此,在实际应用的过程中,网络接口之间不需要进行链路的重新构建,也不需要进行对数据包的仲裁及多种消息的解析,其中,对多种消息的解析和对数据包的仲裁,用于网络接口确定该数据包是否是发往自身的数据包。如此,有利于降低数据处理的复杂度,从而提高数据传输效率。For neural network chips, by configuring the configuration information in the configuration switch, the network interfaces connected to the neural network nodes with dense local traffic can be formed into a subnet, so that multicast data packets can be transmitted in the subnet using broadcast mode to improve data transmission efficiency. Since the configuration information in the configuration switch can be pre-configured, the pre-configured information has set the transmission path of the data packets between the network interfaces. Therefore, in the actual application process, there is no need to rebuild the links between the network interfaces, nor is there any need to arbitrate the data packets and parse multiple messages. Among them, the parsing of multiple messages and the arbitration of data packets are used by the network interface to determine whether the data packet is a data packet sent to itself. This is conducive to reducing the complexity of data processing, thereby improving data transmission efficiency.

可选的,第一网络接口201和每个第二网络接口202分别连接一个配置交换器。不同配置交换器206之间直接或间接连接。如图5所示。Optionally, the first network interface 201 and each second network interface 202 are respectively connected to a configuration switch. Different configuration switches 206 are directly or indirectly connected to each other, as shown in FIG5 .

可选的,每个配置交换器206包括多个端口,该多个端口中的第一端口用于连接一个网络接口,该多个端口中的其他网络接口用于连接其他配置交换器。如图4所示。每个配置交换器206,还用于基于配置信息,控制自身的多个端口之间的连通或断开状态。以及,每个配置交换器206,还用于基于配置信息,控制自身的多个端口之间的数据传输方向。具体实现方式可以参考下文。Optionally, each configuration switch 206 includes multiple ports, a first port among the multiple ports is used to connect a network interface, and other network interfaces among the multiple ports are used to connect other configuration switches. As shown in Figure 4. Each configuration switch 206 is also used to control the connected or disconnected state between its multiple ports based on the configuration information. And, each configuration switch 206 is also used to control the data transmission direction between its multiple ports based on the configuration information. The specific implementation method can be referred to below.

可选的,一个子网中的部分网络接口可以属于其他子网,例如,第一子网中的部分网络接口属于第二子网。Optionally, some network interfaces in one subnet may belong to other subnets, for example, some network interfaces in the first subnet belong to the second subnet.

需要说明的是,如果一个网络接口属于多个子网,则该网路接口在其中一个子网中作为第二网络节点,在其他子网中均作为中间网络接口。其中,如果一个网络接口在一个子网中是中间网络接口,则在该子网中,该中间网络接口不会接收到其所连接的配置交换器发送的数据包,因此不会向与自身连接的处理节点发送数据包。而第一网络接口和第二网络接口可以向与自身连接的处理节点发送数据包。具体实现时,通过配置与中间网络接口连接的配置交换器的端口的连通和关断,从而控制该配置交换器不向该中间网络接口发送数据包。关于中间网络接口的具体示例可以参考下文,此处不再赘述。It should be noted that if a network interface belongs to multiple subnets, the network interface acts as a second network node in one of the subnets and as an intermediate network interface in the other subnets. Among them, if a network interface is an intermediate network interface in a subnet, then in the subnet, the intermediate network interface will not receive data packets sent by the configuration switch to which it is connected, and therefore will not send data packets to the processing node connected to itself. The first network interface and the second network interface can send data packets to the processing node connected to themselves. In specific implementation, the configuration switch is controlled not to send data packets to the intermediate network interface by configuring the connectivity and disconnection of the port of the configuration switch connected to the intermediate network interface. For specific examples of intermediate network interfaces, please refer to the following, which will not be repeated here.

可选的,配置交换器中包括一个或多个配置寄存器,一个配置寄存器可以对应一个子网,用于配置该子网中的数据传输通路。具体示例可以参考下文,此处不再赘述。Optionally, the configuration switch includes one or more configuration registers, and one configuration register may correspond to one subnet, and is used to configure a data transmission path in the subnet. Specific examples may be referred to below, and will not be described in detail here.

如图6所示,为本申请实施例提供的一种数据传输方法的交互示意图。图6所示的方法可以基于图3至图5中的任一附图提供的数据传输装置20。图6所示的方法包括以下步骤:As shown in Figure 6, it is an interactive schematic diagram of a data transmission method provided in an embodiment of the present application. The method shown in Figure 6 can be based on the data transmission device 20 provided in any of Figures 3 to 5. The method shown in Figure 6 includes the following steps:

S101:路由器向第一网络接口发送数据包。S101: The router sends a data packet to the first network interface.

执行S101之后,执行S102和/或S106。After executing S101, execute S102 and/or S106.

S102:第一网络接口如果确定该数据包中包含第一网络接口的标识,则将该数据包发往与第一网络接口连接的处理节点。S102: If the first network interface determines that the data packet contains the identifier of the first network interface, the first network interface sends the data packet to a processing node connected to the first network interface.

S103:与第一网络接口连接的处理节点处理完该数据包之后,生成新的数据包,并将该新的数据包发往第一网络接口。该新的数据包可以包含目标子网的标识或者主机的标识。其中,目标子网包括第一子网和/或其他子网。S103: After the processing node connected to the first network interface processes the data packet, it generates a new data packet and sends the new data packet to the first network interface. The new data packet may include the identifier of the target subnet or the identifier of the host. The target subnet includes the first subnet and/or other subnets.

执行S103之后,执行S104或S105。After executing S103, execute S104 or S105.

S104:第一网络接口如果确定该新的数据包包含第一子网的标识,则在第一子网中广播该新的数据包。执行S104之后,本次数据传输过程结束。S104: If the first network interface determines that the new data packet contains the identifier of the first subnet, the new data packet is broadcast in the first subnet. After S104 is executed, the data transmission process ends.

S105:第一网络接口如果确定该新的数据包包含其他子网的标识,则通过与第一网络接口连接的路由器发往其他子网中的用于广播数据包的网络接口。如果确定该新的数据包包含主机的标识,则通过与第一网络接口连接的路由器发往主机。执行S105之后,本次数据传输过程结束。S105: If the first network interface determines that the new data packet contains the identifier of another subnet, it sends the data packet to the network interface for broadcasting data packets in the other subnet through the router connected to the first network interface. If it is determined that the new data packet contains the identifier of the host, it sends the data packet to the host through the router connected to the first network interface. After executing S105, the data transmission process ends.

S106:第一网络接口如果确定该数据包中包含其他网络接口的标识,则在第一子网中广播该数据包。S106: If the first network interface determines that the data packet contains identifiers of other network interfaces, the first network interface broadcasts the data packet in the first subnet.

S107:第一子网中的第二网络接口接收到该数据包之后,如果确定自身的标识包含在目的网络接口的标识中,则将该数据包转发给自身连接的一个或多个处理节点。如果确定自身的标识没有包含在目的网络接口的标识中,则丢弃该数据包。S107: After receiving the data packet, the second network interface in the first subnet forwards the data packet to one or more processing nodes connected to the second network interface if it determines that its own identifier is included in the identifier of the destination network interface, or discards the data packet if it determines that its own identifier is not included in the identifier of the destination network interface.

S108:与第二网络接口连接的处理节点处理完该数据包之后,生成新的数据包,并将该新的数据包发往该第二网络接口。其中,该数据包可以包含其他子网的标识(如第二子网的标识),或者可以包含第一子网中的新的目的网络接口的标识。S108: After the processing node connected to the second network interface processes the data packet, it generates a new data packet and sends the new data packet to the second network interface. The data packet may include an identifier of another subnet (such as an identifier of the second subnet), or may include an identifier of a new destination network interface in the first subnet.

执行S108之后,执行S109和/或S110。After executing S108, execute S109 and/or S110.

S109:第二网络接口将该新的数据包发往与该第二网络接口连接的路由器。S109: The second network interface sends the new data packet to the router connected to the second network interface.

后续,如果该路由确定该数据包包含其他子网的标识,则由该路由器将该新的数据包直接发往其他子网中的用于广播数据包的网络接口,或者,由该路由器通过路由器之间的连接关系,间接将该新的数据包发往其他子网中的用于广播数据包的网络接口。如果该路由器确定该数据包包含第一子网中的新的目的网络接口的标识,则由该路由器直接将该新的数据包发往第一网络接口,或者,由与该第二网络接口连接的路由器通过路由器之间的连接关系,间接将该新的数据包发往第一网络接口。Subsequently, if the route determines that the data packet contains the identifier of other subnets, the router directly sends the new data packet to the network interface for broadcasting data packets in other subnets, or indirectly sends the new data packet to the network interface for broadcasting data packets in other subnets through the connection relationship between routers. If the router determines that the data packet contains the identifier of the new destination network interface in the first subnet, the router directly sends the new data packet to the first network interface, or indirectly sends the new data packet to the first network interface through the connection relationship between routers by the router connected to the second network interface.

本实施例所能达到的有益效果的描述可以参考上文,此处不再赘述。The description of the beneficial effects that can be achieved by this embodiment can be found above and will not be repeated here.

以下,对本申请实施例提供的数据包进行说明:The following is a description of the data packets provided in the embodiments of the present application:

如图7所示,为本申请实施例提供的一种数据包的格式示意图。图7所示的数据包包括:包头部分和数据部分。包头部分用于承载数据包的控制信息,数据部分用于携带有效数据。As shown in Figure 7, it is a schematic diagram of the format of a data packet provided in an embodiment of the present application. The data packet shown in Figure 7 includes: a header part and a data part. The header part is used to carry control information of the data packet, and the data part is used to carry valid data.

其中,包头部分可以包括以下标志位/字段:The packet header may include the following flags/fields:

字段1:目的网络接口标志位,用于携带目的网络接口的标识。Field 1: Destination network interface flag, used to carry the identifier of the destination network interface.

在上文中描述的实施例中,目的网络接口是第二网络接口的部分或全部网络接口,此处,为了方便描述,将目的网络接口定义为该数据包被发往的目的地。基于此,具体实现时,以当前子网是第一子网为例,目的网络接口可以包括当前子网中的任意多个网络接口,其中,该网络接口可以均是第二网络接口,或者包含第一网络接口和多个第二网络接口。In the embodiment described above, the destination network interface is part or all of the second network interface. Here, for the convenience of description, the destination network interface is defined as the destination to which the data packet is sent. Based on this, in specific implementation, taking the current subnet as the first subnet as an example, the destination network interface may include any multiple network interfaces in the current subnet, wherein the network interfaces may all be the second network interface, or include the first network interface and multiple second network interfaces.

在一个示例中,由于当前子网中的每个网络接口均可以作为目的网络接口,因此,可以设置目的网络接口标志位包含N个比特,其中,N表示当前子网包括的网络接口的个数,每个比特表示一个网络接口是否是目的网络接口。例如,如果一个网络接口是目的网络接口,则将目的网络接口标志位中的与该网络接口对应的比特位标记为1,如果该网络接口不是目的网络接口,则将目的网络接口标志位中的与该网络接口对应的比特位标记为0。In one example, since each network interface in the current subnet can be used as a destination network interface, the destination network interface flag can be set to include N bits, where N represents the number of network interfaces included in the current subnet, and each bit represents whether a network interface is a destination network interface. For example, if a network interface is a destination network interface, the bit corresponding to the network interface in the destination network interface flag is marked as 1; if the network interface is not a destination network interface, the bit corresponding to the network interface in the destination network interface flag is marked as 0.

在另一个示例中,如果数据传输装置包括多个子网,该多个子网包含的网络接口的数量不同,则为了使得数据包能够在不同子网之间传输和被各子网中的节点识别,可选的,目标网路接口的标志位包含N个比特,其中,N表示目标子网包含的网络接口的数量,目标子网是数据传输装置中的所包含的网络接口的数量最大的子网。In another example, if the data transmission device includes multiple subnets, and the multiple subnets contain different numbers of network interfaces, then in order to enable data packets to be transmitted between different subnets and recognized by nodes in each subnet, optionally, the flag bit of the target network interface contains N bits, where N represents the number of network interfaces contained in the target subnet, and the target subnet is the subnet in the data transmission device that contains the largest number of network interfaces.

字段2:数据包类型标志位,用于携带数据包的类型的标识。该类型可以是广播类型或非广播类型。Field 2: Data packet type flag, used to carry the type of data packet, which can be broadcast type or non-broadcast type.

可选的,包头部分还可以包括:Optionally, the header may also include:

字段3:子网标志位,用于携带该数据包所属子网的标识。例如,如果该数据包需要被发往第一子网,则该数据包的子网标志位携带第一子网的标识。任意一个路由器接收到该数据包之后,均可以直接或间接将该数据包发往第一子网中的第一网络接口。Field 3: Subnet flag, used to carry the identifier of the subnet to which the data packet belongs. For example, if the data packet needs to be sent to the first subnet, the subnet flag of the data packet carries the identifier of the first subnet. After any router receives the data packet, it can directly or indirectly send the data packet to the first network interface in the first subnet.

另外,包头部分还可以包含其他标志位/其他字段。In addition, the packet header may also include other flags/other fields.

数据部分可以包括若干字段,具体的字段名以及字段所表示的含义等,均可以参考现有技术,此处不再赘述。The data part may include several fields. The specific field names and the meanings represented by the fields, etc., can all be referred to in the prior art and will not be described in detail here.

上文中是以一个或多个子网的角度对数据传输装置20进行说明的。以下,从另一个角度对数据传输装置20的结构进行说明:The above description is based on the perspective of one or more subnets to describe the data transmission device 20. The following description is based on the structure of the data transmission device 20 from another perspective:

在一个示例中,如图8所示,为数据传输装置20中所涉及的节点及其之间的连接关系示意图。其中,这些节点包括路由器(R)、配置交换器(S)、网络接口(N)和处理节点(T)。网络接口(N)分别连接路由器(R)、配置交换器(S)和处理节点(T)。In one example, as shown in FIG8 , it is a schematic diagram of the nodes involved in the data transmission device 20 and the connection relationship between them. Among them, these nodes include a router (R), a configuration switch (S), a network interface (N) and a processing node (T). The network interface (N) is respectively connected to the router (R), the configuration switch (S) and the processing node (T).

其中,路由器(R)和配置交换器(S)均可以是多端口的。一个路由器(R)可以连接一个或多个网络接口(N),不同配置交换器(S)之间可以按照一定的方式连接,如图9所示。图9所示的结构可以认为是一种数据传输装置20的基本单元的结构。Wherein, the router (R) and the configuration switch (S) can be multi-port. A router (R) can be connected to one or more network interfaces (N), and different configuration switches (S) can be connected in a certain manner, as shown in FIG9. The structure shown in FIG9 can be considered as a basic unit structure of a data transmission device 20.

图9仅为一个示例,其不对本申请实施例提供的数据传输装置20的基本单元的结构构成限定。例如,实际实现时,一个路由器(R)连接的网络接口(N)的数量、一个网络接口(N)连接的处理节点(T)的数量,以及,一个配置交换器(S)连接的其他配置交换器(S)的数量等均可以根据需要进行设置。FIG9 is only an example, and does not limit the structure of the basic unit of the data transmission device 20 provided in the embodiment of the present application. For example, in actual implementation, the number of network interfaces (N) connected to a router (R), the number of processing nodes (T) connected to a network interface (N), and the number of other configuration switches (S) connected to a configuration switch (S) can be set as needed.

不同路由器(R)之间可以按照一定的方式连接,如图10所示。图10是基于图9所示的基本单元提供的一种数据传输装置20的结构示意图。图10仅为一个示例,其不对本申请实施例提供的数据传输装置20的结构构成限定。例如,一个路由器(R)可连接的其他路由器(R)的数量等均可以根据需要进行配置。Different routers (R) can be connected in a certain manner, as shown in FIG10. FIG10 is a schematic diagram of the structure of a data transmission device 20 provided based on the basic unit shown in FIG9. FIG10 is only an example, and does not limit the structure of the data transmission device 20 provided in the embodiment of the present application. For example, the number of other routers (R) that a router (R) can connect to can be configured as needed.

作为示例,在图10中,路由器(R)之间通过一定的方式连接,构成第一层网络,用于子网之间传输数据包,以及子网内“用于接收广播的数据包”的网络接口(如上述第二网络接口)向本子网内的“用于广播数据包的”的网络接口(如上述第一网络接口)传输数据包。配置交换器(S)之间通过一定的方式连接,构成第二层网络,用于区分子网以及控制子网内的网络接口之间的数据传输方向。As an example, in FIG10 , routers (R) are connected in a certain way to form a first layer network for transmitting data packets between subnets, and a network interface "for receiving broadcast data packets" in a subnet (such as the second network interface) transmits data packets to a network interface "for broadcasting data packets" in the subnet (such as the first network interface). Configuration switches (S) are connected in a certain way to form a second layer network for distinguishing subnets and controlling the data transmission direction between network interfaces in subnets.

图10中的路由器(R)是8端口路由器,其中的4端口用于与其他路由器相互连接成为网络状,其余4端口用于连接不同的网络接口。示例的,8端口路由器可以由经典的路由器结构进行端口扩展得到,例如将经典的5端口路由器扩展出3个端口变成8端口路由器。The router (R) in FIG10 is an 8-port router, 4 of which are used to connect to other routers to form a network, and the remaining 4 ports are used to connect to different network interfaces. For example, an 8-port router can be obtained by expanding the ports of a classic router structure, for example, a classic 5-port router is expanded by 3 ports to become an 8-port router.

图10中的配置交换器(S)是5端口的,其中的1个端口是用于与网络接口连接,该接口可以被称为网络接口端口,其余4端口:东、西、南、北端口用于与其他配置交换器相互连接成为网格形状。The configuration switch (S) in FIG10 has five ports, one of which is used to connect to a network interface, which can be referred to as a network interface port, and the remaining four ports: east, west, south, and north ports are used to connect to other configuration switches to form a mesh shape.

以下,对本申请实施例提供的配置交换器进行说明:The following describes the configuration switch provided in the embodiment of the present application:

如图11所示,为本申请实施例提供的一种配置交换器的结构示意图。图11所示的配置交换器包括东、西、南、北端口和网络接口端口。需要说明的是,这里的东、西、南、北端口仅为示例,实际实现时,可以替换为其他名字。另外,配置交换的用于与其他配置交换器进行连接的端口的个数不限于是4个,还可以是其他任意数量。As shown in FIG11, a schematic diagram of the structure of a configuration switch provided in an embodiment of the present application is shown. The configuration switch shown in FIG11 includes east, west, south, north ports and a network interface port. It should be noted that the east, west, south, and north ports here are only examples and can be replaced with other names in actual implementation. In addition, the number of ports of the configuration switch used to connect to other configuration switches is not limited to 4, but can also be any other number.

配置交换器(S)的每个端口与其他节点之间连接的信号线均是双向接口,该信号线可以作为输入信号线,也可以作为输出信号线,但同一时刻只能作为输入信号线或者输出信号线。The signal lines connecting each port of the configuration switch (S) and other nodes are bidirectional interfaces. The signal lines can be used as input signal lines or output signal lines, but can only be used as input signal lines or output signal lines at the same time.

可选的,配置交换器(S)的每个端口连接的信号线包含数据总线、数据控制总线及状态总线。其中:Optionally, the signal lines connected to each port of the configuration switch (S) include a data bus, a data control bus and a status bus.

数据总线是传输数据的信号线。The data bus is the signal line that transmits data.

数据控制总线是表示数据总线上数据是否有效的信号线。The data control bus is a signal line that indicates whether the data on the data bus is valid.

状态总线是表示与该配置交换器连接的网络接口的状态(如忙碌状态或者空闲状态),以及该配置交换器接收到的其他配置交换器发送的网络接口的状态的信号线。The status bus is a signal line indicating the status of the network interface connected to the configuration switch (such as a busy status or an idle status), and the status of the network interface sent by other configuration switches and received by the configuration switch.

例如,在第一子网中,配置交换器1连接第一网络接口,配置交换器2、3分别连接第二网络接口,并且,配置交换器3经配置交换器2向配置交换器1发送自身的状态信息。该情况下,配置交换器3发往配置交换器2的状态信息,表示:与配置交换器3连接的网络接口是忙碌状态或空闲状态。配置交换器2发往配置交换器1的状态信息,表示:与配置交换器3连接的网络接口以及与配置交换器2连接的网络接口,是忙碌状态或空闲状态。For example, in the first subnet, configuration switch 1 is connected to the first network interface, configuration switches 2 and 3 are respectively connected to the second network interface, and configuration switch 3 sends its own status information to configuration switch 1 via configuration switch 2. In this case, the status information sent by configuration switch 3 to configuration switch 2 indicates that the network interface connected to configuration switch 3 is busy or idle. The status information sent by configuration switch 2 to configuration switch 1 indicates that the network interface connected to configuration switch 3 and the network interface connected to configuration switch 2 are busy or idle.

其中,如果与一个配置交换器连接的网络接口具有空闲的缓存空间来接收数据包,则该配置交换器处于空闲状态,否则,该配置寄存器处于忙碌状态。例如,当与该配置交换器连接的网络接口中用于缓存来自该配置交换器的数据的剩余缓存空间(或者剩余缓存空间占缓存总空间)大于等于一定阈值,则该网络接口具有空间的缓存空间。If a network interface connected to a configuration switch has free cache space to receive a data packet, the configuration switch is in an idle state, otherwise, the configuration register is in a busy state. For example, when the remaining cache space (or the remaining cache space accounts for the total cache space) in the network interface connected to the configuration switch for caching data from the configuration switch is greater than or equal to a certain threshold, the network interface has free cache space.

可以理解的是,数据总线与数据控制总线上的数据传输方向相同。例如,均是“发送”方向,或者均是“接收方向”。It is understandable that the data transmission directions on the data bus and the data control bus are the same, for example, both are in the "sending" direction, or both are in the "receiving direction".

可以理解的是,数据总线与状态总线上的数据传输方向相反。具体的:It is understandable that the data transmission direction on the data bus is opposite to that on the status bus. Specifically:

如果一个配置交换器连接的网络接口是用于广播数据包的网络接口(如上述第一网络接口),则该配置交换器用于向本子网内的其他网络接口连接的其他配置交换器发送数据,因此,该配置交换器需要接收其他配置交换器的状态信息(即忙碌状态或空闲状态),从而在确定其他配置交换器均为空闲状态时,向其他配置交换器发送数据。也就是说,如果数据总线上的数据传输方向是“发送”,则状态总线上的数据传输方向是“接收”。If the network interface connected to a configuration switch is a network interface for broadcasting data packets (such as the first network interface mentioned above), the configuration switch is used to send data to other configuration switches connected to other network interfaces in the subnet. Therefore, the configuration switch needs to receive the status information of other configuration switches (i.e., busy state or idle state), so as to send data to other configuration switches when it is determined that other configuration switches are all in idle state. In other words, if the data transmission direction on the data bus is "send", the data transmission direction on the status bus is "receive".

相应的,如果一个配置交换器连接的网络接口是用于接收广播的数据包的网络接口(如上述第二网络接口),则配置交换器用于直接或间接接收本子网内的与“广播数据包的网络接口”连接的配置交换器发送的数据,因此,该配置交换器需要向与“广播数据包的网络接口”连接的配置交换器上报自身的状态信息。也就是说,如果数据总线上的数据传输方向是“接收”,则状态总线上的数据传输方向是“发送”。Correspondingly, if the network interface connected to a configuration switch is a network interface for receiving broadcast data packets (such as the second network interface mentioned above), the configuration switch is used to directly or indirectly receive data sent by the configuration switch connected to the "network interface for broadcast data packets" in this subnet. Therefore, the configuration switch needs to report its own status information to the configuration switch connected to the "network interface for broadcast data packets". In other words, if the data transmission direction on the data bus is "receive", the data transmission direction on the status bus is "send".

每个配置交换器内部均可以包含配置寄存器,该配置寄存器用于存储配置信息,该配置信息用于该配置交换器控制自身每个端口的连通或关断,以及数据传输方向。Each configuration switch may include a configuration register therein, and the configuration register is used to store configuration information. The configuration information is used by the configuration switch to control the connection or disconnection of each port of the configuration switch, as well as the data transmission direction.

可选的,一个配置交换器中配置的配置寄存器的个数,与该配置交换器同时需要为几个子网传输数据相关。一个配置交换器同时需要为几个子网传输数据是基于配置信息和该配置交换器同时最多可支持为几个子网传输数据确定的。一个配置交换器同时最多可支持为几个子网传输数据,是基于该配置交换器的端口数确定的。Optionally, the number of configuration registers configured in a configuration switch is related to the number of subnets for which the configuration switch needs to transmit data at the same time. The number of subnets for which a configuration switch needs to transmit data at the same time is determined based on the configuration information and the maximum number of subnets for which the configuration switch can simultaneously support data transmission. The maximum number of subnets for which a configuration switch can simultaneously support data transmission is determined based on the number of ports of the configuration switch.

以配置交换器是如图11所示的配置交换器为例,由于该配置交换器包含5个端口,并且,不同子网之间的数据传输不能共用配置交换器的端口,因此,该配置交换器最多可支持为2个子网传输数据,例如,东端口和南端口作为一个子网的数据传输通路的输入端口和输出端口,西端口和北端口作为另一个子网的数据传输通路的输入端口和输出端口。该情况下,该配置交换器中可以包含2个配置寄存器,其中一个配置寄存器用于存储一个子网的配置信息,另一个配置寄存器用于存储另一个子网的配置信息。Taking the configuration switch as shown in FIG11 as an example, since the configuration switch includes 5 ports, and data transmission between different subnets cannot share the ports of the configuration switch, the configuration switch can support data transmission for 2 subnets at most, for example, the east port and the south port serve as the input port and output port of the data transmission path of one subnet, and the west port and the north port serve as the input port and output port of the data transmission path of another subnet. In this case, the configuration switch can include 2 configuration registers, one of which is used to store the configuration information of one subnet, and the other is used to store the configuration information of another subnet.

可选的,配置交换器中的配置寄存器中存储的配置信息的格式主要包括以下标志位/字段,如图12所示:Optionally, the format of the configuration information stored in the configuration register in the configuration switch mainly includes the following flag bits/fields, as shown in FIG12:

字段1:数据总线输入端口标志位和/或状态总线输出端口标志位,用于携带数据总线输入端口的标识和/或状态总线输出端口的标识。Field 1: data bus input port flag bit and/or status bus output port flag bit, used to carry the identifier of the data bus input port and/or the identifier of the status bus output port.

字段2:数据总线输出端口标志位,用于携带数据总线输出端口的标识。Field 2: Data bus output port flag, used to carry the identifier of the data bus output port.

字段3:状态总线输入端口标志位,用于携带状态总线输入端口的标识。Field 3: Status bus input port flag, used to carry the identification of the status bus input port.

需要说明的是,由于数据总线与状态总线上的数据传输方向是相反的,因此,数据总线输入端口标志位与状态总线输出端口标志位相同,因此,二者可以共用一个字段。It should be noted that, since the data transmission directions on the data bus and the status bus are opposite, the data bus input port flag bit is the same as the status bus output port flag bit, so the two can share a field.

另外需要说明的是,由于数据总线与数据控制总线上的数据传输方向是相同的,因此,配置交换器中的配置寄存器的格式中,没有包含数据控制总线的输入端口标志位和输出端口标志位,其具体标志位可以分别参考数据总线输入端口标志位和数据总线输出端口标志位。It should also be noted that since the data transmission direction on the data bus and the data control bus is the same, the format of the configuration register in the configuration switch does not include the input port flag and output port flag of the data control bus. The specific flags can refer to the data bus input port flag and the data bus output port flag respectively.

如图13所示,为本申请实施例提供的一种配置交换器中的配置寄存器所存储的配置信息的结构示意图。图13所示的配置信息的格式包括:As shown in FIG13, a schematic diagram of the structure of configuration information stored in a configuration register in a configuration switch provided in an embodiment of the present application is shown. The format of the configuration information shown in FIG13 includes:

字段1:第0-2位,既用来表示数据输入端口标志位,又用来表示状态总线的输出端口标志位。Field 1: Bits 0-2 are used to indicate both the data input port flag and the output port flag of the status bus.

字段2:第3-7位,表示数据总线输出端口标志位。在一个示例中,第3位表示北端口,第4位表示西端口,第5位表示南端口,第6位表示东端口,第7位表示网络接口端口(NI)。当某个比特位为高电平时,表示该比特对应的数据总线输出端口有效,即该比特对应的端口是数据总线输出端口。当某个比特位为低电平时,表示该比特位对应的数据总线输出端口无效,即该比特对应的端口不是数据总线输出端口。Field 2: Bits 3-7 indicate the data bus output port flag. In one example, bit 3 indicates the north port, bit 4 indicates the west port, bit 5 indicates the south port, bit 6 indicates the east port, and bit 7 indicates the network interface port (NI). When a bit is at a high level, it indicates that the data bus output port corresponding to the bit is valid, that is, the port corresponding to the bit is the data bus output port. When a bit is at a low level, it indicates that the data bus output port corresponding to the bit is invalid, that is, the port corresponding to the bit is not the data bus output port.

字段3:第8-12位,表示状态总线输入端口标志位。在一个示例中,第8位表示北端口,第9位表示西端口,第10位表示南端口,第11位表示东端口,第12位表示网络接口端口。当某个比特位为高电平时,表示该比特对应的状态总线输入端口有效,即该比特对应的端口是状态总线输入端口。当某个比特位为低电平时,表示该比特位对应的状态总线输入端口无效,即该比特对应的端口不是状态总线输入端口。Field 3: Bits 8-12 indicate the status bus input port flag. In one example, bit 8 indicates the north port, bit 9 indicates the west port, bit 10 indicates the south port, bit 11 indicates the east port, and bit 12 indicates the network interface port. When a bit is at a high level, it indicates that the status bus input port corresponding to the bit is valid, that is, the port corresponding to the bit is the status bus input port. When a bit is at a low level, it indicates that the status bus input port corresponding to the bit is invalid, that is, the port corresponding to the bit is not the status bus input port.

如图14所示,为本申请实施例提供的一种配置交换器的状态总线的数据传输方法的流程示意图。图14所示的方法包括以下步骤:As shown in Figure 14, it is a flow chart of a method for data transmission of a state bus of a configuration switch provided in an embodiment of the present application. The method shown in Figure 14 comprises the following steps:

S201:配置交换器初始化自身包含的配置寄存器。其中,配置寄存器中存储的配置信息的格式可以如图13所示。S201: The configuration switch initializes the configuration register contained in itself. The format of the configuration information stored in the configuration register may be as shown in FIG. 13 .

S202:配置交换器基于配置信息,判断状态总线的输出端口标志位(如图13中的第0-2比特)是否有效。S202: The configuration switch determines whether the output port flag bits (such as bits 0-2 in FIG. 13 ) of the status bus are valid based on the configuration information.

若无效,则执行S203。若有效,则执行S204。If invalid, execute S203. If valid, execute S204.

S203:配置交换器确定当前不输出状态信号。执行该步骤之后,本次过程结束。S203: The configuration switch determines that the status signal is not currently output. After executing this step, the current process ends.

S204:配置交换器记录状态总线输入端口标志位(如图13中的第8-12比特)携带的有效端口的标识。S204: The configuration switch records the identifier of the valid port carried by the status bus input port flag bit (such as bits 8-12 in FIG. 13 ).

S205:配置交换器将所记录的有效端口的状态信息进行“或”操作。S205: The configuration switch performs an “OR” operation on the recorded status information of the valid ports.

其中,该步骤是以状态信息是忙碌状态表示为“1”,状态信息是空闲状态表示为“0”为例进行说明的。如果配置交换器记录的任意一个或多个有效端口的状态信息是“1”,则S205中“或”操作的结果是1,表示忙碌。如果配置交换器记录的所有有效端口的状态信息均是“0”,则S205中“或”操作的结果是0,表示空闲。This step is described by taking the busy state information as "1" and the idle state information as "0" as an example. If the state information of any one or more valid ports recorded by the configuration switch is "1", the result of the "or" operation in S205 is 1, indicating busy. If the state information of all valid ports recorded by the configuration switch is "0", the result of the "or" operation in S205 is 0, indicating idle.

S206:配置交换器将“或”操作的结果值赋值给状态总线的输出端口。S206: The configuration switch assigns the result value of the “OR” operation to the output port of the status bus.

每个配置交换器将输入状态信息“或”操作后,赋值给输出状态信息线。对于第一子网来说,各配置交换器都只能将自己的输入状态信息进行或操作赋值给自己的输出端口,从而通过一个接一个配置交换器的传递,将第一子网内的所有第二网络接口的连接的网络接口的状态信息,传递给第一网络接口。Each configuration switch performs an OR operation on the input status information and assigns it to the output status information line. For the first subnet, each configuration switch can only perform an OR operation on its own input status information and assign it to its own output port, thereby transmitting the status information of the network interfaces connected to all the second network interfaces in the first subnet to the first network interface through the transmission of the configuration switches one by one.

如图15所示,为本申请实施例提供的一种配置交换器的数据总线的数据传输方法的流程示意图。图15所示的方法包括以下步骤:As shown in FIG15 , a flow chart of a data transmission method for configuring a data bus of a switch provided in an embodiment of the present application is shown. The method shown in FIG15 includes the following steps:

S301:配置交换器初始化自身包含的配置寄存器。其中,配置寄存器中存储的配置信息的格式可以如图13所示。S301: The configuration switch initializes the configuration register contained in itself. The format of the configuration information stored in the configuration register may be as shown in FIG. 13 .

S302:配置交换器基于配置信息,判断数据总线的输入端口标志位(如图13中的第0-2比特)是否有效。S302: The configuration switch determines whether the input port flag bits (such as bits 0-2 in FIG. 13 ) of the data bus are valid based on the configuration information.

若无效,则执行S303;若有效,则执行S304。If invalid, execute S303; if valid, execute S304.

S303:配置交换器确定当前没有数据输入。执行该步骤之后,本次过程结束。S303: The configuration switch determines that there is no data input at present. After executing this step, this process ends.

S304:配置交换器记录数据总线输出端口标志位(如图13中的第3-7比特)中有效的端口号,该端口号所指示的端口即为有效的数据总线输出端口。S304: The switch is configured to record the valid port number in the data bus output port flag (such as bits 3-7 in FIG. 13 ). The port indicated by the port number is the valid data bus output port.

S305:配置交换器将数据总线的输入端口的数据分别赋值给有效的数据总线输出端口。这样,可以实现将数据总线的输入端口的数据经有效的数据总线输出端口输出。S305: The configuration switch assigns the data of the input port of the data bus to the valid data bus output port, so that the data of the input port of the data bus can be output through the valid data bus output port.

以下,对本申请实施例提供的网络接口进行说明:The following describes the network interface provided in the embodiment of the present application:

如图16所示,为本申请实施例提供的一种网络接口30的结构示意图。为了方便说明,图13中还示意出了与网络接口30连接的路由器、配置交换器和处理节点。图13所示的网络接口30包括:As shown in FIG16, a schematic diagram of the structure of a network interface 30 provided in an embodiment of the present application is shown. For the convenience of explanation, FIG13 also schematically shows a router, a configuration switch, and a processing node connected to the network interface 30. The network interface 30 shown in FIG13 includes:

第一缓存块31,用于缓存路由器发送给网络接口30的数据包。The first cache block 31 is used to cache data packets sent by the router to the network interface 30 .

第二缓存块32,用于缓存与网络接口30连接的配置交换器发送给网络接口30的数据包。The second cache block 32 is used to cache data packets sent to the network interface 30 by the configuration switch connected to the network interface 30 .

配置寄存器(REG)33,用于存储配置信息,该配置信息可以是预定义的,预定义之后是可以更改的。The configuration register (REG) 33 is used to store configuration information, which may be predefined and can be modified after being predefined.

控制器34,用于选择第一缓存块31和第二缓存块32内的数据包输出至合适的端口,这里的合适的端口可以是连接处理节点的端口和/或连接配置交换器的端口。以及,根据REG341中存储的配置信息,与配置交换器和第二缓存块32进行信息交互。The controller 34 is used to select the data packets in the first cache block 31 and the second cache block 32 to be output to the appropriate port, where the appropriate port may be a port connected to the processing node and/or a port connected to the configuration switch. And, according to the configuration information stored in the REG 341, the controller 34 performs information exchange with the configuration switch and the second cache block 32.

第三缓存块35,用于缓存与网络接口30连接的处理节点发往路由器的数据包。The third cache block 35 is used to cache data packets sent from the processing node connected to the network interface 30 to the router.

如图17所示,为本申请实施例提供的一种网络接口中的配置寄存器存储的配置信息的格式的示意图。具体的,该配置信息包括以下字段:As shown in Figure 17, it is a schematic diagram of the format of configuration information stored in a configuration register in a network interface provided by an embodiment of the present application. Specifically, the configuration information includes the following fields:

字段1:主从工作模式标志位,用于携带该网络接口的控制总线的工作模式的标识,该工作模式是主工作模式或从工作模式,主工作模式表示该网络接口是用于广播数据包的网络接口,如上述第一网络接口,从工作模式表示该网络接口是用于接收广播的数据包的网络接口,如上述第二网络接口。Field 1: Master-slave working mode flag, used to carry the identification of the working mode of the control bus of the network interface. The working mode is the master working mode or the slave working mode. The master working mode indicates that the network interface is a network interface for broadcasting data packets, such as the first network interface mentioned above. The slave working mode indicates that the network interface is a network interface for receiving broadcast data packets, such as the second network interface mentioned above.

字段2:网络接口在本子网的标志位,用于携带网络接口在本子网中的标识。Field 2: The flag of the network interface in this subnet, used to carry the identification of the network interface in this subnet.

需要说明的是,一个网络接口可以属于不同子网,其在不同子网中的标识可能不同,因此,这里的标志位具体是指该网络接口在本子网中的标识。It should be noted that a network interface may belong to different subnets, and its identifiers in different subnets may be different. Therefore, the flag bit here specifically refers to the identifier of the network interface in this subnet.

可选的,该配置信息的格式还可以包括其他标志位/字段。Optionally, the format of the configuration information may also include other flag bits/fields.

如图18所示,为本申请实施例提供的一种网络接口的工作流程的方法示意图。图18可以应用于如图16所示的网络接口,以及应用于如图7所示的数据包。图18所示的方法可以包括以下步骤:As shown in Figure 18, a schematic diagram of a method of a workflow of a network interface provided in an embodiment of the present application is provided. Figure 18 can be applied to the network interface shown in Figure 16, and to the data packet shown in Figure 7. The method shown in Figure 18 may include the following steps:

S401:初始化当前网络接口内部的配置寄存器。S401: Initialize the configuration register inside the current network interface.

S402:当前网络接口中的控制器基于配置寄存器中存储的配置信息,判断该当前网络接口的工作模式是主节点工作模式还是从节点工作模式。S402: The controller in the current network interface determines whether the working mode of the current network interface is the master node working mode or the slave node working mode based on the configuration information stored in the configuration register.

如果被配置为主节点工作模式,则执行S403。If it is configured as the master node working mode, execute S403.

如果被配置为从节点工作模式,则执行S409。If it is configured as the slave node working mode, execute S409.

S403:当前网络接口中的控制器检测第一缓存块是否有数据。S403: The controller in the current network interface detects whether there is data in the first cache block.

若是,则执行S404。若否,则本次数据传输过程结束。If yes, then S404 is executed. If no, then the data transmission process ends.

S404:当前网络接口中的控制器读取第一缓存块中的数据包,并判断数据包的“数据包类型标志位”是广播标识还是非广播标识。S404: The controller in the current network interface reads the data packet in the first cache block, and determines whether the “data packet type flag” of the data packet is a broadcast mark or a non-broadcast mark.

如果数据包类型标志位是非广播类型,则执行S405。If the data packet type flag is a non-broadcast type, execute S405.

如果数据包类型标志位是广播类型,则执行S406。If the data packet type flag is a broadcast type, execute S406.

S405:当前网络接口中的控制器将所读取的数据包传输至处理节点。S405: The controller in the current network interface transmits the read data packet to the processing node.

执行S405之后,本次数据传输过程结束。After executing S405, the data transmission process ends.

S406:当前网络接口中的控制器基于数据包的“目的网络接口标志位”判断当前网络接口是否有效。S406: The controller in the current network interface determines whether the current network interface is valid based on the “destination network interface flag bit” of the data packet.

如果有效,说明当前网络接口是该数据包的一个目的网络接口(或者说,当前网络接口是有效的目的网络接口),则执行S407。If valid, it means that the current network interface is a destination network interface of the data packet (or in other words, the current network interface is a valid destination network interface), and then S407 is executed.

如果无效,说明当前网络接口不是该数据包的目的网络接口(或者说,当前网络接口不是有效的目的网络接口),则执行S408。If invalid, it means that the current network interface is not the destination network interface of the data packet (or in other words, the current network interface is not a valid destination network interface), and then S408 is executed.

需要说明的是,这里的目的网络端口,可以包括用于广播数据包的网络接口,也可以包括用于接收广播的数据包的网络接口。It should be noted that the destination network port here may include a network interface for broadcasting data packets, and may also include a network interface for receiving broadcast data packets.

例如,以当前网络接口是网络接口n为例,其中,如果一个子网包括N个网络接口,该子网内的各网络接口的编号依次为1-N,N是大于等于3的整数,则网络接口n是指本子网内编号为n的网络接口,1≤n≤N,n是整数。网络接口n的控制器如果确定数据包的“目的网络接口标志位”的第n位有效,则确定该网络接口有效。For example, if the current network interface is network interface n, where a subnet includes N network interfaces, and the network interfaces in the subnet are numbered 1-N, N is an integer greater than or equal to 3, then network interface n refers to the network interface numbered n in the subnet, 1≤n≤N, and n is an integer. If the controller of network interface n determines that the nth bit of the "destination network interface flag bit" of the data packet is valid, then the network interface is determined to be valid.

S407:当前网络接口中的控制器将所读取的数据包传输至与当前网络接口连接的处理节点,以及,在与当前网络接口连接的配置交换器传输给该当前网络接口的状态总线有效时,当前网络接口中的控制器将所读取的数据包传输至与当前网络接口连接的配置交换器。S407: The controller in the current network interface transmits the read data packet to the processing node connected to the current network interface, and when the status bus transmitted to the current network interface by the configuration switch connected to the current network interface is valid, the controller in the current network interface transmits the read data packet to the configuration switch connected to the current network interface.

执行S407的当前网络接口是用于广播数据包的网络接口,因此,与当前网络接口连接的配置交换器传输给(即输出给)该当前网络接口的状态总线有效,说明:本子网内的所有“用于接收广播的数据包”的网络接口均处于空闲状态,此时,当前网络接口可以在子网内广播数据包,因此,将所读取的数据包传输至与当前网络接口连接的配置交换器。后续,该配置交换器可以将该数据包发送给与其所连接的配置交换器,接收到数据包的配置交换器可以执行如图14和图15所示的方法,从而实现当前网络接口在子网中广播数据包的目的。The current network interface executing S407 is a network interface for broadcasting data packets, so the state bus transmitted to (i.e., output to) the current network interface by the configuration switch connected to the current network interface is valid, indicating that all network interfaces "for receiving broadcast data packets" in this subnet are in an idle state. At this time, the current network interface can broadcast data packets in the subnet, so the read data packets are transmitted to the configuration switch connected to the current network interface. Subsequently, the configuration switch can send the data packet to the configuration switch connected to it, and the configuration switch that receives the data packet can execute the method shown in Figures 14 and 15, thereby achieving the purpose of the current network interface broadcasting data packets in the subnet.

执行S407之后,本次数据传输过程结束。After executing S407, the data transmission process ends.

S408:在与当前网络接口连接的配置交换器传输给该当前网络接口的状态总线有效时,当前网络接口中的控制器将所读取的数据包传输至与当前网络接口连接的配置交换器。S408: When the status bus transmitted from the configuration switch connected to the current network interface to the current network interface is valid, the controller in the current network interface transmits the read data packet to the configuration switch connected to the current network interface.

执行S408之后,本次数据传输过程结束。After executing S408, the data transmission process ends.

S409:当前网络接口中的控制器检测与当前网络接口连接的配置交换器是否传输数据,即判断第二缓存块中是否存储有数据包。S409: The controller in the current network interface detects whether the configuration switch connected to the current network interface transmits data, that is, determines whether a data packet is stored in the second cache block.

若是,则执行S410。若否,则本次数据传输过程结束。If yes, then S410 is executed. If no, then the data transmission process ends.

S410:当前网络接口中的控制器基于数据包的“目的网络接口标志位”判断当前网络接口是否有效。S410: The controller in the current network interface determines whether the current network interface is valid based on the “destination network interface flag bit” of the data packet.

如果有效,说明当前网络接口是一个有效的目的网络端口,则执行S411。If valid, it means that the current network interface is a valid destination network port, and then S411 is executed.

如果无效,则本次数据传输过程结束。If invalid, the data transmission process ends.

S411:当前网络接口中的控制器将第二缓存块内的数据写入与该当前网络接口连接的处理节点。S411: The controller in the current network interface writes the data in the second cache block to the processing node connected to the current network interface.

以下,通过一个具体示例,对本申请实施例提供的上述方法进行说明:The method provided in the embodiment of the present application is described below by using a specific example:

如图19所示,为本申请实施例提供的一种数据传输装置的结构示意图。该数据传输装置包括第一子网和第二子网。其中:As shown in FIG19, it is a schematic diagram of the structure of a data transmission device provided in an embodiment of the present application. The data transmission device includes a first subnet and a second subnet. Among them:

第一子网包含的网络接口为:网络接口1、2、3、4。其中,网络接口1是第一网路接口,网络接口2、3、4是第二网络接口。第二子网包含的网络接口为:网络接口5、3、6、7。其中,网络接口5是第三网络接口,网络接口6、7号是第四网络接口。The first subnet includes the following network interfaces: network interface 1, 2, 3, and 4. Among them, network interface 1 is the first network interface, and network interfaces 2, 3, and 4 are the second network interfaces. The second subnet includes the following network interfaces: network interface 5, 3, 6, and 7. Among them, network interface 5 is the third network interface, and network interfaces 6 and 7 are the fourth network interfaces.

其中,网络接口3属于第一子网,也属于第二子网。网络接口3在第一子网中作为第二网络接口,在第二网络节点中作为中间网络接口。这一信息可以作为配置信息的一部分存储在网络接口3的配置寄存器中。Among them, the network interface 3 belongs to the first subnet and also belongs to the second subnet. The network interface 3 serves as the second network interface in the first subnet and as the intermediate network interface in the second network node. This information can be stored in the configuration register of the network interface 3 as part of the configuration information.

与网络接口1-7(图19中标记为N1-7)连接的配置寄存器分别为配置交换器1-7(图19中标记为S1-7)。配置交换器1、2、3、4之间数据流方向如图19所示中的实线箭头所示,配置器3、5、6、7之间数据流方向如图19所示中的虚线箭头所示。The configuration registers connected to the network interfaces 1-7 (labeled as N1-7 in FIG. 19 ) are respectively configured switches 1-7 (labeled as S1-7 in FIG. 19 ). The direction of data flow between the configuration switches 1, 2, 3, 4 is shown by the solid arrows in FIG. 19 , and the direction of data flow between the configuration switches 3, 5, 6, 7 is shown by the dotted arrows in FIG. 19 .

在一个示例中,与网络接口1-7分别连接的配置交换器的配置结果如图20所示。In one example, the configuration results of the configuration switches respectively connected to the network interfaces 1 - 7 are shown in FIG. 20 .

在图20中,每个配置交换器中设置有2个配置寄存器,分别标记为REG1和REG2。其中,REG1是针对第一子网的配置寄存器,REG2是针对第二子网的配置寄存器。每个配置寄存器中存储的配置信息的结构和该结构中每个字段的含义如图13所示。In FIG20 , two configuration registers are set in each configuration switch, which are marked as REG1 and REG2. Among them, REG1 is a configuration register for the first subnet, and REG2 is a configuration register for the second subnet. The structure of the configuration information stored in each configuration register and the meaning of each field in the structure are shown in FIG13 .

在一个示例中,数据总线输入端口标志位/状态总线输出端口标志位中携带的信息的含义如下:“000”表示北端口(N),“001”表示西端口(W),“010”表示南端口(S),“011”表示东端口(E),“100”表示网络接口端口(NI),“111”表示无效(INVALID)。In one example, the meaning of the information carried in the data bus input port flag/status bus output port flag is as follows: "000" represents the north port (N), "001" represents the west port (W), "010" represents the south port (S), "011" represents the east port (E), "100" represents the network interface port (NI), and "111" represents invalid (INVALID).

以下,结合图20,以配置交换器3为例说明配置寄存器中存储的配置信息的含义。In the following, in conjunction with FIG. 20 , the meaning of the configuration information stored in the configuration register is explained by taking the configuration switch 3 as an example.

REG1的字段1“011”表示:数据总线的输入端口为东端口,状态总线的输出端口为东端口。Field 1 "011" of REG1 indicates that the input port of the data bus is the east port and the output port of the status bus is the east port.

REG1的字段2中“00001”表示:NI端口为数据总线输出端口,其余端口无效。由此可知,数据总线的数据流向为:从东端口输入,由NI端口输出。也就是说,针对第一子网,配置交换器3从配置交换器2接收到数据包之后,发往网络接口3。"00001" in field 2 of REG1 indicates that the NI port is the data bus output port, and the other ports are invalid. Therefore, the data flow of the data bus is: input from the east port and output from the NI port. That is to say, for the first subnet, after configuration switch 3 receives the data packet from configuration switch 2, it sends it to network interface 3.

REG1的字段3“00001”表示,NI端口为状态总线输入端口,其余端口无效。由此可知,状态总线的数据流向为:从NI端口输入,东端口输出。Field 3 "00001" of REG1 indicates that the NI port is the input port of the status bus, and the other ports are invalid. Therefore, the data flow of the status bus is: input from the NI port and output from the East port.

REG2的字段1“001”表示:数据总线的输入端口为西端口,状态总线的输出端口为西端口。Field 1 "001" of REG2 indicates that the input port of the data bus is the west port, and the output port of the status bus is the west port.

REG2的字段2“10000”表示:北端口为数据总线输出端口,其余端口为无效。由此可知,数据总线的数据流向为:从西端口输入,由北端口输出。也就是说,针对第二子网,配置交换器3从配置交换器5接收到数据包之后,发往配置交换器6,而不会发往网络接口3。这是在考虑到网络接口3在第二子网中是中间网络接口而设计的配置信息。Field 2 "10000" of REG2 indicates that the north port is the data bus output port, and the other ports are invalid. Therefore, it can be seen that the data flow direction of the data bus is: input from the west port and output from the north port. In other words, for the second subnet, after configuration switch 3 receives the data packet from configuration switch 5, it sends it to configuration switch 6 instead of network interface 3. This is the configuration information designed considering that network interface 3 is an intermediate network interface in the second subnet.

REG2的字段3“10000”表示:北端口为状态总线输入端口,其余端口无效。由此可知,状态总线的数据流向为:从北端口输入,西端口输出。Field 3 "10000" of REG2 indicates that the north port is the input port of the status bus, and the other ports are invalid. Therefore, the data flow direction of the status bus is: input from the north port and output from the west port.

可以理解的是,对于配置交换器来说,可以基于预先设定的数据包传输路径,确定配置交换器的相应配置寄存器中的配置信息,从而在数据传输过程中,由该配置寄存器读取并分析配置信息,实现数据包按照预先设定的路径进行传输。其他示例不再一一说明。It is understandable that, for a configuration switch, the configuration information in the corresponding configuration register of the configuration switch can be determined based on the preset data packet transmission path, so that during the data transmission process, the configuration register reads and analyzes the configuration information to achieve data packet transmission along the preset path. Other examples are not described one by one.

在一个示例中,第一子网和第二子网中的数据包的示例如图21所示。其中,数据包类型标志位中的“11”表示:数据包类型为广播类型。图21中是以目的网络接口标志位是16比特为例进行说明的,具体实现时不现于此。其中,第n比特为高电平“1”表示网络接口n是目的网络接口,为低电平“0”表示网络接口n不是目的网络接口。1≤n≤16,n是整数。“其他字段”表示,数据包中包含的其他信息,其相关描述可以参考上文,也可以参考现有技术。In one example, examples of data packets in the first subnet and the second subnet are shown in Figure 21. Among them, "11" in the data packet type flag indicates that the data packet type is a broadcast type. Figure 21 is illustrated by taking the destination network interface flag as 16 bits as an example, which is not shown in the specific implementation. Among them, the nth bit is a high level "1" indicating that network interface n is the destination network interface, and a low level "0" indicating that network interface n is not the destination network interface. 1≤n≤16, n is an integer. "Other fields" indicate other information contained in the data packet, and the relevant description can refer to the above text or the prior art.

在一个示例中,网络接口1-7中的配置寄存器中存储的配置信息如图22所示。In one example, the configuration information stored in the configuration register in the network interface 1 - 7 is as shown in FIG. 22 .

结合图20至图22,对于第一子网来说:In conjunction with FIG. 20 to FIG. 22 , for the first subnet:

网络接口1基于图22所示的主从节点标志位“1”,确定自身的工作模式是主工作模式,从而在第一子网中广播数据包。具体的,数据包由网络接口1所连接的配置交换器,发送到配置交换器2-4。配置交换器2-4基于图20中所示的相应配置信息,将接收到的数据包分别发送给网络接口2-4。Based on the master-slave node flag bit "1" shown in FIG22, the network interface 1 determines that its own working mode is the master working mode, thereby broadcasting the data packet in the first subnet. Specifically, the data packet is sent to the configuration switch 2-4 by the configuration switch connected to the network interface 1. The configuration switch 2-4 sends the received data packets to the network interface 2-4 respectively based on the corresponding configuration information shown in FIG20.

网络接口2-4分别基于图22所示的主从节点标志位“0”,确定自身的工作模式是从工作模式,从而接收第一子网中广播的数据包。然后,网络接口2-4分别基于图21中所示的数据包的目的网络接口标志位,确定将该数据包发往自身连接的处理节点,还是丢弃该数据包。具体的,由图21中第一子网中的数据包的目的网络接口标志位“1110000000000000”,且预定义的其从高位开始的第1-4比特依次对应网络接口1-4,可知:网络接口1-3是目标网络接口,网络接口4不是目标网络接口,因此,网络接口1-3分别将数据包发往自身连接的处理节点,网络接口4丢弃接收到的数据包。Network interface 2-4 determines that its own working mode is slave working mode based on the master-slave node flag "0" shown in Figure 22, thereby receiving the data packet broadcasted in the first subnet. Then, network interface 2-4 determines whether to send the data packet to the processing node connected to itself or discard the data packet based on the destination network interface flag of the data packet shown in Figure 21. Specifically, from the destination network interface flag "11100000000000000" of the data packet in the first subnet in Figure 21, and the predefined 1-4 bits starting from the high position correspond to network interface 1-4 in sequence, it can be known that: network interface 1-3 is the target network interface, and network interface 4 is not the target network interface. Therefore, network interface 1-3 sends the data packet to the processing node connected to itself, and network interface 4 discards the received data packet.

结合图20至图22,对于第二子网来说:In conjunction with FIG. 20 to FIG. 22 , for the second subnet:

网络接口5基于图22所示的主从节点标志位“1”,确定自身的工作模式是主工作模式,从而在第二子网中广播数据包。具体的,数据包由网络接口5所连接的配置交换器,发送到配置交换器3、6、7。配置交换器3、6、7基于图20中所示的相应配置信息,将接收到的数据包分别发送给网络接口6、7。Based on the master-slave node flag "1" shown in FIG22, the network interface 5 determines that its own working mode is the master working mode, thereby broadcasting the data packet in the second subnet. Specifically, the data packet is sent to the configuration switches 3, 6, and 7 by the configuration switch connected to the network interface 5. The configuration switches 3, 6, and 7 send the received data packets to the network interfaces 6 and 7 respectively based on the corresponding configuration information shown in FIG20.

网络接口6、7分别基于图22所示的主从节点标志位“0”,确定自身的工作模式是从工作模式,从而接收第二子网中广播的数据包。然后,网络接口6、7分别图21中所示的数据包的目的网络接口标志位,确定将该数据包发往自身连接的处理节点,还是丢弃该数据包。具体的,由图21中第二子网中的数据包的目的网络接口标志位“011000000000000”,且预定义的其从高位开始的第1-3比特依次对应网络接口5、6、7,可知:网络接口6、7是目标网络接口,网络接口5不是目标网络接口,因此,网络接口6、7分别将接收到的数据包发往自身连接的处理节点。Network interfaces 6 and 7 respectively determine that their own working mode is slave working mode based on the master-slave node flag "0" shown in Figure 22, thereby receiving the data packet broadcasted in the second subnet. Then, network interfaces 6 and 7 respectively determine whether to send the data packet to the processing node connected to themselves or discard the data packet based on the destination network interface flag of the data packet shown in Figure 21. Specifically, from the destination network interface flag "011000000000000" of the data packet in the second subnet in Figure 21, and the predefined 1-3 bits starting from the high position correspond to network interfaces 5, 6, and 7 in sequence, it can be known that: network interfaces 6 and 7 are the target network interfaces, and network interface 5 is not the target network interface. Therefore, network interfaces 6 and 7 respectively send the received data packets to the processing nodes connected to themselves.

网络接口3在第二子网是中间网路接口,因此,不会接收到配置交换器3发送的数据包。关于该情况下,配置交换器3中的配置信息的具体说明可以参考上文。The network interface 3 is an intermediate network interface in the second subnet, and therefore, will not receive the data packet sent by the configuration switch 3. For the detailed description of the configuration information in the configuration switch 3 in this case, reference can be made to the above text.

上述主要从方法的角度对本申请实施例提供的方案进行了介绍。为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的方法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the method. In order to achieve the above functions, it includes hardware structures and/or software modules corresponding to the execution of each function. Those skilled in the art should easily appreciate that, in combination with the method steps of each example described in the embodiment disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.

本申请实施例可以根据上述方法示例对网络接口进行功能模块的划分,例如可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。The embodiment of the present application can divide the network interface into functional modules according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

如图23所示,为本申请实施例提供的一种网络接口23的结构示意图。该网络接口23用于执行上文中任意一个实施例提供的方法中第二网络接口所执行的步骤。例如,该网络接口23可以包括:接收单元2301,用于接收第一网络接口广播的数据包,该数据包中包括多个目的网络接口的标识。处理单元2302,用于在确定该数据包中的目的网络接口的标识包括第二网络接口的标识时,将该数据包转发给对应的处理节点;或在确定该数据包中的目的网络接口的标识不包括第二网络接口的标识时,丢弃该数据包。例如,结合图18,处理单元2302可以用于执行S411。As shown in Figure 23, it is a schematic diagram of the structure of a network interface 23 provided in an embodiment of the present application. The network interface 23 is used to execute the steps performed by the second network interface in the method provided in any one of the embodiments above. For example, the network interface 23 may include: a receiving unit 2301, used to receive a data packet broadcast by the first network interface, and the data packet includes identifiers of multiple destination network interfaces. A processing unit 2302 is used to forward the data packet to a corresponding processing node when it is determined that the identifier of the destination network interface in the data packet includes the identifier of the second network interface; or to discard the data packet when it is determined that the identifier of the destination network interface in the data packet does not include the identifier of the second network interface. For example, in combination with Figure 18, the processing unit 2302 can be used to execute S411.

本申请实施例还提供的一种网络接口。该网络接口24包括:存储器和一个或多个处理器,存储器用于存储计算机指令,处理器用于调用所述计算机指令,以执行上文中任意一个实施例提供的方法中第二网络接口所执行的步骤。The embodiment of the present application also provides a network interface. The network interface 24 includes: a memory and one or more processors, the memory is used to store computer instructions, and the processor is used to call the computer instructions to execute the steps performed by the second network interface in the method provided in any of the embodiments above.

本申请实施例还提供了一种网络接口,用于执行上文中任意一个实施例提供的方法中第一网络接口所执行的步骤。在一种实现方式中,可以对该网络接口进行逻辑功能划分,如包括收发单元和处理单元,收发单元用于执行收发步骤,处理单元用于执行收发步骤之外的其他步骤。在另一种实现方式中,该网络接口包括存储器和一个或多个处理器,存储器用于存储计算机指令,处理器用于调用所述计算机指令,以执行上文中任意一个实施例提供的方法中第一网络接口所执行的步骤。The embodiment of the present application also provides a network interface for executing the steps performed by the first network interface in the method provided in any one of the embodiments above. In one implementation, the network interface can be divided into logical functions, such as including a transceiver unit and a processing unit, the transceiver unit is used to perform the transceiver step, and the processing unit is used to perform other steps other than the transceiver step. In another implementation, the network interface includes a memory and one or more processors, the memory is used to store computer instructions, and the processor is used to call the computer instructions to execute the steps performed by the first network interface in the method provided in any one of the embodiments above.

本申请实施例还提供了一种配置交换器,用于执行上文中任意一个实施例提供的方法中配置交换器所执行的步骤。在一种实现方式中,可以对该配置交换器进行逻辑功能划分,如包括收发单元和处理单元,收发单元用于执行收发步骤,处理单元用于执行收发步骤之外的其他步骤。在另一种实现方式中,该配置交换器包括存储器和一个或多个处理器,存储器用于存储计算机指令,处理器用于调用所述计算机指令,以执行上文中任意一个实施例提供的方法中配置交换器所执行的步骤。The embodiment of the present application also provides a configuration switch for executing the steps performed by the configuration switch in the method provided in any one of the embodiments above. In one implementation, the configuration switch can be divided into logical functions, such as including a transceiver unit and a processing unit, the transceiver unit is used to execute the transceiver step, and the processing unit is used to execute other steps other than the transceiver step. In another implementation, the configuration switch includes a memory and one or more processors, the memory is used to store computer instructions, and the processor is used to call the computer instructions to execute the steps performed by the configuration switch in the method provided in any one of the embodiments above.

本申请实施例还提供了一种网络接口,包括用于实现上述第一网络接口功能的控制电路和/或实现第二网络接口功能的控制电路,以及一个或多个端口。An embodiment of the present application further provides a network interface, including a control circuit for implementing the above-mentioned first network interface function and/or a control circuit for implementing the second network interface function, and one or more ports.

本申请实施例还提供了一种配置交换器,包括用于实现上述配置交换器功能的控制电路,以及一个或多个端口。An embodiment of the present application also provides a configuration switch, including a control circuit for implementing the above-mentioned configuration switch function, and one or more ports.

本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行上文提供的任一种网络接口所执行的方法,或者配置交换器所执行的方法。An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a computer, the computer executes any method performed by the network interface provided above, or the method performed by the configuration switch.

关于上述提供的任一种网络接口和配置交换器中相关内容的解释及有益效果的描述,均可以参考上述对应的实施例,此处不再赘述。For explanations of the relevant contents and descriptions of the beneficial effects of any of the network interfaces and configuration switches provided above, reference may be made to the corresponding embodiments described above, and no further details will be given here.

本申请实施例还提供了一种芯片。该芯片中集成了用于实现上述数据传输装置的功能的控制电路和一个或者多个端口。可选的,该芯片支持的功能可以参考上文,此处不再赘述。本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可通过程序来指令相关的硬件完成。所述的程序可以存储于一种计算机可读存储介质中。上述提到的存储介质可以是只读存储器,随机接入存储器等。上述处理单元或处理器可以是中央处理器,通用处理器、特定集成电路(application specific integrated circuit,ASIC)、微处理器(digital signal processor,DSP),现场可编程门阵列(field programmable gatearray,FPGA)或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。The embodiment of the present application also provides a chip. The chip integrates a control circuit and one or more ports for realizing the functions of the above-mentioned data transmission device. Optionally, the functions supported by the chip can be referred to above and will not be repeated here. A person of ordinary skill in the art can understand that all or part of the steps of implementing the above-mentioned embodiment can be completed by instructing the relevant hardware through a program. The program can be stored in a computer-readable storage medium. The storage medium mentioned above can be a read-only memory, a random access memory, etc. The above-mentioned processing unit or processor can be a central processing unit, a general-purpose processor, an application specific integrated circuit (ASIC), a microprocessor (digital signal processor, DSP), a field programmable gate array (field programmable gatearray, FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof.

本申请实施例还提供了一种包含指令的计算机程序产品,当该指令在计算机上运行时,使得计算机执行上述实施例中的任意一种方法。该计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行计算机程序指令时,全部或部分地产生按照本申请实施例的流程或功能。计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,计算机指令可以从一个网站站点、计算机、服务器或者数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可以用介质集成的服务器、数据中心等数据存储设备。可用介质可以是磁性介质(例如,软盘、硬盘、磁带),光介质(例如,DVD)、或者半导体介质(例如SSD)等。The embodiment of the present application also provides a computer program product including instructions, when the instructions are run on a computer, the computer executes any one of the methods in the above embodiments. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may 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 computer instructions may be transmitted from a website site, a computer, a server, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means to another website site, computer, server, or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server, a data center, etc. that includes one or more servers that can be integrated with the medium. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., an SSD), etc.

应注意,本申请实施例提供的上述用于存储计算机指令或者计算机程序的器件,例如但不限于,上述存储器、计算机可读存储介质和通信芯片等,均具有非易失性(non-transitory)。It should be noted that the above-mentioned devices for storing computer instructions or computer programs provided in the embodiments of the present application, such as but not limited to the above-mentioned memories, computer-readable storage media, and communication chips, etc., are all non-transitory.

在实施所要求保护的本申请过程中,本领域技术人员通过查看附图、公开内容、以及所附权利要求书,可理解并实现公开实施例的其他变化。在权利要求中,“包括”(comprising)一词不排除其他组成部分或步骤,“一”或“一个”不排除多个的情况。单个处理器或其他单元可以实现权利要求中列举的若干项功能。相互不同的从属权利要求中记载了某些措施,但这并不表示这些措施不能组合起来产生良好的效果。尽管结合具体特征及其实施例对本申请进行了描述,在不脱离本申请的精神和范围的情况下,可对其进行各种修改和组合。相应地,本说明书和附图仅仅是所附权利要求所界定的本申请的示例性说明,且视为已覆盖本申请范围内的任意和所有修改、变化、组合或等同物。In the process of implementing the claimed application, those skilled in the art can understand and implement other changes to the disclosed embodiments by viewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "one" or "an" does not exclude multiple situations. A single processor or other unit can implement several functions listed in the claims. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results. Although the present application is described in conjunction with specific features and embodiments thereof, various modifications and combinations may be made to it without departing from the spirit and scope of the present application. Accordingly, this specification and the drawings are merely exemplary illustrations of the present application as defined by the appended claims, and are deemed to have covered any and all modifications, changes, combinations or equivalents within the scope of the present application.

Claims (16)

1. A data transmission apparatus, the data transmission apparatus being applied to a neural network system, the data transmission apparatus comprising:
The router is used for sending a data packet to the first network interface, wherein the data packet comprises identifiers of a plurality of destination network interfaces;
the first network interface is configured to: receiving the data packet sent by the router and broadcasting the data packet in a first subnet, wherein the first subnet comprises the first network interface and a plurality of second network interfaces, the plurality of second network interfaces comprise the plurality of destination network interfaces, the first network interface is a network interface for broadcasting the data packet in the first subnet, and the second network interface is a network interface for receiving the broadcasted data packet in the first subnet;
The plurality of second network interfaces are used for receiving the data packet sent by the first network interface, wherein the plurality of destination network interfaces are also used for forwarding the data packet to a corresponding processing node according to the identification of the destination network interface in the data packet, and other network interfaces except the plurality of destination network interfaces in the plurality of second network interfaces are also used for discarding the data packet according to the identification of the plurality of destination network interfaces.
2. The data transmission apparatus according to claim 1, wherein: the first network interface is configured to broadcast the data packet to the plurality of second network interfaces in the first subnet according to the identifiers of the plurality of destination network interfaces.
3. The data transmission apparatus according to claim 1, wherein: the first network interface is configured to broadcast the data packet to the plurality of second network interfaces in the first subnet according to a broadcast identifier included in the data packet.
4. A data transmission device according to any one of claims 1 to 3, wherein: the data packet further includes an identification of the first subnet;
the router is configured to send the data packet to the first network interface according to the first subnet identification.
5. The data transmission apparatus according to claim 1, wherein: the data transmission device further comprises a third network interface, and the router is further used for communicating with the third network interface, wherein the third network interface is a network interface in a second subnet, and the second subnet comprises the third network interface and a plurality of fourth network interfaces.
6. The data transmission device of claim 5, wherein: part of the network interfaces in the first subnetwork also belong to the second subnetwork.
7. A data transmission device according to claim 5 or 6, characterized in that: the data transmission device further comprises a plurality of configuration switches;
A first configuration switch of the plurality of configuration switches is connected to the first network interface and is configured to receive the data packet sent by the first network interface, and send the data packet to other configuration switches in the first subnetwork connected to the plurality of second network interfaces.
8. The data transmission apparatus according to claim 7, wherein: each configuration switch of the plurality of configuration switches comprises a plurality of ports, a first port of the plurality of ports being for connecting to one network interface, and other network interfaces of the plurality of ports being for connecting to other configuration switches;
Each of the plurality of configuration switches is further configured to control a connection or disconnection state between the plurality of ports of itself based on configuration information.
9. The data transmission apparatus according to claim 1, wherein: the data transmission device is a neural network chip, and the processing node is a processing node in the neural network.
10. The data transmission apparatus according to claim 9, wherein:
the first network interface comprises a network interface connected with a first processing node of a first neural network layer in the neural network chip, and the plurality of second network interfaces comprises a network interface connected with a plurality of second processing nodes of a second neural network layer, wherein the first processing node is used for transmitting data to the plurality of second processing nodes.
11. The data transmission device according to claim 9 or 10, characterized in that: the data volume of the data packets transmitted between the network interfaces in the first subnetwork is greater than a first threshold.
12. A data transmission method, wherein the data transmission method is applied to a neural network system, the method comprising:
The method comprises the steps that a first network interface receives a data packet sent by a router, wherein the data packet comprises identifiers of a plurality of destination network interfaces;
the first network interface broadcasts the data packet in a first sub-network, wherein the first sub-network comprises the first network interface and a plurality of second network interfaces, the plurality of second network interfaces comprise the plurality of destination network interfaces, the first network interface is a network interface for broadcasting the data packet in the first sub-network, and the second network interface is a network interface for receiving the broadcasted data packet in the first sub-network;
The plurality of destination network interfaces forward the data packet to corresponding processing nodes according to the identifiers of the destination network interfaces in the data packet;
and discarding the data packet according to the identification of the destination network interface in the data packet by other network interfaces except the destination network interfaces in the second network interfaces.
13. The method according to claim 12, wherein: the first network interface broadcasts the data packet into a first subnet, comprising:
The first network interface broadcasts the data packet to the plurality of second network interfaces in the first subnet according to the identifiers of the plurality of destination network interfaces.
14. The method according to claim 12, wherein: the first network interface broadcasts the data packet into a first subnet, comprising:
The first network interface broadcasts the data packet to the plurality of second network interfaces in the first subnet according to the broadcast identification in the data packet.
15. A data transmission method, wherein the data transmission method is applied to a neural network system, a first subnet includes a first network interface and a plurality of second network interfaces, the first network interface is a network interface for broadcasting data packets in the first subnet, and the second network interface is a network interface for receiving the broadcasted data packets in the first subnet, the method comprising:
The second network interface receives a data packet broadcast by the first network interface, wherein the data packet comprises identifiers of a plurality of destination network interfaces;
The second network interface forwards the data packet to a corresponding processing node when determining that the identification of the destination network interface in the data packet comprises the identification of the second network interface; or (b)
And discarding the data packet by the second network interface when the identification of the destination network interface in the data packet is determined not to comprise the identification of the second network interface.
16. A network interface for use in a neural network system, the network interface comprising:
the receiving unit is used for receiving a data packet broadcast by the first network interface, wherein the data packet comprises identifiers of a plurality of destination network interfaces;
A processing unit, configured to forward the data packet to a corresponding processing node when it is determined that the identifier of the destination network interface in the data packet includes the identifier of the second network interface; or discarding the data packet when the identification of the destination network interface in the data packet is determined not to include the identification of the second network interface;
The first subnet comprises the first network interface and a plurality of the second network interfaces, the first network interface is a network interface for broadcasting data packets in the first subnet, and the second network interface is a network interface for receiving the broadcasted data packets in the first subnet.
CN202010820611.6A 2020-08-14 2020-08-14 Data transmission device and method Active CN114079627B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010820611.6A CN114079627B (en) 2020-08-14 2020-08-14 Data transmission device and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010820611.6A CN114079627B (en) 2020-08-14 2020-08-14 Data transmission device and method

Publications (2)

Publication Number Publication Date
CN114079627A CN114079627A (en) 2022-02-22
CN114079627B true CN114079627B (en) 2024-07-09

Family

ID=80280805

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010820611.6A Active CN114079627B (en) 2020-08-14 2020-08-14 Data transmission device and method

Country Status (1)

Country Link
CN (1) CN114079627B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101322358A (en) * 2005-11-26 2008-12-10 考科尼散思有限公司 Data transmission method
CN103607352A (en) * 2013-11-22 2014-02-26 上海电机学院 Multicast routing method based on network topology

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102368739A (en) * 2011-12-02 2012-03-07 南京大学 Broadcast mechanism routing algorithm orienting to packet-circuit switch on-chip router
US9467372B2 (en) * 2013-11-26 2016-10-11 Pismo Labs Technology Limited Methods and systems for processing internet protocol packets
CN103729331B (en) * 2013-11-26 2019-04-12 西安电子科技大学 Network-on-chip communication deadlock avoiding method, router and communication network
CN104579697B (en) * 2015-01-23 2019-03-01 北京立华莱康平台科技有限公司 Network expansion module and Multi net voting processing system
CN107872332B (en) * 2016-09-23 2020-12-22 华为技术有限公司 A kind of detection method and related device of message forwarding path
US10721338B2 (en) * 2017-07-31 2020-07-21 Nicira, Inc. Application based egress interface selection
CN110266614B (en) * 2018-03-12 2020-12-04 大唐移动通信设备有限公司 Ethernet data exchange method and device
CN110324265B (en) * 2018-03-29 2021-09-07 阿里巴巴集团控股有限公司 Traffic distribution method, routing method, equipment and network system
CN109873771B (en) * 2019-01-21 2022-04-12 佛山市顺德区中山大学研究院 On-chip network system and communication method thereof
CN109639574B (en) * 2019-01-30 2021-02-09 四川省电子信息产业技术研究院有限公司 Self-adaptive multicast routing method
CN111245730B (en) * 2020-01-15 2021-10-08 中山大学 A kind of routing system and communication method of network-on-chip

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101322358A (en) * 2005-11-26 2008-12-10 考科尼散思有限公司 Data transmission method
CN103607352A (en) * 2013-11-22 2014-02-26 上海电机学院 Multicast routing method based on network topology

Also Published As

Publication number Publication date
CN114079627A (en) 2022-02-22

Similar Documents

Publication Publication Date Title
US9590813B1 (en) Supporting multicast in NoC interconnect
CN105450555B (en) A kind of method for building up of network-on-a-chip and network-on-chip communication link
US9825809B2 (en) Dynamically configuring store-and-forward channels and cut-through channels in a network-on-chip
US9477280B1 (en) Specification for automatic power management of network-on-chip and system-on-chip
CN109873771B (en) On-chip network system and communication method thereof
CN102685017A (en) On-chip network router based on field programmable gate array (FPGA)
JP6383793B2 (en) A cache-coherent network-on-chip (NOC) having a variable number of cores, input/output (I/O) devices, directory structures, and coherency points.
US10313269B2 (en) System and method for network on chip construction through machine learning
WO2024098869A1 (en) Communication method and apparatus
WO2022121707A1 (en) Packet transmission method, device, and system
CN116915708A (en) Method for routing data packets, processor and readable storage medium
CN114584510B (en) Routing with fixed match switches
CN114079627B (en) Data transmission device and method
CN119583431A (en) Method for constructing network topology structure, data transmission method, electronic device, and computer program product
CN114978859A (en) Network-on-chip architecture, related equipment and data transmission system
CN117176834A (en) A message sending and receiving method, network card and computing device
CN113225241A (en) Data transmission congestion control method and system for ring-shaped data message network
CN118748654A (en) Data packet sending method, device, electronic device and readable storage medium
CN114079634A (en) A message forwarding method, device and computer-readable storage medium
CN103152275A (en) Router suitable for network on chip and allowable for configuring switching mechanisms
WO2024060730A1 (en) Traffic control method and device
CN112583746B (en) Cell transmission method and device, storage medium and electronic device
CN115955429B (en) Routing method, device, system and electronic equipment of network on chip
CN116821044B (en) Processing system, access method and computer readable storage medium
CN119767175B (en) A peer-to-peer optical interconnection circuit switching networking method and system based on DPU

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant