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 PDFInfo
- 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
- data packet
- sent
- channel
- priority
- storage space
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 44
- 230000005540 biological transmission Effects 0.000 claims description 20
- 238000004590 computer program Methods 0.000 claims description 17
- 238000012545 processing Methods 0.000 claims description 13
- 230000003247 decreasing effect Effects 0.000 claims description 3
- 238000005516 engineering process Methods 0.000 abstract description 2
- 101100325756 Arabidopsis thaliana BAM5 gene Proteins 0.000 description 19
- 101150046378 RAM1 gene Proteins 0.000 description 19
- 101100476489 Rattus norvegicus Slc20a2 gene Proteins 0.000 description 19
- 102100031584 Cell division cycle-associated 7-like protein Human genes 0.000 description 13
- 101000777638 Homo sapiens Cell division cycle-associated 7-like protein Proteins 0.000 description 13
- 101100328887 Caenorhabditis elegans col-34 gene Proteins 0.000 description 10
- RRLHMJHRFMHVNM-BQVXCWBNSA-N [(2s,3r,6r)-6-[5-[5-hydroxy-3-(4-hydroxyphenyl)-4-oxochromen-7-yl]oxypentoxy]-2-methyl-3,6-dihydro-2h-pyran-3-yl] acetate Chemical compound C1=C[C@@H](OC(C)=O)[C@H](C)O[C@H]1OCCCCCOC1=CC(O)=C2C(=O)C(C=3C=CC(O)=CC=3)=COC2=C1 RRLHMJHRFMHVNM-BQVXCWBNSA-N 0.000 description 9
- 238000010586 diagram Methods 0.000 description 8
- 238000012544 monitoring process Methods 0.000 description 3
- 238000004891 communication Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L49/00—Packet switching elements
- H04L49/90—Buffering arrangements
- H04L49/901—Buffering arrangements using storage descriptor, e.g. read or write pointers
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/14—Handling requests for interconnection or transfer
- G06F13/16—Handling requests for interconnection or transfer for access to memory bus
- G06F13/18—Handling requests for interconnection or transfer for access to memory bus based on priority control
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L49/00—Packet switching elements
- H04L49/90—Buffering arrangements
- H04L49/9063—Intermediate storage in different physical parts of a node or terminal
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The method, apparatus, device, storage medium, and program product for sending data packets 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 a random storage space corresponding to a channel according to the channel to which the data packet to be sent belongs; reading a data packet to be sent from each random storage space according to the priority of each channel, and writing the read data packet to be sent into a first-in first-out memory; the priority of each channel is determined according to the smoothness degree when the data packets to be sent belonging to each channel are sent; and transmitting each data packet to be transmitted stored in the first-in first-out memory. According to the scheme provided by the scheme, the data packet sending sequence of each channel can be determined according to the priority of each channel, the data packets of the unblocked channels are sent firstly, and the data packets of the unblocked channels are sent secondly, so that the sending quantity of the whole data packets can be increased in the same time, and the sending efficiency of the whole data packets can be increased.
Description
Technical Field
The present disclosure relates to computer technologies, and in particular, to a method, an apparatus, a device, a storage medium, and a program product for transmitting a data packet.
Background
At present, in some application scenarios with high requirements for the performance of sending data packets, a multi-channel packet sending mode can be adopted, so that the sending efficiency of the data packets is improved.
In a multi-channel packet sending mode in the prior art, data packets of each channel are processed according to a first-in first-out sequence, if a channel is blocked, a first data packet arranged at an outlet of the blocked channel is read and put into the channel again, and then a next data packet is processed.
However, when multi-channel packet transmission is adopted, the transmission speeds of the data packets in different channels are different, some channels are blocked, some channels are unobstructed, and the overall transmission efficiency of the data packets is low.
Disclosure of Invention
The present disclosure provides a method, an apparatus, a device, a storage medium, and a program product for sending a data packet, so as to solve the problem in the prior art that when a multi-channel packet is sent, the sending speeds of data packets in different channels are different, some channels are blocked, some channels are unobstructed, and the overall sending efficiency of the data packet is low.
According to a first aspect of the present application, there is provided a method for transmitting a data packet, including:
acquiring a data packet to be sent, and writing the data packet to be sent into a random storage space corresponding to a channel according to the channel to which the data packet to be sent belongs;
reading a data packet to be sent from each random storage space according to the priority of each channel, and writing the read data packet to be sent into a first-in first-out memory; the priority of each channel is determined according to the smoothness degree when the data packet to be sent belonging to each channel is sent;
and transmitting each data packet to be transmitted stored in the first-in first-out memory.
According to a second aspect of the present application, there is provided an apparatus for transmitting a data packet, 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 a channel to which the data packet to be sent belongs according to the channel to which the data packet to be sent belongs;
the processing unit is used for reading a data packet to be sent from each random storage space according to the priority of each channel and writing the read data packet to be sent into a first-in first-out memory; the priority of each channel is determined according to the smoothness degree when the data packet to be sent belonging to each channel is sent;
and the sending unit is used for sending each data packet to be sent stored in the first-in first-out memory.
According to a third aspect of the present application, there is provided an electronic device comprising a memory and a processor; wherein,
the memory for storing a computer program;
the processor is configured to read the computer program stored in the memory, and execute the method for sending the data packet according to the first aspect according to the computer program in the memory.
According to a fourth aspect of the present application, there is provided a computer-readable storage medium having stored therein computer-executable instructions that, when executed by a processor, implement the method for transmitting data packets according to the first aspect.
According to a fifth aspect of the application, a computer program product is provided, comprising a computer program which, when executed by a processor, performs the method of transmitting data packets as described in the first aspect.
The method, apparatus, device, storage medium, and program product for transmitting a data packet provided by the present disclosure include: acquiring a data packet to be sent, and writing the data packet to be sent into a random storage space corresponding to a channel according to the channel to which the data packet to be sent belongs; reading a data packet to be sent from each random storage space according to the priority of each channel, and writing the read data packet to be sent into a first-in first-out memory; the priority of each channel is determined according to the smoothness degree when the data packet to be sent belonging to each channel is sent; and transmitting each data packet to be transmitted stored in the first-in first-out memory. In the method, the device, the equipment, the storage medium and the program product for sending the data packets, the order of sending the data packets of each channel can be determined according to the priority of each channel, the data packets of the unblocked channel are sent first, and the data packets of the unblocked channel are sent next, so that the sending quantity of the whole data packets can be increased in the same time, and the sending efficiency of the whole data packets can be increased.
Drawings
Fig. 1 is a flowchart illustrating a method for transmitting a data packet according to an exemplary embodiment of the present application;
fig. 2 is a flowchart illustrating a method for transmitting a data packet according to another exemplary embodiment of the present application;
FIG. 3 is a diagram illustrating a process for sending a data packet according to an exemplary embodiment of the present application;
fig. 4 is a block diagram of a packet transmitting apparatus according to an exemplary embodiment of the present application;
fig. 5 is a block diagram of a packet transmitting apparatus according to another exemplary embodiment of the present application;
fig. 6 is a block diagram of an electronic device according to an exemplary embodiment of the present application.
Detailed Description
At present, under some application scenarios with high requirements on the performance of sending data packets, a multi-channel packet sending mode can be adopted. Specifically, the multi-channel packet sending method is to process the data packets of each channel according to a first-in first-out sequence, if a channel is blocked, the first data packet arranged at the outlet of the blocked channel is read and put into the channel again, and then the next data packet is processed.
However, when the multi-channel packet transmission method is adopted, the data packets of each channel are processed in turn, and all the channels are in parallel. The sending speed of the data packets in different channels is different, some channels are blocked, some channels are unobstructed, and the overall sending efficiency of the data packets is low.
In order to solve the technical problem, in the scheme provided by the application, the priority of each channel is adjusted according to the smoothness of the data packet to be sent, and the data packet to be sent of each channel is sent and processed based on the priority. The method provided by the application can determine the data packet sending sequence of each channel according to the priority of each channel, firstly send the data packets of the unblocked channel and then send the data packets of the unblocked channel, and can improve the sending quantity of the whole data packets in the same time, namely improve the sending efficiency of the whole data packets.
Fig. 1 is a flowchart illustrating a method for sending a data packet according to an exemplary embodiment of the present application.
As shown in fig. 1, the method for sending a data packet according to this embodiment includes:
The method provided by the present application may be executed by an electronic device with computing capability, for example, a computer or other devices. The electronic equipment can acquire a data packet to be sent, and writes the data packet to be sent into a random storage space corresponding to a channel according to the channel to which the data packet to be sent belongs.
For example, in the financial field, notification information needs to be sent to a user terminal, and if the notification information is sent through the channel 1, a data packet including notification communication that needs to be sent is called a data packet to be sent, and the electronic device can obtain the data packet to be sent and write the data packet to be sent into a random storage space corresponding to the channel 1.
The Random Access Memory (RAM) is a space obtained by dividing a RAM, and the RAM is an internal Memory that directly exchanges data with the CPU and is also called a main Memory (internal Memory). It can be read and written at any time, and is fast, usually used as temporary data storage medium of operating system or other running program. The electronic device may store the acquired data packet to be sent in the random storage space.
Specifically, data can be transmitted through a network transmission channel in a computer system, and in the scheme, a plurality of channels are used for transmitting each data packet to be transmitted. Different types of data packets may be transmitted over different channels. For example, a voice signal may be transmitted through one channel, and an image signal may be transmitted through the other channel.
Each channel may be named, for example, channel 1, channel 2, channel 3, and so on, and a corresponding relationship between the channels and the random access memory space may also be set, for example, each channel may be divided into a block of space in the RAM, for example, channel 1 is divided into RAM1, channel 2 is divided into RAM2, channel 3 is divided into RAM3, and so on. The electronic device can write the data packet to be sent in the corresponding channel into the corresponding random storage space.
First In First Out (FIFO), which is a First In First Out data buffer, can be written In sequence and read Out In sequence, and the data written In First can be read Out First.
Specifically, the priority of each channel can be determined by monitoring the smoothness of the packets of each channel; the channels with a higher degree of openness may be set to a high priority and the channels with a lower degree of openness may be set to a low priority. Therefore, the priority level of each channel in the scheme is not fixed and can be adjusted according to the actual situation of the package.
During actual application, an external environment detector can be arranged, the external environment detector can monitor the smoothness degree of the hair packages of all the channels, and then the priority of all the channels can be adjusted based on the monitoring result of the external environment detector. The detector can be used for adjusting the priority of the unobstructed channel of the hair pack to be high priority and the priority of the obstructed channel to be low priority according to the monitoring result. The external environment changes dynamically, and the detector can adjust the priority of each channel correspondingly.
In the application, the priority of each channel can be registered through the register, and 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, so that the specific data packet to be sent is determined to be stored into the FIFO memory.
Specifically, when the data packet to be sent in the random storage space is written into the FIFO, the data packet to be sent in the random storage space corresponding to the high-priority channel can be read away and written into the FIFO according to the priority of each channel, and if there is excess space in the FIFO, the data packet to be sent in the random storage space corresponding to the low-priority channel can be read away and written into the FIFO.
In the embodiment, the data packets are transmitted more smoothly by using the channel with high priority level, and the data packets are transmitted by using the channel with low priority level, so that the number of the channel packets with high priority level, namely high smoothness level, can be increased to a certain extent, and the number of the channel packets with low priority level, namely low smoothness level, can be reduced, thereby preventing the packets of the low priority channel transmitted by FIFO from being blocked due to too many packets, and improving the total number of the packets transmitted in unit time to a certain extent, namely improving the whole packet transmitting efficiency.
And 103, transmitting each data packet to be transmitted stored in the first-in first-out memory.
Specifically, each to-be-sent data packet in the FIFO is sent out in a manner that the to-be-sent data packet written in advance is read out and sent out first. And transmitting each data packet to be transmitted through the channel to which the data packet belongs.
For example, a first data packet and a second data packet are written into the FIFO in sequence, where the first data packet belongs to the channel 1 and the second data packet belongs to the channel 2; a first packet may be read and transmitted via channel 1, followed by a second packet being read and transmitted via channel 2.
The method for sending the data packet provided by the application comprises the following steps: acquiring a data packet to be sent, and writing the data packet to be sent into a random storage space corresponding to a channel according to the channel to which the data packet to be sent belongs; reading a data packet to be sent from each random storage space according to the priority of each channel, and writing the read data packet to be sent into a first-in first-out memory; the priority of each channel is determined according to the smoothness degree when the data packets to be sent belonging to each channel are sent; and transmitting each data packet to be transmitted stored in the first-in first-out memory. According to the method, the priority of each channel can be adjusted according to the smoothness degree of the data packets to be sent belonging to each channel, and the data packets to be sent are sent and processed based on the priority of each channel, so that the data packets to be sent corresponding to the channels which are smooth in sending can be processed preferentially, and the overall sending efficiency of the data packets can be improved.
The methods provided herein are each performed by a device provided with the methods provided herein, which is typically implemented in hardware and/or software.
Fig. 2 is a flowchart illustrating a method for transmitting a data packet according to another exemplary embodiment of the present application.
As shown in fig. 2, the method for sending a data packet according to this embodiment includes:
Step 201 is similar to step 101 in implementation manner and principle, and is not described again.
The channel and the random storage space have a corresponding relationship, for example, channel 1 and the first random storage space have a corresponding relationship, and channel 2 and the second random storage space have a corresponding relationship, so that the target random storage space can be determined in each random storage space according to the priority of each channel.
If the priority of each channel corresponding to each random storage space in which the data packet to be sent is stored comprises a plurality of priorities, in each random storage space in which the data packet to be sent is stored, the random storage space corresponding to the channel with the higher priority is determined as the target random storage space in turn.
In one embodiment, the priority level in the present application can be divided into two types, i.e., a high priority and a low priority. For example, the high-priority channel includes a channel 1 and a channel 2, the random storage space corresponding to the channel 1 is a RAM1, and the random storage space corresponding to the channel 2 is a RAM2; the low priority channel comprises a channel 4 and a channel 5, the random storage space corresponding to the channel 4 is a RAM4, and the random storage space corresponding to the channel 5 is a RAM5.
When the data packets are to be sent in the RAM1, the RAM2, the RAM4 and the RAM5, that is, the priority of each channel corresponding to each random storage space in which the data packets to be sent are stored includes a plurality of priorities, the RAM1 and the RAM2 corresponding to the high-priority channel are alternately determined as the target random storage space. For example, the RAM1 may be first used as a target random access space, one packet may be read from the RAM1, the RAM2 may be used as the target random access space, one packet may be read from the RAM2, the RAM1 may be used as the target random access space, and one packet may be read from the RAM1, so that the RAM1 and the RAM2 corresponding to the high-priority channel are alternately determined as the target random access space. And if the data packet to be sent in the RAM1 is read away completely and the data packet to be sent does not exist in the RAM1, determining the RAM2 as a target random storage space.
After the data packets to be sent in the random access memory spaces RAM1 and RAM2 corresponding to the high-priority channels are all read away, if the data packets to be sent are in the random access memory spaces RAM4 and RAM5 corresponding to the low-priority channels, the priorities of the channels corresponding to the random access memory spaces in which the data packets to be sent are currently stored are the same, and the random access memory spaces in which the data packets to be sent are stored are alternately determined as target random access memory spaces.
Specifically, the RAM4 and the RAM5 corresponding to the low-priority channel may be alternately set as the target random access memory space. For example, the RAM4 may be first used as a target random access space, one packet may be read from the RAM4, the RAM5 may be used as the target random access space, one packet may be read from the RAM5, the RAM4 may be used as the target random access space, and one packet may be read from the RAM4, so that the RAM4 and the RAM5 corresponding to the high-priority channel are alternately determined as the target random access space. And if the data packet to be sent in the RAM5 is read away completely and the data packet to be sent does not exist in the RAM5, determining the RAM4 as a target random storage space.
For another example, when only the data packets to be transmitted are stored in the RAM1 and the RAM2, that is, the priorities of the channels corresponding to the random storage spaces in which the data packets to be transmitted are stored are the same, the RAM1 and the RAM2 are alternately determined as the target random storage spaces.
The logic may be analogized as above whether there are several high priority and low priority channels, respectively. In addition, when there are a plurality of priorities, the above-described logic may be used for processing.
Step 203 is similar to the implementation and principle of step 102, and is not described again.
And step 204, performing transmission processing on each data packet to be transmitted according to the sequence of storing each data packet to be transmitted into the first-in first-out memory.
The data written first in the FIFO is read first and then sent. For example, conventionally, a first data packet, a second data packet, and a third data packet are sequentially written into the FIFO, and the first data packet therein may be read first, and the first data packet may be sent. The FIFO memory is a first-in first-out double-port buffer into which the first data is shifted out first, and has two transfer ports, one being an entry port of the memory and the other being an exit port of the memory.
Specifically, the state of the channel to which the to-be-transmitted data packet arranged at the outlet in the FIFO belongs may also be obtained, and if the channel is not blocked, the to-be-transmitted data packet may be directly transmitted. Specifically, the data packet to be sent may be sent through a channel to which the data packet to be sent belongs.
The first to-be-transmitted data packet arranged at the outlet of the FIFO can be transmitted, and during the transmission, the state of the channel to which the to-be-transmitted data packet belongs can be acquired.
Reading a data packet to be sent if a channel to which the data packet to be sent arranged at the outlet of the first-in first-out memory belongs is blocked; and writing the blocked data packet to be sent into a random storage space corresponding to the channel to which the blocked data packet to be sent belongs.
If the channel to which the first to-be-sent data packet arranged at the outlet of the FIFO is blocked when the first to-be-sent data packet is sent, the channel to which the to-be-sent data packet belongs can be rewritten into the random storage space, so as to reduce the data transmission pressure of the blocked channel.
Specifically, for example, a first data packet to be sent arranged in the FIFO is packet 1 of RAM1, a channel corresponding to the first data packet is channel 1, and a random memory space corresponding to the first data packet is RAM1; if the channel 1 is blocked when the packet 1 is transmitted, the packet 1 is read and then written into the RAM1 again. And then, according to the processing mode, processing the next data packet to be sent in the FIFO again according to the first-in first-out sequence.
The timing of the steps 205 and steps 201-204 is not limited.
Specifically, can set up the external environment detector that is used for acquireing the data transmission information who corresponds with each passageway, this external environment detector can each passageway of real-time supervision send out the patency of package, electronic equipment can be based on the testing result of external environment detector, the priority of the unobstructed passageway of package will be sent out and is transferred to high priority, and/or the priority of the unobstructed passageway of will not be transferred to low priority, thereby when external environment dynamic change, adjust the priority of each passageway correspondingly, reduce the priority of blockking up the passageway, and/or improve the priority of unobstructed passageway.
In one embodiment, an external environment detector and a transmitter may be disposed in the electronic device. The transmitter is used to perform steps 201-204 and the external environment detector may perform step 205. The external environment detector may acquire data transmission information corresponding to each channel and adjust a priority level of the channel.
And the priority of each channel determined by the external environment detector is transmitted to the packet sender in real time for the packet sender to use. And the packet sender determines a target random storage space according to the priority, reads a data packet to be sent from the target random storage space, and writes the read data packet to be sent into the FIFO. If the priority of each channel changes, the packet sender will adjust accordingly.
Furthermore, the priority of each channel can be preset according to the importance degree of a data packet to be sent by each channel, the priority level of each channel can be adjusted according to requirements, and the level of each channel is written into a packet sender.
In addition, if the smoothness of each channel has a certain rule, the priority of each channel can be predetermined and written into the packet sender.
Fig. 3 is a schematic diagram illustrating a process of sending a data packet according to an exemplary embodiment of the present application.
The present embodiment is described by taking three channels as an example.
As shown in fig. 3, it is assumed that there are three channels 31, which are channel 1, channel 2, and channel 3, respectively, and the random access memory spaces 32 corresponding to the three channels are RAM1, RAM2, and RAM3, respectively; respectively writing the data packets to be sent in the channel 31 into the corresponding random storage spaces 32, specifically, writing the data packets to be sent in the channel 1 into the RAM1, writing the data packets to be sent in the channel 2 into the RAM2, and writing the data packets to be sent in the channel 3 into the RAM3; determining a target random storage space according to the priority judged by the external environment detector 34, reading a data packet to be sent from the target random storage space and writing the data packet into the first-in first-out memory 33; judging whether a channel to which a first incoming data packet to be sent in a first-in first-out memory 33 belongs is blocked or not, and if not, directly sending the data packet; if so, the packet is read and rewritten to the corresponding RAM.
Fig. 4 is a block diagram of a packet transmitting apparatus according to an exemplary embodiment of the present application.
As shown in fig. 4, the packet transmitting apparatus 400 according to the present application includes:
an obtaining unit 410, configured to obtain a data packet to be sent, and write the data packet to be sent into a random storage space corresponding to a channel according to the channel to which the data packet to be sent belongs;
a processing unit 420, configured to read a to-be-sent data packet from each random access memory space according to the priority of each channel, and write the read to-be-sent data packet into a first-in first-out memory; the priority of each channel is determined according to the smoothness degree when the data packet to be sent belonging to each channel is sent;
a sending unit 430, configured to send each data packet to be sent stored in the fifo memory.
The principle, implementation and technical effects of the data packet sending device provided by the application are similar to those of fig. 1, and are not repeated.
Fig. 5 is a block diagram of a packet transmitting apparatus according to another exemplary embodiment of the present application.
As shown in fig. 5, in the above embodiment, in the packet sending apparatus 500 provided by the present application, the processing unit 420 includes:
a target space determining module 421, configured to determine a target random storage space according to the priority of each channel;
the reading module 422 is configured to read a data packet to be sent from the target random access memory space.
If the priority of each channel corresponding to each random storage space in which the data packet to be sent is stored includes multiple priorities, the target space determining module 421 is specifically configured to determine, in each random storage space in which the data packet to be sent is stored, the random storage space corresponding to the channel with the higher priority as the target random storage space in turn.
The target space determining module 421 is specifically configured to determine, in turn, each random storage space in which the data packet to be sent is stored as a target random storage space if the priorities of the channels corresponding to the random storage spaces in which the data packet to be sent is stored are the same.
As shown in fig. 5, in the packet sending apparatus 500 provided by the present application based on the above-mentioned embodiment, the sending unit 430 is specifically configured to:
and carrying out sending processing on each data packet to be sent according to the sequence of storing each data packet to be sent into the first-in first-out memory.
The sending unit 430 is specifically configured to, if a channel to which a to-be-sent data packet arranged at an outlet of the fifo is blocked, read the to-be-sent data packet;
and writing the read data packet to be sent into a random storage space corresponding to the blocked channel.
The sending unit 430 is specifically configured to send the data packet to be sent through the channel to which the data packet to be sent belongs if the channel to which the data packet to be sent arranged at the outlet of the fifo is not blocked.
As shown in fig. 5, on the basis of the foregoing embodiment, the apparatus 500 for sending a data packet further includes an adjusting unit 440, configured to:
acquiring data transmission information corresponding to each channel;
determining a blocked channel and/or a unblocked channel in each channel according to the data transmission information of each channel;
decreasing the priority of blocked channels, and/or increasing the priority of clear channels.
Fig. 6 is a block diagram of an electronic device according to an exemplary embodiment of the present application.
As shown in fig. 6, the electronic device provided in this embodiment includes:
a memory 601;
a processor 602; and
a computer program;
wherein the computer program is stored in the memory 601 and configured to be executed by the processor 602 to implement any of the methods of transmitting data packets as above.
The present embodiments also provide a computer-readable storage medium, having stored thereon a computer program,
the computer program is executed by a processor to implement any of the above methods of transmitting a data packet.
The present embodiment also provides a computer program product comprising a computer program, which when executed by a processor, implements any of the above-described methods for transmitting data packets.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.
Claims (12)
1. A method for transmitting a data packet, comprising:
acquiring a data packet to be sent, and writing the data packet to be sent into a random storage space corresponding to a channel according to the channel to which the data packet to be sent belongs;
reading a data packet to be sent from each random storage space according to the priority of each channel, and writing the read data packet to be sent into a first-in first-out memory; the priority of each channel is determined according to the smoothness degree when the data packet to be sent belonging to each channel is sent;
and sending each data packet to be sent stored in the first-in first-out memory.
2. The method of claim 1, wherein reading a data packet to be transmitted from each random access memory space according to the priority of each channel, and writing the read data packet to be transmitted into a first-in first-out memory, comprises:
determining a target random storage space according to the priority of each channel;
and reading the data packet to be sent from the target random storage space.
3. The method of claim 2, wherein if the priority of each channel corresponding to each random access memory space storing the data packet to be sent includes multiple priorities, determining the target random access memory space according to the priority of each channel comprises:
and in each random storage space in which the data packet to be sent is stored, determining the random storage space corresponding to the channel with the high priority level as a target random storage space in turn.
4. The method of claim 2, wherein if the priorities of the channels corresponding to the random access memory spaces in which the data packets to be sent are stored are the same, determining the target random access memory space according to the priorities of the channels comprises:
and determining each random storage space in which the data packet to be sent is stored as a target random storage space in turn.
5. The method according to any one of claims 1-4, wherein said performing transmission processing on each data packet to be transmitted stored in said FIFO memory comprises:
and performing transmission processing on each data packet to be transmitted according to the sequence of storing each data packet to be transmitted into the first-in first-out memory.
6. The method according to claim 5, wherein said performing transmission processing on each data packet to be transmitted comprises:
if the channel to which the data packet to be sent arranged at the outlet of the first-in first-out memory belongs is blocked, reading the data packet to be sent;
and writing the read data packet to be sent into a random storage space corresponding to the blocked channel.
7. The method according to claim 5, wherein the performing transmission processing on each data packet to be transmitted includes:
and if the channel to which the data packet to be sent arranged at the outlet of the first-in first-out memory belongs is not blocked, sending the data packet to be sent through the channel to which the data packet to be sent belongs.
8. The method according to any one of claims 1-4, further comprising:
acquiring data transmission information corresponding to each channel;
determining a blocked channel and/or an unobstructed channel in each channel according to data transmission information of each channel;
decreasing the priority of the blocked channels, and/or increasing the priority of the clear channels.
9. An apparatus for transmitting 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 a channel to which the data packet to be sent belongs according to the channel to which the data packet to be sent belongs;
the processing unit is used for reading a data packet to be sent from each random storage space according to the priority of each channel and writing the read data packet to be sent into a first-in first-out memory; the priority of each channel is determined according to the smoothness degree when the data packet to be sent belonging to each channel is sent;
and the sending unit is used for sending each data packet to be sent stored in the first-in first-out memory.
10. An electronic device comprising a memory and a processor; wherein,
the memory for storing a computer program;
the processor is configured to read the computer program stored in the memory and execute the method of any one of claims 1-8 according to the computer program in the memory.
11. A computer-readable storage medium having computer-executable instructions stored thereon which, when executed by a processor, implement the method of any one of claims 1-8.
12. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, carries out the method of any one of the preceding claims 1-8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110384104.7A CN115208845A (en) | 2021-04-09 | 2021-04-09 | Method, apparatus, device, storage medium, and program product for transmitting data packet |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110384104.7A CN115208845A (en) | 2021-04-09 | 2021-04-09 | Method, apparatus, device, storage medium, and program product for transmitting data packet |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115208845A true CN115208845A (en) | 2022-10-18 |
Family
ID=83570336
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110384104.7A Pending CN115208845A (en) | 2021-04-09 | 2021-04-09 | Method, apparatus, device, storage medium, and program product for transmitting data packet |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115208845A (en) |
Cited By (1)
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)
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 transmitting and receiving control method and device, mobile terminal and storage medium |
-
2021
- 2021-04-09 CN CN202110384104.7A patent/CN115208845A/en active Pending
Patent Citations (9)
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 transmitting and receiving control method and device, mobile terminal and storage medium |
Cited By (2)
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 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8732360B2 (en) | System and method for accessing memory | |
US10248350B2 (en) | Queue management method and apparatus | |
US5933413A (en) | Adaptive priority determination for servicing transmit and receive in network controllers | |
CN111641566B (en) | Data processing method, network card and server | |
JPH04311126A (en) | Method and system for monitoring flow rate in packet network | |
CN112953848A (en) | Strict priority based traffic supervision method, system and equipment | |
CN108462649A (en) | The method and apparatus for reducing high-priority data propagation delay time under congestion state in ONU | |
US20210029062A1 (en) | Network packet receiving apparatus and method | |
CN115208845A (en) | Method, apparatus, device, storage medium, and program product for transmitting data packet | |
US7330481B2 (en) | Highly channelized port polling in a telecommunications switch | |
CN118509399A (en) | Message processing method and device, electronic equipment and storage medium | |
WO2022174444A1 (en) | Data stream transmission method and apparatus, and network device | |
CN115086248A (en) | Data packet processing method, communication chip and computer equipment | |
CN113157465B (en) | Message sending method and device based on pointer linked list | |
CN116055409B (en) | Data transmission method and device of Ethernet card, network equipment and storage medium | |
CN109637540B (en) | Bluetooth evaluation method, device, equipment and medium for intelligent voice equipment | |
CN107911317B (en) | Message scheduling method and device | |
CN114401235B (en) | Method, system, medium, equipment and application for processing heavy load in queue management | |
CN116458143B (en) | Method and device for editing message | |
CN106776393A (en) | A kind of serial data method of reseptance and device without interruption | |
US20050132078A1 (en) | Facilitating transmission of a packet in accordance with a number of transmit buffers to be associated with the packet | |
CN112737977B (en) | Data packet processing method and device | |
JP4086676B2 (en) | Data transfer device | |
CN111124987B (en) | PCIE-based data transmission control system and method | |
CN111756650A (en) | Data processing method and device, operation chip and storage medium |
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 |