CN115208845A - Method, apparatus, device, storage medium, and program product for transmitting data packet - Google Patents

Method, apparatus, device, storage medium, and program product for transmitting data packet Download PDF

Info

Publication number
CN115208845A
CN115208845A CN202110384104.7A CN202110384104A CN115208845A CN 115208845 A CN115208845 A CN 115208845A CN 202110384104 A CN202110384104 A CN 202110384104A CN 115208845 A CN115208845 A CN 115208845A
Authority
CN
China
Prior art keywords
sent
channel
data packet
storage space
priority
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110384104.7A
Other languages
Chinese (zh)
Other versions
CN115208845B (en
Inventor
陈亮
何继昌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shengli Anyuan Technology Hangzhou Co ltd
Original Assignee
Shengli Anyuan Technology Hangzhou Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shengli Anyuan Technology Hangzhou Co ltd filed Critical Shengli Anyuan Technology Hangzhou Co ltd
Priority to CN202110384104.7A priority Critical patent/CN115208845B/en
Publication of CN115208845A publication Critical patent/CN115208845A/en
Application granted granted Critical
Publication of CN115208845B publication Critical patent/CN115208845B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/90Buffering arrangements
    • H04L49/901Buffering arrangements using storage descriptor, e.g. read or write pointers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/16Handling requests for interconnection or transfer for access to memory bus
    • G06F13/18Handling requests for interconnection or transfer for access to memory bus based on priority control
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/90Buffering arrangements
    • H04L49/9063Intermediate storage in different physical parts of a node or terminal

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本公开提供的发送数据包的方法、装置、设备、存储介质、程序产品,涉及计算机技术,包括:获取待发送数据包,根据待发送数据包所属的通道,将待发送数据包写入与通道对应的随机存储空间中;根据各通道的优先级,从各随机存储空间中读取待发送数据包,并将读取的待发送数据包写入先进先出存储器;其中,各通道的优先级是根据发送属于各通道的待发送数据包时的通畅程度确定的;对先进先出存储器中存储的各待发送数据包进行发送处理。本方案提供的方案中,可以通过各通道的优先级确定各通道的发送数据包顺序,先发送畅通通道的数据包,再发送不畅通通道的数据包,相同时间下可以提高整体数据包发送数量,进而可以提高整体的数据包发送效率。

Figure 202110384104

The method, device, device, storage medium, and program product for sending a data packet provided by the present disclosure relate to computer technology, and include: acquiring a data packet to be sent, and writing the data packet to be sent into the channel according to the channel to which the data packet to be sent belongs. In the corresponding random storage space; according to the priority of each channel, read the data packets to be sent from each random storage space, and write the read data packets to be sent into the FIFO memory; among them, the priority of each channel It is determined according to the smoothness of sending the data packets to be sent belonging to each channel; the data packets to be sent stored in the FIFO memory are sent and processed. In the solution provided by this solution, the order of sending data packets of each channel can be determined by the priority of each channel, and the data packets of the smooth channel are sent first, and then the data packets of the unsmooth channel are sent, and the overall number of data packets sent can be increased at the same time. , thereby improving the overall data packet transmission efficiency.

Figure 202110384104

Description

发送数据包的方法、装置、设备、存储介质、程序产品Method, apparatus, device, storage medium, program product for sending data packets

技术领域technical field

本公开涉及计算机技术,尤其涉及一种发送数据包的方法、装置、设备、存储介质、程序产品。The present disclosure relates to computer technology, and in particular, to a method, apparatus, device, storage medium, and program product for sending data packets.

背景技术Background technique

目前,在一些对发送数据包性能要求较高的应用场景下,可以采用多通道发包的方式,从而提高数据包的发送效率。At present, in some application scenarios that require high performance of sending data packets, a multi-channel packet sending method can be adopted, thereby improving the sending efficiency of data packets.

现有技术中的多通道发包方式,按照先进先出顺序对每个通道的数据包进行处理,若通道发生堵塞,则读取排在发生堵塞的通道出口的第一个数据包并将其重新放入通道,接着处理下一个数据包。In the multi-channel packet sending method in the prior art, the data packets of each channel are processed according to the first-in-first-out order. If the channel is blocked, the first data packet at the exit of the blocked channel is read and re-created. Put into the channel, and then process the next packet.

但是,采用多通道发包时,不同通道中数据包的发送速度不一样,有的通道堵塞,有的通道通畅,导致数据包的整体发送效率低下。However, when multi-channel packet sending is adopted, the sending speed of data packets in different channels is different, some channels are blocked, and some channels are unobstructed, resulting in low overall data packet sending efficiency.

发明内容SUMMARY OF THE INVENTION

本公开提供了一种发送数据包的方法、装置、设备、存储介质、程序产品,以解决现有技术中采用多通道发包时,不同通道中数据包的发送速度不一样,有的通道堵塞,有的通道通畅,导致数据包的整体发送效率低下的问题。The present disclosure provides a method, device, device, storage medium, and program product for sending data packets, so as to solve the problem that when multi-channel packet sending is adopted in the prior art, the sending speed of data packets in different channels is different, and some channels are blocked. Some channels are unobstructed, which leads to the problem of low overall transmission efficiency of data packets.

根据本申请第一方面,提供了一种发送数据包的方法,包括:According to the first aspect of the present application, a method for sending a data packet is provided, comprising:

获取待发送数据包,根据所述待发送数据包所属的通道,将所述待发送数据包写入与所述通道对应的随机存储空间中;Acquire the data packet to be sent, and write the data packet to be sent into the random storage space corresponding to the channel according to the channel to which the data packet to be sent belongs;

根据各通道的优先级,从各随机存储空间中读取待发送数据包,并将读取的所述待发送数据包写入先进先出存储器;其中,各所述通道的优先级是根据发送属于各所述通道的待发送数据包时的通畅程度确定的;According to the priority of each channel, read the data packet to be sent from each random storage space, and write the read data packet to be sent into the FIFO memory; wherein, the priority of each channel is based on the transmission Determined by the smoothness of the data packets to be sent belonging to each of the channels;

对所述先进先出存储器中存储的各待发送数据包进行发送处理。Sending processing is performed on each data packet to be sent stored in the FIFO memory.

根据本申请第二方面,提供了一种发送数据包的装置,包括:According to a second aspect of the present application, an apparatus for sending data packets is provided, comprising:

获取单元,用于获取待发送数据包,根据所述待发送数据包所属的通道,将所述待发送数据包写入与所述通道对应的随机存储空间中;an acquisition unit, configured to acquire a data packet to be sent, and write the data packet to be sent into a random storage space corresponding to the channel according to the channel to which the data packet to be sent belongs;

处理单元,用于根据各通道的优先级,从各随机存储空间中读取待发送数据包,并将读取的所述待发送数据包写入先进先出存储器;其中,各所述通道的优先级是根据发送属于各所述通道的待发送数据包时的通畅程度确定的;The processing unit is used to read the data packets to be sent from each random storage space according to the priority of each channel, and write the read data packets to be sent into the FIFO memory; The priority is determined according to the smoothness of sending the to-be-sent data packets belonging to each of the channels;

发送单元,用于对所述先进先出存储器中存储的各待发送数据包进行发送处理。A sending unit, configured to send each data packet to be sent stored in the FIFO memory.

根据本申请第三方面,提供了一种电子设备,包括存储器和处理器;其中,According to a third aspect of the present application, an electronic device is provided, including a memory and a processor; wherein,

所述存储器,用于存储计算机程序;the memory for storing computer programs;

所述处理器,用于读取所述存储器存储的计算机程序,并根据所述存储器中的计算机程序执行如第一方面所述的发送数据包的方法。The processor is configured to read the computer program stored in the memory, and execute the method for sending a data packet according to the first aspect according to the computer program in the memory.

根据本申请第四方面,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机执行指令,当处理器执行所述计算机执行指令时,实现如第一方面所述的发送数据包的方法。According to a fourth aspect of the present application, a computer-readable storage medium is provided, where computer-executable instructions are stored in the computer-readable storage medium, and when a processor executes the computer-executable instructions, the first aspect is implemented. Method for sending packets.

根据本申请第五方面,提供了一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时,实现如第一方面所述的发送数据包的方法。According to a fifth aspect of the present application, a computer program product is provided, including a computer program, which, when executed by a processor, implements the method for sending a data packet according to the first aspect.

本公开提供的发送数据包的方法、装置、设备、存储介质、程序产品,包括:获取待发送数据包,根据所述待发送数据包所属的通道,将所述待发送数据包写入与所述通道对应的随机存储空间中;根据各通道的优先级,从各随机存储空间中读取待发送数据包,并将读取的所述待发送数据包写入先进先出存储器;其中,各所述通道的优先级是根据发送属于各所述通道的待发送数据包时的通畅程度确定的;对所述先进先出存储器中存储的各待发送数据包进行发送处理。本方案提供的发送数据包的方法、装置、设备、存储介质、程序产品中,可以通过各通道的优先级确定各通道的发送数据包顺序,先发送畅通通道的数据包,再发送不畅通通道的数据包,相同时间下可以提高整体数据包发送数量,进而可以提高整体的数据包发送效率。The method, device, device, storage medium, and program product for sending a data packet provided by the present disclosure include: acquiring a data packet to be sent, and writing the data packet to be sent with the channel according to the channel to which the data packet to be sent belongs. In the random storage space corresponding to the channel; according to the priority of each channel, read the data packet to be sent from each random storage space, and write the read data packet to be sent into the FIFO memory; wherein, each The priority of the channel is determined according to the smoothness when sending the data packets to be sent belonging to each channel; the sending process is performed on each data packet to be sent stored in the first-in-first-out memory. In the method, device, device, storage medium, and program product for sending data packets provided by this solution, the order of sending data packets of each channel can be determined by the priority of each channel, and the data packets of the smooth channel are sent first, and then the data packets of the unsmooth channel are sent. The number of data packets sent in the same time can be increased, and the overall data packet transmission efficiency can be improved.

附图说明Description of drawings

图1为本申请一示例性实施例示出的发送数据包的方法的流程示意图;FIG. 1 is a schematic flowchart of a method for sending a data packet according to an exemplary embodiment of the present application;

图2为本申请另一示例性实施例示出的发送数据包的方法的流程示意图;2 is a schematic flowchart of a method for sending a data packet according to another exemplary embodiment of the present application;

图3为本申请一示例性实施例示出的发送数据包过程示意图;3 is a schematic diagram of a process of sending a data packet according to an exemplary embodiment of the present application;

图4为本申请一示例性实施例示出的发送数据包装置的结构图;FIG. 4 is a structural diagram of an apparatus for sending data packets according to an exemplary embodiment of the application;

图5为本申请另一示例性实施例示出的发送数据包装置的结构图;5 is a structural diagram of an apparatus for sending data packets according to another exemplary embodiment of the present application;

图6为本申请一示例性实施例示出的电子设备的结构图。FIG. 6 is a structural diagram of an electronic device according to an exemplary embodiment of the present application.

具体实施方式Detailed ways

目前,在一些对发送数据包性能要求较高的应用场景下,可以采用多通道发包的方式。具体的,这种多通道发包方式是按照先进先出顺序对每个通道的数据包进行处理,若通道发生堵塞,则读取排在发生堵塞的通道出口的第一个数据包并将其重新放入通道,接着处理下一个数据包。At present, in some application scenarios that require higher performance of sending data packets, a multi-channel packet sending method can be adopted. Specifically, this multi-channel packet sending method is to process the data packets of each channel according to the first-in-first-out order. If the channel is blocked, the first data packet at the exit of the blocked channel is read and reset. Put into the channel, and then process the next packet.

但是,采用这种多通道发包方式时,是对每个通道的数据包轮流进行处理,所有通道都是平级的。不同通道中数据包的发送速度不一样,有的通道堵塞,有的通道通畅,导致数据包的整体发送效率低下。However, when this multi-channel packet sending method is adopted, the data packets of each channel are processed in turn, and all channels are equal. The transmission speed of data packets in different channels is different, some channels are blocked, and some channels are unobstructed, resulting in low overall transmission efficiency of data packets.

为了解决上述技术问题,本申请提供的方案中,根据发送数据包的通畅性调整各通道的优先级,并基于优先级对各通道的待发送数据包进行发送处理。本申请提供的方法可以通过各通道的优先级确定各通道的发送数据包顺序,先发送畅通通道的数据包,再发送不畅通通道的数据包,相同时间下可以提高整体数据包发送数量,也就是说可以提高整体的数据包发送效率。In order to solve the above technical problems, in the solution provided by the present application, the priority of each channel is adjusted according to the smoothness of the data packets to be sent, and the data packets to be sent of each channel are sent based on the priority. The method provided by the present application can determine the order of sending data packets of each channel according to the priority of each channel, and send the data packets of the smooth channel first, and then send the data packets of the unsmooth channel. That is to say, the overall packet transmission efficiency can be improved.

图1为本申请一示例性实施例示出的发送数据包的方法的流程示意图。FIG. 1 is a schematic flowchart of a method for sending a data packet according to an exemplary embodiment of the present application.

如图1所示,本实施例提供的发送数据包的方法包括:As shown in FIG. 1 , the method for sending data packets provided by this embodiment includes:

步骤101,获取待发送数据包,根据待发送数据包所属的通道,将待发送数据包写入与通道对应的随机存储空间中。Step 101: Acquire the data packet to be sent, and write the data packet to be sent into a random storage space corresponding to the channel according to the channel to which the data packet to be sent belongs.

其中,本申请提供的方法可以由具备计算能力的电子设备来执行,比如可以是计算机等设备。该电子设备能够获取待发送数据包,根据待发送数据包所属的通道,将待发送数据包写入与通道对应的随机存储空间中。Wherein, the method provided in this application may be executed by an electronic device with computing capability, such as a computer and other devices. The electronic device can acquire the data packet to be sent, and write the data packet to be sent into a random storage space corresponding to the channel according to the channel to which the data packet to be sent belongs.

其中,比如在金融领域中需要给用户终端发送通知信息,假设该通知信息通过通道1发送,那么需要发送的包含通知通信的数据包就叫做待发送数据包,电子设备能够去获取该待发送数据包,并将待发送数据包写入与通道1对应的随机存储空间中。Among them, for example, in the financial field, notification information needs to be sent to the user terminal. Assuming that the notification information is sent through channel 1, the data packet containing the notification communication that needs to be sent is called the data packet to be sent, and the electronic device can obtain the data to be sent. packet, and write the data packet to be sent into the random storage space corresponding to channel 1.

其中,随机存储空间是对随机存取存储器(Random Access Memory,RAM)进行划分得到的空间,RAM是与CPU直接交换数据的内部存储器,也叫主存(内存)。它可以随时读写,而且速度很快,通常作为操作系统或其他正在运行中的程序的临时数据存储媒介。电子设备可以将获取的待发送数据包存储在随机存储空间中。The random storage space is a space obtained by dividing a random access memory (Random Access Memory, RAM), and the RAM is an internal memory that directly exchanges data with the CPU, also called main memory (memory). It can be read and written at any time, is fast, and is often used as a temporary data storage medium for the operating system or other running programs. The electronic device may store the acquired data packets to be sent in a random storage space.

具体的,在计算机系统中可以通过网络传输通道来传输数据,本案中,利用多个通道对各个待发送数据包进行传输。不同类型的数据包可以通过不同的通道传输。比如语音信号可以通过一条通道传输,图像信号可以通过另一条通道来传输。Specifically, in a computer system, data can be transmitted through a network transmission channel. In this case, multiple channels are used to transmit each data packet to be sent. Different types of packets can be transmitted over different channels. For example, a voice signal can be transmitted through one channel, and an image signal can be transmitted through another channel.

可以给每个通道命名,比如通道1、通道2、通道3等等,还可以设置通道与随机存储空间之间的对应关系,比如可以给每个通道在RAM中划分一块空间,比如给通道1划分RAM1,给通道2划分RAM2,通道3划分RAM3等等。电子设备可以将对应通道中的待发送数据包写入对应的随机存储空间中。You can name each channel, such as channel 1, channel 2, channel 3, etc., you can also set the corresponding relationship between the channel and the random storage space, for example, you can divide a space in RAM for each channel, such as channel 1 Divide RAM1, divide RAM2 for channel 2, divide RAM3 for channel 3, and so on. The electronic device can write the data packets to be sent in the corresponding channel into the corresponding random storage space.

步骤102,根据各通道的优先级,从各随机存储空间中读取待发送数据包,并将读取的待发送数据包写入先进先出存储器;其中,各通道的优先级是根据发送属于各通道的待发送数据包时的通畅程度确定的。Step 102, according to the priority of each channel, read the data packet to be sent from each random storage space, and write the read data packet to be sent into the FIFO memory; The smoothness of the data packets to be sent on each channel is determined.

其中,先进先出存储器(First In First Out,FIFO),是一种先进先出的数据缓存器,可以顺序写入数据,顺序的读出数据,先写入的数据会被先读出。Among them, the first-in-first-out (FIFO) memory is a first-in, first-out data buffer, which can write data in sequence, read data sequentially, and the data written first will be read first.

具体的,可以通过监控各个通道的发包畅通程度来确定各个通道的优先级;可以将畅通程度较高的通道设置为高优先级,畅通程度较低的通道设置为低优先级。因此,本方案中各个通道的优先级别并不是固定不变的,可以根据发包的实际情况进行调整。Specifically, the priority of each channel can be determined by monitoring the smoothness of sending packets of each channel; a channel with a higher smoothness can be set as a high priority, and a channel with a low smoothness can be set as a low priority. Therefore, the priority level of each channel in this solution is not fixed and can be adjusted according to the actual situation of the package.

实际应用时,可以设置外部环境探测器,该外部环境探测器能够监控各个通道的发包畅通程度,进而可以基于外部环境探测器的监控结果,调整各个通道的优先级。其中,可以由该探测器根据监测结果,将发包通畅的通道的优先级调为高优先级,不通畅的通道的优先级调为低优先级。外部环境动态变化,本探测器也会相应地调整各个通道优先级。In practical applications, an external environment detector can be set, which can monitor the smoothness of each channel for sending packets, and then can adjust the priority of each channel based on the monitoring results of the external environment detector. Wherein, according to the monitoring result, the detector can adjust the priority of the channel that sends the packets smoothly to the high priority, and the priority of the channel that is not smooth to the low priority. When the external environment changes dynamically, the detector will also adjust the priority of each channel accordingly.

本申请中,还可以通过寄存器寄存各个通道的优先级,在将随机存储空间中的待发送数据包写入FIFO存储器时,可以从寄存器中获取通道的优先级,进而确定具体将哪个待发送数据包存入到FIFO存储器。In this application, the priority of each channel can also be registered through the register. When the data packet to be sent in the random storage space is written into the FIFO memory, the priority of the channel can be obtained from the register, and then the specific data to be sent can be determined. Packets are stored in FIFO memory.

具体的,将随机存储空间中的待发送数据包写入FIFO时,可以根据各个通道的优先级,先把高优先级通道对应的随机存储空间中待发送数据包读走并写入FIFO中,若FIFO中有多余空间,再把低优先级通道对应的随机存储空间中的待发送数据包读走并写入FIFO中。Specifically, when writing the data packets to be sent in the random storage space into the FIFO, according to the priority of each channel, the to-be-sent data packets in the random storage space corresponding to the high-priority channel can be read and written into the FIFO first. If there is excess space in the FIFO, the data packets to be sent in the random storage space corresponding to the low-priority channel are read out and written into the FIFO.

这种实施方式中,由于利用优先级别高的通道发送数据包时发送更畅通,利用优先级别低的通道发送数据包时通畅性低一些,因此在一定程度上可以增加高优先级即畅通度高的通道发包数量,减少低优先级即畅通度低的通道发包数量,从而不至于因为通过FIFO发出去的低优先级通道的包过多而产生堵塞,在一定程度上提高了单位时间的总发包数量即提高了整体的发包效率。In this embodiment, since the data packets are sent more smoothly when the channel with a high priority is used, and the smoothness is lower when the data packets are sent by the channel with a low priority, it is possible to increase the high priority to a certain extent, that is, the smoothness is high. The number of packets sent by the channel can reduce the number of packets sent by the low priority channel, that is, the channel with low smoothness, so as not to cause blockage due to too many packets of the low priority channel sent through the FIFO, which improves the total number of packets sent per unit time to a certain extent. The quantity improves the overall package delivery efficiency.

步骤103,对先进先出存储器中存储的各待发送数据包进行发送处理。Step 103: Sending processing is performed on each data packet to be sent stored in the FIFO memory.

具体的,对FIFO中的各待发送数据包按先写入的待发送数据包先读出发送的方式发送出去。各待发送数据包通过所属通道传输出去。Specifically, each data packet to be sent in the FIFO is sent out in a manner of reading and sending the data packet to be sent that is written first. Each data packet to be sent is transmitted through the channel to which it belongs.

比如,现有将第一数据包、第二数据包依次写入FIFO中,第一数据包属于通道1,第二数据包属于通道2;则可以先读取其中的第一数据包,并通过通道1传输该第一数据包,再读取其中的第二数据包,并通过通道2传输该第二数据包。For example, currently, the first data packet and the second data packet are written into the FIFO in sequence, the first data packet belongs to channel 1, and the second data packet belongs to channel 2; Channel 1 transmits the first data packet, then reads the second data packet therein, and transmits the second data packet through channel 2.

本申请提供的发送数据包的方法,包括:获取待发送数据包,根据待发送数据包所属的通道,将待发送数据包写入与通道对应的随机存储空间中;根据各通道的优先级,从各随机存储空间中读取待发送数据包,并将读取的待发送数据包写入先进先出存储器;其中,各通道的优先级是根据发送属于各通道的待发送数据包时的通畅程度确定的;对先进先出存储器中存储的各待发送数据包进行发送处理。本申请中采用的方法中,可以根据发送属于各通道的待发送数据包时的通畅程度调整各通道的优先级,并且基于各通道的优先级对待发送数据包进行发送处理,从而能够优先处理发送时较为通畅的通道对应的待发送数据包,从而可以提高数据包的整体发送效率。The method for sending a data packet provided by the present application includes: acquiring a data packet to be sent, and writing the data packet to be sent into a random storage space corresponding to the channel according to the channel to which the data packet to be sent belongs; according to the priority of each channel, Read the data packets to be sent from each random storage space, and write the read data packets to be sent into the FIFO memory; wherein, the priority of each channel is based on the smoothness of the data packets to be sent belonging to each channel. The degree is determined; the sending process is performed on each data packet to be sent stored in the first-in-first-out memory. In the method adopted in this application, the priority of each channel can be adjusted according to the smoothness of the data packets to be sent belonging to each channel, and the data packets to be sent can be sent based on the priority of each channel, so that the transmission can be prioritized. The data packets to be sent corresponding to the relatively unobstructed channel at the time can be improved, so that the overall transmission efficiency of the data packets can be improved.

本申请提供的方法均由设置有本申请提供的方法的设备执行,该设备通常以硬件和/或软件的方式来实现。The methods provided in this application are all executed by a device provided with the methods provided in this application, and the device is usually implemented in hardware and/or software.

图2为本申请另一示例性实施例示出的发送数据包的方法的流程示意图。FIG. 2 is a schematic flowchart of a method for sending a data packet according to another exemplary embodiment of the present application.

如图2所示,本实施例提供的发送数据包的方法包括:As shown in FIG. 2, the method for sending data packets provided by this embodiment includes:

步骤201,获取待发送数据包,根据待发送数据包所属的通道,将待发送数据包写入与通道对应的随机存储空间中。Step 201: Acquire the data packet to be sent, and write the data packet to be sent into a random storage space corresponding to the channel according to the channel to which the data packet to be sent belongs.

步骤201与步骤101的实现方式、原理类似,不再赘述。The implementation manner and principle of step 201 are similar to those of step 101, and details are not repeated here.

步骤202,根据各通道的优先级,确定目标随机存储空间。Step 202: Determine the target random storage space according to the priority of each channel.

其中,通道与随机存储空间具有对应关系,比如,通道1与第一随机存储空间具有对应关系,通道2与第二随机存储空间具有对应关系,因此,可以根据各通道的优先级,在各随机存储空间中确定目标随机存储空间。Among them, the channel has a corresponding relationship with the random storage space. For example, the channel 1 has a corresponding relationship with the first random storage space, and the channel 2 has a corresponding relationship with the second random storage space. Therefore, according to the priority of each channel, the random Determine the target random storage space in the storage space.

若存储有待发送数据包的各随机存储空间对应的各通道的优先级包括多个优先级,在存储有待发送数据包的各随机存储空间中,则将与优先级别高的通道对应的随机存储空间轮流确定为目标随机存储空间。If the priority of each channel corresponding to each random storage space storing data packets to be sent includes multiple priorities, in each random storage space storing data packets to be sent, the random storage space corresponding to the channel with higher priority Take turns to determine the target random storage space.

一种实施方式中,本申请中优先级级别例如可以分为高优先级和低优先级两种。比如高优先级通道有通道1、通道2,与通道1对应的随机存储空间为RAM1,与通道2对应的随机存储空间为RAM2;低优先级通道有通道4、通道5,与通道4对应的随机存储空间为RAM4,与通道5对应的随机存储空间为RAM5。In an implementation manner, the priority levels in this application can be, for example, divided into two types: high priority and low priority. For example, the high-priority channel has channel 1 and channel 2, the random storage space corresponding to channel 1 is RAM1, and the random storage space corresponding to channel 2 is RAM2; the low-priority channel has channel 4 and channel 5, which corresponds to channel 4. The random storage space is RAM4, and the random storage space corresponding to channel 5 is RAM5.

当RAM1、RAM2、RAM4、RAM5中都有待发送数据包时,也就是存储有待发送数据包的各随机存储空间对应的各通道的优先级包括多个优先级,则将与高优先级通道对应的RAM1、RAM2轮流定为目标随机存储空间。比如,可以先将RAM1作为目标随机存储空间,从RAM1中读取一个包,再将RAM2作为目标随机存储空间,从RAM2中读取一个包,接着将RAM1作为目标随机存储空间,从RAM1中读取一个包,如此将与高优先级通道对应的RAM1、RAM2轮流定为目标随机存储空间。若RAM1中待发送数据包全被读走,RAM1中不存在待发送数据包,则将RAM2确定为目标随机存储空间。When there are data packets to be sent in RAM1, RAM2, RAM4, and RAM5, that is, the priority of each channel corresponding to each random storage space that stores the data packets to be sent includes multiple priorities, then the channel corresponding to the high-priority channel will be RAM1 and RAM2 are set as the target random storage space in turn. For example, you can first use RAM1 as the target random storage space, read a packet from RAM1, then use RAM2 as the target random storage space, read a packet from RAM2, and then use RAM1 as the target random storage space, read from RAM1 Take a package, and set RAM1 and RAM2 corresponding to the high-priority channel as the target random storage space in turn. If all the data packets to be sent in RAM1 are read, and there is no data packet to be sent in RAM1, then RAM2 is determined as the target random storage space.

当与高优先级通道对应的随机存储空间RAM1、RAM2中的待发送数据包全被读走后,若低优先级通道对应的随机存储空间RAM4和RAM5中有待发送数据包时,则当前存储有待发送数据包的各随机存储空间对应的各通道的优先级相同,则将存储有待发送数据包的各随机存储空间,轮流确定为目标随机存储空间。After all the data packets to be sent in the random storage spaces RAM1 and RAM2 corresponding to the high-priority channel are all read, if there are data packets to be sent in the random storage spaces RAM4 and RAM5 corresponding to the low-priority channel, the current storage is pending. If the priority of each channel corresponding to each random storage space for sending data packets is the same, each random storage space for storing data packets to be sent is determined in turn as the target random storage space.

具体可以将与低优先级通道对应的RAM4、RAM5轮流定为目标随机存储空间。比如,可以先将RAM4作为目标随机存储空间,从RAM4中读取一个包,再将RAM5作为目标随机存储空间,从RAM5中读取一个包,接着将RAM4作为目标随机存储空间,从RAM4中读取一个包,如此将与高优先级通道对应的RAM4、RAM5轮流定为目标随机存储空间。若RAM5中待发送数据包全被读走,RAM5中不存在待发送数据包,则将RAM4确定为目标随机存储空间。Specifically, the RAM4 and RAM5 corresponding to the low-priority channel may be set as the target random storage space in turn. For example, you can first use RAM4 as the target random storage space, read a packet from RAM4, then use RAM5 as the target random storage space, read a packet from RAM5, then use RAM4 as the target random storage space, read from RAM4 Take a package, and set RAM4 and RAM5 corresponding to the high-priority channel as the target random storage space in turn. If all the data packets to be sent in the RAM5 are read, and there is no data packet to be sent in the RAM5, then the RAM4 is determined as the target random storage space.

再比如,当只有RAM1、RAM2中有待发送数据包时,也就是存储有待发送数据包的各随机存储空间对应的各通道的优先级相同,则将RAM1、RAM2轮流定为目标随机存储空间。For another example, when there are only data packets to be sent in RAM1 and RAM2, that is, each channel corresponding to each random storage space storing the data packets to be sent has the same priority, then RAM1 and RAM2 are set in turn as the target random storage space.

不论高优先级和低优先级通道分别有几个,按照上述逻辑类推。另外,具有多个优先级时,也可以采用上述逻辑进行处理。Regardless of the number of high-priority and low-priority channels, the logic is analogous to the above. In addition, when there are multiple priorities, the above logic can also be used for processing.

步骤203,从目标随机存储空间中读取待发送数据包,并将读取的待发送数据包写入先进先出存储器。Step 203: Read the data packet to be sent from the target random storage space, and write the read data packet to be sent into the FIFO memory.

步骤203与步骤102中相关的实现方式、原理类似,不再赘述。Step 203 is similar to the related implementation manner and principle in step 102, and will not be repeated here.

步骤204,根据各待发送数据包存储到先进先出存储器的顺序,对各待发送数据包进行发送处理。Step 204, according to the order in which the data packets to be sent are stored in the first-in-first-out memory, send each data packet to be sent.

FIFO中先写入的数据会被先读出,进而对其进行发送处理。比如,现有将第一数据包、第二数据包、第三数据包依次写入FIFO中,则可以先读取其中的第一数据包,并发送该第一数据包。FIFO存储器是一个先入先出的双口缓冲器,第一个进入其内的数据第一个被移出,该存储器具有两个传输口,一个是存储器的入口,另一个口是存储器的出口。The data written first in the FIFO will be read first and then sent for processing. For example, in the prior art, the first data packet, the second data packet, and the third data packet are written into the FIFO in sequence, and the first data packet in the FIFO can be read first, and then the first data packet is sent. The FIFO memory is a first-in-first-out dual-port buffer, the first data entered into it is the first to be shifted out, the memory has two transmission ports, one is the entrance of the memory, and the other port is the exit of the memory.

具体的,还可以获取FIFO中排在出口的待发送数据包所属通道的状态,若该通道未堵塞,则可以直接将该待发送数据包发出去。具体可以通过待发送数据包所属的通道发送该待发送数据包。Specifically, it is also possible to obtain the status of the channel to which the data packet to be sent that is queued at the exit in the FIFO belongs, and if the channel is not blocked, the data packet to be sent can be sent directly. Specifically, the data packet to be sent may be sent through the channel to which the data packet to be sent belongs.

其中,可以对FIFO中排在出口的第一个待发送数据包进行发送处理,在发送处理时,可以获取该待发送数据包所属通道的状态。Wherein, the first data packet to be sent that is ranked at the exit in the FIFO can be sent, and during the sending process, the status of the channel to which the data packet to be sent belongs can be acquired.

排在先进先出存储器出口的待发送数据包所属的通道堵塞,则读取该待发送数据包;并将堵塞的待发送数据包写入与堵塞的待发送数据包所属通道对应的随机存储空间中。If the channel to which the data packet to be sent that is placed at the exit of the FIFO memory is blocked, the data packet to be sent is read; and the blocked data packet to be sent is written into the random storage space corresponding to the channel to which the blocked data packet to be sent belongs. middle.

若对FIFO中排在出口的第一个待发送数据包进行发送处理时,该待发送数据包所属通道堵塞,则可以将其重新写入随机存储空间,以降低该堵塞的通道的数据传输压力。If the channel to which the to-be-sent data packet belongs is blocked when the first data packet to be sent in the FIFO is processed, it can be rewritten into the random storage space to reduce the data transmission pressure on the blocked channel .

具体的,比如FIFO中排在第一个的待发送数据包为RAM1的包1,其对应的通道为通道1,对应的随机存储空间为RAM1;若发送包1时通道1发生了堵塞,则将包1读走后重新写入RAM1。接着按照以上处理方式,按先入先出顺序再处理FIFO中下一个待发送数据包。Specifically, for example, the first data packet to be sent in the FIFO is packet 1 of RAM1, its corresponding channel is channel 1, and the corresponding random storage space is RAM1; if channel 1 is blocked when sending packet 1, then Read packet 1 and rewrite to RAM1. Then, according to the above processing method, the next data packet to be sent in the FIFO is processed in a first-in, first-out order.

步骤205,获取与各通道对应的数据传输信息;根据各通道的数据传输信息,在各通道中确定堵塞通道和/或通畅通道;降低堵塞通道的优先级,和/或提高通畅通道的优先级。Step 205: Acquire data transmission information corresponding to each channel; according to the data transmission information of each channel, determine a blocked channel and/or an unobstructed channel in each channel; reduce the priority of the blocked channel, and/or increase the priority of the unobstructed channel .

步骤205与步骤201-204的执行时序不做限制。The execution sequence of step 205 and steps 201-204 is not limited.

具体的,可以设置用于获取与各通道对应的数据传输信息的外部环境探测器,该外部环境探测器可以实时监测各个通道发包的通畅性,电子设备可以基于外部环境探测器的检测结果,将发包通畅的通道的优先级调为高优先级,和/或将不通畅的通道的优先级调为低优先级,从而在外部环境动态变化时,相应地调整各个通道的优先级,降低堵塞通道的优先级,和/或提高通畅通道的优先级。Specifically, an external environment detector for acquiring data transmission information corresponding to each channel can be set up. The external environment detector can monitor the smoothness of packets sent by each channel in real time, and the electronic device can Adjust the priority of the unobstructed channel to a high priority, and/or adjust the priority of an unobstructed channel to a low priority, so that when the external environment changes dynamically, the priority of each channel is adjusted accordingly to reduce blocked channels , and/or increase the priority of the clear channel.

一种实施方式中,电子设备中可以设置外部环境探测器以及一发包器。发包器用于执行步骤201-204,外部环境探测器可以执行步骤205。外部环境探测器可以获取与各通道对应的数据传输信息,并调整通道的优先级别。In one embodiment, an external environment detector and a packet transmitter may be provided in the electronic device. The packet sender is used to execute steps 201-204, and the external environment detector can execute step 205. The external environment detector can obtain the data transmission information corresponding to each channel and adjust the priority level of the channel.

其中,外部环境探测器确定的各个通道的优先级,实时传输给发包器,供发包器使用。发包器根据此优先级确定目标随机存储空间,并从目标随机存储空间中读取待发送数据包,将读取的待发送数据包写入FIFO中。若各通道优先级有变化,则发包器会相应做调整。Among them, the priority of each channel determined by the external environment detector is transmitted to the packet sender in real time for use by the packet sender. The packet sender determines the target random storage space according to the priority, reads the data packets to be sent from the target random storage space, and writes the read data packets to be sent into the FIFO. If the priority of each channel changes, the packet sender will adjust accordingly.

进一步的,可以根据各个通道待发送数据包的重要程度,预先设置各个通道的优先级,还可以根据需求调整通道的优先级别,并将通道的级别并写入发包器中。Further, the priority of each channel can be preset according to the importance of the data packets to be sent by each channel, the priority level of the channel can also be adjusted according to the requirements, and the level of the channel can be written into the packet sender.

另外,如果各通道的通畅性具有一定的规律,那么也可以预先确定各通道的优先级,并把各通道优先级写入发包器中。In addition, if the smoothness of each channel has a certain rule, the priority of each channel can also be determined in advance, and the priority of each channel can be written into the packet transmitter.

图3为本申请一示例性实施例示出的发送数据包过程示意图。FIG. 3 is a schematic diagram of a process of sending a data packet according to an exemplary embodiment of the present application.

本实施例以三个通道为例进行说明。This embodiment takes three channels as an example for description.

如图3所示,假设有三个通道31分别为通道1、通道2、通道3,与这三个通道所对应的随机存储空间32分别为RAM1、RAM2、RAM3;将通道31中待发送数据包分别写入对应的随机存储空间32中,具体的,通道1中的待发送数据包写入RAM1中,通道2中的待发送数据包写入RAM2中,通道3中的待发送数据包写入RAM3中;根据外部环境探测器34判断出的优先级确定目标随机存储空间,并从目标随机存储空间中读取待发送数据包并写入先进先出存储器33中;判断发送先进先出存储器33中第一个进入的待发送数据包所属的通道是否堵塞,若不堵塞则直接发送该数据包;若堵塞,则把该数据包读出并重新写入对应的RAM中。As shown in FIG. 3 , it is assumed that there are three channels 31, namely, channel 1, channel 2, and channel 3, and the random storage spaces 32 corresponding to these three channels are RAM1, RAM2, and RAM3, respectively; They are written into the corresponding random storage space 32 respectively. Specifically, the data packets to be sent in channel 1 are written into RAM1, the data packets to be sent in channel 2 are written into RAM2, and the data packets to be sent in channel 3 are written into RAM1. In RAM3; determine the target random storage space according to the priority judged by the external environment detector 34, and read the data packets to be sent from the target random storage space and write them into the FIFO memory 33; determine the sending FIFO memory 33 Whether the channel to which the first incoming data packet to be sent belongs is blocked, if not, the data packet is sent directly; if it is blocked, the data packet is read out and rewritten into the corresponding RAM.

图4为本申请一示例性实施例示出的发送数据包装置的结构图。FIG. 4 is a structural diagram of an apparatus for sending data packets according to an exemplary embodiment of the present application.

如图4所示,本申请提供的发送数据包装置400,包括:As shown in FIG. 4 , the device 400 for sending data packets provided by the present application includes:

获取单元410,用于获取待发送数据包,根据待发送数据包所属的通道,将待发送数据包写入与通道对应的随机存储空间中;The obtaining unit 410 is configured to obtain the data packet to be sent, and according to the channel to which the data packet to be sent belongs, write the data packet to be sent into the random storage space corresponding to the channel;

处理单元420,用于根据各通道的优先级,从各随机存储空间中读取待发送数据包,并将读取的待发送数据包写入先进先出存储器;其中,各通道的优先级是根据发送属于各通道的待发送数据包时的通畅程度确定的;The processing unit 420 is configured to read the data packets to be sent from each random storage space according to the priority of each channel, and write the read data packets to be sent into the FIFO memory; wherein, the priority of each channel is Determined according to the smoothness of sending data packets to be sent belonging to each channel;

发送单元430,用于对先进先出存储器中存储的各待发送数据包进行发送处理。The sending unit 430 is configured to send each data packet to be sent stored in the FIFO memory.

本申请提供的发送数据包装置的原理、实现方式、技术效果与图1相似,不再赘述。The principle, implementation manner, and technical effect of the device for sending data packets provided by the present application are similar to those in FIG. 1 , and will not be repeated here.

图5为本申请另一示例性实施例示出的发送数据包装置的结构图。FIG. 5 is a structural diagram of an apparatus for sending data packets according to another exemplary embodiment of the present application.

如图5所示,在上述实施例基础上,本申请提供的发送数据包装置500中,处理单元420包括:As shown in FIG. 5 , on the basis of the foregoing embodiment, in the apparatus for sending data packets 500 provided by the present application, the processing unit 420 includes:

目标空间确定模块421,用于根据各通道的优先级,确定目标随机存储空间;The target space determination module 421 is used to determine the target random storage space according to the priority of each channel;

读取模块422,用于从目标随机存储空间中读取待发送数据包。The reading module 422 is configured to read the data packet to be sent from the target random storage space.

若存储有待发送数据包的各随机存储空间对应的各通道的优先级包括多个优先级,目标空间确定模块421,具体用于在存储有待发送数据包的各随机存储空间中,将与优先级别高的通道对应的随机存储空间轮流确定为目标随机存储空间。If the priority of each channel corresponding to each random storage space for storing data packets to be sent includes multiple priorities, the target space determination module 421 is specifically configured to store data packets to be sent in each random storage space. The random storage space corresponding to the high channel is determined in turn as the target random storage space.

若存储有待发送数据包的各随机存储空间对应的各通道的优先级相同,目标空间确定模块421,具体用于将存储有待发送数据包的各随机存储空间,轮流确定为目标随机存储空间。If the priority of each channel corresponding to each random storage space storing data packets to be sent is the same, the target space determination module 421 is specifically configured to determine each random storage space storing data packets to be sent as the target random storage space in turn.

如图5所示,在上述实施例基础上,本申请提供的发送数据包装置500中,发送单元430具体用于:As shown in FIG. 5 , on the basis of the above embodiment, in the apparatus for sending data packets 500 provided by the present application, the sending unit 430 is specifically used for:

根据各待发送数据包存储到先进先出存储器的顺序,对各待发送数据包进行发送处理。According to the sequence in which the data packets to be sent are stored in the first-in-first-out memory, the data packets to be sent are processed for sending.

发送单元430具体用于,若排在先进先出存储器出口的待发送数据包所属的通道堵塞,则读取待发送数据包;The sending unit 430 is specifically configured to read the data packet to be sent if the channel to which the data packet to be sent that is arranged at the FIFO memory outlet belongs is blocked;

将读取的待发送数据包写入与堵塞的通道对应的随机存储空间中。Write the read data packets to be sent into the random storage space corresponding to the blocked channel.

发送单元430具体用于,若排在先进先出存储器出口的待发送数据包所属的通道未堵塞,则通过待发送数据包所属的通道发送待发送数据包。The sending unit 430 is specifically configured to send the to-be-sent data packet through the channel to which the to-be-sent data packet belongs if the channel to which the to-be-sent data packet is queued at the FIFO memory outlet is not blocked.

如图5所示,在上述实施例基础上,本申请提供的发送数据包装置500中,还包括调整单元440,用于:As shown in FIG. 5 , on the basis of the above-mentioned embodiment, the apparatus for sending data packets 500 provided by the present application further includes an adjustment unit 440 for:

获取与各通道对应的数据传输信息;Obtain data transmission information corresponding to each channel;

根据各通道的数据传输信息,在各通道中确定堵塞通道和/或通畅通道;According to the data transmission information of each channel, determine the blocked channel and/or the unobstructed channel in each channel;

降低堵塞通道的优先级,和/或提高通畅通道的优先级。Decrease the priority of blocked channels, and/or increase the priority of clear channels.

图6为本申请一示例性实施例示出的电子设备的结构图。FIG. 6 is a structural diagram of an electronic device according to an exemplary embodiment of the present application.

如图6所示,本实施例提供的电子设备包括:As shown in FIG. 6 , the electronic device provided in this embodiment includes:

存储器601;memory 601;

处理器602;以及processor 602; and

计算机程序;Computer program;

其中,计算机程序存储在存储器601中,并配置为由处理器602执行以实现如上的任一种发送数据包方法。The computer program is stored in the memory 601 and configured to be executed by the processor 602 to implement any of the above methods for sending data packets.

本实施例还提供一种计算机可读存储介质,其上存储有计算机程序,This embodiment also provides a computer-readable storage medium on which a computer program is stored,

计算机程序被处理器执行以实现如上的任一种发送数据包方法。A computer program is executed by a processor to implement any of the above methods of sending data packets.

本实施例还提供一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时,实现上述任一种发送数据包方法。This embodiment also provides a computer program product, including a computer program, which, when executed by a processor, implements any of the above-mentioned methods for sending data packets.

本领域普通技术人员可以理解:实现上述各方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成。前述的程序可以存储于一计算机可读取存储介质中。该程序在执行时,执行包括上述各方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments may be completed by program instructions related to hardware. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps including the above method embodiments are executed; and the foregoing storage medium includes: ROM, RAM, magnetic disk or optical disk and other media that can store program codes.

最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, but not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: The technical solutions described in the foregoing embodiments can still be modified, or some or all of the technical features thereof can be equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the technical solutions of the embodiments of the present invention. scope.

Claims (12)

1.一种发送数据包的方法,其特征在于,包括:1. a method for sending a data packet, comprising: 获取待发送数据包,根据所述待发送数据包所属的通道,将所述待发送数据包写入与所述通道对应的随机存储空间中;Acquire the data packet to be sent, and write the data packet to be sent into the random storage space corresponding to the channel according to the channel to which the data packet to be sent belongs; 根据各通道的优先级,从各随机存储空间中读取待发送数据包,并将读取的所述待发送数据包写入先进先出存储器;其中,各所述通道的优先级是根据发送属于各所述通道的待发送数据包时的通畅程度确定的;According to the priority of each channel, read the data packet to be sent from each random storage space, and write the read data packet to be sent into the FIFO memory; wherein, the priority of each channel is based on the transmission Determined by the smoothness of the data packets to be sent belonging to each of the channels; 对所述先进先出存储器中存储的各待发送数据包进行发送处理。Sending processing is performed on each data packet to be sent stored in the FIFO memory. 2.根据权利要求1所述的方法,其特征在于,根据各通道的优先级,从各随机存储空间中读取待发送数据包,并将读取的所述待发送数据包写入先进先出存储器,包括:2. The method according to claim 1, wherein, according to the priority of each channel, read data packets to be sent from each random storage space, and write the read data packets to be sent into first-in-first-out output memory, including: 根据各通道的优先级,确定目标随机存储空间;Determine the target random storage space according to the priority of each channel; 从所述目标随机存储空间中读取所述待发送数据包。Read the data packet to be sent from the target random storage space. 3.根据权利要求2所述的方法,其特征在于,若存储有待发送数据包的各随机存储空间对应的各通道的优先级包括多个优先级,则根据各通道的优先级,确定目标随机存储空间,包括:3. The method according to claim 2, wherein, if the priority of each channel corresponding to each random storage space for storing the data packet to be sent includes a plurality of priorities, then according to the priority of each channel, determine the target random Storage space, including: 在存储有待发送数据包的各随机存储空间中,将与优先级别高的通道对应的随机存储空间轮流确定为目标随机存储空间。In each random storage space storing the data packets to be sent, the random storage space corresponding to the channel with a high priority is determined in turn as the target random storage space. 4.根据权利要求2所述的方法,其特征在于,若存储有待发送数据包的各随机存储空间对应的各所述通道的优先级相同,则根据各通道的优先级,确定目标随机存储空间,包括:4. method according to claim 2 is characterized in that, if the priority of each described channel corresponding to each random storage space that stores the data packet to be sent is the same, then according to the priority of each channel, determine the target random storage space ,include: 将存储有待发送数据包的各随机存储空间,轮流确定为目标随机存储空间。Each random storage space that stores the data packets to be sent is determined in turn as the target random storage space. 5.根据权利要求1-4任一项所述的方法,其特征在于,所述对所述先进先出存储器中存储的各待发送数据包进行发送处理,包括:5. The method according to any one of claims 1-4, wherein the sending processing of each data packet to be sent stored in the FIFO memory comprises: 根据各所述待发送数据包存储到所述先进先出存储器的顺序,对各待发送数据包进行发送处理。According to the sequence in which the data packets to be sent are stored in the first-in-first-out memory, the data packets to be sent are sent. 6.根据权利要求5所述的方法,其特征在于,所述对各待发送数据包进行发送处理,包括:6. The method according to claim 5, wherein the sending processing of each data packet to be sent comprises: 若排在所述先进先出存储器出口的待发送数据包所属的通道堵塞,则读取所述待发送数据包;If the channel to which the to-be-sent data packets arranged at the FIFO memory outlet belong is blocked, read the to-be-sent data packets; 将读取的所述待发送数据包写入与堵塞的所述通道对应的随机存储空间中。The read data packet to be sent is written into a random storage space corresponding to the blocked channel. 7.根据权利要求5所述的方法,其特征在于,所述对各待发送数据包进行发送处理,包括:7. The method according to claim 5, wherein the sending processing of each data packet to be sent comprises: 若排在所述先进先出存储器出口的待发送数据包所属的通道未堵塞,则通过所述待发送数据包所属的通道发送所述待发送数据包。If the channel to which the to-be-sent data packet arranged at the FIFO memory outlet belongs is not blocked, the to-be-sent data packet is sent through the channel to which the to-be-sent data packet belongs. 8.根据权利要求1-4任一项所述的方法,其特征在于,所述方法还包括:8. The method according to any one of claims 1-4, wherein the method further comprises: 获取与各通道对应的数据传输信息;Obtain data transmission information corresponding to each channel; 根据各通道的数据传输信息,在各所述通道中确定堵塞通道和/或通畅通道;According to the data transmission information of each channel, determine a blocked channel and/or an unobstructed channel in each of the channels; 降低所述堵塞通道的优先级,和/或提高所述通畅通道的优先级。Decrease the priority of the blocked channel, and/or increase the priority of the clear channel. 9.一种发送数据包的装置,其特征在于,包括:9. A device for sending data packets, comprising: 获取单元,用于获取待发送数据包,根据所述待发送数据包所属的通道,将所述待发送数据包写入与所述通道对应的随机存储空间中;an obtaining unit, configured to obtain a data packet to be sent, and write the data packet to be sent into a random storage space corresponding to the channel according to the channel to which the data packet to be sent belongs; 处理单元,用于根据各通道的优先级,从各随机存储空间中读取待发送数据包,并将读取的所述待发送数据包写入先进先出存储器;其中,各所述通道的优先级是根据发送属于各所述通道的待发送数据包时的通畅程度确定的;The processing unit is used to read the data packets to be sent from each random storage space according to the priority of each channel, and write the read data packets to be sent into the FIFO memory; The priority is determined according to the smoothness of sending the to-be-sent data packets belonging to each of the channels; 发送单元,用于对所述先进先出存储器中存储的各待发送数据包进行发送处理。A sending unit, configured to send each data packet to be sent stored in the FIFO memory. 10.一种电子设备,其特征在于,包括存储器和处理器;其中,10. An electronic device, comprising a memory and a processor; wherein, 所述存储器,用于存储计算机程序;the memory for storing computer programs; 所述处理器,用于读取所述存储器存储的计算机程序,并根据所述存储器中的计算机程序执行上述权利要求1-8任一项所述的方法。The processor is configured to read the computer program stored in the memory, and execute the method according to any one of the preceding claims 1-8 according to the computer program in the memory. 11.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机执行指令,当处理器执行所述计算机执行指令时,实现上述权利要求1-8任一项所述的方法。11. A computer-readable storage medium, characterized in that, the computer-readable storage medium stores computer-executable instructions, and when a processor executes the computer-executable instructions, any one of the above claims 1-8 is implemented. method described. 12.一种计算机程序产品,包括计算机程序,其特征在于,该计算机程序被处理器执行时,实现上述权利要求1-8任一项所述的方法。12. A computer program product, comprising a computer program, characterized in that, when the computer program is executed by a processor, the method according to any one of the preceding claims 1-8 is implemented.
CN202110384104.7A 2021-04-09 2021-04-09 Method, device, equipment, storage medium, and program product for sending data packets Active CN115208845B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110384104.7A CN115208845B (en) 2021-04-09 2021-04-09 Method, device, equipment, storage medium, and program product for sending data packets

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110384104.7A CN115208845B (en) 2021-04-09 2021-04-09 Method, device, equipment, storage medium, and program product for sending data packets

Publications (2)

Publication Number Publication Date
CN115208845A true CN115208845A (en) 2022-10-18
CN115208845B CN115208845B (en) 2024-12-10

Family

ID=83570336

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110384104.7A Active CN115208845B (en) 2021-04-09 2021-04-09 Method, device, equipment, storage medium, and program product for sending data packets

Country Status (1)

Country Link
CN (1) CN115208845B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115604198A (en) * 2022-11-29 2023-01-13 珠海星云智联科技有限公司(Cn) Network card controller, network card control method, equipment and medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060259648A1 (en) * 2005-05-13 2006-11-16 Sanjive Agarwala Concurrent read response acknowledge enhanced direct memory access unit
CN101459611A (en) * 2008-12-23 2009-06-17 杭州华三通信技术有限公司 Data transmission scheduling method, system and device for IP SAN storage
US20100185818A1 (en) * 2009-01-21 2010-07-22 Lanping Sheng Resource pool managing system and signal processing method
CN103678199A (en) * 2012-09-26 2014-03-26 深圳市中兴微电子技术有限公司 Data transmission method and data transmission equipment
CN107391023A (en) * 2016-05-16 2017-11-24 深圳市中兴微电子技术有限公司 A kind of multi-channel data memory and its access method and device
CN107679620A (en) * 2017-04-19 2018-02-09 北京深鉴科技有限公司 Artificial neural network processing unit
CN108259368A (en) * 2018-01-11 2018-07-06 郑州云海信息技术有限公司 A kind of data transmission system and method based on FPGA
CN109361620A (en) * 2018-11-09 2019-02-19 杭州迪普科技股份有限公司 A kind of method, apparatus, equipment and storage medium that data are sent
CN111459690A (en) * 2020-04-10 2020-07-28 Oppo广东移动通信有限公司 Data transceiver control method, device, mobile terminal and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060259648A1 (en) * 2005-05-13 2006-11-16 Sanjive Agarwala Concurrent read response acknowledge enhanced direct memory access unit
CN101459611A (en) * 2008-12-23 2009-06-17 杭州华三通信技术有限公司 Data transmission scheduling method, system and device for IP SAN storage
US20100185818A1 (en) * 2009-01-21 2010-07-22 Lanping Sheng Resource pool managing system and signal processing method
CN103678199A (en) * 2012-09-26 2014-03-26 深圳市中兴微电子技术有限公司 Data transmission method and data transmission equipment
CN107391023A (en) * 2016-05-16 2017-11-24 深圳市中兴微电子技术有限公司 A kind of multi-channel data memory and its access method and device
CN107679620A (en) * 2017-04-19 2018-02-09 北京深鉴科技有限公司 Artificial neural network processing unit
CN108259368A (en) * 2018-01-11 2018-07-06 郑州云海信息技术有限公司 A kind of data transmission system and method based on FPGA
CN109361620A (en) * 2018-11-09 2019-02-19 杭州迪普科技股份有限公司 A kind of method, apparatus, equipment and storage medium that data are sent
CN111459690A (en) * 2020-04-10 2020-07-28 Oppo广东移动通信有限公司 Data transceiver control method, device, mobile terminal and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115604198A (en) * 2022-11-29 2023-01-13 珠海星云智联科技有限公司(Cn) Network card controller, network card control method, equipment and medium
CN115604198B (en) * 2022-11-29 2023-03-10 珠海星云智联科技有限公司 Network card controller, network card control method, equipment and medium

Also Published As

Publication number Publication date
CN115208845B (en) 2024-12-10

Similar Documents

Publication Publication Date Title
US20240171507A1 (en) System and method for facilitating efficient utilization of an output buffer in a network interface controller (nic)
US8732360B2 (en) System and method for accessing memory
US10158702B2 (en) Network operation offloading for collective operations
CN111641566B (en) Data processing method, network card and server
US9276857B2 (en) Method and apparatus for scheduling packets for transmission in a network processor having a programmable pipeline
CN110602211B (en) Out-of-order RDMA method and device with asynchronous notification
CN115208845A (en) Method, apparatus, device, storage medium, and program product for transmitting data packet
CN118509399B (en) A message processing method, device, electronic device and storage medium
CN115941634A (en) Threshold adjustment method, device and computer equipment for shared cache
WO2019109902A1 (en) Queue scheduling method and apparatus, communication device, and storage medium
WO2022174444A1 (en) Data stream transmission method and apparatus, and network device
CN112448897B (en) Switch shared cache allocation method and device based on reinforcement learning
CN114500403A (en) A data processing method, apparatus and computer readable storage medium
CN111740922B (en) Data transmission method, device, electronic equipment and medium
CN116991609B (en) Queue fairness processing method, apparatus, and readable storage medium
CN116800684B (en) Performance isolation method of RDMA network card transmission queue and RDMA network card
CN117749726A (en) Method and device for mixed scheduling of output port priority queues of TSN switch
CN114827312B (en) Method and device for self-adapting delay and throughput rate requirement in intelligent network card/DPU
CN116633879A (en) Data packet receiving method, device, equipment and storage medium
CN110413540A (en) Method, system, device and storage medium for FPGA data caching
CN115604210A (en) scalable queue
CN114401235A (en) Method, system, medium, equipment and application for processing heavy load in queue management
CN109413122B (en) A data processing method, network processor and computer storage medium
US11240178B2 (en) Data transmission method and data transmission system
JP4086676B2 (en) Data transfer device

Legal Events

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