CN114143267A - Flow adjusting method and device, electronic equipment and computer readable storage medium - Google Patents

Flow adjusting method and device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN114143267A
CN114143267A CN202111422142.3A CN202111422142A CN114143267A CN 114143267 A CN114143267 A CN 114143267A CN 202111422142 A CN202111422142 A CN 202111422142A CN 114143267 A CN114143267 A CN 114143267A
Authority
CN
China
Prior art keywords
counter
value
current
preset value
storage unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111422142.3A
Other languages
Chinese (zh)
Other versions
CN114143267B (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.)
Beijing Topsec Technology Co Ltd
Beijing Topsec Network Security Technology Co Ltd
Beijing Topsec Software Co Ltd
Original Assignee
Beijing Topsec Technology Co Ltd
Beijing Topsec Network Security Technology Co Ltd
Beijing Topsec Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Topsec Technology Co Ltd, Beijing Topsec Network Security Technology Co Ltd, Beijing Topsec Software Co Ltd filed Critical Beijing Topsec Technology Co Ltd
Priority to CN202111422142.3A priority Critical patent/CN114143267B/en
Publication of CN114143267A publication Critical patent/CN114143267A/en
Application granted granted Critical
Publication of CN114143267B publication Critical patent/CN114143267B/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/25Flow control; Congestion control with rate being modified by the source upon detecting a change of network conditions
    • 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/22Traffic shaping
    • H04L47/225Determination of shaping rate, e.g. using a moving window
    • 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/29Flow control; Congestion control using a combination of thresholds
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/164Adaptation or special uses of UDP protocol

Landscapes

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

Abstract

The application provides a flow adjusting method, a flow adjusting device, an electronic device and a computer readable storage medium, wherein the method comprises the following steps: storing the received data streams into storage units; polling a plurality of storage units to determine the value of a counter corresponding to each storage unit; judging whether the value of a current counter of the current polled storage unit is a preset value or not; if the value of the current counter is a preset value, scheduling the message in the data stream in the storage unit which is polled currently, and adjusting the current counter; and if the value of the current counter is not a preset value, adjusting the current counter.

Description

Flow adjusting method and device, electronic equipment and computer readable storage medium
Technical Field
The present application relates to the field of network technologies, and in particular, to a method and an apparatus for adjusting traffic, an electronic device, and a computer-readable storage medium.
Background
Generally, in UDP (user data protocol) streaming media applications, since the UDP protocol has no flow control mechanism, there is no sliding window to automatically adjust the sending rate according to the end-to-end bandwidth as in TCP (transmission control protocol) protocol, and when the sudden traffic is too large, network congestion and traffic loss are easily caused.
Disclosure of Invention
In view of the above, embodiments of the present application provide a method and an apparatus for adjusting traffic, an electronic device, and a computer-readable storage medium. The problems of network blockage and flow loss can be solved.
In a first aspect, an embodiment of the present application provides a method for adjusting traffic, including:
storing the received data streams into storage units;
polling a plurality of storage units to determine the value of a counter corresponding to each storage unit;
judging whether the value of a current counter of the current polled storage unit is a preset value or not;
if the value of the current counter is a preset value, scheduling the message in the data stream in the storage unit which is polled currently, and adjusting the current counter;
and if the value of the current counter is not a preset value, adjusting the current counter.
In an optional implementation manner, the determining whether the value of the current counter of the currently polled storage unit is a preset value includes:
judging whether a current rate counter in a current counter of a current polled storage unit is a first preset value or not;
judging whether a current burst counter in a current counter of a current polled storage unit is a second preset value or not;
and when the current rate counter is the first preset value and the current burst counter is the second preset value, determining that the value of the current counter is a preset value.
In the above embodiment, the speed of scheduling packets can be dynamically adjusted by two counters, which can be suitable for more different scenarios, and can better adjust the scheduling speed, so as to reduce congestion or traffic loss caused by traffic.
In an optional embodiment, the adjusting the current counter includes:
adjusting the current rate counter;
and adjusting the current burst counter.
In an optional embodiment, the adjusting of the current rate counter includes:
and when the value of the current rate counter is not the first preset value, adjusting the value of the current rate counter by a numerical unit.
In an optional embodiment, the adjusting the current burst counter includes:
when the value of the current burst counter is the second preset value, adjusting the value of the current burst counter by a numerical unit;
when the value of the current burst counter is not the second preset value, judging whether the value of a current holding counter in the current counter is the third preset value;
and when the value of the current keeping counter is not a third preset value, adjusting the value of the current keeping counter by a numerical value unit.
In the above embodiment, the three counters are adjusted to realize the scheduling of the constant speed and variable speed control flow.
In an optional embodiment, the method further comprises:
when the value of the current holding counter is the third preset value, updating the value of the current burst counter by using an initial burst value; updating the value of the current hold counter using the initial hold value.
In an optional embodiment, the method further comprises:
and when the value of the current rate counter is the first preset value, updating the value of the current rate counter by using an initial rate value.
In the above embodiment, the adjustment speed of each counter is set by each initial value, so as to adjust the traffic scheduling speed.
In an optional implementation manner, the scheduling a packet in a data stream in a storage unit to which the current polling is performed includes:
scheduling cells to be sent in messages to be sent in a data stream in a storage unit polled currently, wherein each message is divided into one or more cells;
the adjusting the current counter includes:
if the value of the current cell counter in the current counter is not a fourth preset value, adjusting the value of the current cell counter by a numerical value unit;
and if the value of the current cell counter in the current counter is the fourth preset value, updating the value of the current cell counter by using the cell number of the next message of the message to be sent in the current polled storage unit.
In the above embodiment, each message may be fragmented, and since the fragmented data is recorded, it may be better to record whether each message is called up.
In a second aspect, an embodiment of the present application further provides a flow rate adjustment device, including:
the storage module is used for storing the received data streams into the storage units;
the polling module is used for polling the storage units to determine the value of the counter corresponding to each storage unit;
the judging module is used for judging whether the value of the current counter of the current polled storage unit is a preset value or not;
the scheduling module is used for scheduling the message in the data stream in the storage unit which is polled currently if the value of the current counter is a preset value;
and the adjusting module is used for adjusting the current counter if the value of the current counter is not a preset value or after a message in a data stream in the storage unit polled currently is scheduled.
In a third aspect, an embodiment of the present application further provides an electronic device, including: a processor, a memory, the memory storing machine-readable instructions executable by the processor, the machine-readable instructions, when executed by the processor, perform the steps of the method for traffic regulation according to the first aspect, or any possible implementation manner of the first aspect, when the electronic device is running.
In a fourth aspect, this application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program performs the steps of the foregoing first aspect, or the flow rate adjustment method in any possible implementation manner of the first aspect.
The traffic adjusting method, the traffic adjusting device, the electronic device, and the computer-readable storage medium provided by the embodiments of the present application use the auxiliary function of the counter, and call the received message based on the counting condition of the counter.
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a block diagram of an electronic device according to an embodiment of the present disclosure;
fig. 2 is a flowchart of a flow rate adjustment method according to an embodiment of the present application;
fig. 3a to fig. 3g are schematic diagrams of time distribution of scheduling packets provided by a traffic adjustment method according to an embodiment of the present application;
fig. 4 is a schematic functional block diagram of a flow rate adjustment device according to an embodiment of the present application.
Detailed Description
The technical solution in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
The inventors have appreciated that because the UDP protocol has no flow control mechanism, there is no sliding window to automatically adjust the rate of transmission based on end-to-end bandwidth as does the TCP protocol. However, in the video stream, a UDP packet is generally used, such a packet is fragmented and then sent through the network, and becomes a Burst (Burst) of multiple messages, so that the flow of the streaming media on the network is not uniform, and individual routing and switch devices cause network congestion and flow loss due to sudden excessive flow.
An alternative approach is that QoS (Quality of Service) services can be implemented using software. The software adopts different flow control for different services according to different algorithm models. When the flow is too large, the load of a Central Processing Unit (CPU) is too high, and the flow control effect is limited. Another optional processing mode is that the QOS technology may adopt a token authorization mode to design traffic shaping to control QOS traffic, and this traffic shaping method generally needs to set a fixed rate and balance egress traffic through a token scheduling injection mode. The token grant based scheduling method can meet the requirement of general traffic shaping, but has some defects: 1. the fineness of flow control by a flow shaping technology based on token authorization depends on the design of a token scheduling module, but the delay of the token scheduling module is larger, and the overflow of flow is easily caused; 2, the CPU load is overlarge; when the flow is too large or the number of token bucket stages is too large, the CPU is used for calculating the too large token scheduling time and is easily influenced by other software processes; 2. the flow shaping based on the token can not respectively carry out fine flow control on a plurality of flows, if each flow can not be independently controlled, the sending rates of the plurality of flows have mutual influence; the QoS flow control generally uses the data flows to be sent in sequence according to different data flow priorities, even if the bandwidth of the flow is enough, the flow with low priority level must wait for the data flow with high priority level to be sent, which causes the flow sending to be very uneven, especially the phenomenon of jam and timeout caused by uneven flow media data flow. Meanwhile, the flow control method has very high design requirements on the flow scheduling control module, and the design complexity is increased along with the increase of the priority level of the flow.
Based on the above research, the present application provides a flow rate adjustment method, which can adopt an independent flow rate control manner for each data stream. This is described below by some examples.
To facilitate understanding of the present embodiment, first, an electronic device that executes the flow rate adjustment method disclosed in the embodiments of the present application will be described in detail.
As shown in fig. 1, is a block schematic diagram of an electronic device. The electronic device 100 may include a memory 111, a processor 113. It will be understood by those of ordinary skill in the art that the structure shown in fig. 1 is merely exemplary and is not intended to limit the structure of the electronic device 100. For example, electronic device 100 may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The above-mentioned components of the memory 111 and the processor 113 are directly or indirectly electrically connected to each other to realize data transmission or interaction. For example, the components may be electrically connected to each other via one or more communication buses or signal lines. The processor 113 is used to execute the executable modules stored in the memory.
The Memory 111 may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and the like. The memory 111 is configured to store a program, and the processor 113 executes the program after receiving an execution instruction, and the method performed by the electronic device 100 defined by the process disclosed in any embodiment of the present application may be applied to the processor 113, or implemented by the processor 113.
The processor 113 may be an integrated circuit chip having signal processing capability. The Processor 113 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The electronic device 100 in this embodiment may be configured to perform each step in each method provided in this embodiment. The following describes the implementation of the flow adjustment method in detail by several embodiments.
Please refer to fig. 2, which is a flowchart illustrating a flow adjusting method according to an embodiment of the present disclosure. The specific process shown in fig. 2 will be described in detail below.
Step 210, storing the received data streams into storage units.
In this embodiment, a plurality of storage units may be prepared in advance, and each storage unit is used to store a received data stream.
Before the data stream is called, the data stream may be stored in each storage unit, and then the received data stream is uniformly called by controlling the rate of scheduling each packet in the data stream.
Alternatively, the number of storage units for storing the data streams to be scheduled may be set according to the processing of the electronic device. The number of memory cells may be an exponential multiple of two. For example, the number of memory cells may be 1024, 512, etc.
In step 220, a plurality of the storage units are polled to determine the value of the counter corresponding to each storage unit.
Each memory unit may be configured with a counter or a set of counters, and through adjustment of the counters, scheduling messages may be adaptively turned on or skipped.
It is considered that not all memory locations need to be used at a time, e.g., where only 800 data streams need to be transmitted for a period of time, but 1024 memory locations are used for scheduling the data streams, and thus there are 224 memory locations that will not be used, and the unused memory locations may be set to an off state. When the storage unit in the closed state is polled, the storage unit can be directly skipped without acquiring the value of the counter of the storage unit; when a memory cell in use is polled, the value of the counter for that memory cell may be obtained.
In this embodiment, each time the time intervals of two adjacent memory cells in a round are the same, the time taken to poll all memory cells once is fixed.
In step 230, it is determined whether the current counter value of the currently polled storage unit is a preset value.
If the current counter is a preset value, go to step 240; if the current counter value is not the preset value, go to step 250.
For example, each storage unit may be matched with a counter, the value of the counter may be uniformly adjusted, and when the counter of the storage unit reaches the preset value, the message in the storage unit may be scheduled.
Illustratively, the preset value may be 0, 2, 4, 6, etc. For example, when the preset value is a non-zero value, the counter may be incremented from zero. At 0, the counter may be adjusted from a set non-zero initial value to a small value.
For example, each storage unit may be matched with a plurality of counters, values of the plurality of counters may be uniformly adjusted, and when each counter of the storage unit reaches a preset value corresponding to each counter, the message in the storage unit may be scheduled.
For example, the preset value corresponding to each counter may be the same value or different values. The starting value of each counter may be the same or different.
Step 240, scheduling the messages in the data stream in the currently polled storage unit.
In this embodiment, when the packet in the data stream in the storage unit is scheduled, step 250 may be executed.
Step 250, adjust the current counter.
In this embodiment, when each storage unit corresponds to one counter, the counter may be adjusted in a direction approaching the preset value. For example, if the initial value of the target counter is 2 and the preset value is 0, the value of the target counter may be decreased by one each time the target storage unit corresponding to the target counter is polled. For another example, if the initial value of the target counter is 0 and the preset value is 3, the value of the target counter may be incremented by one each time the target storage unit corresponding to the target counter is polled. For another example, if the initial value of the target counter is 4 and the preset value is 0, the value of the target counter may be decremented by two each time the target storage unit corresponding to the target counter is polled.
In this embodiment, when each storage unit corresponds to only one counter, the adjustment may be performed once in each polling cycle.
In this embodiment, when each storage unit corresponds to a plurality of counters, each counter may be adjusted in a direction approaching the preset value. For example, when there are two counters for each memory cell, the two counters may be adjusted in a direction approaching the preset value.
Optionally, when the counter is adjusted to the preset value, the counter may be restored to the initial value next time the value of the counter needs to be adjusted.
In this embodiment, when each storage unit only corresponds to a plurality of counters, a part of the counters may be adjusted once in each polling cycle, and the part of the counters may not need to be adjusted in each polling cycle.
In one example, when three counters are provided for each memory cell, the counters are a first counter, a second counter and a third counter. The first counter and the third counter are adjusted in each polling period, and the second counter can be adjusted when the values of the second counter and the third counter meet corresponding conditions.
For example, each time the corresponding storage unit is polled, if the first counter is not zero, the first counter may be decreased by one, and if the first counter is zero, the first counter may be set to a corresponding initial value; when the corresponding storage unit is polled each time, if the third counter is not zero, the third counter can be reduced by one, and if the third counter is zero, the third counter can be set to be a corresponding initial value; when the polling is to the corresponding storage unit, if the second counter is a non-zero value, the second counter is decreased by one, if the second counter is zero, whether the third counter is zero is judged, and the second counter is set to a corresponding initial value.
For example, the initial value of the first counter is 2, the initial value of the second counter is 5, and the initial value of the third counter is 9. The preset value corresponding to the first counter may be 0, the preset value of the second counter may be non-zero, and the preset value of the third counter may be 0. When the corresponding storage unit is polled each time, if the first counter is not zero, the first counter can be decreased by one, and if the first counter is zero, the first counter can be set to be a corresponding initial value 2; when the corresponding storage unit is polled each time, if the third counter is not zero, the third counter can be decreased by one, and if the third counter is zero, the third counter can be set to be 9 correspondingly; when the corresponding storage unit is polled, if the second counter is a non-zero value, the second counter is decreased by one, if the second counter is zero, whether the third counter is zero is judged, and the second counter is set to be 5 correspondingly.
In the above example, when polling a storage unit, if the value of the first counter of the storage unit is 0 and the value of the second counter of the storage unit is non-zero, the message in the storage unit may be scheduled.
In order to meet the requirements of data stream scheduling in different scenes, a plurality of counters can be configured for each storage unit. Under this requirement, step 230 may include steps 231 and 232.
In step 231, it is determined whether a current rate counter of the current counters of the currently polled storage units is a first preset value.
Illustratively, the first preset value may be zero, and the current rate counter may be adjusted in a uniform decrementing manner, where the decrementing rate is one, two, or so per decrement.
Illustratively, the first preset value may be non-zero, and the current rate counter may be adjusted in a uniform increment rate, the decrement rate being one, two, etc. at a time.
Of course, the adjustment speed of each counter may be different according to different requirements.
In step 232, it is determined whether a current burst counter in the current counters of the currently polled storage units is a second preset value.
The second preset value may be non-zero.
When the current rate counter is the first preset value and the current burst counter is the second preset value, determining the value of the current counter as a preset value.
When each memory cell includes a plurality of counters, the adjustment may be performed by one or more of the plurality of counters when the adjustment is required. In this embodiment, step 250 may be implemented as: adjusting the current rate counter; the current burst counter is adjusted.
Optionally, when the value of the current rate counter is not the first preset value, the value of the current rate counter is adjusted by one value unit.
The value of the current rate counter may be adjusted in a direction closer to the first preset value. For example, if the first predetermined value is zero and the current rate counter has a non-zero value, the current rate counter is decremented by one unit of value.
The value of the value unit can be set as required, for example, one value unit can be 1, or 2 values.
Optionally, when the current burst counter value is the second preset value, the current burst counter value is adjusted by a value unit.
For example, the second preset value may be a non-zero value, and when the current burst counter has a non-zero value, the current burst counter may be decreased by one value unit.
When the value of the current burst counter is not the second preset value, judging whether the value of the current holding counter in the current counter is the third preset value, and when the value of the current holding counter is not the third preset value, adjusting a numerical unit for the value of the current holding counter.
The third preset value may be zero, and if the value of the current holding counter is non-zero, then the zero value of the current burst counter may be kept unchanged, and the value of the current holding counter is decreased by one value unit.
For example, if the current burst counter value and the current hold counter value are both not zero, the current burst counter value and the current hold counter value may be decreased by one value unit.
In this embodiment, when the value of the current keep counter is the third preset value, the value of the current burst counter is updated by using the initial burst value; the value of the current hold counter is updated using the initial hold value.
In this embodiment, when the current rate counter is the first preset value, the initial rate value is used to update the current rate counter.
In order to better determine whether each packet is completely scheduled, a cell counter can be configured for each storage unit, and each cell counter is used for recording the number of cells contained in the packet to be currently scheduled.
On this basis, step 240 may include: scheduling cells to be sent in messages to be sent in a data stream in a storage unit polled currently, wherein each message is divided into one or more cells;
the cell counter may be adjusted after each scheduling of one of the cells of a message. Step 250 may include: if the value of the current cell counter in the current counter is not the fourth preset value, adjusting the value of the current cell counter by a numerical unit; if the value of the current cell counter in the current counter is the fourth preset value, the value of the current cell counter is updated by using the cell number of the next message of the message to be sent in the current polled storage unit.
The fourth preset value may be zero. The initial value of the cell counter may be the number of cells of the packet partition that need to be sent.
The cell counter value may be decremented by one each time a cell is scheduled.
The scheduling flow for a data flow is described below by some examples:
a set of counters may be configured in advance for each storage unit, and each set of counters may define an adjustment rule of each counter through a set of scheduling descriptors.
Illustratively, the schedule descriptor may be as shown in table 1 below:
TABLE 1
Figure BDA0003377775020000131
Wherein PCR RLD represents an initial value for packet cell rate reload; MBS RLD represents the initial value of maximum burst size reload; HLD RLD represents an initial value to keep reloading; PCR cnt denotes a rate counter; MBS cnt denotes the maximum burst size counter; HLD cnt: indicating a hold counter; cel cnt denotes a cell counter.
When the PCR cnt is reduced to 0, the value of PCR RLD is written into the PCR cnt.
When the MBS cnt is reduced to 0, the value of MBS RLD is written into the MBS cnt.
When HLD cnt is reduced to 0, the value of HLD RLD is written to HLD cnt.
In this example, the PCR cnt determines the maximum rate value of the data stream controlled by the counter. The PCR cnt is decremented by 1 for each poll, and the value of PCR RLD is written to the PCR cnt every time the PCR is decremented to 0. When the period for accessing each memory cell is fixed, the period for accessing each counter of each memory cell is also fixed, and thus the overflow rate of the PCR cnt is uniform.
In this example, the MBS cnt determines the MBS value of the data stream controlled by the counter, i.e. the number of cells of the message that can be continuously transmitted at the maximum uniform rate. Every time the PCR cnt is decremented to 0, if the MBS cnt is not 0, the MBS counter is decremented by 1 and transmission of one cell is allowed. When the PCR cnt is reduced to 0 each time, if the MBS cnt is 0, the value of the MBS cnt is not changed, and the cell is not sent. Each time the PCR cnt is reduced to 0, if the HOLD cnt is 0, the value of MBS RLD is written into MBS cnt.
The HLD cnt, PCR cnt and MBS cnt together determine the final rate of the controlled data stream. The HOLD cnt has a value equal to or greater than the MBS cnt. Every time the PCR cnt is reduced to 0, if the HLD cnt is not 0, the HLD cnt is reduced by 1. Every time the PCR cnt is reduced to 0, if the HLD cnt is 0, the value of HLD RLD is written into the HLD cnt. The value of MBS RLD is also written into MBS cnt.
The MBS cnt and the HOLD cnt determine the scheduling proportion, and the MBS RLD cells are scheduled to be sent every time the HLD RLD overflows from the PCR cnt.
In this example, the length of a message is reduced to a number of byte cells, and the number of cells in each message is stored in the Celcnt. When a message is scheduled, the cell number of this message is written to the Cel cnt. Each time a message is sent, it is equivalent to sending a plurality of cells, so when the scheduler sends cells according with the conditions, if Cel cnt is not 0, then Cel cnt is reduced by 1, when Cel cnt is reduced to 0, then a new message is sent, and at the same time, the cell number of the new message is written into Cel cnt.
For data streams that require uniform rates, the value of MBS RLD may be set to 1, while the value of HOLD RLD is set to 0. At this time, since HOLD cnt is always 0, MBS reload value is written into MSB cnt every time. Since the value of MBS is always greater than 0, one cell is transmitted each time the PCR cnt becomes 0, and thus the interval of transmitting cells each time is constant depending only on the value counter of PCR RLD.
Illustratively, each schedule descriptor traffic is calculated as follows:
it is assumed that 128 sets of scheduling descriptors are designed for traffic shaping, each set of scheduling descriptors corresponds to one storage unit, that is, the maximum traffic C that can be scheduled by averagely allocating to each scheduling descriptor is 1/128 of the total traffic M bandwidth, where C is 1/128 × M.
After configuration adjustment through the scheduling descriptors PCR RLD, MBS RLD, HLD, the flow of the scheduling descriptor C is calculated as follows:
C=1/128*M*(1/(PCR RLD+1))*(MBS RLD/HLD RLD)。
in one example, as shown in fig. 3a, the time interval between two adjacent solid arrows is the time required for one round of polling. The value of PCR RLD is now set to 0, so each time a poll is sent to this data stream, a cell is sent. The interval time for transmitting one cell each time is the time of one round of polling.
In one example, as shown in fig. 3b, the time interval between two adjacent solid arrows is the time required for two rounds of polling. The value of PCR RLD is now set to 1 so that one cell is transmitted every second poll into the data stream. The interval between each transmission of a cell is two weeks of polling.
In one example, as shown in fig. 3c, the time interval between two adjacent solid arrows is the time required for three polling turns. The value of PCR RLD is now set to 2 so that one cell is transmitted every third poll into the data stream. The interval between each transmission of one cell is three polling weeks.
In one example, as shown in fig. 3d, the time interval of two adjacent solid arrows is the time required for four polling turns. The value of PCR RLD is now set to 3 so that one cell is transmitted every four times this data stream is polled. The interval between each transmission of a cell is the polling period of four weeks.
Based on the above example, it can be appreciated that if a uniform rate stream rate is desired, it can only be 1/n of the maximum rate. When the required rate of the scheduled data stream cannot use 1/n of the maximum rate, a non-uniform rate implementation may be employed.
In one example, as shown in fig. 3e, in the case where PCR RLD is 0, MBS RLD is 10, and HLD RLD is 17, the time interval between two adjacent arrows is the time required for polling one round, where a solid arrow is a time point when a message is allowed to be sent, and a dotted arrow is a time point when a message is not allowed to be sent. At this point, the rate of the scheduled data stream is 10/18 of the maximum rate.
In one example, as shown in fig. 3f, in the case where PCR RLD is 1, MBS RLD is 5, and HLD RLD is 8, the time interval between two adjacent arrows is the time required for polling for two weeks, where the solid arrow is the time point when the message is allowed to be sent, and the dotted arrow is the time point when the message is not allowed to be sent. At this time, the rate of the scheduled data stream is 5/(9 × 2) of the maximum rate.
In one example, as shown in fig. 3g, in the case where PCR RLD is 2, MBS RLD is 5, and HLD RLD is 6, the time interval between two adjacent arrows is the time required for polling for three weeks, where the solid arrow is the time point when the message is allowed to be sent, and the dotted arrow is the time point when the message is not allowed to be sent. At this time, the rate of the scheduled data stream is 5/(7 × 3) of the maximum rate.
When the data stream is required to be a non-uniform stream, the PCR RLD, the MBS RLD and the HLD RLD can be configured as required. When the data stream is required to be a uniform stream, only the PCR RLD needs to be configured, the MBS RLD is set to be all 1, and the HLD RLD is set to be 0.
Optionally, values of the scheduling descriptors corresponding to the storage units may be different or the same, and may be specifically set according to actual requirements.
In the method provided by the embodiment of the application, the received message is called based on the counting condition of the counter by adopting the auxiliary action of the counter, and compared with the calling according to the speed of receiving data in the prior art, the speed of calling the message can be adjusted by the counter, so that the network congestion or flow loss caused by sudden overlarge flow can be relieved. After each data stream is subjected to the traffic shaping provided by the embodiment of the application, the balance and smoothness can be realized, and the overflow phenomenon caused by uneven scheduling is relieved.
Furthermore, QoS flow control realizes that each data flow is independently refined and does not influence each other. The adjustment of each flow only needs to reconfigure the respective scheduling descriptor parameter, so that the adjustment of the data flow can be realized, and the adjustment parameter is effective with almost no delay.
When a large number of storage units are not needed, the method can realize the real-time dynamic increase or decrease of the starting number of the storage units for controlling the data flow according to the requirement without redesigning the traffic scheduling module.
Based on the same application concept, a flow rate adjustment device corresponding to the flow rate adjustment method is further provided in the embodiments of the present application, and since the principle of solving the problem of the device in the embodiments of the present application is similar to that in the embodiments of the flow rate adjustment method, the implementation of the device in the embodiments of the present application may refer to the description in the embodiments of the method, and repeated details are not described again.
Please refer to fig. 4, which is a schematic diagram of a functional module of a flow adjusting device according to an embodiment of the present disclosure. Each module in the flow adjusting apparatus in this embodiment is configured to perform each step in the above method embodiment. The flow rate adjusting device includes: a logging module 310, a polling module 320, a determining module 330, a scheduling module 340, and an adjusting module 350; wherein the content of the first and second substances,
a storing module 310, configured to store the received data streams into storage units;
a polling module 320, configured to poll a plurality of storage units to determine a value of a counter corresponding to each storage unit;
the judging module 330 is configured to judge whether a current counter value of a currently polled storage unit is a preset value;
a scheduling module 340, configured to schedule a packet in the data stream in the storage unit that is currently polled, if the value of the current counter is a preset value;
an adjusting module 350, configured to adjust the current counter if the value of the current counter is not the preset value, or after scheduling a packet in a data stream in the currently polled storage unit.
In a possible implementation, the determining module 330 is configured to:
judging whether a current rate counter in a current counter of a current polled storage unit is a first preset value or not;
judging whether a current burst counter in a current counter of a current polled storage unit is a second preset value or not;
when the current rate counter is the first preset value and the current burst counter is the second preset value, determining the value of the current counter as a preset value.
In a possible embodiment, the adjustment module includes: a rate adjustment unit and a burst adjustment unit.
A rate adjustment unit for adjusting the current rate counter;
and a burst adjusting unit for adjusting the current burst counter.
In a possible embodiment, the rate adjustment unit is configured to:
when the current rate counter value is not the first preset value, the current rate counter value is adjusted by a numerical unit.
In a possible embodiment, the burst adjustment unit is configured to:
when the current burst counter value is the second predetermined value, adjusting the current burst counter value by a value unit;
when the value of the current burst counter is not the second preset value, judging whether the value of the current holding counter in the current counter is the third preset value;
and when the value of the current holding counter is not the third preset value, adjusting the value of the current holding counter by a numerical unit.
In a possible implementation manner, the flow rate adjusting apparatus in this embodiment further includes:
a first updating module, configured to update the value of the current burst counter by using the initial burst value when the value of the current keep counter is the third preset value; the value of the current hold counter is updated using the initial hold value.
In a possible implementation manner, the flow rate adjusting apparatus in this embodiment further includes:
and the second updating module is used for updating the value of the current rate counter by using the initial rate value when the value of the current rate counter is the first preset value.
In one possible implementation, the scheduling module 340 is configured to:
scheduling cells to be sent in messages to be sent in a data stream in a storage unit polled currently, wherein each message is divided into one or more cells;
an adjustment module to:
if the value of the current cell counter in the current counter is not the fourth preset value, adjusting the value of the current cell counter by a numerical unit;
if the value of the current cell counter in the current counter is the fourth preset value, the value of the current cell counter is updated by using the cell number of the next message of the message to be sent in the current polled storage unit.
In addition, an embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the method for adjusting a flow rate in the above method embodiment is performed.
The computer program product of the flow rate adjustment method provided in the embodiment of the present application includes a computer-readable storage medium storing a program code, where instructions included in the program code may be used to execute the steps of the flow rate adjustment method in the above method embodiment, which may be specifically referred to in the above method embodiment, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes. It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (11)

1. A method for adjusting traffic, comprising:
storing the received data streams into storage units;
polling a plurality of storage units to determine the value of a counter corresponding to each storage unit;
judging whether the value of a current counter of the current polled storage unit is a preset value or not;
if the value of the current counter is a preset value, scheduling the message in the data stream in the storage unit which is polled currently, and adjusting the current counter;
and if the value of the current counter is not a preset value, adjusting the current counter.
2. The method of claim 1, wherein the determining whether the current counter value of the currently polled storage unit is a preset value comprises:
judging whether a current rate counter in a current counter of a current polled storage unit is a first preset value or not;
judging whether a current burst counter in a current counter of a current polled storage unit is a second preset value or not;
and when the current rate counter is the first preset value and the current burst counter is the second preset value, determining that the value of the current counter is a preset value.
3. The method of claim 2, wherein said adjusting said current counter comprises:
adjusting the current rate counter;
and adjusting the current burst counter.
4. The method of claim 3, wherein the current rate counter is adjusted, comprising:
and when the value of the current rate counter is not the first preset value, adjusting the value of the current rate counter by a numerical unit.
5. The method of claim 3, wherein the adjusting the current burst counter comprises:
when the value of the current burst counter is the second preset value, adjusting the value of the current burst counter by a numerical unit;
when the value of the current burst counter is not the second preset value, judging whether the value of a current holding counter in the current counter is the third preset value;
and when the value of the current keeping counter is not a third preset value, adjusting the value of the current keeping counter by a numerical value unit.
6. The method of claim 5, further comprising:
when the value of the current holding counter is the third preset value, updating the value of the current burst counter by using an initial burst value; updating the value of the current hold counter using the initial hold value.
7. The method of claim 4, further comprising:
and when the value of the current rate counter is the first preset value, updating the value of the current rate counter by using an initial rate value.
8. The method according to any of claims 1-7, wherein the scheduling the packets in the data stream in the storage unit currently polled to comprises:
scheduling cells to be sent in messages to be sent in a data stream in a storage unit polled currently, wherein each message is divided into one or more cells;
the adjusting the current counter includes:
if the value of the current cell counter in the current counter is not a fourth preset value, adjusting the value of the current cell counter by a numerical value unit;
and if the value of the current cell counter in the current counter is the fourth preset value, updating the value of the current cell counter by using the cell number of the next message of the message to be sent in the current polled storage unit.
9. A flow regulating device, comprising:
the storage module is used for storing the received data streams into the storage units;
the polling module is used for polling the storage units to determine the value of the counter corresponding to each storage unit;
the judging module is used for judging whether the value of the current counter of the current polled storage unit is a preset value or not;
the scheduling module is used for scheduling the message in the data stream in the storage unit which is polled currently if the value of the current counter is a preset value;
and the adjusting module is used for adjusting the current counter if the value of the current counter is not a preset value or after a message in a data stream in the storage unit polled currently is scheduled.
10. An electronic device, comprising: a processor, a memory storing machine-readable instructions executable by the processor, the machine-readable instructions when executed by the processor performing the steps of the method of any of claims 1 to 8 when the electronic device is run.
11. A computer-readable storage medium, having stored thereon a computer program which, when being executed by a processor, is adapted to carry out the steps of the method according to any one of claims 1 to 8.
CN202111422142.3A 2021-11-26 2021-11-26 Flow adjustment method, device, electronic equipment and computer readable storage medium Active CN114143267B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111422142.3A CN114143267B (en) 2021-11-26 2021-11-26 Flow adjustment method, device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111422142.3A CN114143267B (en) 2021-11-26 2021-11-26 Flow adjustment method, device, electronic equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN114143267A true CN114143267A (en) 2022-03-04
CN114143267B CN114143267B (en) 2023-08-29

Family

ID=80388349

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111422142.3A Active CN114143267B (en) 2021-11-26 2021-11-26 Flow adjustment method, device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN114143267B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115086302A (en) * 2022-06-27 2022-09-20 杭州壹悟科技有限公司 Internet of things equipment data transmission optimization method and system, Internet of things equipment and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107483363A (en) * 2017-08-15 2017-12-15 无锡职业技术学院 A kind of Weight Round Robin device and method of layering
CN111708482A (en) * 2020-05-12 2020-09-25 苏州浪潮智能科技有限公司 Method, system, device and medium for limiting bandwidth in distributed storage
CN112738119A (en) * 2020-12-30 2021-04-30 北京天融信网络安全技术有限公司 Message processing method and device, electronic equipment and readable storage medium
CN113595922A (en) * 2021-07-29 2021-11-02 上海浦东发展银行股份有限公司 Flow limiting method, device, server and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107483363A (en) * 2017-08-15 2017-12-15 无锡职业技术学院 A kind of Weight Round Robin device and method of layering
CN111708482A (en) * 2020-05-12 2020-09-25 苏州浪潮智能科技有限公司 Method, system, device and medium for limiting bandwidth in distributed storage
CN112738119A (en) * 2020-12-30 2021-04-30 北京天融信网络安全技术有限公司 Message processing method and device, electronic equipment and readable storage medium
CN113595922A (en) * 2021-07-29 2021-11-02 上海浦东发展银行股份有限公司 Flow limiting method, device, server and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115086302A (en) * 2022-06-27 2022-09-20 杭州壹悟科技有限公司 Internet of things equipment data transmission optimization method and system, Internet of things equipment and medium
CN115086302B (en) * 2022-06-27 2023-06-20 杭州壹悟科技有限公司 Data transmission optimization method and system for Internet of things equipment, internet of things equipment and medium

Also Published As

Publication number Publication date
CN114143267B (en) 2023-08-29

Similar Documents

Publication Publication Date Title
CN1716914B (en) Fair WRED for traffic mix
US6940861B2 (en) Data rate limiting
US10389637B2 (en) Quality of service for mixed service tiers
US9438523B2 (en) Method and apparatus for deriving a packet select probability value
US10425347B2 (en) Scheduling of packets in network devices
US8543685B1 (en) Usage based multiplier modification in rate limiting schemes
US7848239B2 (en) Network system capable of dynamically controlling data flow and its method
EP3073680A1 (en) Methods, queueing system, network element and network system for queueing and processing of packets
EP1848161B1 (en) Efficient method and system for weighted fair policing
US7843825B2 (en) Method and system for packet rate shaping
US20140146831A1 (en) Queue Scheduling Method and Apparatus
CN114143267A (en) Flow adjusting method and device, electronic equipment and computer readable storage medium
CN112968845B (en) Bandwidth management method, device, equipment and machine-readable storage medium
Lu et al. Weighted fair queuing with differential dropping
US20120127858A1 (en) Method and apparatus for providing per-subscriber-aware-flow qos
US11202301B2 (en) Self-learning rate access prioritizer for applications in a wireless network
JP3680015B2 (en) Information processing device
US11349770B2 (en) Communication control apparatus, and communication control method
US20220329542A1 (en) Method for managing data throughput
US7773512B2 (en) Bandwidth control module and bandwidth control method thereof
Martin et al. Managing fairness and application performance with active queue management in docsis-based cable networks
CN117492992A (en) Data scheduling method, device, electronic equipment and computer readable storage medium
EP3716549A1 (en) Bandwidth management
US20200162398A1 (en) Methods for the processing of data packets, corresponding device, computer program product, storage medium and network node
KR20040048233A (en) Apparatus for queue scheduling using linear control and method therefor

Legal Events

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