WO2020200113A1 - Network device - Google Patents

Network device Download PDF

Info

Publication number
WO2020200113A1
WO2020200113A1 PCT/CN2020/081750 CN2020081750W WO2020200113A1 WO 2020200113 A1 WO2020200113 A1 WO 2020200113A1 CN 2020081750 W CN2020081750 W CN 2020081750W WO 2020200113 A1 WO2020200113 A1 WO 2020200113A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
interface
conversion device
main control
message
Prior art date
Application number
PCT/CN2020/081750
Other languages
French (fr)
Chinese (zh)
Inventor
丁元翕
慕长林
Original Assignee
新华三技术有限公司
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 新华三技术有限公司 filed Critical 新华三技术有限公司
Publication of WO2020200113A1 publication Critical patent/WO2020200113A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols

Definitions

  • Network equipment (such as routers, switches, firewalls, etc.) includes a main control board and an interface board.
  • the main control board can include PCI-E (Peripheral Component Interconnect Express) interfaces, and the interface board can also include PCI-E (Peripheral Component Interconnect Express) interfaces.
  • E interface based on this, the main control board can be connected to the interface board through the PCI-E bus, that is, both sides of the PCI-E bus are PCI-E interfaces.
  • the interface board does not have a PCI-E interface, but has a low-speed interface (such as a local bus interface).
  • the conversion device has a PCI-E interface and a low-speed interface
  • the main control board is connected to the conversion device through a PCI-E bus
  • the interface board is connected to the conversion device through a low-speed bus (such as a local bus).
  • the main control board in order to read data 1-data 10 from the interface board, the main control board sends a read command to the conversion device, and the conversion device reads data 1 from the interface board and returns data 1 to the main control board. After the main control board obtains data 1, it sends a read command to the conversion device. The conversion device reads data 2 from the interface board, and returns data 2 to the main control board, and so on, until data 1-data is successfully read 10.
  • FIG. 1 is a schematic diagram of the hardware structure of a network device in an embodiment of the present application
  • 2A is a schematic diagram of the hardware structure of a conversion device in an embodiment of the present application.
  • 2B is a schematic diagram of the hardware structure of the conversion device in another embodiment of the present application.
  • FIG. 2C is a schematic diagram of the hardware structure of the conversion device in another embodiment of the present application.
  • FIG. 2D is a schematic diagram of the hardware structure of a conversion device in another embodiment of the present application.
  • 2E is a schematic diagram of the hardware structure of the conversion device in another embodiment of the present application.
  • FIG. 3 is a schematic flowchart of a data transmission method in an embodiment of the present application.
  • the network device may include a main control board, an interface board, and a conversion device.
  • FIG. 1 it is a schematic structural diagram of the network device.
  • the network device may include, but is not limited to: a main control board 10, a conversion device 20, an interface board 30, and an interface board 40.
  • the main control board 10 can be connected to the interface board 40, the main control board 10 can also be connected to the conversion device 20, and the conversion device 20 can be connected to the interface board 30.
  • the conversion device 20 and the main control board 10 may be deployed on the same single board, that is, a single board includes the conversion device 20 and the main control board 10 at the same time.
  • the conversion device 20 may be deployed on a separate single board, that is, the conversion device 20 and the main control board 10 are deployed on different single boards.
  • the position of the conversion device 20 is not limited.
  • the conversion device 20 may also be deployed on the same single board as the interface board 30, or, for network equipment including a main control board, a network board, and an interface board, the conversion device 20 may also be deployed on the same single board as the network board. There is no restriction on this.
  • the description is given by taking the conversion device 20 deployed on a separate single board as an example.
  • the main control board 10 includes a CPU (Central Processing Unit) implemented based on SOC (System on Chip), and the CPU communicates with the interface board 30/interface board 40, that is, to the interface board 30/interface board 40 writes data, and reads data from the interface board 30/interface board 40.
  • a CPU Central Processing Unit
  • SOC System on Chip
  • some interface boards have high-speed interfaces (such as PCI-E interfaces, SGMII (Serial Gigabit Media Independent, serial Gigabit Media Independent) interfaces, etc.).
  • -E interface is taken as an example for description
  • the main control board 10 has a PCI-E interface
  • the main control board 10 and the interface board 40 are directly connected, that is, the main control board 10 and the interface board 40 can pass through a high-speed bus (
  • PCI-E bus such as PCI-E bus, SGMII bus, etc., in Fig. 1, the PCI-E bus is taken as an example for illustration
  • some interface boards can have low-speed interfaces (such as local bus interface, TDM (Time Division Multiplexing, time division multiplexing) interface, etc.).
  • the local bus interface Take an example for description), but it does not have a PCI-E interface. Since the main control board 10 has a PCI-E interface but does not have a local bus interface, the main control board 10 can be connected to the interface board 30 through the conversion device 20. In other words, the main control board 10 is not directly connected to the interface board 30.
  • the conversion device 20 can have a PCI-E interface and a local bus interface. Therefore, the conversion device 20 can be connected to the main control board 10 through the PCI-E interface, that is, the conversion device 20 and the main control board 10 can be connected through the PCI-E interface. -E bus connection.
  • the conversion device 20 can be connected to the interface board 30 through a local bus interface, that is, the conversion device 20 and the interface board 30 can be connected through a low-speed bus (such as a local bus, a TDM bus, etc.).
  • the local bus is taken as an example in FIG. Description) Connect.
  • the communication process between the main control board 10 and the interface board 40 may include: the main control board 10 writes data to the interface board 40 via the PCI-E bus, and the main control board 10 uses the PCI-E bus The data is read from the interface board 40, and the data writing process and the data reading process will not be repeated.
  • the communication process between the main control board 10 and the interface board 30 may include: the main control board 10 sends data to the conversion device 20 through the PCI-E bus, and the conversion device 20 writes data to the interface board 30 through the local bus. This data writing process will not be repeated.
  • the main control board 10 sends a read command to the conversion device 20 via the PCI-E bus.
  • the conversion device 20 reads data from the interface board 30 via the local bus, and returns the data to the main control board 10 via the PCI-E bus. In the example, this data reading process is introduced.
  • the main control board 10 sends a read command to the conversion device 20, and the conversion device 20 reads the data from the interface board 30 through the local bus.
  • the data bit width of the local bus is 8. Therefore, the conversion device 20 only reads 8-bit data from the interface board 30 and sends the data to the main control board 10. After the main control board 10 receives the 8-bit data, if the main control board 10 has not read all the data currently, it continues to send the read command to the conversion device 20, and so on.
  • the main control board 10 needs to send 10 read commands, the conversion device 20 reads data from the interface board 30 10 times, and the conversion device 20 sends data to the main control board 10 10 times. Obviously, the data reading operation takes a long time. During this period of time, the main control board 10 is always occupied and cannot process other tasks. Other tasks can only wait, which wastes the resources of the main control board 10.
  • the main control board 10 sends a read command to the conversion device 20, and the conversion device 20 reads data from the interface board 30 through the local bus, and reads the data continuously N times, assuming that N is 5. Then the conversion device 20 reads the data from the interface board 30 continuously 5 times. Since the data bit width of the local bus is 8 bits, the conversion device 20 reads 8 bits of data from the interface board 30 every time, reads 40 bits of data 5 times, and sends the 40 bits of data to the main control board 10. . The main control board 10 sends a read command to the conversion device 20 again, and the conversion device 20 continuously reads data from the interface board 30 N times, and so on.
  • the main control board 10 needs to send read commands twice, the conversion device 20 reads data from the interface board 30 10 times, and the conversion device 20 sends data to the main control board 10 twice.
  • the number of times that the main control board 10 sends read commands is significantly reduced, and the number of times the conversion device 20 sends data to the main control board 10 is significantly reduced, thereby reducing the time consumed for data reading operations and saving the main control board. 10 resources to improve bandwidth utilization and improve the overall performance of network equipment.
  • an embodiment of the present application proposes a conversion device.
  • the conversion device can be applied to a network device.
  • the network device can also include a main control board (such as a main control board with a first type interface) and an interface board (for example, an interface board with a second type of interface), the conversion device may include a first type of interface and a second type of interface, the conversion device is connected to the main control board through the first type of interface, and the conversion device is connected to the interface board through the second type of interface connection.
  • the first type of interface can be a high-speed interface (such as PCI-E interface, SGMII interface, etc., in Figure 1 taking the PCI-E interface as an example)
  • the second type of interface can be a low-speed interface (such as local bus interface , TDM interface, etc., take the local bus interface as an example in Figure 1 for illustration).
  • the conversion device 20 includes but is not limited to: a message processing unit 21, a determination unit 22, a continuous reading operation unit 23, and a cycle counter 24.
  • the message processing unit 21 is configured to receive a first data message from the main control board 10, obtain a decision parameter from the first data message, and output the decision parameter to the determination unit twenty two.
  • the determining unit 22 is configured to output the first command to the continuous reading operation unit 23 when the decision parameter is the first decision parameter.
  • the loop counter 24 is used to store the number of data reads N, where N is a positive integer greater than 1.
  • the continuous read operation unit 23 is configured to read the number of data reads N from the cycle counter 24 after receiving the first command, and send N read operation commands to the interface board 30, so that the interface board 30 can respond to the N
  • the read operation command returns N data.
  • the message processing unit 21 is further configured to obtain data information of N pieces of data, encapsulate the data information into a second data message, and send the second data message to the main control board 10.
  • the message processing unit 21 is further configured to obtain the number of data reads from the first data message, and send the number of data reads to the loop counter 24, so that the loop The counter 24 stores the number of times the data is read.
  • the message processing unit 21 is further configured to determine the number of data reads according to the data carrying length of the first type of interface and the data carrying length of the second type of interface, and send the number of data reads to the loop counter 24 to The loop counter 24 is caused to store the number of data reads.
  • the message processing unit 21 determines the number of data reads according to the data carrying length of the first type of interface and the data carrying length of the second type of interface, which is specifically used to: obtain the interface type of the first type of interface, and determine the interface type with the first type of interface.
  • the first data carrying length corresponding to the interface type of the class interface; the interface type of the second class interface is obtained, and the second data carrying length corresponding to the interface type of the second class interface is determined; then, the first data carrying length and The second data carrying length determines the number of data reads.
  • the conversion device 20 may further include: multiple sets of data assembling units 25.
  • the multiple data assembling unit 25 is configured to receive N pieces of data returned by the interface board 30, compose the N pieces of data into payload data, and send the payload data to the message processing unit 21.
  • the message processing unit 21 can receive the payload data and encapsulate the payload data into a second data message.
  • the message processing unit 21 is configured to obtain data information of N pieces of data, and encapsulate the data information into a second data message. Specifically, if the conversion device 20 does not include multiple sets of data assembling units 25, the data information of the N data is the N data itself returned by the interface board, and the message processing unit 21 can obtain the N data returned by the interface board, and N pieces of data form payload data, and the payload data is encapsulated into a second data message. If the conversion device 20 includes multiple sets of data assembling units 25, the data information of the N pieces of data is the load data sent by the multiple sets of data assembling units 25, and the message processing unit 21 can obtain the load data and encapsulate the load data into The second data message.
  • the conversion device 20 may further include: a single read operation unit 26.
  • the determining unit 22 is further configured to output a second command to the single read operation unit 26 when the decision parameter is the second decision parameter.
  • the single read operation unit 26 is configured to send a read operation command to the interface board 30 after receiving the second command, so that the interface board 30 returns a piece of data according to a read operation command.
  • the message processing unit 21 is further configured to obtain data information of the data, encapsulate the data information into a third data message, and send the third data message to the main control board 10.
  • the conversion device 20 may further include: a single set of data assembling unit 27.
  • the single-group data assembling unit 27 is configured to receive a piece of data returned by the interface board 30, compose the data into load data, and send the load data to the message processing unit 21.
  • the message processing unit 21 can receive the payload data and encapsulate the payload data into a third data message.
  • the message processing unit 21 is configured to obtain data information of one piece of data, and encapsulate the data information into a third data message. Specifically, if the conversion device 20 does not include a single set of data assembling unit 27, the data information of a piece of data is a piece of data itself returned by the interface board, and the message processing unit 21 can obtain a piece of data returned by the interface board and compose the data. Load data, and encapsulate the load data into a third data message.
  • the conversion device 20 includes a single set of data assembling unit 27, the data information of a piece of data is the load data sent by the single set of data assembling unit 27, and the message processing unit 21 can obtain the load data and encapsulate the load data into the first Three data messages.
  • the conversion device 20 may further include: an interrupt processing unit 28.
  • the interrupt processing unit 28 is configured to, when receiving an interrupt sent by the interface board 30, send the interrupt to the main control board 10, so that the main control board 10 sends the above-mentioned first data message. Based on this, the message processing unit 21 can receive the first data message from the main control board 10, and then realize data transmission through the cooperation of various units.
  • the decision parameter when the decision identifier in the data read address is the first value, then the decision parameter is the first decision parameter; when the decision identifier in the data read address is the second value, then The decision parameter is the second decision parameter.
  • the conversion device reads N data from the interface board, where N is a positive integer greater than 1, instead of reading one data from the interface board, so that N data is read at a time. N data are sent to the main control board.
  • N data are sent to the main control board.
  • the time spent in data reading operations can be reduced, and the main control board can be prevented from being occupied by data reading operations for a long time, saving main control board resources, improving bandwidth utilization, improving the efficiency of the main control board obtaining data, and improving the overall network equipment Performance, reduce the occupancy rate of the main control board, save the occupancy time of the main control board, improve data acquisition efficiency, and occupy less logic resources of the conversion device.
  • the conversion device 20 may include: a message processing unit 21, a judging unit 22, a continuous read operation unit 23, a cycle counter 24, a multiple data assembly unit 25, a single read operation unit 26, and a single set of data assembly Unit 27 and interrupt processing unit 28.
  • the continuous read operation unit 23, the cycle counter 24, and the multiple sets of data assembling unit 25 belong to the accelerated logic channel, which is used to implement accelerated reading, that is, for each read command of the interface board 30, read multiple times from the interface board 30 data.
  • the single read operation unit 26 and the single set of data assembling unit 27 belong to non-accelerated logical channels, and there is no need to implement accelerated reading, that is, for each read command of the interface board 30, data is read from the interface board 30 once.
  • the conversion device 20 may include, but is not limited to, a logic chip, such as FPGA (Field Programmable Gate Array), CPLD (Complex Programmable Logic Device), ASIC (Application Specific Integrated Circuit), etc., there is no specific restriction on the type of the conversion device 20.
  • a logic chip such as FPGA (Field Programmable Gate Array), CPLD (Complex Programmable Logic Device), ASIC (Application Specific Integrated Circuit), etc.
  • the interface board 30 when the interface board 30 has data to be read (that is, data that needs to be sent to the main control board 10), the interface board 30 sends an interrupt to the interrupt processing unit 28 of the conversion device 20 through the interrupt channel. After receiving the interrupt, the processing unit 28 forwards the interrupt to the main control board 10 through the interrupt channel.
  • the main control board 10 After receiving the interrupt, the main control board 10 determines that it needs to read data from the interface board 30. In order to read data from the interface board 30, the main control board 10 may send a first data message to the message processing unit 21 of the conversion device 20, and the first data message may be a TLP (Transaction Layer Interface, transaction layer interface) Message. Of course, the first data message may also be other types of messages, and there is no restriction on this.
  • TLP Transaction Layer Interface, transaction layer interface
  • the first data message may carry a decision parameter, which indicates whether to accelerate the data reading operation. For example, if the main control board 10 determines to accelerate the data reading operation, add the first decision parameter that needs to accelerate the data reading operation in the first data message; if the main control board 10 determines not to perform the data reading The operation is accelerated, and a second decision parameter that does not require accelerated processing of the data reading operation is added to the first data message.
  • the main control board 10 may determine whether to accelerate the data reading operation according to the data type of the data to be read. For example, if the data type of the data to be read is business data, the main control board 10 may determine to accelerate the data reading operation, that is, the first data packet may carry the first decision parameter; or, if the data to be read is If the data type of the fetched data is control data, the main control board 10 may determine not to accelerate the data reading operation, that is, the first data message may carry the second decision parameter.
  • control data such as the state value of a status register of the interface board 30
  • the control data is usually relatively small, such as 8 bits, and the control data can be completed through one or a few reading processes. Therefore, if the data type of the data to be read is control data, the main control board 10 determines not to accelerate the data reading operation.
  • business data such as data sent by other network devices to the interface board 30, etc.
  • business data is usually relatively large, such as tens of thousands of bits. After multiple reading processes, the reading of business data can be completed. If the data type of the data to be read is business data, the main control board 10 determines to accelerate the data reading operation.
  • accelerated processing is not performed for control data, and accelerated processing for business data, so that control data and business data do not affect each other, can ensure the efficiency of control data acquisition, and ensure the acquisition of business data
  • the high efficiency greatly improves the reading efficiency of business data.
  • the packet processing unit 21 receives the first data packet. Since the first data message carries the decision parameter, the message processing unit 21 obtains the decision parameter from the first data message and outputs the decision parameter to the determination unit 22.
  • the decision parameter can be the first decision parameter or the first decision parameter. 2. Decision-making parameters.
  • the determining unit 22 receives the decision parameter, if the decision parameter is the first decision parameter, the determining unit 22 outputs the first command to the continuous reading operation unit 23. If the decision parameter is the second decision parameter, the determination unit 22 outputs the second command to the single read operation unit 26.
  • the decision parameters included in the first data message may be implemented in the following manner:
  • Manner 1 Carry the decision identifier in the designated field of the first data message.
  • the decision identifier When the decision identifier is the first value, it represents the first decision parameter for accelerating the data reading operation, and when the decision identifier is the second value, it represents the second decision parameter for not accelerating the data reading operation.
  • the determination unit 22 can determine that the decision parameter is the first decision parameter; if the decision identifier is the second value, the decision parameter is determined to be the second decision parameter.
  • the main control board 10 when the main control board 10 determines to perform accelerated processing on the data reading operation, the main control board 10 adds the first value to the designated field of the first data message. When the main control board 10 determines not to accelerate the data reading operation, the main control board 10 adds the second value to the designated field of the first data message.
  • the designated field can be any field of the first data message, and there is no restriction on this.
  • the first data message may include a data field (ie, data field).
  • the decision identifier can be carried by the data field of the first data message.
  • the data read address in the first data message carries the decision identifier.
  • the decision identifier in the data read address is the first value, it means the first decision parameter for accelerating the data read operation, and when the decision identifier in the data read address is the second value, it means that the data is not read Operate the second decision parameter for accelerated processing.
  • the determination unit 22 can determine that the decision parameter is the first decision parameter; if the decision identifier in the data read address is the second value, the determination unit 22 can Determine the decision parameter as the second decision parameter.
  • the data read address can be carried in the first data message, indicating that data needs to be read from this data read address.
  • the data read address in the first data message may carry the decision identifier.
  • the highest bit of the data read address is used to indicate the decision flag.
  • the second bit of the data read address is used to indicate the decision flag, which is not limited, and the highest bit of the data read address is used as an example in the following to indicate the decision flag.
  • the highest bit 1 in the data read address "10FFFH" can represent the decision flag.
  • the decision identifier is the value 1 (assuming the value 1 is the first value), it indicates the first decision parameter.
  • the most significant bit 2 in the data read address "20FFFH" can represent the decision flag.
  • the decision identifier is the value 2 (assuming the value 2 is the second value), it indicates the second decision parameter.
  • the value 0 in 10FFFH indicates the interface board for slot 0, and the "FFF" in 10FFFH indicates that data needs to be read from this address.
  • the value 0 in 20FFFH indicates the interface board for slot 0, and the "FFF” in 20FFFH indicates that data needs to be read from this address.
  • the loop counter 24 is used to store the number of data reads, and the number of data reads is recorded as N, where N is a positive integer greater than one.
  • the cycle counter 24 stores the number of data reads in the following manner:
  • Manner 1 When the main control board 10 sends a first data message to the message processing unit 21 of the conversion device 20, the first data message may carry the number N of data reads.
  • the message processing unit 21 may obtain the data read count N from the first data message, and send the data read count N to the loop counter 24. After receiving the number N of data reads, the loop counter 24 can store the number N of data reads.
  • the main control board 10 can determine the number of data reads N, and there is no restriction on the determination method.
  • the main control board 10 may obtain the interface type of the first type of interface, and determine the first data carrying length corresponding to the interface type of the first type of interface; obtain the interface type of the second type of interface, and determine the interface type with the second type of interface The second data carrying length corresponding to the interface type of, then, the number of data reading times N is determined according to the first data carrying length and the second data carrying length, and the number of data reading times N is added to the first data message.
  • the message processing unit 21 determines the number of data reads N according to the data carrying length of the first type of interface and the data carrying length of the second type of interface, and sends the number of data reads N to the loop counter 24 to make the loop
  • the counter 24 stores the number N of data reads. Specifically, the interface type of the first type of interface can be obtained, and the first data carrying length corresponding to the interface type of the first type of interface can be determined; the interface type of the second type of interface can be obtained, and the interface type of the second type of interface can be determined Corresponding second data carrying length; the number of data reads is determined according to the first data carrying length and the second data carrying length.
  • the message processing unit 21 may obtain the number of data reads N from the first data message. , And send the number of data reads N to the loop counter 24. If the first data message does not carry the data reading times N, the message processing unit 21 may determine the data reading times N according to the data carrying length of the first type interface and the data carrying length of the second type interface, and read the data The number N is sent to the loop counter 24.
  • Manner 3 According to the data carrying length of the first type interface and the data carrying length of the second type interface, determine the number of data reads N, and configure the number of data reads N to the loop counter 24. For example, the user can determine the number of data reading times N according to the data carrying length of the first type interface and the data carrying length of the second type interface, and configure the data reading times N to the loop counter 24.
  • Mode 1 Mode 2, and Mode 3
  • the number of data reading times N can be determined according to the data carrying length of the first type interface and the data carrying length of the second type interface, but the execution subject is different.
  • the corresponding relationship between the interface type of the first type of interface and the first data carrying length, and the corresponding relationship between the interface type of the second type of interface and the second data carrying length can be pre-configured, which is not limited.
  • the conversion device 20 is connected to the main control board 10 through the PCI-E interface, that is, the conversion device 20 sends a data message to the main control board 10 through the PCI-E interface, and the data carrying length of the data message is known, such as 32 One bit, that is, when the conversion device 20 sends a data message to the main control board 10, the data message carries a maximum of 32 bits of data, that is, the first data carrying length corresponding to the interface type of the first type of interface.
  • the conversion device 20 is connected to the interface board 30 through a local bus interface, that is, the conversion device 20 reads data from the interface board 30 through the local bus interface.
  • the data carrying length of the data to be read is known, such as 8 bits, that is, In other words, when the conversion device 20 reads data from the interface board 30, it can only read up to 8 bits of data at a time, that is, the second data carrying length corresponding to the interface type of the second type of interface.
  • the first data carrying length corresponding to the interface type of the first type interface/the second data carrying length corresponding to the interface type of the second type interface can be valued downward, and the value after the downward value
  • the value is the number of data reads N. For example, if the value of (32/8) is taken down, the number of data reads N is 4.
  • the continuous reading operation unit 23 of the conversion device 20 can continuously read data from the interface board 30 4 times, reading 8 bits each time, so that a total of 32 bits are read in 4 reading processes, because the data message A maximum of 32 bits of data can be carried. Therefore, all the read data (ie, 32 bits of data) can be added to the data message, and the data message can be sent to the main control board 10. Obviously, based on the above method, the data bandwidth of the data message can be fully utilized, and the efficiency of data transmission can be improved.
  • the first data carrying length and the second data carrying length refer to the length of the payload data, and do not include the length of the message header.
  • the data carrying length is the length of the payload data carried in the data message, and does not include the length of the header carried in the data message.
  • the above is only an example of determining the number of times N of data reads, and there is no restriction on the determination method. Moreover, in practical applications, the number of data reads N can also be dynamically adjusted according to different situations.
  • the continuous read operation unit 23 reads the number of data reads N from the cycle counter 24, and sends N read operation commands to the interface board 30, so that the interface board 30 returns N data to the multiple data assembling unit 25 according to N read operation commands.
  • the continuous read operation unit 23 continuously sends N read operation commands to the interface board 30, that is, reads data to the interface board 30 continuously N times.
  • the interface board 30 receives a read operation command, it returns a piece of data (such as 8-bit data) to the multiple data assembly unit 25 through the local bus interface. Since the interface board 30 can receive N read operation commands, the interface board 30 returns N data to the multiple data assembly unit 25 through the local bus interface.
  • the multiple sets of data assembling unit 25 can receive N pieces of data and compose the N pieces of data into payload data (that is, payload). For example, the N pieces of data are composed into payload data according to the order of each data, and then the payload data Sent to the message processing unit 21.
  • the conversion device 20 may include a buffer (buffer), and this buffer may store data in a FIFO (First Input First Output) manner.
  • buffer buffer
  • FIFO First Input First Output
  • the multi-group data assembling unit 25 receives a piece of data, it stores the currently received piece of data in the buffer, and then determines whether the number of data in the buffer reaches N. If it is not reached, wait for the next data reception. If it has been reached, obtain N data from the buffer, compose the N data into load data, send the load data to the message processing unit 21, and delete the N data from the buffer.
  • the message processing unit 21 After the message processing unit 21 receives the load data (that is, load data composed of N data, such as 32-bit load data), it encapsulates the load data into a second data message (such as a TLP message, which is based on PCI-E interface data message), and send the second data message to the main control board 10.
  • load data that is, load data composed of N data, such as 32-bit load data
  • a second data message such as a TLP message, which is based on PCI-E interface data message
  • the single read operation unit 26 after receiving the second command, sends a read operation command to the interface board 30, so that the interface board 30 sends a read operation command to the single group data assembly unit 27 according to the read operation command. Return a piece of data, such as 8-bit data.
  • the single read operation unit 26 may only send a read operation command to the interface board 30.
  • the interface board 30 may return a data to the single group data assembly unit 27 through the local bus interface.
  • the group data assembling unit 27 composes the piece of data into payload data (that is, payload), and then sends the payload data to the message processing unit 21.
  • the message processing unit 21 After the message processing unit 21 receives the payload data (that is, payload data composed of one piece of data, such as 8-bit payload data), it encapsulates the payload data into a third data message (such as a TLP message, which is based on PCI -E interface data message), and send the third data message to the main control board 10.
  • the payload data that is, payload data composed of one piece of data, such as 8-bit payload data
  • a third data message such as a TLP message, which is based on PCI -E interface data message
  • the number of times the main control board sends the first data message is significantly reduced, and the number of times the conversion device sends the second data message to the main control board is significantly reduced, thereby making full use of the second data message Effective bandwidth (for example, the second data message carries 32 bits of data instead of 8 bits of data, that is, carries data that needs several transmissions into one second data message), reducing data read operations Time-consuming, to avoid the main control board being occupied by data reading operations for a long time, save the resources of the main control board, improve bandwidth utilization, improve data acquisition efficiency, reduce the occupancy rate of the main control board, save the time occupied by the main control board, and increase
  • the overall performance of the network equipment occupies less logic resources of the conversion device.
  • the embodiment of the present application also proposes a network device, which may include a main control board, an interface board, and a conversion device.
  • the conversion device may be connected to the main control board through a first type interface, and the conversion device may be connected to the main control board through a second type interface.
  • the interface board is connected;
  • the main control board is used to send the first data message to the conversion device
  • the conversion device is used to obtain the decision parameter from the first data packet after receiving the first data packet; when the decision parameter is the first decision parameter, obtain the number of data reads N, where N is a positive value greater than 1. Integer, and send N read operation commands to the interface board;
  • Interface board used to return N data after receiving N read operation commands
  • the conversion device is also used to obtain data information of N pieces of data, encapsulate the data information into a second data message, and send the second data message to the main control board.
  • the conversion device may also be used to send a read operation command to the interface board when the decision parameter is the second decision parameter;
  • the interface board can also be used to return a data after receiving the read operation command
  • the conversion device can also be used to obtain data information of the data, encapsulate the data information into a third data message, and send the third data message to the main control board.
  • the conversion device and the main control board may be deployed on the same single board; or, the conversion device may be deployed on a separate single board.
  • the decision parameter when the decision identifier in the data read address is the first value, the decision parameter is the first decision parameter; when the decision identifier in the data read address is the second value , The decision parameter is the second decision parameter.
  • the message processing unit may also be used to obtain the number of data reads from the first data message, and send the number of data reads to the loop counter, so that the loop counter stores the data Number of reads; or,
  • the message processing unit can also be used to determine the number of data reads according to the data carrying length of the first type of interface and the data carrying length of the second type of interface, and send the number of data reads to the loop counter, so that the loop counter stores Number of data reads.
  • the conversion device when the conversion device obtains the number of data reads N, it is specifically used to: obtain the number of data reads N from the first data packet; or, according to the data carrying length of the first type of interface The data carrying length of the second type interface determines the number of data reads N.
  • the message processing unit is specifically used to obtain the first type when determining the number of data reading times N according to the data carrying length of the first type interface and the data carrying length of the second type interface.
  • the interface type of the interface and determine the first data carrying length corresponding to the interface type of the first type of interface; obtaining the interface type of the second type of interface, and determining the second data carrying length corresponding to the interface type of the second type of interface;
  • the number of data reads is determined according to the first data carrying length and the second data carrying length.
  • the conversion device may also include multiple sets of data assembling units, multiple sets of data assembling units, for receiving N pieces of data returned by the interface board, forming the N pieces of data into load data, and The payload data is sent to the message processing unit, so that the message processing unit encapsulates the payload data into a second data message.
  • this embodiment of the application also proposes a data transmission method that can be applied to network equipment.
  • the network equipment includes a main control board, an interface board, and a conversion device.
  • the conversion device passes the first type
  • the interface is connected to the main control board, and the conversion device is connected to the interface board through the second type of interface.
  • the method may include:
  • Step 301 The conversion device receives a first data message from the main control board, and obtains a decision parameter from the first data message.
  • Step 302 When the decision parameter is the first decision parameter, the conversion device obtains the number of data reads N, where N is a positive integer greater than 1, and sends N read operation commands to the interface board, so that the interface board performs the N read operations The command returns N data.
  • Step 303 The conversion device obtains data information of N pieces of data, encapsulates the data information into a second data packet, and sends the second data packet to the main control board.
  • the method further includes: when the decision parameter is the second decision parameter, the conversion device sends a read operation to the interface board Command, so that the interface board returns a piece of data according to the read operation command; the conversion device obtains the data information of the data, encapsulates the data information into a third data message, and sends the third data message to the main control board.
  • the decision parameter when the decision identifier in the data read address is the first value, the decision parameter is the first decision parameter; when the decision identifier in the data read address is the second value , The decision parameter is the second decision parameter.
  • acquiring the number of data reads N by the conversion device may include: acquiring the number of data reads N from the first data packet; or, according to the data carrying length of the first type of interface and The data carrying length of the second type of interface determines the number of data reads N.
  • the conversion device determines the number of data reading times N according to the data carrying length of the first type of interface and the data carrying length of the second type of interface, which may include: obtaining the interface of the first type of interface Type, determine the first data carrying length corresponding to the interface type of the first type of interface; obtain the interface type of the second type of interface, determine the second data carrying length corresponding to the interface type of the second type of interface; according to the first data carrying The length and the second data carrying length determine the number of data reads.
  • the conversion device obtains data information of N pieces of data, and encapsulates the data information into a second data message, which may include: receiving N pieces of data returned by the interface board and composing the N pieces of data Load data, encapsulate the load data into a second data message.
  • a typical implementation device is a computer.
  • the specific form of the computer can be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email receiving and sending device, and a game control A console, a tablet computer, a wearable device, or a combination of any of these devices.
  • the embodiments of the present application can be provided as methods, devices, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
  • a computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • these computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device,
  • the instruction device realizes the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operating steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so that the computer or other programmable equipment is executed
  • the instructions provide steps for implementing functions specified in a flow or multiple flows in the flowchart and/or a block or multiple blocks in the block diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Communication Control (AREA)

Abstract

Provided are a conversion apparatus, a network device, and a data transmission method. The conversion apparatus comprises a message processing unit, a determination unit, a cyclic counter and a continuous read operation unit. The message processing unit is used for receiving a first data message, acquiring a decision parameter from the first data message, and outputting the decision parameter to the determination unit; the determination unit is used for outputting a first command to the continuous read operation unit when the decision parameter is a first decision parameter; the cyclic counter is used for storing the number N of data reads; the continuous read operation unit is used for reading, after receiving the first command, the number N of data reads from the cyclic counter and sending N read operation commands to an interface board such that the interface board returns N pieces of data; and the message processing unit is used for acquiring data information of the N pieces of data, encapsulating the data information into a second data message and sending the second data message to a main control board. By means of the technical solution of the present application, main control board resources are economized.

Description

网络设备Internet equipment
本申请要求于2019年03月29日提交中国专利局、申请号为201910251463.8发明名称为“一种转换装置、网络设备及数据传输方法”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on March 29, 2019 with the application number 201910251463.8 and the invention title is "a conversion device, network equipment and data transmission method", the entire content of which is incorporated by reference In this application.
背景技术Background technique
网络设备(如路由器、交换机、防火墙等)包括主控板和接口板,主控板可以包括PCI-E(Peripheral Component Interconnect Express,外设部件互连标准快速)接口,接口板也可以包括PCI-E接口,基于此,主控板可以通过PCI-E总线与接口板连接,也就是说,该PCI-E总线的两侧均为PCI-E接口。Network equipment (such as routers, switches, firewalls, etc.) includes a main control board and an interface board. The main control board can include PCI-E (Peripheral Component Interconnect Express) interfaces, and the interface board can also include PCI-E (Peripheral Component Interconnect Express) interfaces. E interface, based on this, the main control board can be connected to the interface board through the PCI-E bus, that is, both sides of the PCI-E bus are PCI-E interfaces.
在某些应用场景下,接口板不具有PCI-E接口,而是具有低速接口(如本地总线接口),为了使主控板与接口板交互,则需要在主控板与接口板之间部署转换装置,该转换装置具有PCI-E接口和低速接口,主控板通过PCI-E总线与转换装置连接,接口板通过低速总线(如本地总线)与转换装置连接。In some application scenarios, the interface board does not have a PCI-E interface, but has a low-speed interface (such as a local bus interface). In order to enable the main control board to interact with the interface board, it needs to be deployed between the main control board and the interface board Conversion device, the conversion device has a PCI-E interface and a low-speed interface, the main control board is connected to the conversion device through a PCI-E bus, and the interface board is connected to the conversion device through a low-speed bus (such as a local bus).
在上述应用场景下,为了从接口板读取数据1-数据10,则主控板向转换装置发送读取命令,由转换装置从接口板读取数据1,将数据1返回给主控板。主控板在获取到数据1后,向转换装置发送读取命令,由转换装置从接口板读取数据2,将数据2返回给主控板,以此类推,直到成功读取数据1-数据10。In the above application scenario, in order to read data 1-data 10 from the interface board, the main control board sends a read command to the conversion device, and the conversion device reads data 1 from the interface board and returns data 1 to the main control board. After the main control board obtains data 1, it sends a read command to the conversion device. The conversion device reads data 2 from the interface board, and returns data 2 to the main control board, and so on, until data 1-data is successfully read 10.
附图简要说明Brief description of the drawings
为了更清楚地说明本申请实施例和现有技术的技术方案,下面对本申请实施例和现有技术中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the embodiments of the present application and the technical solutions of the prior art more clearly, the following briefly introduces the drawings that need to be used in the embodiments of the present application and the prior art. Obviously, the drawings in the following description are merely present For some of the embodiments of the application, for those of ordinary skill in the art, other drawings can be obtained from these drawings without creative work.
图1是本申请一种实施方式中的网络设备的硬件结构示意图;FIG. 1 is a schematic diagram of the hardware structure of a network device in an embodiment of the present application;
图2A是本申请一种实施方式中的转换装置的硬件结构示意图;2A is a schematic diagram of the hardware structure of a conversion device in an embodiment of the present application;
图2B是本申请另一种实施方式中的转换装置的硬件结构示意图;2B is a schematic diagram of the hardware structure of the conversion device in another embodiment of the present application;
图2C是本申请再一种实施方式中的转换装置的硬件结构示意图;FIG. 2C is a schematic diagram of the hardware structure of the conversion device in another embodiment of the present application;
图2D是本申请又一种实施方式中的转换装置的硬件结构示意图;FIG. 2D is a schematic diagram of the hardware structure of a conversion device in another embodiment of the present application;
图2E是本申请又一种实施方式中的转换装置的硬件结构示意图;2E is a schematic diagram of the hardware structure of the conversion device in another embodiment of the present application;
图3是本申请一种实施方式中的数据传输方法的流程示意图。FIG. 3 is a schematic flowchart of a data transmission method in an embodiment of the present application.
具体实施方式detailed description
为使本申请实施例的目的、技术方案、及优点更加清楚明白,以下参照附图并举实施例,对本申请实施例进一步详细说明。显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the following further describes the embodiments of the present application in detail with reference to the accompanying drawings and embodiments. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of this application.
本申请实施例中提出一种网络设备(如路由器、交换机、防火墙、服务器等),该网络设备可以包括主控板、接口板和转换装置。参见图1所示,为该网络设备的结构示意图,该网络设备可以包括但不限于:主控板10、转换装置20、接口板30和接口板40。其中,主控板10可以与接口板40连接,主控板10还可以与转换装置20连接,且转换装置20可以与接口板30连接。An embodiment of the application proposes a network device (such as a router, a switch, a firewall, a server, etc.). The network device may include a main control board, an interface board, and a conversion device. Referring to FIG. 1, it is a schematic structural diagram of the network device. The network device may include, but is not limited to: a main control board 10, a conversion device 20, an interface board 30, and an interface board 40. The main control board 10 can be connected to the interface board 40, the main control board 10 can also be connected to the conversion device 20, and the conversion device 20 can be connected to the interface board 30.
在一种可实现方式中,转换装置20与主控板10可以部署在同一个单板,也就是说,一个单板同时包括转换装置20与主控板10。或者,转换装置20可以部署在单独的单板,即转换装置20与主控板10部署在不同的单板。当然,上述只是两个示例,对转换装置20的位置不做限制。例如,转换装置20还可以与接口板30部署在同一个单板,或者,针对包括主控板、网板和接口板的网络设备,转换装置20还可以与网板部署在同一个单板,对此不做限制。In an implementation manner, the conversion device 20 and the main control board 10 may be deployed on the same single board, that is, a single board includes the conversion device 20 and the main control board 10 at the same time. Alternatively, the conversion device 20 may be deployed on a separate single board, that is, the conversion device 20 and the main control board 10 are deployed on different single boards. Of course, the above are only two examples, and the position of the conversion device 20 is not limited. For example, the conversion device 20 may also be deployed on the same single board as the interface board 30, or, for network equipment including a main control board, a network board, and an interface board, the conversion device 20 may also be deployed on the same single board as the network board. There is no restriction on this.
参见图1所示,以转换装置20部署在单独的单板为例进行说明。Referring to FIG. 1, the description is given by taking the conversion device 20 deployed on a separate single board as an example.
其中,主控板10包括基于SOC(System on Chip,系统芯片)实现的CPU(Central Processing Unit,中央处理器),由CPU与接口板30/接口板40通信,即向接口板30/接口板40写入数据,并从接口板30/接口板40读取数据。Among them, the main control board 10 includes a CPU (Central Processing Unit) implemented based on SOC (System on Chip), and the CPU communicates with the interface board 30/interface board 40, that is, to the interface board 30/interface board 40 writes data, and reads data from the interface board 30/interface board 40.
在一种可实现方式中,某些接口板(如接口板40)具有高速接口(如PCI-E接口、SGMII(Serial Gigabit Media Independent,串行千兆介质无关)接口等,图1中以PCI-E接口为例进行说明),由于主控板10具有PCI-E接口,因此,主控板10与接口板40直接连接,也就是说,主控板10与接口板40可以通过高速总线(如PCI-E总线、SGMII总线等,图1中以PCI-E总线为例进行说明)连接。In an achievable way, some interface boards (such as interface board 40) have high-speed interfaces (such as PCI-E interfaces, SGMII (Serial Gigabit Media Independent, serial Gigabit Media Independent) interfaces, etc.). -E interface is taken as an example for description), since the main control board 10 has a PCI-E interface, the main control board 10 and the interface board 40 are directly connected, that is, the main control board 10 and the interface board 40 can pass through a high-speed bus ( Such as PCI-E bus, SGMII bus, etc., in Fig. 1, the PCI-E bus is taken as an example for illustration) connection.
在另一种可实现方式中,某些接口板(如接口板30)可以具有低速接口(如本地总线接口、TDM(Time Division Multiplexing,时分复用)接口等,在图1中以本地总线接口为例进行说明),但是不具有PCI-E接口,由于主控板10具有PCI-E接口,但是不具有本地总线接口,因此,主控板10可以通过转换装置20与接口板30连接,也就是说,主控板10不是与接口板30直接连接。In another achievable way, some interface boards (such as interface board 30) can have low-speed interfaces (such as local bus interface, TDM (Time Division Multiplexing, time division multiplexing) interface, etc.). In Figure 1, the local bus interface Take an example for description), but it does not have a PCI-E interface. Since the main control board 10 has a PCI-E interface but does not have a local bus interface, the main control board 10 can be connected to the interface board 30 through the conversion device 20. In other words, the main control board 10 is not directly connected to the interface board 30.
进一步的,转换装置20可以具有PCI-E接口和本地总线接口,因此,转换装置20可以通过PCI-E接口与主控板10连接,也就是说,转换装置20与主控板10可以通过PCI-E总线连接。此外,转换装置20可以通过本地总线接口与接口板30连接,也就是说,转换装置20与接口板30可以通过低速总线(如本地总线、TDM总线等,在图1中以本地总线为例进行说明)连接。Further, the conversion device 20 can have a PCI-E interface and a local bus interface. Therefore, the conversion device 20 can be connected to the main control board 10 through the PCI-E interface, that is, the conversion device 20 and the main control board 10 can be connected through the PCI-E interface. -E bus connection. In addition, the conversion device 20 can be connected to the interface board 30 through a local bus interface, that is, the conversion device 20 and the interface board 30 can be connected through a low-speed bus (such as a local bus, a TDM bus, etc.). The local bus is taken as an example in FIG. Description) Connect.
在上述应用场景下,针对主控板10与接口板40之间的通信过程,可以包括:主控板10通过PCI-E总线向接口板40写入数据,主控板10通过PCI-E总线从接口板40读取数据,对此数据写入过程和数据读取过程,不再赘述。In the above application scenario, the communication process between the main control board 10 and the interface board 40 may include: the main control board 10 writes data to the interface board 40 via the PCI-E bus, and the main control board 10 uses the PCI-E bus The data is read from the interface board 40, and the data writing process and the data reading process will not be repeated.
针对主控板10与接口板30之间的通信过程,可以包括:主控板10通过PCI-E总线将数据发送给转换装置20,转换装置20通过本地总线向接口板30写入数据,对此数据写入过程不再赘述。主控板10通过PCI-E总线向转换装置20发送读取命令,转换装置20通过本地总线从接口板30读取数据,并通过PCI-E总线将数据返回给主控板10,在后续实施例中,介绍这个数据读取过程。The communication process between the main control board 10 and the interface board 30 may include: the main control board 10 sends data to the conversion device 20 through the PCI-E bus, and the conversion device 20 writes data to the interface board 30 through the local bus. This data writing process will not be repeated. The main control board 10 sends a read command to the conversion device 20 via the PCI-E bus. The conversion device 20 reads data from the interface board 30 via the local bus, and returns the data to the main control board 10 via the PCI-E bus. In the example, this data reading process is introduced.
在传统方式中,为了从接口板30读取数据,主控板10向转换装置20发送读取命令,转换装置20通过本地总线从接口板30读取数据,由于本地总线的数据位宽为8比特,因此,转换装置20只从接口板30读取8比特的数据,将数据发送给主控板10。主控板10在接收到8比特的数据之后,若主控板10当前未读取到所有数据,则继续向转换装置20发送读取命令,以此类推。In the traditional way, in order to read data from the interface board 30, the main control board 10 sends a read command to the conversion device 20, and the conversion device 20 reads the data from the interface board 30 through the local bus. The data bit width of the local bus is 8. Therefore, the conversion device 20 only reads 8-bit data from the interface board 30 and sends the data to the main control board 10. After the main control board 10 receives the 8-bit data, if the main control board 10 has not read all the data currently, it continues to send the read command to the conversion device 20, and so on.
假设接口板30包括80个比特的数据,则主控板10需要发送10次读取命令,转换装置20从接口板30读取10次数据,转换装置20向主控板10发送10次数据。显然,数据读取操作需要耗费较长的时间,在这段时间内,主 控板10始终被占用,无法处理其它任务,其它任务只能等待,浪费主控板10的资源。Assuming that the interface board 30 includes 80 bits of data, the main control board 10 needs to send 10 read commands, the conversion device 20 reads data from the interface board 30 10 times, and the conversion device 20 sends data to the main control board 10 10 times. Obviously, the data reading operation takes a long time. During this period of time, the main control board 10 is always occupied and cannot process other tasks. Other tasks can only wait, which wastes the resources of the main control board 10.
针对上述发现,本申请实施例中,主控板10向转换装置20发送读取命令,转换装置20通过本地总线从接口板30读取数据,且连续读取N次数据,假设N为5,则转换装置20连续从接口板30读取5次数据。由于本地总线的数据位宽为8比特,因此,转换装置20每次从接口板30读取8比特的数据,且5次读取40比特的数据,将40比特的数据发送给主控板10。主控板10再次向转换装置20发送读取命令,转换装置20从接口板30连续读取N次数据,以此类推。In response to the above findings, in this embodiment of the application, the main control board 10 sends a read command to the conversion device 20, and the conversion device 20 reads data from the interface board 30 through the local bus, and reads the data continuously N times, assuming that N is 5. Then the conversion device 20 reads the data from the interface board 30 continuously 5 times. Since the data bit width of the local bus is 8 bits, the conversion device 20 reads 8 bits of data from the interface board 30 every time, reads 40 bits of data 5 times, and sends the 40 bits of data to the main control board 10. . The main control board 10 sends a read command to the conversion device 20 again, and the conversion device 20 continuously reads data from the interface board 30 N times, and so on.
假设接口板30包括80个比特的数据,则主控板10需要发送2次读取命令,转换装置20从接口板30读取10次数据,转换装置20向主控板10发送2次数据。显然,与传统方式相比,主控板10发送读取命令的次数显著降低,转换装置20向主控板10发送数据的次数显著降低,从而减少数据读取操作耗费的时间,节约主控板10的资源,提高带宽利用率,提高网络设备的整体性能。Assuming that the interface board 30 includes 80 bits of data, the main control board 10 needs to send read commands twice, the conversion device 20 reads data from the interface board 30 10 times, and the conversion device 20 sends data to the main control board 10 twice. Obviously, compared with the traditional method, the number of times that the main control board 10 sends read commands is significantly reduced, and the number of times the conversion device 20 sends data to the main control board 10 is significantly reduced, thereby reducing the time consumed for data reading operations and saving the main control board. 10 resources to improve bandwidth utilization and improve the overall performance of network equipment.
为了实现上述功能,本申请实施例中提出一种转换装置,该转换装置可以应用于网络设备,该网络设备还可以包括主控板(如具有第一类接口的主控板)和接口板(如具有第二类接口的接口板),转换装置可以包括第一类接口和第二类接口,转换装置通过该第一类接口与主控板连接,转换装置通过该第二类接口与接口板连接。其中,该第一类接口可以为高速接口(如PCI-E接口、SGMII接口等,图1中以PCI-E接口为例进行说明),该第二类接口可以为低速接口(如本地总线接口、TDM接口等,图1中以本地总线接口为例进行说明)。In order to realize the above-mentioned functions, an embodiment of the present application proposes a conversion device. The conversion device can be applied to a network device. The network device can also include a main control board (such as a main control board with a first type interface) and an interface board ( For example, an interface board with a second type of interface), the conversion device may include a first type of interface and a second type of interface, the conversion device is connected to the main control board through the first type of interface, and the conversion device is connected to the interface board through the second type of interface connection. Among them, the first type of interface can be a high-speed interface (such as PCI-E interface, SGMII interface, etc., in Figure 1 taking the PCI-E interface as an example), the second type of interface can be a low-speed interface (such as local bus interface , TDM interface, etc., take the local bus interface as an example in Figure 1 for illustration).
参见图2A所示,为转换装置20的结构示意图,转换装置20包括但不限于:报文处理单元21、判定单元22、连续读操作单元23、循环计数器24。2A, which is a schematic structural diagram of the conversion device 20. The conversion device 20 includes but is not limited to: a message processing unit 21, a determination unit 22, a continuous reading operation unit 23, and a cycle counter 24.
在一种可实现方式中,报文处理单元21,用于接收来自主控板10的第一数据报文,从该第一数据报文中获取决策参数,并将该决策参数输出给判定单元22。判定单元22,用于当决策参数为第一决策参数时,向连续读操作单元23输出第一命令。循环计数器24,用于存储数据读取次数N,N为大于1 的正整数。连续读操作单元23,用于在接收到该第一命令后,从循环计数器24中读取数据读取次数N,并向接口板30发送N个读操作命令,以使接口板30根据N个读操作命令返回N个数据。报文处理单元21,还用于获取N个数据的数据信息,并将数据信息封装成第二数据报文,将第二数据报文发送给主控板10。In an implementation manner, the message processing unit 21 is configured to receive a first data message from the main control board 10, obtain a decision parameter from the first data message, and output the decision parameter to the determination unit twenty two. The determining unit 22 is configured to output the first command to the continuous reading operation unit 23 when the decision parameter is the first decision parameter. The loop counter 24 is used to store the number of data reads N, where N is a positive integer greater than 1. The continuous read operation unit 23 is configured to read the number of data reads N from the cycle counter 24 after receiving the first command, and send N read operation commands to the interface board 30, so that the interface board 30 can respond to the N The read operation command returns N data. The message processing unit 21 is further configured to obtain data information of N pieces of data, encapsulate the data information into a second data message, and send the second data message to the main control board 10.
可选的,在一种可实现方式中,报文处理单元21,还用于从第一数据报文中获取数据读取次数,并将该数据读取次数发送给循环计数器24,以使循环计数器24存储该数据读取次数。或者,报文处理单元21,还用于根据第一类接口的数据承载长度和第二类接口的数据承载长度,确定数据读取次数,并将该数据读取次数发送给循环计数器24,以使循环计数器24存储该数据读取次数。Optionally, in an implementable manner, the message processing unit 21 is further configured to obtain the number of data reads from the first data message, and send the number of data reads to the loop counter 24, so that the loop The counter 24 stores the number of times the data is read. Alternatively, the message processing unit 21 is further configured to determine the number of data reads according to the data carrying length of the first type of interface and the data carrying length of the second type of interface, and send the number of data reads to the loop counter 24 to The loop counter 24 is caused to store the number of data reads.
其中,报文处理单元21根据第一类接口的数据承载长度和第二类接口的数据承载长度,确定数据读取次数时具体用于:获取第一类接口的接口类型,并确定与第一类接口的接口类型对应的第一数据承载长度;获取第二类接口的接口类型,并确定与第二类接口的接口类型对应的第二数据承载长度;然后,可以根据第一数据承载长度和第二数据承载长度确定数据读取次数。Wherein, the message processing unit 21 determines the number of data reads according to the data carrying length of the first type of interface and the data carrying length of the second type of interface, which is specifically used to: obtain the interface type of the first type of interface, and determine the interface type with the first type of interface. The first data carrying length corresponding to the interface type of the class interface; the interface type of the second class interface is obtained, and the second data carrying length corresponding to the interface type of the second class interface is determined; then, the first data carrying length and The second data carrying length determines the number of data reads.
可选的,参见图2B所示,转换装置20还可以包括:多组数据组装单元25。多组数据组装单元25,用于接收接口板30返回的N个数据,并将N个数据组成载荷数据,并将该载荷数据发送给报文处理单元21。这样,报文处理单元21可以接收该载荷数据,并将该载荷数据封装成第二数据报文。Optionally, referring to FIG. 2B, the conversion device 20 may further include: multiple sets of data assembling units 25. The multiple data assembling unit 25 is configured to receive N pieces of data returned by the interface board 30, compose the N pieces of data into payload data, and send the payload data to the message processing unit 21. In this way, the message processing unit 21 can receive the payload data and encapsulate the payload data into a second data message.
参见上述实施例,报文处理单元21用于获取N个数据的数据信息,并将数据信息封装成第二数据报文。具体的,若转换装置20未包括多组数据组装单元25,则N个数据的数据信息就是接口板返回的N个数据本身,报文处理单元21可以获取到接口板返回的N个数据,将N个数据组成载荷数据,并将该载荷数据封装成第二数据报文。若转换装置20包括多组数据组装单元25,则N个数据的数据信息就是多组数据组装单元25发送的载荷数据,报文处理单元21可以获取到该载荷数据,并将该载荷数据封装成第二数据报文。Referring to the foregoing embodiment, the message processing unit 21 is configured to obtain data information of N pieces of data, and encapsulate the data information into a second data message. Specifically, if the conversion device 20 does not include multiple sets of data assembling units 25, the data information of the N data is the N data itself returned by the interface board, and the message processing unit 21 can obtain the N data returned by the interface board, and N pieces of data form payload data, and the payload data is encapsulated into a second data message. If the conversion device 20 includes multiple sets of data assembling units 25, the data information of the N pieces of data is the load data sent by the multiple sets of data assembling units 25, and the message processing unit 21 can obtain the load data and encapsulate the load data into The second data message.
可选的,参见图2C所示,转换装置20还可以包括:单次读操作单元26。判定单元22,还用于在当决策参数为第二决策参数时,向单次读操作单元26 输出第二命令。单次读操作单元26,用于在接收到该第二命令后,向接口板30发送一个读操作命令,以使接口板30根据一个读操作命令返回一个数据。报文处理单元21,还用于获取该数据的数据信息,将该数据信息封装成第三数据报文,并将该第三数据报文发送给主控板10。Optionally, referring to FIG. 2C, the conversion device 20 may further include: a single read operation unit 26. The determining unit 22 is further configured to output a second command to the single read operation unit 26 when the decision parameter is the second decision parameter. The single read operation unit 26 is configured to send a read operation command to the interface board 30 after receiving the second command, so that the interface board 30 returns a piece of data according to a read operation command. The message processing unit 21 is further configured to obtain data information of the data, encapsulate the data information into a third data message, and send the third data message to the main control board 10.
可选的,参见图2D所示,转换装置20还可以包括:单组数据组装单元27。单组数据组装单元27,用于接收接口板30返回的一个数据,并将该数据组成载荷数据,并将该载荷数据发送给报文处理单元21。这样,报文处理单元21可以接收该载荷数据,并将该载荷数据封装成第三数据报文。Optionally, referring to FIG. 2D, the conversion device 20 may further include: a single set of data assembling unit 27. The single-group data assembling unit 27 is configured to receive a piece of data returned by the interface board 30, compose the data into load data, and send the load data to the message processing unit 21. In this way, the message processing unit 21 can receive the payload data and encapsulate the payload data into a third data message.
参见上述实施例,报文处理单元21用于获取一个数据的数据信息,并将该数据信息封装成第三数据报文。具体的,若转换装置20未包括单组数据组装单元27,则一个数据的数据信息就是接口板返回的一个数据本身,报文处理单元21可以获取到接口板返回的一个数据,将该数据组成载荷数据,并将该载荷数据封装成第三数据报文。若转换装置20包括单组数据组装单元27,则一个数据的数据信息就是单组数据组装单元27发送的载荷数据,报文处理单元21可以获取到该载荷数据,并将该载荷数据封装成第三数据报文。Referring to the foregoing embodiment, the message processing unit 21 is configured to obtain data information of one piece of data, and encapsulate the data information into a third data message. Specifically, if the conversion device 20 does not include a single set of data assembling unit 27, the data information of a piece of data is a piece of data itself returned by the interface board, and the message processing unit 21 can obtain a piece of data returned by the interface board and compose the data. Load data, and encapsulate the load data into a third data message. If the conversion device 20 includes a single set of data assembling unit 27, the data information of a piece of data is the load data sent by the single set of data assembling unit 27, and the message processing unit 21 can obtain the load data and encapsulate the load data into the first Three data messages.
可选的,参见图2E所示,转换装置20还可以包括:中断处理单元28。中断处理单元28,用于在接收到接口板30发送的中断时,将该中断发送给主控板10,以使主控板10发送上述第一数据报文。基于此,报文处理单元21可以接收来自主控板10的第一数据报文,继而通过各单元的配合实现数据传输。Optionally, referring to FIG. 2E, the conversion device 20 may further include: an interrupt processing unit 28. The interrupt processing unit 28 is configured to, when receiving an interrupt sent by the interface board 30, send the interrupt to the main control board 10, so that the main control board 10 sends the above-mentioned first data message. Based on this, the message processing unit 21 can receive the first data message from the main control board 10, and then realize data transmission through the cooperation of various units.
可选的,在上述实施例中,当数据读取地址中的决策标识为第一数值时,则决策参数为第一决策参数;当数据读取地址中的决策标识为第二数值时,则决策参数为第二决策参数。Optionally, in the above embodiment, when the decision identifier in the data read address is the first value, then the decision parameter is the first decision parameter; when the decision identifier in the data read address is the second value, then The decision parameter is the second decision parameter.
基于上述技术方案,本申请实施例中,转换装置从接口板读取N个数据,N为大于1的正整数,而不是从接口板读取一个数据,从而一次就读取N个数据,将N个数据发送给主控板。这样,可以减少数据读取操作所耗费的时间,避免主控板长期被数据读取操作占用,节约主控板资源,提高带宽利用率,提高主控板获取数据的效率,提高网络设备的整体性能,降低主控板的占用率,节省主控板的占用时间,提高数据获取效率,占用转换装置的逻辑 资源较少。Based on the above technical solution, in this embodiment of the application, the conversion device reads N data from the interface board, where N is a positive integer greater than 1, instead of reading one data from the interface board, so that N data is read at a time. N data are sent to the main control board. In this way, the time spent in data reading operations can be reduced, and the main control board can be prevented from being occupied by data reading operations for a long time, saving main control board resources, improving bandwidth utilization, improving the efficiency of the main control board obtaining data, and improving the overall network equipment Performance, reduce the occupancy rate of the main control board, save the occupancy time of the main control board, improve data acquisition efficiency, and occupy less logic resources of the conversion device.
以下结合图2E所示的应用场景,对上述技术方案进行详细说明。The above technical solution will be described in detail below in conjunction with the application scenario shown in FIG. 2E.
参见图2E所示,转换装置20可以包括:报文处理单元21、判定单元22、连续读操作单元23、循环计数器24、多组数据组装单元25、单次读操作单元26、单组数据组装单元27和中断处理单元28。其中,连续读操作单元23、循环计数器24和多组数据组装单元25属于加速逻辑通道,用于实现加速读取,即针对接口板30的每个读取命令,从接口板30读取多次数据。此外,单次读操作单元26和单组数据组装单元27属于非加速逻辑通道,不需要实现加速读取,即针对接口板30的每个读取命令,从接口板30读取一次数据。2E, the conversion device 20 may include: a message processing unit 21, a judging unit 22, a continuous read operation unit 23, a cycle counter 24, a multiple data assembly unit 25, a single read operation unit 26, and a single set of data assembly Unit 27 and interrupt processing unit 28. Among them, the continuous read operation unit 23, the cycle counter 24, and the multiple sets of data assembling unit 25 belong to the accelerated logic channel, which is used to implement accelerated reading, that is, for each read command of the interface board 30, read multiple times from the interface board 30 data. In addition, the single read operation unit 26 and the single set of data assembling unit 27 belong to non-accelerated logical channels, and there is no need to implement accelerated reading, that is, for each read command of the interface board 30, data is read from the interface board 30 once.
在一种可实现方式中,转换装置20可以包括但不限于逻辑芯片,例如,FPGA(Field Programmable Gate Array,现场可编程门阵列)、CPLD(Complex Programmable Logic Device,复杂可编程逻辑器件)、ASIC(Application Specific Integrated Circuit,专用集成电路)等,对此转换装置20的类型不做具体限制。In an achievable manner, the conversion device 20 may include, but is not limited to, a logic chip, such as FPGA (Field Programmable Gate Array), CPLD (Complex Programmable Logic Device), ASIC (Application Specific Integrated Circuit), etc., there is no specific restriction on the type of the conversion device 20.
在一种可实现方式中,当接口板30存在待读取数据(即需要发送给主控板10的数据)时,接口板30通过中断通道向转换装置20的中断处理单元28发送中断,中断处理单元28在接收到中断后,通过中断通道向主控板10转发该中断。In an achievable manner, when the interface board 30 has data to be read (that is, data that needs to be sent to the main control board 10), the interface board 30 sends an interrupt to the interrupt processing unit 28 of the conversion device 20 through the interrupt channel. After receiving the interrupt, the processing unit 28 forwards the interrupt to the main control board 10 through the interrupt channel.
主控板10在接收到中断后,确定需要从接口板30读取数据。为了从接口板30读取数据,则主控板10可以向转换装置20的报文处理单元21发送第一数据报文,该第一数据报文可以为TLP(Transaction Layer Interface,事务层接口)报文。当然,该第一数据报文也可以为其它类型报文,对此不做限制。After receiving the interrupt, the main control board 10 determines that it needs to read data from the interface board 30. In order to read data from the interface board 30, the main control board 10 may send a first data message to the message processing unit 21 of the conversion device 20, and the first data message may be a TLP (Transaction Layer Interface, transaction layer interface) Message. Of course, the first data message may also be other types of messages, and there is no restriction on this.
与传统数据报文不同的是,在图2A-图2E所示的各实施例中,第一数据报文可以携带决策参数,该决策参数表示是否对数据读取操作进行加速处理。例如,若主控板10确定对数据读取操作进行加速处理,在第一数据报文中添加需要对数据读取操作进行加速处理的第一决策参数;若主控板10确定不对数据读取操作进行加速处理,在第一数据报文中添加不需要对数据读取操作进行加速处理的第二决策参数。Different from the traditional data message, in the embodiments shown in FIGS. 2A-2E, the first data message may carry a decision parameter, which indicates whether to accelerate the data reading operation. For example, if the main control board 10 determines to accelerate the data reading operation, add the first decision parameter that needs to accelerate the data reading operation in the first data message; if the main control board 10 determines not to perform the data reading The operation is accelerated, and a second decision parameter that does not require accelerated processing of the data reading operation is added to the first data message.
可选的,主控板10可以根据待读取数据的数据类型确定是否对数据读取 操作进行加速处理。例如,若待读取数据的数据类型为业务类数据,则主控板10可以确定对数据读取操作进行加速处理,即,第一数据报文可以携带第一决策参数;或者,若待读取数据的数据类型为控制类数据,则主控板10可以确定不对数据读取操作进行加速处理,即,第一数据报文可以携带第二决策参数。Optionally, the main control board 10 may determine whether to accelerate the data reading operation according to the data type of the data to be read. For example, if the data type of the data to be read is business data, the main control board 10 may determine to accelerate the data reading operation, that is, the first data packet may carry the first decision parameter; or, if the data to be read is If the data type of the fetched data is control data, the main control board 10 may determine not to accelerate the data reading operation, that is, the first data message may carry the second decision parameter.
其中,针对控制类数据(如接口板30的某个状态寄存器的状态值),控制类数据通常比较小,如8个比特,通过一次或者少数几个读取过程,就可以完成控制类数据的读取,因此,若待读取数据的数据类型为控制类数据,则主控板10确定不对数据读取操作进行加速处理。针对业务类数据(如其它网络设备发送给接口板30的数据等),业务类数据通常比较大,如几万个比特,通过多次读取过程,才可以完成业务类数据的读取,因此,若待读取数据的数据类型为业务类数据,则主控板10确定对数据读取操作进行加速处理。Among them, for control data (such as the state value of a status register of the interface board 30), the control data is usually relatively small, such as 8 bits, and the control data can be completed through one or a few reading processes. Therefore, if the data type of the data to be read is control data, the main control board 10 determines not to accelerate the data reading operation. For business data (such as data sent by other network devices to the interface board 30, etc.), business data is usually relatively large, such as tens of thousands of bits. After multiple reading processes, the reading of business data can be completed. If the data type of the data to be read is business data, the main control board 10 determines to accelerate the data reading operation.
综上所述,针对控制类数据不进行加速处理,针对业务类数据进行加速处理,使得控制类数据和业务类数据互不影响,可以保障控制类数据获取的高效性,并保障业务类数据获取的高效性,大大提高业务类数据的读取效率。In summary, accelerated processing is not performed for control data, and accelerated processing for business data, so that control data and business data do not affect each other, can ensure the efficiency of control data acquisition, and ensure the acquisition of business data The high efficiency greatly improves the reading efficiency of business data.
在一种可实现方式中,主控板10向转换装置20的报文处理单元21发送第一数据报文后,报文处理单元21接收第一数据报文。由于第一数据报文携带决策参数,因此,报文处理单元21从第一数据报文中获取决策参数,并将该决策参数输出给判定单元22,该决策参数可以为第一决策参数或者第二决策参数。In an implementation manner, after the main control board 10 sends the first data packet to the packet processing unit 21 of the conversion device 20, the packet processing unit 21 receives the first data packet. Since the first data message carries the decision parameter, the message processing unit 21 obtains the decision parameter from the first data message and outputs the decision parameter to the determination unit 22. The decision parameter can be the first decision parameter or the first decision parameter. 2. Decision-making parameters.
进一步的,判定单元22在接收到该决策参数后,若该决策参数为第一决策参数,则判定单元22向连续读操作单元23输出第一命令。若该决策参数为第二决策参数,则判定单元22向单次读操作单元26输出第二命令。Further, after the determining unit 22 receives the decision parameter, if the decision parameter is the first decision parameter, the determining unit 22 outputs the first command to the continuous reading operation unit 23. If the decision parameter is the second decision parameter, the determination unit 22 outputs the second command to the single read operation unit 26.
可选的,针对第一数据报文包括的决策参数,可以采用如下方式实现:Optionally, the decision parameters included in the first data message may be implemented in the following manner:
方式一、在第一数据报文的指定字段携带决策标识。当决策标识为第一数值时,表示对数据读取操作进行加速处理的第一决策参数,当决策标识为第二数值时,表示不对数据读取操作进行加速处理的第二决策参数。基于此,若该决策标识为第一数值,则判定单元22可以确定决策参数为第一决策参数;若该决策标识为第二数值,则确定决策参数为第二决策参数。Manner 1: Carry the decision identifier in the designated field of the first data message. When the decision identifier is the first value, it represents the first decision parameter for accelerating the data reading operation, and when the decision identifier is the second value, it represents the second decision parameter for not accelerating the data reading operation. Based on this, if the decision identifier is the first value, the determination unit 22 can determine that the decision parameter is the first decision parameter; if the decision identifier is the second value, the decision parameter is determined to be the second decision parameter.
针对方式一,主控板10确定对数据读取操作进行加速处理时,则主控板10在第一数据报文的指定字段添加第一数值。主控板10确定不对数据读取操作进行加速处理时,则主控板10在第一数据报文的指定字段添加第二数值。Regarding the first method, when the main control board 10 determines to perform accelerated processing on the data reading operation, the main control board 10 adds the first value to the designated field of the first data message. When the main control board 10 determines not to accelerate the data reading operation, the main control board 10 adds the second value to the designated field of the first data message.
其中,指定字段可以是第一数据报文的任意字段,对此不做限制。例如,第一数据报文可以包括数据字段(即data字段),在主控板10向转换装置20发送第一数据报文时,第一数据报文中的数据字段未被使用,因此,本实施例中,可以通过第一数据报文的数据字段来携带决策标识。The designated field can be any field of the first data message, and there is no restriction on this. For example, the first data message may include a data field (ie, data field). When the main control board 10 sends the first data message to the conversion device 20, the data field in the first data message is not used. Therefore, this In an embodiment, the decision identifier can be carried by the data field of the first data message.
方式二、通过第一数据报文中的数据读取地址携带决策标识。当数据读取地址中的决策标识为第一数值时,表示对数据读取操作进行加速处理的第一决策参数,当数据读取地址中的决策标识为第二数值时,表示不对数据读取操作进行加速处理的第二决策参数。基于此,若数据读取地址中的决策标识为第一数值,则判定单元22可以确定决策参数为第一决策参数;若数据读取地址中的决策标识为第二数值,则判定单元22可以确定决策参数为第二决策参数。Manner 2: The data read address in the first data message carries the decision identifier. When the decision identifier in the data read address is the first value, it means the first decision parameter for accelerating the data read operation, and when the decision identifier in the data read address is the second value, it means that the data is not read Operate the second decision parameter for accelerated processing. Based on this, if the decision identifier in the data read address is the first value, the determination unit 22 can determine that the decision parameter is the first decision parameter; if the decision identifier in the data read address is the second value, the determination unit 22 can Determine the decision parameter as the second decision parameter.
在一种可实现方式中,在第一数据报文中可以携带数据读取地址,表示需要从这个数据读取地址读取数据。本实施例中,主控板在发送第一数据报文时,可以通过第一数据报文中的数据读取地址携带决策标识。例如,通过数据读取地址的最高位,来表示决策标识。或者,通过数据读取地址的第二位,来表示决策标识,对此不做限制,后续以数据读取地址的最高位表示决策标识为例。In an achievable manner, the data read address can be carried in the first data message, indicating that data needs to be read from this data read address. In this embodiment, when the main control board sends the first data message, the data read address in the first data message may carry the decision identifier. For example, the highest bit of the data read address is used to indicate the decision flag. Alternatively, the second bit of the data read address is used to indicate the decision flag, which is not limited, and the highest bit of the data read address is used as an example in the following to indicate the decision flag.
例如,数据读取地址“10FFFH”中的最高位1,可以表示决策标识。当决策标识为数值1(假设数值1为第一数值)时,则表示第一决策参数。For example, the highest bit 1 in the data read address "10FFFH" can represent the decision flag. When the decision identifier is the value 1 (assuming the value 1 is the first value), it indicates the first decision parameter.
又例如,数据读取地址“20FFFH”中的最高位2,可以表示决策标识。当决策标识为数值2(假设数值2为第二数值)时,则表示第二决策参数。For another example, the most significant bit 2 in the data read address "20FFFH" can represent the decision flag. When the decision identifier is the value 2 (assuming the value 2 is the second value), it indicates the second decision parameter.
此外,10FFFH中的数值0,表示针对槽位0的接口板,10FFFH中的“FFF”,表示需要从这个地址读取数据。同理,20FFFH中的数值0,表示针对槽位0的接口板,20FFFH中的“FFF”,表示需要从这个地址读取数据。In addition, the value 0 in 10FFFH indicates the interface board for slot 0, and the "FFF" in 10FFFH indicates that data needs to be read from this address. Similarly, the value 0 in 20FFFH indicates the interface board for slot 0, and the "FFF" in 20FFFH indicates that data needs to be read from this address.
当然,上述只是数据读取地址的示例,对此数据读取地址不做限制。Of course, the above is only an example of the data read address, and there is no restriction on this data read address.
当然,上述方式一和方式二只是决策参数的两个示例,对此不做限制。Of course, the above method 1 and method 2 are only two examples of decision parameters, and there is no restriction on this.
在一种可实现方式中,循环计数器24用于存储数据读取次数,将数据读取次数记为N,N为大于1的正整数。循环计数器24存储数据读取次数,采用如下方式:In an implementation manner, the loop counter 24 is used to store the number of data reads, and the number of data reads is recorded as N, where N is a positive integer greater than one. The cycle counter 24 stores the number of data reads in the following manner:
方式1、主控板10在向转换装置20的报文处理单元21发送第一数据报文时,该第一数据报文可以携带数据读取次数N。报文处理单元21可以从第一数据报文中获取数据读取次数N,并将数据读取次数N发送给循环计数器24。循环计数器24在接收到数据读取次数N后,可以存储数据读取次数N。Manner 1. When the main control board 10 sends a first data message to the message processing unit 21 of the conversion device 20, the first data message may carry the number N of data reads. The message processing unit 21 may obtain the data read count N from the first data message, and send the data read count N to the loop counter 24. After receiving the number N of data reads, the loop counter 24 can store the number N of data reads.
其中,主控板10可以确定数据读取次数N,对此确定方式不做限制。例如,主控板10可以获取第一类接口的接口类型,并确定与第一类接口的接口类型对应的第一数据承载长度;获取第二类接口的接口类型,并确定与第二类接口的接口类型对应的第二数据承载长度;然后,根据第一数据承载长度和第二数据承载长度确定数据读取次数N,并将数据读取次数N添加到第一数据报文中。Wherein, the main control board 10 can determine the number of data reads N, and there is no restriction on the determination method. For example, the main control board 10 may obtain the interface type of the first type of interface, and determine the first data carrying length corresponding to the interface type of the first type of interface; obtain the interface type of the second type of interface, and determine the interface type with the second type of interface The second data carrying length corresponding to the interface type of, then, the number of data reading times N is determined according to the first data carrying length and the second data carrying length, and the number of data reading times N is added to the first data message.
方式2、报文处理单元21根据第一类接口的数据承载长度和第二类接口的数据承载长度,确定数据读取次数N,并将数据读取次数N发送给循环计数器24,以使循环计数器24存储该数据读取次数N。具体的,可以获取第一类接口的接口类型,并确定与第一类接口的接口类型对应的第一数据承载长度;获取第二类接口的接口类型,并确定与第二类接口的接口类型对应的第二数据承载长度;根据第一数据承载长度和第二数据承载长度确定数据读取次数。Manner 2. The message processing unit 21 determines the number of data reads N according to the data carrying length of the first type of interface and the data carrying length of the second type of interface, and sends the number of data reads N to the loop counter 24 to make the loop The counter 24 stores the number N of data reads. Specifically, the interface type of the first type of interface can be obtained, and the first data carrying length corresponding to the interface type of the first type of interface can be determined; the interface type of the second type of interface can be obtained, and the interface type of the second type of interface can be determined Corresponding second data carrying length; the number of data reads is determined according to the first data carrying length and the second data carrying length.
其中,报文处理单元21在接收到第一数据报文后,若第一数据报文携带数据读取次数N,则报文处理单元21可以从第一数据报文中获取数据读取次数N,并将数据读取次数N发送给循环计数器24。若第一数据报文未携带数据读取次数N,则报文处理单元21可以根据第一类接口的数据承载长度和第二类接口的数据承载长度确定数据读取次数N,将数据读取次数N发送给循环计数器24。Wherein, after the message processing unit 21 receives the first data message, if the first data message carries the number of data reads N, the message processing unit 21 may obtain the number of data reads N from the first data message. , And send the number of data reads N to the loop counter 24. If the first data message does not carry the data reading times N, the message processing unit 21 may determine the data reading times N according to the data carrying length of the first type interface and the data carrying length of the second type interface, and read the data The number N is sent to the loop counter 24.
方式3、根据第一类接口的数据承载长度和第二类接口的数据承载长度,确定数据读取次数N,并将数据读取次数N配置到循环计数器24。例如,用户可以根据第一类接口的数据承载长度和第二类接口的数据承载长度,确定 数据读取次数N,并将数据读取次数N配置到循环计数器24。Manner 3: According to the data carrying length of the first type interface and the data carrying length of the second type interface, determine the number of data reads N, and configure the number of data reads N to the loop counter 24. For example, the user can determine the number of data reading times N according to the data carrying length of the first type interface and the data carrying length of the second type interface, and configure the data reading times N to the loop counter 24.
在方式1、方式2和方式3中,均可以根据第一类接口的数据承载长度和第二类接口的数据承载长度,确定数据读取次数N,只是执行主体不同。此外,可以预先配置第一类接口的接口类型与第一数据承载长度的对应关系、第二类接口的接口类型与第二数据承载长度的对应关系,对此不做限制。In Mode 1, Mode 2, and Mode 3, the number of data reading times N can be determined according to the data carrying length of the first type interface and the data carrying length of the second type interface, but the execution subject is different. In addition, the corresponding relationship between the interface type of the first type of interface and the first data carrying length, and the corresponding relationship between the interface type of the second type of interface and the second data carrying length can be pre-configured, which is not limited.
其中,转换装置20通过PCI-E接口与主控板10连接,即转换装置20通过PCI-E接口向主控板10发送数据报文,该数据报文的数据承载长度为已知,如32个比特,也就是说,转换装置20向主控板10发送数据报文时,该数据报文最多承载32个比特的数据,即第一类接口的接口类型对应的第一数据承载长度。Wherein, the conversion device 20 is connected to the main control board 10 through the PCI-E interface, that is, the conversion device 20 sends a data message to the main control board 10 through the PCI-E interface, and the data carrying length of the data message is known, such as 32 One bit, that is, when the conversion device 20 sends a data message to the main control board 10, the data message carries a maximum of 32 bits of data, that is, the first data carrying length corresponding to the interface type of the first type of interface.
此外,转换装置20通过本地总线接口与接口板30连接,即转换装置20通过本地总线接口从接口板30读取数据,待读取数据的数据承载长度为已知,如8个比特,也就是说,转换装置20在从接口板30读取数据时,一次最多只能读取8个比特的数据,即第二类接口的接口类型对应的第二数据承载长度。In addition, the conversion device 20 is connected to the interface board 30 through a local bus interface, that is, the conversion device 20 reads data from the interface board 30 through the local bus interface. The data carrying length of the data to be read is known, such as 8 bits, that is, In other words, when the conversion device 20 reads data from the interface board 30, it can only read up to 8 bits of data at a time, that is, the second data carrying length corresponding to the interface type of the second type of interface.
综上所述,可以对(第一类接口的接口类型对应的第一数据承载长度/第二类接口的接口类型对应的第二数据承载长度)向下取值,而向下取值后的数值就是数据读取次数N。例如,对(32/8)向下取值,得到数据读取次数N为4。In summary, (the first data carrying length corresponding to the interface type of the first type interface/the second data carrying length corresponding to the interface type of the second type interface) can be valued downward, and the value after the downward value The value is the number of data reads N. For example, if the value of (32/8) is taken down, the number of data reads N is 4.
基于此,转换装置20的连续读操作单元23可以连续从接口板30读取4次数据,每次读取8个比特,这样,4个读取过程一共读取32个比特,由于数据报文最多承载32个比特的数据,因此,可以将读取的所有数据(即32个比特的数据)均添加到数据报文中,并将数据报文发送给主控板10。显然,基于上述方式,能够充分利用数据报文的数据带宽,提高数据传输的效率。Based on this, the continuous reading operation unit 23 of the conversion device 20 can continuously read data from the interface board 30 4 times, reading 8 bits each time, so that a total of 32 bits are read in 4 reading processes, because the data message A maximum of 32 bits of data can be carried. Therefore, all the read data (ie, 32 bits of data) can be added to the data message, and the data message can be sent to the main control board 10. Obviously, based on the above method, the data bandwidth of the data message can be fully utilized, and the efficiency of data transmission can be improved.
在上述实施例中,第一数据承载长度和第二数据承载长度,是指载荷数据的长度,而不包括报文头的长度。也就是说,数据承载长度是在数据报文中承载的载荷数据的长度,而不包括在数据报文中承载的报文头的长度。In the foregoing embodiment, the first data carrying length and the second data carrying length refer to the length of the payload data, and do not include the length of the message header. In other words, the data carrying length is the length of the payload data carried in the data message, and does not include the length of the header carried in the data message.
当然,上述只是确定数据读取次数N的一个示例,对此确定方式不做限制。而且,在实际应用中,还可以根据不同情况对数据读取次数N进行动态 调整。Of course, the above is only an example of determining the number of times N of data reads, and there is no restriction on the determination method. Moreover, in practical applications, the number of data reads N can also be dynamically adjusted according to different situations.
在一种可实现方式中,连续读操作单元23在接收到第一命令后,从循环计数器24中读取数据读取次数N,并向接口板30发送N个读操作命令,以使接口板30根据N个读操作命令向多组数据组装单元25返回N个数据。In an achievable manner, after receiving the first command, the continuous read operation unit 23 reads the number of data reads N from the cycle counter 24, and sends N read operation commands to the interface board 30, so that the interface board 30 returns N data to the multiple data assembling unit 25 according to N read operation commands.
具体的,连续读操作单元23连续向接口板30发送N个读操作命令,即对接口板30连续读取N次数据。接口板30每接收到一个读操作命令,就通过本地总线接口向多组数据组装单元25返回一个数据(如8比特的数据)。由于接口板30可以接收到N个读操作命令,因此,接口板30通过本地总线接口向多组数据组装单元25返回N个数据。这样,多组数据组装单元25可以接收到N个数据,并将N个数据组成载荷数据(即payload),例如,按照每个数据的顺序将N个数据组成载荷数据,然后,将该载荷数据发送给报文处理单元21。Specifically, the continuous read operation unit 23 continuously sends N read operation commands to the interface board 30, that is, reads data to the interface board 30 continuously N times. Each time the interface board 30 receives a read operation command, it returns a piece of data (such as 8-bit data) to the multiple data assembly unit 25 through the local bus interface. Since the interface board 30 can receive N read operation commands, the interface board 30 returns N data to the multiple data assembly unit 25 through the local bus interface. In this way, the multiple sets of data assembling unit 25 can receive N pieces of data and compose the N pieces of data into payload data (that is, payload). For example, the N pieces of data are composed into payload data according to the order of each data, and then the payload data Sent to the message processing unit 21.
在一种可实现方式中,转换装置20可以包括一个buffer(缓冲区),这个buffer可以采用FIFO(First Input First Output,先进先出)方式存储数据。多组数据组装单元25每次接收到一个数据时,就将当前接收的一个数据存储到buffer中,然后,判断buffer中的数据数量是否达到N个。如果未达到,则等待下一次接收数据。如果已经达到,就从buffer中获取N个数据,将N个数据组成载荷数据,将该载荷数据发送给报文处理单元21,并从buffer中删除这N个数据。In an implementation manner, the conversion device 20 may include a buffer (buffer), and this buffer may store data in a FIFO (First Input First Output) manner. Each time the multi-group data assembling unit 25 receives a piece of data, it stores the currently received piece of data in the buffer, and then determines whether the number of data in the buffer reaches N. If it is not reached, wait for the next data reception. If it has been reached, obtain N data from the buffer, compose the N data into load data, send the load data to the message processing unit 21, and delete the N data from the buffer.
报文处理单元21在接收到该载荷数据(即N个数据组成的载荷数据,如32个比特的载荷数据)后,将该载荷数据封装成第二数据报文(如TLP报文,是基于PCI-E接口的数据报文),并将该第二数据报文发送给主控板10。After the message processing unit 21 receives the load data (that is, load data composed of N data, such as 32-bit load data), it encapsulates the load data into a second data message (such as a TLP message, which is based on PCI-E interface data message), and send the second data message to the main control board 10.
在另一种可实现方式中,单次读操作单元26在接收到第二命令后,向接口板30发送一个读操作命令,以使接口板30根据一个读操作命令向单组数据组装单元27返回一个数据,如返回8比特的数据。In another achievable manner, after receiving the second command, the single read operation unit 26 sends a read operation command to the interface board 30, so that the interface board 30 sends a read operation command to the single group data assembly unit 27 according to the read operation command. Return a piece of data, such as 8-bit data.
具体的,单次读操作单元26可以只向接口板30发送一个读操作命令,接口板30在接收到该读操作命令后,可以通过本地总线接口向单组数据组装单元27返回一个数据,单组数据组装单元27接收到一个数据后,将一个数据组成载荷数据(即payload),然后,将该载荷数据发送给报文处理单元21。Specifically, the single read operation unit 26 may only send a read operation command to the interface board 30. After receiving the read operation command, the interface board 30 may return a data to the single group data assembly unit 27 through the local bus interface. After receiving a piece of data, the group data assembling unit 27 composes the piece of data into payload data (that is, payload), and then sends the payload data to the message processing unit 21.
报文处理单元21在接收到该载荷数据(即一个数据组成的载荷数据,如8个比特的载荷数据)后,将该载荷数据封装成第三数据报文(如TLP报文,是基于PCI-E接口的数据报文),并将该第三数据报文发送给主控板10。After the message processing unit 21 receives the payload data (that is, payload data composed of one piece of data, such as 8-bit payload data), it encapsulates the payload data into a third data message (such as a TLP message, which is based on PCI -E interface data message), and send the third data message to the main control board 10.
基于上述技术方案,本申请实施例中,主控板发送第一数据报文的次数显著降低,转换装置向主控板发送第二数据报文的次数显著降低,从而充分利用第二数据报文的有效带宽(如第二数据报文承载32个比特的数据,而不是承载8个比特的数据,即,将需要几次传输的数据承载到一个第二数据报文),减少数据读取操作耗费的时间,避免主控板长期被数据读取操作占用,节约主控板的资源,提高带宽利用率,提高数据获取效率,降低主控板的占用率,节省主控板的占用时间,提高网络设备的整体性能,占用转换装置的逻辑资源较少。Based on the above technical solution, in this embodiment of the application, the number of times the main control board sends the first data message is significantly reduced, and the number of times the conversion device sends the second data message to the main control board is significantly reduced, thereby making full use of the second data message Effective bandwidth (for example, the second data message carries 32 bits of data instead of 8 bits of data, that is, carries data that needs several transmissions into one second data message), reducing data read operations Time-consuming, to avoid the main control board being occupied by data reading operations for a long time, save the resources of the main control board, improve bandwidth utilization, improve data acquisition efficiency, reduce the occupancy rate of the main control board, save the time occupied by the main control board, and increase The overall performance of the network equipment occupies less logic resources of the conversion device.
本申请实施例中还提出一种网络设备,该网络设备可以包括主控板、接口板和转换装置,转换装置可以通过第一类接口与主控板连接,转换装置可以通过第二类接口与所述接口板连接;其中:The embodiment of the present application also proposes a network device, which may include a main control board, an interface board, and a conversion device. The conversion device may be connected to the main control board through a first type interface, and the conversion device may be connected to the main control board through a second type interface. The interface board is connected; where:
主控板,用于向转换装置发送第一数据报文;The main control board is used to send the first data message to the conversion device;
转换装置,用于在接收到第一数据报文后,从第一数据报文中获取决策参数;当决策参数为第一决策参数时,则获取数据读取次数N,N为大于1的正整数,并向接口板发送N个读操作命令;The conversion device is used to obtain the decision parameter from the first data packet after receiving the first data packet; when the decision parameter is the first decision parameter, obtain the number of data reads N, where N is a positive value greater than 1. Integer, and send N read operation commands to the interface board;
接口板,用于在接收到N个读操作命令后,返回N个数据;Interface board, used to return N data after receiving N read operation commands;
转换装置,还用于获取N个数据的数据信息,将数据信息封装成第二数据报文,并将第二数据报文发送给主控板。The conversion device is also used to obtain data information of N pieces of data, encapsulate the data information into a second data message, and send the second data message to the main control board.
可选的,在一种可实现方式中,转换装置,还可以用于当决策参数为第二决策参数时,向接口板发送一个读操作命令;Optionally, in an implementable manner, the conversion device may also be used to send a read operation command to the interface board when the decision parameter is the second decision parameter;
接口板,还可以用于在接收到该读操作命令后,返回一个数据;The interface board can also be used to return a data after receiving the read operation command;
转换装置,还可以用于获取该数据的数据信息,将该数据信息封装成第三数据报文,并将第三数据报文发送给主控板。The conversion device can also be used to obtain data information of the data, encapsulate the data information into a third data message, and send the third data message to the main control board.
可选的,在一种可实现方式中,转换装置与主控板可以部署在同一个单板;或者,转换装置可以部署在单独的单板。Optionally, in an implementable manner, the conversion device and the main control board may be deployed on the same single board; or, the conversion device may be deployed on a separate single board.
可选的,在一种可实现方式中,当数据读取地址中的决策标识为第一数 值时,则决策参数为第一决策参数;当数据读取地址中的决策标识为第二数值时,则决策参数为第二决策参数。Optionally, in an implementable manner, when the decision identifier in the data read address is the first value, the decision parameter is the first decision parameter; when the decision identifier in the data read address is the second value , The decision parameter is the second decision parameter.
可选的,在一种可实现方式中,报文处理单元,还可以用于从第一数据报文中获取数据读取次数,将数据读取次数发送给循环计数器,以使循环计数器存储数据读取次数;或者,Optionally, in an achievable manner, the message processing unit may also be used to obtain the number of data reads from the first data message, and send the number of data reads to the loop counter, so that the loop counter stores the data Number of reads; or,
报文处理单元,还可以用于根据第一类接口的数据承载长度和第二类接口的数据承载长度,确定数据读取次数,并将数据读取次数发送给循环计数器,以使循环计数器存储数据读取次数。The message processing unit can also be used to determine the number of data reads according to the data carrying length of the first type of interface and the data carrying length of the second type of interface, and send the number of data reads to the loop counter, so that the loop counter stores Number of data reads.
可选的,在一种可实现方式中,转换装置获取数据读取次数N时具体用于:从第一数据报文中获取数据读取次数N;或者,根据第一类接口的数据承载长度和第二类接口的数据承载长度,确定数据读取次数N。Optionally, in an achievable manner, when the conversion device obtains the number of data reads N, it is specifically used to: obtain the number of data reads N from the first data packet; or, according to the data carrying length of the first type of interface The data carrying length of the second type interface determines the number of data reads N.
可选的,在一种可实现方式中,报文处理单元根据第一类接口的数据承载长度和第二类接口的数据承载长度,确定数据读取次数N时具体用于:获取第一类接口的接口类型,并确定与第一类接口的接口类型对应的第一数据承载长度;获取第二类接口的接口类型,并确定与第二类接口的接口类型对应的第二数据承载长度;根据第一数据承载长度和第二数据承载长度确定数据读取次数。Optionally, in an achievable manner, the message processing unit is specifically used to obtain the first type when determining the number of data reading times N according to the data carrying length of the first type interface and the data carrying length of the second type interface. The interface type of the interface, and determine the first data carrying length corresponding to the interface type of the first type of interface; obtaining the interface type of the second type of interface, and determining the second data carrying length corresponding to the interface type of the second type of interface; The number of data reads is determined according to the first data carrying length and the second data carrying length.
可选的,在一种可实现方式中,转换装置还可以包括多组数据组装单元,多组数据组装单元,用于接收接口板返回的N个数据,将N个数据组成载荷数据,并将载荷数据发送给报文处理单元,以使报文处理单元将载荷数据封装成第二数据报文。Optionally, in an implementable manner, the conversion device may also include multiple sets of data assembling units, multiple sets of data assembling units, for receiving N pieces of data returned by the interface board, forming the N pieces of data into load data, and The payload data is sent to the message processing unit, so that the message processing unit encapsulates the payload data into a second data message.
其中,网络设备中各部件的功能,可以参见上述实施例,在此不再赘述。For the function of each component in the network device, please refer to the above-mentioned embodiment, which will not be repeated here.
基于与上述网络设备、转换装置同样的申请构思,本申请实施例还提出一种数据传输方法,可以应用于网络设备,网络设备包括主控板、接口板和转换装置,转换装置通过第一类接口与主控板连接,转换装置通过第二类接口与接口板连接,参见图3所示,该方法可以包括:Based on the same application concept as the above-mentioned network equipment and conversion device, this embodiment of the application also proposes a data transmission method that can be applied to network equipment. The network equipment includes a main control board, an interface board, and a conversion device. The conversion device passes the first type The interface is connected to the main control board, and the conversion device is connected to the interface board through the second type of interface. As shown in Figure 3, the method may include:
步骤301,转换装置接收来自主控板的第一数据报文,并从第一数据报文中获取决策参数。Step 301: The conversion device receives a first data message from the main control board, and obtains a decision parameter from the first data message.
步骤302,当决策参数为第一决策参数时,转换装置获取数据读取次数N, N为大于1的正整数,并向接口板发送N个读操作命令,以使接口板根据N个读操作命令返回N个数据。Step 302: When the decision parameter is the first decision parameter, the conversion device obtains the number of data reads N, where N is a positive integer greater than 1, and sends N read operation commands to the interface board, so that the interface board performs the N read operations The command returns N data.
步骤303,转换装置获取N个数据的数据信息,将数据信息封装成第二数据报文,并将第二数据报文发送给主控板。Step 303: The conversion device obtains data information of N pieces of data, encapsulates the data information into a second data packet, and sends the second data packet to the main control board.
可选的,在一种可实现方式中,转换装置从第一数据报文中获取决策参数之后,该方法还包括:当决策参数为第二决策参数时,转换装置向接口板发送一个读操作命令,以使接口板根据该读操作命令返回一个数据;转换装置获取该数据的数据信息,将该数据信息封装成第三数据报文,并将第三数据报文发送给主控板。Optionally, in an achievable manner, after the conversion device obtains the decision parameter from the first data message, the method further includes: when the decision parameter is the second decision parameter, the conversion device sends a read operation to the interface board Command, so that the interface board returns a piece of data according to the read operation command; the conversion device obtains the data information of the data, encapsulates the data information into a third data message, and sends the third data message to the main control board.
可选的,在一种可实现方式中,当数据读取地址中的决策标识为第一数值时,则决策参数为第一决策参数;当数据读取地址中的决策标识为第二数值时,则决策参数为第二决策参数。Optionally, in an implementable manner, when the decision identifier in the data read address is the first value, the decision parameter is the first decision parameter; when the decision identifier in the data read address is the second value , The decision parameter is the second decision parameter.
可选的,在一种可实现方式中,转换装置获取数据读取次数N,可以包括:从第一数据报文中获取数据读取次数N;或者,根据第一类接口的数据承载长度和第二类接口的数据承载长度,确定数据读取次数N。Optionally, in an achievable manner, acquiring the number of data reads N by the conversion device may include: acquiring the number of data reads N from the first data packet; or, according to the data carrying length of the first type of interface and The data carrying length of the second type of interface determines the number of data reads N.
可选的,在一种可实现方式中,转换装置根据第一类接口的数据承载长度和第二类接口的数据承载长度,确定数据读取次数N,可以包括:获取第一类接口的接口类型,确定与第一类接口的接口类型对应的第一数据承载长度;获取第二类接口的接口类型,确定与第二类接口的接口类型对应的第二数据承载长度;根据第一数据承载长度和第二数据承载长度确定数据读取次数。Optionally, in an implementable manner, the conversion device determines the number of data reading times N according to the data carrying length of the first type of interface and the data carrying length of the second type of interface, which may include: obtaining the interface of the first type of interface Type, determine the first data carrying length corresponding to the interface type of the first type of interface; obtain the interface type of the second type of interface, determine the second data carrying length corresponding to the interface type of the second type of interface; according to the first data carrying The length and the second data carrying length determine the number of data reads.
可选的,在一种可实现方式中,转换装置获取N个数据的数据信息,将数据信息封装成第二数据报文,可以包括:接收接口板返回的N个数据,将N个数据组成载荷数据,将载荷数据封装成第二数据报文。Optionally, in an achievable manner, the conversion device obtains data information of N pieces of data, and encapsulates the data information into a second data message, which may include: receiving N pieces of data returned by the interface board and composing the N pieces of data Load data, encapsulate the load data into a second data message.
上述实施例阐明的设备、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机,计算机的具体形式可以是个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件收发设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任意几种设备 的组合。The equipment, devices, modules or units explained in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. The specific form of the computer can be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email receiving and sending device, and a game control A console, a tablet computer, a wearable device, or a combination of any of these devices.
为了描述的方便,描述以上装置时以功能分为各种单元分别描述。当然,在实施本申请时可以把各单元的功能在同一个或多个软件和/或硬件中实现。For the convenience of description, when describing the above device, the functions are divided into various units and described separately. Of course, when implementing this application, the functions of each unit can be implemented in the same one or more software and/or hardware.
本领域内的技术人员应明白,本申请的实施例可提供为方法、设备、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present application can be provided as methods, devices, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
本申请是参照根据本申请实施例的方法、设备、和计算机程序产品的流程图和/或方框图来描述的。应理解可以由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其它可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其它可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。This application is described with reference to flowcharts and/or block diagrams of methods, devices, and computer program products according to embodiments of this application. It should be understood that each process and/or block in the flowchart and/or block diagram, and the combination of processes and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing equipment to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing equipment are generated It is a device that realizes the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
而且,这些计算机程序指令也可以存储在能引导计算机或其它可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或者多个流程和/或方框图一个方框或者多个方框中指定的功能。Moreover, these computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device, The instruction device realizes the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
这些计算机程序指令也可装载到计算机或其它可编程数据处理设备上,使得在计算机或者其它可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其它可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operating steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so that the computer or other programmable equipment is executed The instructions provide steps for implementing functions specified in a flow or multiple flows in the flowchart and/or a block or multiple blocks in the block diagram.
以上实施例仅为本申请的较佳实施例而已,并不用以限制本申请,凡在本申请的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本申请保护的范围之内。The above embodiments are only preferred embodiments of the application, and are not intended to limit the application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the application shall be included in the application Within the scope of protection.

Claims (10)

  1. 一种转换装置,所述转换装置应用于网络设备,所述网络设备还包括主控板和接口板,所述转换装置通过第一类接口与所述主控板连接,所述转换装置通过第二类接口与所述接口板连接,其中:所述转换装置包括:报文处理单元、判定单元、循环计数器、连续读操作单元;A conversion device, the conversion device is applied to a network device, the network device further includes a main control board and an interface board, the conversion device is connected to the main control board through a first type of interface, and the conversion device is The second type interface is connected to the interface board, wherein: the conversion device includes: a message processing unit, a determination unit, a cycle counter, and a continuous read operation unit;
    所述报文处理单元,用于接收来自所述主控板的第一数据报文,从所述第一数据报文中获取决策参数,并将所述决策参数输出给判定单元;The message processing unit is configured to receive a first data message from the main control board, obtain a decision parameter from the first data message, and output the decision parameter to a determination unit;
    所述判定单元,用于当所述决策参数为第一决策参数时,向连续读操作单元输出第一命令;The determining unit is configured to output a first command to the continuous reading operation unit when the decision parameter is the first decision parameter;
    所述循环计数器,用于存储数据读取次数N,N为大于1的正整数;The cycle counter is used to store the number of data reads N, where N is a positive integer greater than 1;
    所述连续读操作单元,用于在接收到所述第一命令后,从所述循环计数器中读取所述数据读取次数N,并向所述接口板发送N个读操作命令,以使所述接口板根据所述N个读操作命令返回N个数据;The continuous read operation unit is configured to, after receiving the first command, read the number of data reads N from the cycle counter, and send N read operation commands to the interface board, so that The interface board returns N pieces of data according to the N read operation commands;
    所述报文处理单元,还用于获取所述N个数据的数据信息,将所述数据信息封装成第二数据报文,并将所述第二数据报文发送给所述主控板。The message processing unit is further configured to obtain data information of the N pieces of data, encapsulate the data information into a second data message, and send the second data message to the main control board.
  2. 根据权利要求1所述的转换装置,所述转换装置还包括:单次读操作单元;The conversion device according to claim 1, further comprising: a single read operation unit;
    所述判定单元,还用于当所述决策参数为第二决策参数时,向所述单次读操作单元输出第二命令;The determination unit is further configured to output a second command to the single read operation unit when the decision parameter is a second decision parameter;
    所述单次读操作单元,用于在接收到所述第二命令后,向所述接口板发送一个读操作命令,以使所述接口板根据所述一个读操作命令返回一个数据;The single read operation unit is configured to send a read operation command to the interface board after receiving the second command, so that the interface board returns a piece of data according to the one read operation command;
    所述报文处理单元,还用于获取所述一个数据的数据信息,将该数据信息封装成第三数据报文,并将所述第三数据报文发送给所述主控板。The message processing unit is further configured to obtain data information of the one piece of data, encapsulate the data information into a third data message, and send the third data message to the main control board.
  3. 根据权利要求2所述的转换装置,当数据读取地址中的决策标识为第一数值时,所述决策参数为第一决策参数;当数据读取地址中的决策标识为第二数值时,则所述决策参数为第二决策参数。The conversion device according to claim 2, when the decision identifier in the data read address is the first value, the decision parameter is the first decision parameter; when the decision identifier in the data read address is the second value, Then the decision parameter is the second decision parameter.
  4. 根据权利要求1所述的转换装置,所述报文处理单元,还用于从所述 第一数据报文中获取数据读取次数,将所述数据读取次数发送给所述循环计数器,以使所述循环计数器存储所述数据读取次数;或者,The conversion device according to claim 1, wherein the message processing unit is further configured to obtain the number of data reads from the first data message, and send the number of data reads to the loop counter to Make the cycle counter store the number of data reads; or,
    所述报文处理单元,还用于根据第一类接口的数据承载长度和第二类接口的数据承载长度,确定数据读取次数,并将所述数据读取次数发送给所述循环计数器,以使所述循环计数器存储所述数据读取次数。The message processing unit is further configured to determine the number of data reading times according to the data carrying length of the first type interface and the data carrying length of the second type interface, and sending the data reading times to the loop counter, So that the loop counter stores the number of data reads.
  5. 根据权利要求4所述的转换装置,所述报文处理单元根据第一类接口的数据承载长度和第二类接口的数据承载长度,确定数据读取次数时具体用于:获取第一类接口的接口类型,并确定与所述第一类接口的接口类型对应的第一数据承载长度;获取第二类接口的接口类型,并确定与所述第二类接口的接口类型对应的第二数据承载长度;根据所述第一数据承载长度和所述第二数据承载长度确定数据读取次数。The conversion device according to claim 4, wherein the message processing unit is specifically configured to obtain the first-type interface when determining the data reading times according to the data carrying length of the first-type interface and the data carrying length of the second-type interface And determine the first data carrying length corresponding to the interface type of the first type of interface; obtain the interface type of the second type of interface, and determine the second data corresponding to the interface type of the second type of interface Bearer length; the number of data reads is determined according to the first data bearer length and the second data bearer length.
  6. 根据权利要求1所述的转换装置,所述转换装置还包括:多组数据组装单元;The conversion device according to claim 1, further comprising: multiple sets of data assembling units;
    所述多组数据组装单元,用于接收所述接口板返回的N个数据,将所述N个数据组成载荷数据,并将所述载荷数据发送给所述报文处理单元,以使所述报文处理单元将所述载荷数据封装成第二数据报文。The multiple sets of data assembling units are configured to receive N pieces of data returned by the interface board, compose the N pieces of data into load data, and send the load data to the message processing unit, so that the The message processing unit encapsulates the payload data into a second data message.
  7. 一种网络设备,所述网络设备包括主控板、接口板和转换装置,所述转换装置通过第一类接口与所述主控板连接,所述转换装置通过第二类接口与所述接口板连接;其中:A network device includes a main control board, an interface board, and a conversion device, the conversion device is connected to the main control board through a first type interface, and the conversion device is connected to the interface through a second type interface Board connection; where:
    所述主控板,用于向所述转换装置发送第一数据报文;The main control board is configured to send a first data message to the conversion device;
    所述转换装置,用于在接收到所述第一数据报文后,从所述第一数据报文中获取决策参数;当所述决策参数为第一决策参数时,则获取数据读取次数N,N为大于1的正整数,并向所述接口板发送N个读操作命令;The conversion device is configured to obtain a decision parameter from the first data packet after receiving the first data packet; when the decision parameter is the first decision parameter, obtain the number of data reads N, N is a positive integer greater than 1, and N read operation commands are sent to the interface board;
    所述接口板,用于在接收到所述N个读操作命令后,返回N个数据;The interface board is configured to return N pieces of data after receiving the N read operation commands;
    所述转换装置,还用于获取所述N个数据的数据信息,将所述数据信息封装成第二数据报文,并将所述第二数据报文发送给所述主控板。The conversion device is further configured to obtain data information of the N pieces of data, encapsulate the data information into a second data message, and send the second data message to the main control board.
  8. 根据权利要求7所述的网络设备,所述转换装置,还用于当所述决策 参数为第二决策参数时,向所述接口板发送一个读操作命令;The network device according to claim 7, wherein the conversion device is further configured to send a read operation command to the interface board when the decision parameter is a second decision parameter;
    所述接口板,还用于在接收到所述一个读操作命令后,返回一个数据;The interface board is further configured to return a piece of data after receiving the one read operation command;
    所述转换装置,还用于获取所述一个数据的数据信息,将该数据信息封装成第三数据报文,并将所述第三数据报文发送给所述主控板。The conversion device is also used to obtain data information of the one piece of data, encapsulate the data information into a third data message, and send the third data message to the main control board.
  9. 根据权利要求7或8所述的网络设备,所述转换装置与所述主控板部署在同一个单板;或者,所述转换装置部署在单独的单板。The network device according to claim 7 or 8, wherein the conversion device and the main control board are deployed on the same single board; or, the conversion device is deployed on a separate single board.
  10. 一种数据传输方法,应用于网络设备,所述网络设备包括主控板、接口板和转换装置,所述转换装置通过第一类接口与主控板连接,所述转换装置通过第二类接口与接口板连接,所述方法包括:A data transmission method is applied to a network device. The network device includes a main control board, an interface board, and a conversion device. The conversion device is connected to the main control board through a first type interface, and the conversion device is connected through a second type interface. Connecting to the interface board, the method includes:
    所述转换装置接收来自所述主控板的第一数据报文,并从所述第一数据报文中获取决策参数;The conversion device receives a first data message from the main control board, and obtains a decision parameter from the first data message;
    当所述决策参数为第一决策参数时,所述转换装置获取数据读取次数N,N为大于1的正整数,并向所述接口板发送N个读操作命令,以使所述接口板根据所述N个读操作命令返回N个数据;When the decision parameter is the first decision parameter, the conversion device obtains the number of data reads N, where N is a positive integer greater than 1, and sends N read operation commands to the interface board so that the interface board Return N data according to the N read operation commands;
    所述转换装置获取所述N个数据的数据信息,将所述数据信息封装成第二数据报文,并将所述第二数据报文发送给所述主控板。The conversion device obtains data information of the N pieces of data, encapsulates the data information into a second data message, and sends the second data message to the main control board.
PCT/CN2020/081750 2019-03-29 2020-03-27 Network device WO2020200113A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910251463.8A CN109862044B (en) 2019-03-29 2019-03-29 Conversion device, network equipment and data transmission method
CN201910251463.8 2019-03-29

Publications (1)

Publication Number Publication Date
WO2020200113A1 true WO2020200113A1 (en) 2020-10-08

Family

ID=66902670

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/081750 WO2020200113A1 (en) 2019-03-29 2020-03-27 Network device

Country Status (2)

Country Link
CN (1) CN109862044B (en)
WO (1) WO2020200113A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109862044B (en) * 2019-03-29 2021-04-27 新华三技术有限公司 Conversion device, network equipment and data transmission method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103186223A (en) * 2011-12-27 2013-07-03 英业达股份有限公司 Computer device and detection method for external daughterboard
US20140156889A1 (en) * 2012-12-04 2014-06-05 Hon Hai Precision Industry Co., Ltd. Apparatus and method for monitoring signals transmitted in bus
CN106528474A (en) * 2016-11-02 2017-03-22 中国电子科技集团公司第五十研究所 RapidIO and PCI-E (Peripheral Component Interconnect-Express) interconnection system constructed on the basis of bridging chip
CN108733482A (en) * 2018-03-27 2018-11-02 华为技术有限公司 Method, processor and the communication device of acquisition of information
CN109862044A (en) * 2019-03-29 2019-06-07 新华三技术有限公司 A kind of conversion equipment, the network equipment and data transmission method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10572434B2 (en) * 2017-02-27 2020-02-25 International Business Machines Corporation Intelligent certificate discovery in physical and virtualized networks

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103186223A (en) * 2011-12-27 2013-07-03 英业达股份有限公司 Computer device and detection method for external daughterboard
US20140156889A1 (en) * 2012-12-04 2014-06-05 Hon Hai Precision Industry Co., Ltd. Apparatus and method for monitoring signals transmitted in bus
CN106528474A (en) * 2016-11-02 2017-03-22 中国电子科技集团公司第五十研究所 RapidIO and PCI-E (Peripheral Component Interconnect-Express) interconnection system constructed on the basis of bridging chip
CN108733482A (en) * 2018-03-27 2018-11-02 华为技术有限公司 Method, processor and the communication device of acquisition of information
CN109862044A (en) * 2019-03-29 2019-06-07 新华三技术有限公司 A kind of conversion equipment, the network equipment and data transmission method

Also Published As

Publication number Publication date
CN109862044A (en) 2019-06-07
CN109862044B (en) 2021-04-27

Similar Documents

Publication Publication Date Title
US9825809B2 (en) Dynamically configuring store-and-forward channels and cut-through channels in a network-on-chip
US8149708B2 (en) Dynamically switching streams of packets among dedicated and shared queues
US20140036681A1 (en) Traffic generator with priority flow control
US20060083185A1 (en) Method and apparatus for generic interface, packet cut-through, overbooking, queue concatenation, and logical identification priority for a system packet interface device
US8687483B2 (en) Parallel traffic generator with priority flow control
CN113573341B (en) Method, device, equipment and storage medium for negotiating business and link mapping configuration
US8824468B2 (en) System and method for parsing frames
WO2020200113A1 (en) Network device
CN114885045B (en) Method and device for saving DMA channel resources in high-speed intelligent network card/DPU
CN113141520B (en) Video stream transmission method and device, electronic equipment and storage medium
CN112019492B (en) Access control method, device and storage medium
CN111131408B (en) FPGA-based network protocol stack architecture design method
CN102308538B (en) Message processing method and device
US20230147734A1 (en) Communication method and apparatus
CN104038441A (en) Method and system for transmitting data
EP4203395A1 (en) Packet forwarding method and apparatus, and computer-readable storage medium
WO2020200111A1 (en) Network device
JP2020088517A (en) Communication apparatus, and control method and program of communication apparatus
CN117499351A (en) Message forwarding device and method, communication chip and network equipment
CN114363273A (en) Method and chip for processing message
CN109450823B (en) Network large-capacity switching device based on aggregation type cross node
US8793698B1 (en) Load balancer for parallel processors
WO2018196833A1 (en) Message sending method and message receiving method and apparatus
WO2022012204A1 (en) Queue scheduling method, device, and system
WO2024060247A1 (en) Data exchange method and apparatus based on bluetooth communication, and device and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20784223

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20784223

Country of ref document: EP

Kind code of ref document: A1