CN108494586B - Bandwidth control method and device - Google Patents

Bandwidth control method and device Download PDF

Info

Publication number
CN108494586B
CN108494586B CN201810175001.8A CN201810175001A CN108494586B CN 108494586 B CN108494586 B CN 108494586B CN 201810175001 A CN201810175001 A CN 201810175001A CN 108494586 B CN108494586 B CN 108494586B
Authority
CN
China
Prior art keywords
data packet
transmitted
bandwidth
length
idle
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810175001.8A
Other languages
Chinese (zh)
Other versions
CN108494586A (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.)
Comba Network Systems Co Ltd
Original Assignee
Comba Telecom Systems China 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 Comba Telecom Systems China Ltd filed Critical Comba Telecom Systems China Ltd
Priority to CN201810175001.8A priority Critical patent/CN108494586B/en
Publication of CN108494586A publication Critical patent/CN108494586A/en
Application granted granted Critical
Publication of CN108494586B publication Critical patent/CN108494586B/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
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0896Bandwidth or capacity management, i.e. automatically increasing or decreasing capacities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention relates to a bandwidth control method and a device, wherein the bandwidth control method comprises the steps of measuring the length of a data packet to be transmitted; generating an output ratio and idle data packets for separating the data packets to be transmitted in the transmission process based on the length of the data packets and a preset bandwidth; according to the output ratio, transmitting the data packet to be transmitted and the idle data packet to the Ethernet by using a preset bandwidth; the method can measure the length of the data packet and dynamically adjust the bandwidth in real time without increasing extra cost, is favorable for controlling the transmission bandwidth according to requirements when the Ethernet transmits data, and meanwhile, the software realizes automatic adjustment without excessive manual intervention, is convenient to configure, improves the convenience and the adaptability of bandwidth control, and can avoid the problem of packet loss caused by data congestion in an Ethernet transmission link.

Description

Bandwidth control method and device
Technical Field
The present invention relates to the field of network transmission technologies, and in particular, to a bandwidth control method and apparatus.
Background
In recent years, with the rapid development of the internet, the transmission of ethernet data is widely used, and devices accessing the internet basically use the ethernet transmission technology. In data transmission, transmission bandwidth needs to be controlled many times to meet the bandwidth requirement of an actual channel, so that data congestion and packet loss are avoided.
In the implementation process, the inventor finds that at least the following problems exist in the conventional technology: the traditional ethernet Transmission bandwidth Control method adopts TCP/IP Protocol (Transmission Control Protocol/Internet Protocol ) Control, and the transmitting and receiving parties agree on Transmission bandwidth to transmit data with a certain specified bandwidth; this method needs interaction between both parties and negotiates the transmission rate, but in the actual ethernet transmission link, the transmission Protocol is not limited to TCP/IP Protocol, but also UDP Protocol (user datagram Protocol), even self-defined transmission Protocol, and both the transmitting and receiving parties have no rule for specifying the transmission rate by any Protocol; the transmission bandwidth thus becomes uncontrollable.
Disclosure of Invention
Based on this, it is necessary to provide a bandwidth control method and apparatus for the problem of uncontrolled data transmission bandwidth.
In order to achieve the above object, in one aspect, an embodiment of the present invention provides a bandwidth control method, including:
measuring the packet length of a packet to be transmitted;
generating an output ratio and idle data packets for separating the data packets to be transmitted in the transmission process based on the length of the data packets and a preset bandwidth; the output ratio is the data packet length ratio or the number ratio of the data packet to be transmitted and the idle data packet;
and transmitting the data packet to be transmitted and the idle data packet to the Ethernet by using a preset bandwidth according to the output ratio.
In one embodiment, the step of measuring the packet length of the packet comprises:
the packet length is measured by the working clock.
In one embodiment, the step of generating the idle packet based on the packet length and the preset bandwidth includes:
generating an idle data packet length according to a preset bandwidth and the data packet length;
and generating an idle data packet based on the idle data packet length.
In one embodiment, the step of transmitting the data packet to be transmitted and the idle data packet to the ethernet with the preset bandwidth according to the output ratio includes:
converting to obtain a read-write control delay value according to the output ratio; the read-write control delay value comprises the output sequence and the output ratio of the data packet to be transmitted and the idle data packet;
and reading and outputting the data packet to be transmitted and the idle data packet based on the read-write control delay value.
In one embodiment, the step of transmitting the data packet to be transmitted and the idle data packet to the ethernet with the preset bandwidth according to the output ratio further includes:
and caching the data packet to be transmitted.
In one embodiment, the step of buffering the data packets to be transmitted comprises:
when a preset number of data packets to be transmitted are acquired within a preset time, caching the data packets in sequence according to the sequence of acquiring the data packets to be transmitted.
In one embodiment, after the step of measuring the packet length of the packet to be transmitted, the method further includes the steps of:
the packet length is recorded.
On the other hand, an embodiment of the present invention further provides a bandwidth control apparatus, including:
the data packet length measuring module is used for measuring the data packet length of the data packet to be transmitted;
the bandwidth configuration module is used for generating an output ratio and idle data packets for separating the data packets to be transmitted in the transmission process based on the length of the data packets and a preset bandwidth; the output ratio is the data packet length ratio or the number ratio of the data packet to be transmitted and the idle data packet;
and the data packet transmission module is used for transmitting the data packet to be transmitted and the idle data packet to the Ethernet in a preset bandwidth according to the output ratio.
An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the above-described bandwidth control method.
The embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the bandwidth control method when executing the computer program.
One of the above technical solutions has the following advantages and beneficial effects:
measuring the packet length of a packet to be transmitted; generating an output ratio and an idle data packet based on the length of the data packet and a preset bandwidth; according to the output ratio, transmitting the data packet to be transmitted and the idle data packet to the Ethernet by using a preset bandwidth; the embodiment of the invention can measure the length of the data packet and dynamically adjust the bandwidth in real time, solves the problem of uncontrolled transmission bandwidth, is not limited by a specific transmission protocol, does not need manual participation, improves the convenience and the adaptability of bandwidth control, and can avoid the problem of packet loss caused by data congestion in an Ethernet transmission link.
Drawings
FIG. 1 is a diagram of an application environment of an embodiment of a bandwidth control method of the present invention;
fig. 2 is a first flowchart of a bandwidth control method according to embodiment 1 of the present invention;
FIG. 3 is a second flowchart of an embodiment of a bandwidth control method according to the present invention;
FIG. 4 is a schematic diagram of a third flow chart of an embodiment of a bandwidth control method according to the present invention;
FIG. 5 is a diagram illustrating a fourth flowchart of an embodiment of a bandwidth control method according to the present invention;
FIG. 6 is a fifth flowchart illustrating a bandwidth control method according to an embodiment of the present invention;
FIG. 7 is a sixth flowchart illustrating a bandwidth control method according to an embodiment of the present invention;
FIG. 8 is a seventh flowchart illustrating a bandwidth control method according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a bandwidth control apparatus according to embodiment 1 of the present invention;
FIG. 10 is a system connection block diagram illustrating an exemplary bandwidth control method of the present invention;
FIG. 11 is a diagram of packet control bandwidth output for an example of the bandwidth control method of the present invention;
fig. 12 is an internal structural view of a computer device in one embodiment of the present invention.
Detailed Description
To facilitate an understanding of the invention, the invention will now be described more fully with reference to the accompanying drawings. Preferred embodiments of the present invention are shown in the drawings. This invention may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
At present, the transmission bandwidth which is not controlled by the protocol becomes more and more, and under the environment, according to the requirement of the high-speed development of the ethernet, the transmission bandwidth needs to be controlled to meet the requirement of rate transmission, so that the problem of network congestion and even packet loss can be avoided.
The bandwidth control method provided in the embodiment of the present invention may be applied to an application environment shown in fig. 1, where fig. 1 is an application environment diagram of an embodiment of the bandwidth control method of the present invention. Wherein the terminal 102 communicates with the server 104 via a network. The terminal 102 measures the length of the data packet, dynamically adjusts the bandwidth in real time, and transmits the data packet to the network with the preset bandwidth, so that the problem of packet loss caused by data congestion is avoided. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the server 104 may be implemented by an independent server or a server cluster formed by a plurality of servers.
Specifically, an embodiment of the present invention provides a bandwidth control method, as shown in fig. 2, where fig. 2 is a schematic diagram of a first flow of an embodiment 1 of the bandwidth control method of the present invention, and the method includes:
step S210, measuring the data packet length of the data packet to be transmitted;
specifically, length measurement is carried out on an input data packet to be transmitted, and the length of the data packet can be obtained; preferably, the data packets to be transmitted are counted by using the clock period of the working clock, and the obtained counted number can be the length of the data packets to be transmitted; further, after obtaining the length of the data packet, the length of the data packet can be recorded to a specified position;
it should be noted that the data packet to be transmitted may be a data packet to be transmitted to the ethernet;
the length of the data packet can be measured or calculated in bytes, for example, the physical characteristics of the ethernet determine that the maximum length of a link layer data frame is 1500 bytes, a longest IP packet can be 65535 bytes, and the like;
step S220, based on the length of the data packet and the preset bandwidth, generating an output ratio and idle data packets for separating the data packets to be transmitted in the transmission process; the output ratio is the data packet length ratio or the number ratio of the data packet to be transmitted and the idle data packet;
specifically, generating an idle data packet and an output ratio according to a preset bandwidth by the length of an input data packet;
it should be noted that the preset bandwidth may be used to set the bandwidth size or the rate according to the actual need, and may be obtained by the system configuration parameters; specifically, such as full speed, cutout, half speed, 1/4 rate, 1/5 rate, 1/8 rate, etc.; the embodiment of the invention achieves real-time adjustment of the parameters by dynamically adjusting the bandwidth parameters in real time without restarting the system;
the idle data packets can be idle invalid data packets or idle characters and can be used for controlling the interval of each data packet to be transmitted in the transmission process; specifically, a corresponding idle data packet can be generated according to the length of the data packet to be transmitted and a preset bandwidth, and the idle data packet can be used for separating the data packets to be transmitted in the transmission process, so that the bandwidth parameters can be dynamically adjusted in real time without restarting the system;
the output ratio can be the length or the number ratio of the data packets to be transmitted to the idle data packets, and can be used for controlling the proportion of the data packets to be transmitted to the idle data packets in the data transmission process;
specifically, the length of a data packet to be transmitted is measured to obtain the length L of the data packet; generating an idle data packet and an output ratio according to the length L of the data packet and a preset bandwidth, wherein the length of the data packet of the idle data packet is I;
if L is equal to I, the output ratio may represent the number ratio of the data packets to be transmitted to the idle data packets; when the preset bandwidth is in a full-speed mode, the output ratio can be 1/0, the number of data packets to be transmitted is 1, and the number of idle data packets is 0, that is, the input data packets are continuously sent away without increasing packet intervals; when the preset bandwidth is in a cutoff mode, the output ratio can be 0/1, the number of data packets to be transmitted is 0, the number of idle data packets is 1, no data packet is output, and idle characters are continuously sent; when the preset bandwidth is in a half-speed mode, the output ratio can be 1/1, the number of data packets to be transmitted is 1, the number of idle data packets is 1, one data packet to be transmitted is sent, one idle data packet is sent, and the output bandwidth is controlled to be reduced by half; when the preset bandwidth is in a 1/4 rate mode, the output ratio can be 1/3, the number of data packets to be transmitted is 1, the number of idle data packets is 3, a packet of data to be transmitted is sent, 3 packets of idle data packets are sent, and the output bandwidth is controlled to be 1/4; by analogy, the preset bandwidth may also be an 1/5 rate mode, a 1/8 rate mode, and the like, which is not described herein again;
if L is not equal to I, the output ratio can represent the packet length ratio of the data packet to be transmitted and the idle data packet; according to the preset bandwidth, sending a packet of data packet to be transmitted with the length of L, sending an idle data packet with the length of I, and controlling the actual transmission bandwidth to be L/(L + I);
and step S230, transmitting the data packet to be transmitted and the idle data packet to the Ethernet in a preset bandwidth according to the output ratio.
Specifically, based on the output ratio, outputting the data packet to be transmitted and the idle data packet to the next stage according to reading control, and transmitting the data packet to the Ethernet in a preset bandwidth to complete bandwidth control;
it should be noted that other processing can be performed in the process of transmitting the data packet to be transmitted and the idle data packet to the ethernet, so that the data packet to be transmitted and the idle data packet can be transmitted to the next stage with a preset bandwidth according to the output ratio, and then transmitted to the ethernet after being processed by the next stage, thereby completing bandwidth control;
optionally, in an example, the output ratio may be converted into a read-write control delay logic, and the data packet is read out and output to the next stage; specifically, in the full-speed mode, the data packet to be transmitted is directly read and output to the next stage without increasing the clock reading delay of the idle data packet; in a half-speed mode, after a data packet to be transmitted with the length of L is read, idle data is added to wait for I clock counts (the number of the clock counts of I is equal to that of the clock counts of L), then the next data packet to be transmitted is read, and the transmission interval between two data packets to be transmitted is strictly controlled to ensure that the average bandwidth is controlled at 1/2;
the embodiment of the invention measures the length of the data packet to be transmitted; generating an output ratio and an idle data packet based on the length of the data packet and a preset bandwidth; according to the output ratio, transmitting the data packet to be transmitted and the idle data packet to the Ethernet by using a preset bandwidth; the method can measure the length of the data packet and dynamically adjust the bandwidth in real time, solves the problem of uncontrolled transmission bandwidth, and is not limited by a specific transmission protocol; the idle data packet is sent to realize the control of the bandwidth, the bandwidth rate of the input data packet is not depended on, extra cost is not required to be added, the control of the transmission bandwidth according to the requirement when the Ethernet transmits data is facilitated, meanwhile, the automatic adjustment is realized by software, excessive manual intervention is not required, the software configuration is convenient, the convenience and the adaptability of the bandwidth control are improved, and the problem of packet loss caused by data congestion in an Ethernet transmission link can be avoided;
further, the embodiments of the present invention are advantageously implemented by using Programmable Logic devices such as an FPGA (Field-Programmable Gate Array), a CPLD (Complex Programmable Logic Device), an EPLD (Erasable Programmable Logic Device), an SPLD (simple Programmable Logic Device), etc., or by using an Application Specific Integrated Circuit (ASIC) chip or a Digital Signal Processing (DSP) Programmable chip.
In a specific embodiment, referring to fig. 3, fig. 3 is a second flowchart of the bandwidth control method according to the embodiment of the present invention, where the step of measuring the packet length of the data packet includes:
in step S310, the length of the data packet is measured by the working clock.
Specifically, the working clock can be used for counting the data packets to be transmitted to reach the data packet length;
it should be noted that, the length of the measurement data packet may be counted by using the clock period of the working clock; the method measures the length of the data packet by counting the working clock, can realize automatic measurement of the length of the data packet, further enhances the flexibility of the bandwidth control method, reduces manual intervention, is convenient for software configuration, and improves the convenience and adaptability of bandwidth control.
In a specific embodiment, as shown in fig. 4, fig. 4 is a third flowchart of an embodiment of the bandwidth control method of the present invention, and the step of generating an idle data packet based on the length of the data packet and a preset bandwidth includes:
step S422, generating the length of an idle data packet according to the preset bandwidth and the length of the data packet;
in step S424, an idle packet is generated based on the idle packet length.
Specifically, the idle data packet length can be calculated according to the measured data packet length of the data packet to be transmitted and the preset bandwidth; generating an idle data packet according to the length of the idle data packet;
specifically, the difference between the preset bandwidth and the data packet length of the data packet to be transmitted can be obtained to obtain the idle data packet length; based on the idle packet length, a number of idle packets may be generated.
In a specific embodiment, referring to fig. 5, fig. 5 is a fourth flowchart illustrating an embodiment of the bandwidth control method of the present invention, where the step of transmitting the data packet to be transmitted and the idle data packet to the ethernet with the preset bandwidth according to the output ratio includes:
step S532, converting to obtain a read-write control delay value according to the output ratio; the read-write control delay value comprises the output sequence and the output ratio of the data packet to be transmitted and the idle data packet;
step S534, based on the read-write control delay value, reading and outputting the data packet to be transmitted and the idle data packet.
Specifically, the data packet to be transmitted and the idle data packet can be read and output based on the read-write control delay value obtained by converting the output ratio;
it should be noted that the read-write control delay value may be obtained by converting the output ratio, and may include the output sequence and the output ratio of the data packet to be transmitted and the idle data packet; reading out the data packet according to the read-write control delay value, and outputting the data packet to the next stage; specifically, in the full-speed mode, the data packet to be transmitted is directly read and output to the next stage without increasing the clock reading delay of the idle data packet; in the half-speed mode, after a data packet to be transmitted with the length of the data packet L is read, an idle data packet with the length of the data packet I can be sent or idle data is added to wait for I clock counts (the number of the clock counts of I is equal to that of the clock counts of L), then the next data packet to be transmitted is read, and the transmission interval between the two data packets to be transmitted is strictly controlled to ensure that the average bandwidth is controlled at 1/2; optionally, the output sequence of the output ratio in the embodiment of the present invention may be that the data packet to be transmitted is read and output first, and then the idle data packet is transmitted, or the idle data packet is transmitted first and then the idle data packet is read and output, or the data packet to be transmitted is inserted into the middle of a plurality of idle data packets and transmitted;
the embodiment of the invention sequentially sends the data packet to be transmitted and the idle data packet according to the read-write control delay value to realize the control of the bandwidth, does not depend on the specific bandwidth rate of the input data packet, does not need to increase extra cost, is favorable for controlling the transmission bandwidth according to the requirement when the data is transmitted by the Ethernet, simultaneously realizes automatic adjustment by software, does not need excessive manual intervention, is convenient for software configuration, improves the convenience and the self-adaptability of the bandwidth control, and can avoid the problem of packet loss caused by data congestion in an Ethernet transmission link.
In a specific embodiment, as shown in fig. 6, fig. 6 is a schematic diagram of a fifth flow chart of an embodiment of the bandwidth control method of the present invention, and according to the output ratio, before the step of transmitting the data packet to be transmitted and the idle data packet to the ethernet with the preset bandwidth, the method further includes:
step S612, cache the data packet to be transmitted.
Specifically, after an input data packet to be transmitted is acquired, the data packet to be transmitted can be cached so as to facilitate subsequent reading and transmission; preferably, the data packet to be transmitted may be stored in an internal Memory of the programming chip, such as a First Input First Output (FIFO) Memory, a Random-Access Memory (RAM), and the like
In a specific embodiment, referring to fig. 7, fig. 7 is a sixth flowchart illustrating an embodiment of the bandwidth control method of the present invention, where the step of caching the to-be-transmitted data packet includes:
step S714, when a preset number of data packets to be transmitted are obtained within a preset time, sequentially caching the data packets according to the sequence of obtaining the data packets to be transmitted.
Specifically, when a plurality of data packets to be transmitted are acquired in a short time, the data packets can be sequentially cached according to the sequence of acquiring the data packets to be transmitted, which is beneficial to sequentially reading the data packets to be transmitted subsequently;
the preset time can be set according to actual needs, and specifically, can be 1s (second), 0.01s, 0.001s, or the like;
the preset number can be set according to actual needs, specifically, more than 2, more than 3 and the like;
when a plurality of data packets are received in a burst manner, the data packets are sequentially stored in the memory so as to be read in a correct sequence subsequently, the accuracy of reading the output data packets is ensured, and the accurate transmission of bandwidth control is guaranteed.
In a specific embodiment, as shown in fig. 8, fig. 8 is a seventh flowchart illustrating an embodiment of the bandwidth control method of the present invention, and after the step of measuring the packet length of the data packet to be transmitted, the method further includes the steps of:
in step S812, the packet length is recorded.
Specifically, after measuring the packet length of the packet to be transmitted, the packet length may be recorded and saved to a designated location for invocation of subsequent steps.
It should be understood that although the various steps in the flow charts of fig. 2-8 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-8 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternating with other steps or at least some of the sub-steps or stages of other steps.
On the other hand, an embodiment of the present invention further provides a bandwidth control apparatus, referring to fig. 9, where fig. 9 is a schematic structural diagram of an embodiment 1 of the bandwidth control apparatus of the present invention, including:
a packet length measuring module 910, configured to measure a packet length of a packet to be transmitted;
a bandwidth configuration module 920, configured to generate an output ratio and idle data packets for separating data packets to be transmitted in a transmission process based on the length of the data packet and a preset bandwidth; the output ratio is the data packet length ratio or the number ratio of the data packet to be transmitted and the idle data packet;
the data packet transmission module 930 is configured to transmit the data packet to be transmitted and the idle data packet to the ethernet with a preset bandwidth according to the output ratio.
Further, the embodiment of the present invention may further include: the data packet caching module is used for caching the data packet to be transmitted; the data packet length recording module is used for recording the data packet length;
the data packet length measuring module can comprise a working clock measuring unit which is used for measuring the data packet length of the data packet to be transmitted through a working clock;
the bandwidth configuration module can comprise an idle data packet length acquisition unit and an idle data packet generation unit; the idle data packet length acquisition unit is used for generating the idle data packet length according to the preset bandwidth and the data packet length; the idle data packet generating unit is used for generating an idle data packet based on the length of the idle data packet;
the data packet transmission module can comprise a read-write control delay value acquisition unit and a read output data packet unit; the read-write control delay value acquisition unit is used for converting to obtain a read-write control delay value according to the output ratio; the reading output data packet unit is used for reading and outputting a data packet to be transmitted and an idle data packet based on the read-write control delay value;
it should be noted that, for specific limitations of the bandwidth control apparatus, reference may be made to the above limitations of the bandwidth control method, which is not described herein again. The various modules in the bandwidth control apparatus described above may be implemented in whole or in part by software, hardware, and combinations thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
To facilitate understanding of a specific implementation flow of the embodiment of the present invention, a specific implementation example is set forth, as shown in fig. 10 and 11, fig. 10 is a system connection block diagram of an example of a bandwidth control method of the present invention, and fig. 11 is a data packet control bandwidth output diagram of an example of a bandwidth control method of the present invention;
acquiring a data packet 1 and a data packet 2 to be transmitted, and measuring the data packet lengths of the data packets 1 and 2 by adopting a working clock to obtain L1 and L2; writing the received data packets 1 and 2 into an internal memory such as FIFO, RAM and the like in sequence; according to the packet lengths L1 and L2 and the preset bandwidth, the packet lengths I1 and I2 of the idle packets are obtained through calculation, and output proportion including L1, L2, I1 and I2 is generated; according to the output ratio, sequentially reading data packets 1 with the length of L1 according to reading control, then sending idle packets 1 with the length of I1, then reading data packets 2 with the length of L2, then sending idle packets 2 with the length of I2, sequentially outputting the data packets to the next stage, and further transmitting the data packets to the Ethernet to finish bandwidth control; the data packet corresponds to the data packet to be transmitted, and the idle packet corresponds to the idle data packet.
The embodiment of the invention can measure the data packet length of the data packet to be transmitted; generating an output ratio and an idle data packet based on the length of the data packet and a preset bandwidth; according to the output ratio, transmitting the data packet to be transmitted and the idle data packet to the Ethernet by using a preset bandwidth; the method can measure the length of the data packet and dynamically adjust the bandwidth in real time without increasing extra cost, is beneficial to controlling the transmission bandwidth according to requirements when the data is transmitted by the Ethernet, meanwhile, realizes automatic adjustment by software, does not need excessive manual intervention, is convenient for software configuration, improves the convenience and the adaptability of bandwidth control, solves the problem of uncontrolled transmission bandwidth, is not limited by a specific transmission protocol, and can avoid the problem of packet loss caused by data congestion in an Ethernet transmission link;
furthermore, the data packet length is measured by dynamically caching the data packet and utilizing the working clock, so that the transmission bandwidth can be configured in real time, the actually output data transmission bandwidth is controlled, the flexibility of bandwidth control is enhanced, manual intervention is reduced, and the software configuration is convenient.
In one embodiment, a computer device is provided, the computer device may be a server, an internal structure diagram of the computer device may be as shown in fig. 12, and fig. 12 is an internal structure diagram of the computer device in one embodiment of the invention. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a bandwidth control method.
Those skilled in the art will appreciate that the architecture shown in fig. 12 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
When a processor of the computer device executes a program, the bandwidth control method can be realized in any one of the above embodiments, so that the bandwidth can be dynamically adjusted in real time without manual participation, the convenience and the adaptability of bandwidth control are improved, the problem of uncontrolled transmission bandwidth is solved, the computer device is not limited by a specific transmission protocol, and the problem of packet loss caused by data congestion in an Ethernet transmission link can be avoided.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when executed by a processor, implements a bandwidth control method.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM). The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (16)

1. A method of bandwidth control, comprising:
measuring the packet length of a packet to be transmitted;
generating an output ratio and idle data packets for separating the data packets to be transmitted in the transmission process based on the length of the data packets and a preset bandwidth, wherein the idle data packets are used for separating the data packets to be transmitted in the transmission process, so that the preset bandwidth parameters are dynamically adjusted in real time; the output ratio is the data packet length ratio or the number ratio of the data packet to be transmitted and the idle data packet; according to the output ratio, transmitting the data packet to be transmitted and the idle data packet to an Ethernet by using the preset bandwidth; and the output proportion of the data packet to be transmitted and the idle data packet generated correspondingly under different preset bandwidth modes is different.
2. The bandwidth control method according to claim 1, wherein the step of measuring the packet length of the packet comprises:
and measuring the length of the data packet through an operating clock.
3. The bandwidth control method according to claim 2, wherein the step of generating the idle packet based on the packet length and a preset bandwidth comprises:
generating an idle data packet length according to the preset bandwidth and the data packet length;
generating the idle data packet based on the idle data packet length.
4. The bandwidth control method according to claim 3, wherein the step of transmitting the data packet to be transmitted and the idle data packet to an ethernet with the preset bandwidth according to the output ratio comprises:
converting to obtain a read-write control delay value according to the output ratio; the read-write control delay value comprises the output sequence and the output ratio of the data packet to be transmitted and the idle data packet;
and reading and outputting the data packet to be transmitted and the idle data packet based on the read-write control delay value.
5. The bandwidth control method according to any one of claims 1 to 4, wherein before the step of transmitting the data packet to be transmitted and the idle data packet to the Ethernet with the preset bandwidth according to the output ratio, the method further comprises:
and caching the data packet to be transmitted.
6. The bandwidth control method of claim 5,
the step of caching the data packet to be transmitted comprises the following steps:
when a preset number of the data packets to be transmitted are acquired within a preset time, sequentially caching the data packets according to the sequence of acquiring the data packets to be transmitted.
7. The bandwidth control method of claim 6,
after the step of measuring the packet length of the packet to be transmitted, the method further comprises the steps of:
and recording the data packet length.
8. A bandwidth control apparatus, comprising:
the data packet length measuring module is used for measuring the data packet length of the data packet to be transmitted;
the bandwidth configuration module is used for generating an output ratio and idle data packets used for separating the data packets to be transmitted in the transmission process based on the length of the data packets and a preset bandwidth, wherein the idle data packets are used for separating the data packets to be transmitted in the transmission process, and the preset bandwidth parameters are dynamically adjusted in real time; the output ratio is the data packet length ratio or the number ratio of the data packet to be transmitted and the idle data packet;
the data packet transmission module is used for transmitting the data packet to be transmitted and the idle data packet to the Ethernet according to the output ratio by using the preset bandwidth; and the output proportion of the data packet to be transmitted and the idle data packet generated correspondingly under different preset bandwidth modes is different.
9. The bandwidth control device of claim 8, wherein the packet length measuring module comprises:
and the working clock measuring unit is used for measuring the length of the data packet through a working clock.
10. The bandwidth control apparatus of claim 9, wherein the bandwidth configuration module comprises:
an idle data packet length obtaining unit, configured to generate an idle data packet length according to the preset bandwidth and the data packet length;
and the idle data packet generating unit is used for generating the idle data packet based on the length of the idle data packet.
11. The bandwidth control apparatus of claim 10, wherein the packet transmission module comprises:
the read-write control delay value acquisition unit is used for converting the output ratio to obtain a read-write control delay value; the read-write control delay value comprises the output sequence and the output ratio of the data packet to be transmitted and the idle data packet;
and the read output data packet unit is used for reading and outputting the data packet to be transmitted and the idle data packet based on the read-write control delay value.
12. The bandwidth control apparatus according to any one of claims 8 to 11, wherein the apparatus further comprises:
and the data packet caching module is used for caching the data packet to be transmitted.
13. The bandwidth control apparatus of claim 12,
the data packet caching module is further configured to, when a preset number of data packets to be transmitted are obtained within a preset time, sequentially cache each of the data packets according to the sequence of obtaining the data packets to be transmitted.
14. The bandwidth control apparatus of claim 13, wherein the apparatus further comprises:
and the data packet length recording module is used for recording the data packet length.
15. A computer-readable storage medium on which a computer program is stored, the program, when executed by a processor, implementing the bandwidth control method of any one of claims 1 to 7.
16. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the bandwidth control method according to any one of claims 1 to 7 when executing the computer program.
CN201810175001.8A 2018-03-02 2018-03-02 Bandwidth control method and device Active CN108494586B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810175001.8A CN108494586B (en) 2018-03-02 2018-03-02 Bandwidth control method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810175001.8A CN108494586B (en) 2018-03-02 2018-03-02 Bandwidth control method and device

Publications (2)

Publication Number Publication Date
CN108494586A CN108494586A (en) 2018-09-04
CN108494586B true CN108494586B (en) 2021-04-27

Family

ID=63341343

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810175001.8A Active CN108494586B (en) 2018-03-02 2018-03-02 Bandwidth control method and device

Country Status (1)

Country Link
CN (1) CN108494586B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11606346B2 (en) 2020-06-29 2023-03-14 Rockwell Automation Technologies, Inc. Method and apparatus for managing reception of secure data packets
US11599649B2 (en) * 2020-06-29 2023-03-07 Rockwell Automation Technologies, Inc. Method and apparatus for managing transmission of secure data packets

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6108306A (en) * 1997-08-08 2000-08-22 Advanced Micro Devices, Inc. Apparatus and method in a network switch for dynamically allocating bandwidth in ethernet workgroup switches
CN1798099A (en) * 2004-12-29 2006-07-05 华为技术有限公司 Method for implementing dynamic speed adjustment for data packets based on logic
CN101222296A (en) * 2008-01-31 2008-07-16 上海交通大学 Self-adapting transmission method and system in ascending honeycomb video communication

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003169090A (en) * 2001-11-30 2003-06-13 Fujitsu Ltd Transmission system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6108306A (en) * 1997-08-08 2000-08-22 Advanced Micro Devices, Inc. Apparatus and method in a network switch for dynamically allocating bandwidth in ethernet workgroup switches
CN1798099A (en) * 2004-12-29 2006-07-05 华为技术有限公司 Method for implementing dynamic speed adjustment for data packets based on logic
CN101222296A (en) * 2008-01-31 2008-07-16 上海交通大学 Self-adapting transmission method and system in ascending honeycomb video communication

Also Published As

Publication number Publication date
CN108494586A (en) 2018-09-04

Similar Documents

Publication Publication Date Title
WO2021012869A1 (en) Transmission rate determination method and device, apparatus, and storage medium
CN108494586B (en) Bandwidth control method and device
WO2021232260A1 (en) Method for time synchronization of a plurality of auxiliary devices of autonomous vehicle, vehicle, computer device, and storage medium
CN108024126A (en) Network direct broadcasting video regulation method, device, electronic equipment and storage medium
WO2021179304A1 (en) Method for automatically adjusting video live broadcast bit rate, video transmission device, and server
US10296602B1 (en) Determining real-time timestamps for robotic sensor data
CN113519146A (en) Streaming media network delay determination method and device, computer equipment, readable storage medium and remote driving system
CN109495660B (en) Audio data coding method, device, equipment and storage medium
CN112187921B (en) Object file downloading method, device, system, server and storage medium
CN110751045A (en) Fault recording method, system and terminal equipment
CN110098976A (en) Measurement method, device, computer equipment and the storage medium of network parameter
JP3524914B1 (en) Checksum calculation method, checksum recording method, and communication device that can use the method
WO2019169727A1 (en) Network traffic test method and apparatus, device, and computer-readable storage medium
CN114710426A (en) Method, device, system and related equipment for determining round-trip delay of read operation
CN111327645B (en) Network sharing method and device and electronic equipment
WO2017077704A1 (en) Throughput measuring device and method, and recording medium
CN111556535A (en) Communication method, communication device, electronic apparatus, and storage medium
CN114629826A (en) Network maximum bandwidth estimation method and device, electronic equipment and storage medium
CN109040653B (en) Data encryption and decryption overhead determining method and device and electronic equipment
CN106600754A (en) Cloud calculation iris identification access control apparatus
CN107710662A (en) The method and receiving device of data processing
CN112738574B (en) Screen recording data processing method and device, computer equipment and storage medium
CN111200621A (en) Ad hoc network method and device, and electronic device
CN114546924B (en) AXI-based bidirectional data transmission method, AXI-based bidirectional data transmission system, AXI-based bidirectional data transmission storage medium and AXI-based bidirectional data transmission equipment
CN113726691B (en) Bandwidth reservation method, device, equipment 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
TA01 Transfer of patent application right

Effective date of registration: 20200109

Address after: 510663 Shenzhou Road, Guangzhou Science City, Guangzhou economic and Technological Development Zone, Guangdong, 10

Applicant after: Jingxin Communication System (China) Co., Ltd.

Address before: 510663 Shenzhou Road 10, Guangzhou Science City, Guangzhou economic and Technological Development Zone, Guangzhou, Guangdong

Applicant before: Jingxin Communication System (China) Co., Ltd.

Applicant before: Jingxin Communication System (Guangzhou) Co., Ltd.

Applicant before: Jingxin Communication Technology (Guangzhou) Co., Ltd.

Applicant before: TIANJIN COMBA TELECOM SYSTEMS CO., LTD.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: 510663 Shenzhou Road, Guangzhou Science City, Guangzhou economic and Technological Development Zone, Guangdong, 10

Patentee after: Jingxin Network System Co.,Ltd.

Address before: 510663 Shenzhou Road, Guangzhou Science City, Guangzhou economic and Technological Development Zone, Guangdong, 10

Patentee before: Comba Telecom System (China) Ltd.

CP01 Change in the name or title of a patent holder