CN117255058B - Network speed limiting method, terminal equipment and storage medium - Google Patents

Network speed limiting method, terminal equipment and storage medium Download PDF

Info

Publication number
CN117255058B
CN117255058B CN202311534948.0A CN202311534948A CN117255058B CN 117255058 B CN117255058 B CN 117255058B CN 202311534948 A CN202311534948 A CN 202311534948A CN 117255058 B CN117255058 B CN 117255058B
Authority
CN
China
Prior art keywords
forwarded
data packet
target
forwarding
transmission time
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
CN202311534948.0A
Other languages
Chinese (zh)
Other versions
CN117255058A (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.)
Shenzhen Everything Safety Technology Co ltd
Original Assignee
Shenzhen Everything Safety Technology 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 Shenzhen Everything Safety Technology Co ltd filed Critical Shenzhen Everything Safety Technology Co ltd
Priority to CN202311534948.0A priority Critical patent/CN117255058B/en
Publication of CN117255058A publication Critical patent/CN117255058A/en
Application granted granted Critical
Publication of CN117255058B publication Critical patent/CN117255058B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • 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/20Traffic policing
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Landscapes

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

Abstract

The invention discloses a network speed limiting method, terminal equipment and a storage medium, wherein the method comprises the following steps: determining the quantity of data packets to be forwarded according to a network speed limit value, and acquiring the data packets to be forwarded which are consistent with the quantity; determining the total forwarding time for forwarding the data packet to be forwarded according to the total length of the data packet to be forwarded and the network speed limit value; determining unit transmission time corresponding to the data packet to be forwarded according to the total forwarding time and the number; determining a transmission sequence of the data packet to be forwarded according to the length of the data packet to be forwarded and the unit length of the unit transmission time; and forwarding the data packet to be forwarded according to the sending sequence of the data packet to be forwarded. According to the network speed limit value and the length of the data packet to be forwarded, the sending sequence is reasonably planned, so that the bandwidth in each unit transmission time is utilized to the greatest extent, the bandwidth specified by the network speed limit value is not exceeded, the jitter of the network is avoided, and the network traffic is transmitted smoothly.

Description

Network speed limiting method, terminal equipment and storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a network speed limiting method, a terminal device, and a storage medium.
Background
In order to avoid network congestion and overload, ensure normal operation of various applications and provide users with good network service quality, bandwidth usage is generally controlled by setting network speed limit values. The network speed limit value specifies the bandwidth resources that are most available to an application or user in the network for a certain period of time. However, when the network traffic suddenly changes, the network traffic exceeds the bandwidth specified by the network speed limit value, and all the data packets cannot be processed and forwarded in time, so that the phenomena of buffer overflow, packet loss, queuing and the like are caused. These problems can lead to unstable transmission times of data packets, and thus network jitter.
The foregoing is provided merely for the purpose of facilitating understanding of the technical solutions of the present invention and is not intended to represent an admission that the foregoing is prior art.
Disclosure of Invention
The embodiment of the invention provides a network speed limiting method, terminal equipment and a computer readable storage medium, aiming at solving the problems that when network traffic suddenly changes, the network traffic exceeds the bandwidth specified by a network speed limiting value, all data packets cannot be processed and forwarded in time, and buffer overflow, packet loss, queuing and the like are caused. These problems can lead to unstable transmission times of data packets, which can lead to network jitter.
In order to achieve the above object, an embodiment of the present invention provides a network speed limiting method, including:
determining the quantity of data packets to be forwarded according to a network speed limit value, and acquiring the data packets to be forwarded which are consistent with the quantity;
determining the total forwarding time for forwarding the data packet to be forwarded according to the total length of the data packet to be forwarded and the network speed limit value;
determining unit transmission time corresponding to the data packet to be forwarded according to the total forwarding time and the number;
determining a transmission sequence of the data packet to be forwarded according to the length of the data packet to be forwarded and the unit length of the unit transmission time;
and forwarding the data packet to be forwarded according to the sending sequence of the data packet to be forwarded.
Optionally, the step of determining the transmission sequence of the data packet to be forwarded according to the length of the data packet to be forwarded and the unit length of the unit transmission time includes:
determining a target data packet to be forwarded, wherein the length of the data packet to be forwarded is greater than the unit length of the unit transmission time;
determining a target position of the target forwarding data packet in the sending sequence according to the forwarding sequence and the target length of the target forwarding data packet, and inserting the target forwarding data packet into the target position;
And taking the unit transmission time corresponding to the forwarding sequence of the rest data packets to be forwarded as the position of the rest data packets to be forwarded in the sending sequence, and inserting the rest data packets to be forwarded into the position to obtain the sending sequence.
Optionally, the step of determining a target position of the target forwarding data packet in the sending sequence according to the forwarding sequence and the target length of the target forwarding data packet, and inserting the target forwarding data packet into the target position includes:
determining a target unit transmission time corresponding to the target data packet to be forwarded according to the forwarding sequence of the target data packet to be forwarded;
if the forwarding sequence of the target data packet to be forwarded is smaller than a preset threshold, forward operation is carried out on the preamble data packet to be forwarded of the target data packet to be forwarded, and whether the preamble of the target data packet to be forwarded has first remaining time is determined, wherein the preamble data packet to be forwarded is the data packet to be forwarded of which the forwarding sequence is earlier than the forwarding sequence of the target data packet to be forwarded, and the preset threshold is half of the number;
and if the first residual time exists and the total length accommodated by the first residual time and the target unit transmission time is greater than or equal to the target length of the target data packet to be forwarded, taking the first residual time and the target unit transmission time as the target position of the target data packet to be forwarded, and inserting the target data packet to be forwarded into the target position.
Optionally, if the forwarding order of the target to-be-forwarded data packet is smaller than a preset threshold, performing a forward operation on a to-be-forwarded data packet of the preamble of the target to-be-forwarded data packet, and after the step of determining whether the preamble of the target to-be-forwarded data packet has the first remaining time, further includes:
if the first remaining time does not exist, or the total length contained in the first remaining time and the target unit transmission time is smaller than the target length of the target data packet to be forwarded, performing backward operation on the subsequent data packet to be forwarded of the target data packet to be forwarded, and determining whether a second remaining time exists in the subsequent data packet to be forwarded of the target data packet, wherein the subsequent data packet to be forwarded is a data packet to be forwarded in a forwarding sequence of the target data packet to be forwarded after the forwarding sequence;
and if the second residual time exists and the total length accommodated by the second residual time and the target unit transmission time is greater than or equal to the target length of the target data packet to be forwarded, taking the second residual time and the target unit transmission time as the target position of the target data packet to be forwarded, and inserting the target data packet to be forwarded into the target position.
Optionally, after the step of determining the target unit transmission time corresponding to the target data packet to be forwarded according to the forwarding sequence of the target data packet to be forwarded, the method further includes:
if the target to-be-forwarded data packet is larger than the preset threshold value, performing backward operation on a subsequent to-be-forwarded data packet of the target to-be-forwarded data packet, and determining whether a third residual time exists in the subsequent to-be-forwarded data packet, wherein the subsequent to-be-forwarded data packet is a to-be-forwarded data packet in a forwarding sequence of the target to-be-forwarded data packet after the forwarding sequence;
and if the third remaining time exists and the total length accommodated by the third remaining time and the target unit transmission time is greater than or equal to the target length of the target data packet to be forwarded, taking the third remaining time and the target unit transmission time as the target position of the target data packet to be forwarded, and inserting the target data packet to be forwarded into the target position.
Optionally, if the target to-be-forwarded data packet is greater than the preset threshold, performing a backward operation on a to-be-forwarded data packet subsequent to the target to-be-forwarded data packet, and after the step of determining whether the third remaining time exists in the target to-be-forwarded data packet subsequent to the target to-be-forwarded data packet, further includes:
If the third remaining time does not exist, or the total length accommodated by the third remaining time and the target unit transmission time is smaller than the target length of the target data packet to be forwarded, performing the forward operation on the preamble data packet to be forwarded of the target data packet to be forwarded, and determining whether a fourth remaining time exists in the preamble of the target data packet to be forwarded;
and if the fourth remaining time exists and the total length accommodated by the fourth remaining time and the target unit transmission time is greater than or equal to the target length of the target data packet to be forwarded, taking the fourth remaining time and the target unit transmission time as the target position of the target data packet to be forwarded, and inserting the target data packet to be forwarded into the target position.
Optionally, the step of determining the number of the data packets to be forwarded according to the network speed limit value and obtaining the data packets to be forwarded corresponding to the number includes:
acquiring the network speed limit value and the average length of the data packet;
and obtaining the quantity of the data packets to be forwarded according to the network speed limit value and the average length of the data packets, and obtaining the data packets to be forwarded, the quantity of which is consistent with the quantity, from a queue to be forwarded.
Optionally, the step of forwarding the data packet to be forwarded according to the sending sequence of the data packet to be forwarded includes:
determining the duty cycle of each unit transmission time in the transmission sequence;
and forwarding the data packets to be forwarded corresponding to each unit transmission time in sequence according to the duty ratio.
In addition, in order to achieve the above object, the present invention further provides a terminal device, including: the system comprises a memory, a processor and a network speed limiting program stored on the memory and capable of running on the processor, wherein the network speed limiting program realizes the steps of the network speed limiting method when being executed by the processor.
In addition, in order to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon a network speed limiting program which, when executed by a processor, implements the steps of the network speed limiting method as described above.
According to the network speed limiting method, terminal equipment and a computer readable storage medium, the number of data packets to be forwarded is determined according to a network speed limiting value, the data packets to be forwarded which are consistent with the number are obtained, then the total forwarding time for forwarding the data packets to be forwarded is determined according to the total length of the data packets to be forwarded and the network speed limiting value, the unit transmission time corresponding to the data packets to be forwarded is determined according to the total forwarding time and the number, the sending sequence of the data packets to be forwarded is determined according to the length of the data packets to be forwarded and the unit length of the unit transmission time, and the data packets to be forwarded are forwarded according to the sending sequence of the data packets to be forwarded. According to the network speed limit value and the length of the data packet to be forwarded, the transmission sequence of the data packet to be forwarded is reasonably planned, so that the bandwidth in each unit transmission time is utilized to the greatest extent, the bandwidth specified by the network speed limit value is not exceeded, and the network jitter phenomenon is avoided.
Drawings
FIG. 1 is a flow chart of an embodiment of a network speed limiting method of the present invention;
FIG. 2 is a schematic diagram of a refinement flow of step S40 in a second embodiment of the network speed limiting method of the present invention;
FIG. 3 is a schematic diagram of a refinement flow of step S42 in a second embodiment of the network speed limiting method of the present invention;
fig. 4 is a schematic diagram of a refinement flow of step S421 in the third embodiment of the network speed limiting method of the present invention;
fig. 5 is a schematic diagram of a terminal structure of a hardware running environment according to an embodiment of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
In the related art, in order to avoid network congestion and overload, the normal operation of various applications is ensured, and good network service quality is provided for users, and the use of bandwidth is generally controlled by setting a network speed limit value. The network speed limit value specifies the bandwidth resources that are most available to an application or user in the network for a certain period of time. However, when the network traffic suddenly changes, the network traffic exceeds the bandwidth specified by the network speed limit value, and all the data packets cannot be processed and forwarded in time, so that the phenomena of buffer overflow, packet loss, queuing and the like are caused. These problems can lead to unstable transmission times of data packets, which can lead to network jitter.
In order to solve the above-mentioned drawbacks in the related art, the present invention provides a network speed limiting method, which mainly comprises the following steps:
determining the quantity of data packets to be forwarded according to a network speed limit value, acquiring the data packets to be forwarded which are consistent with the quantity, determining the total forwarding time of forwarding the data packets to be forwarded according to the total length of the data packets to be forwarded and the network speed limit value, determining the unit transmission time corresponding to the data packets to be forwarded according to the total forwarding time and the quantity, determining the sending sequence of the data packets to be forwarded according to the length of the data packets to be forwarded and the unit length of the unit transmission time, and forwarding the data packets to be forwarded according to the sending sequence of the data packets to be forwarded. According to the network speed limit value and the length of the data packet to be forwarded, the transmission sequence of the data packet to be forwarded is reasonably planned, so that the bandwidth in each unit transmission time is utilized to the greatest extent, the bandwidth specified by the network speed limit value is not exceeded, and the network jitter phenomenon is avoided.
In order to better understand the above technical solution, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
Referring to fig. 1, in an embodiment of the network speed limiting method of the present invention, the network speed limiting method includes the steps of:
step S10: determining the quantity of data packets to be forwarded according to a network speed limit value, and acquiring the data packets to be forwarded which are consistent with the quantity;
the network speed limit value specifies the bandwidth resources that are most available to an application or user in the network for a certain period of time. For example, the network speed limit value is 200 megabits/second, which indicates that the user can only transmit 200 megabits of data per second at most, and if the data transmitted per second exceeds 200 megabits, the conditions such as data loss, data delay increase, network congestion and the like may be caused, so that the network jitter phenomenon occurs.
In this embodiment, the execution body is a mobile terminal. Such as a mobile phone, a computer, and a server, which is not particularly limited in this embodiment. When receiving the data packet to be forwarded, the mobile terminal stores the data packet to be forwarded into a queue to be forwarded, and forwards the data packet to be forwarded in the queue to be forwarded to the target equipment in sequence according to the first-in first-out rule. The target device may be any device, and this embodiment is not particularly limited.
Optionally, to avoid the occurrence of network jitter, bandwidth resources are utilized to the greatest extent. The invention receives the average length of the data packet and the network speed limit value obtained by calculation, divides the network speed limit value by the average length of the data packet, thereby determining the quantity of the data packet to be forwarded, and obtaining the data packet to be forwarded which is consistent with the quantity from a queue to be forwarded. It can be understood that the result obtained by dividing the network speed limit value by the average length of the data packets represents the maximum number of data packets to be forwarded that can be sent per second by the mobile terminal when the network speed limit value is satisfied.
Step S20: determining the total forwarding time for forwarding the data packet to be forwarded according to the total length of the data packet to be forwarded and the network speed limit value;
in this embodiment, because the lengths of the actually obtained data packets to be forwarded are different from the average lengths, the lengths of the data packets to be forwarded are further obtained, the total length of all the data packets to be forwarded is counted, and the total forwarding time required for actually forwarding all the data packets to be forwarded is determined according to the total length and the network speed limit value. It will be appreciated that the total length of the total forwarding time, determined according to the network speed limit, can accommodate the amount of data equal to the total length of the data packets to be forwarded.
Optionally, the total forwarding time of the data packet to be forwarded=the total length of the data packet to be forwarded/the network speed limit value. Total forwarding time total length of the amount of data can be accommodated = network speed limit/total forwarding time.
Step S30: determining unit transmission time corresponding to the data packet to be forwarded according to the total forwarding time and the number;
in the present embodiment, unit transmission time=total forwarding time/preset number. The total forwarding time is divided into parts which are consistent with the number of the data packets to be forwarded, and the unit transmission time corresponding to each part is the same.
It should be noted that, since the forwarding order of the data packets to be forwarded is fixed, and the unit transmission time is consistent with the number of the data packets to be forwarded, the unit transmission time of each data packet to be forwarded is fixed.
Alternatively, each data packet to be forwarded may be allocated to each unit transmission time according to the forwarding order of the data packets to be forwarded.
For example, the total forwarding time is 1.5 seconds, and the number of packets to be forwarded is 5, so the unit transmission time corresponding to the packets to be forwarded is 1.5/5=0.3 seconds. Thus dividing the total forwarding time into 5 equal parts, and the unit transmission time corresponding to each equal part is 0.3S. I.e. the total forwarding time is divided into five equal parts of 0-0.3S, 0.3-0.6S, 0.6-0.9S, 0.9-1.2S and 1.2-1.5S. And then distributing each data packet to be forwarded to the corresponding unit transmission time according to the forwarding sequence of the data packet to be forwarded. For example, the first data packet to be forwarded is allocated to a unit transmission time of 0-0.3S, the second data packet to be forwarded is allocated to a unit transmission time of 0.3-0.6S, and so on, which will not be repeated in this embodiment.
Optionally, each data packet to be forwarded may be identified in advance according to the forwarding sequence of the data packet to be forwarded, and each unit transmission time may be identified according to the time sequence of each unit transmission time, so that when the data packet to be forwarded is allocated, the data packet to be forwarded may be directly allocated to the unit transmission time having the same identification as the data packet to be forwarded, so as to quickly determine the sending sequence of the data packet to be forwarded.
For example, after the data packets to be forwarded are acquired, according to the forwarding sequence of the data packets to be forwarded, the identifiers of the data packets to be forwarded are determined to be 1, 2, 3, 4 and 5 respectively, and the data packets to be forwarded with the identifiers 1 to 5 are sequentially forwarded during forwarding. After the unit transmission time of the data packet to be forwarded is determined, according to the time sequence of the unit transmission time, the identification of 0-0.3S is 1, the identification of 0.3-0.6S is 2, the identification of 0.6-0.9S is 3, the identification of 0.9-1.2S is 4, and the identification of 1.2-1.5S is 5. And when the transmission sequence is determined, directly distributing the data packet to be forwarded to the unit transmission time with the same identification as the data packet to obtain the transmission sequence.
Step S40: determining a transmission sequence of the data packet to be forwarded according to the length of the data packet to be forwarded and the unit length of the unit transmission time;
the unit length of each unit transmission time capable of accommodating the data amount is the same, and after the data packets to be forwarded are distributed to each unit transmission time, certain unit lengths of the data packets to be forwarded exceed the unit length of the unit transmission time, and certain unit lengths of the data packets to be forwarded are lower than the unit length of the unit transmission time, if the data packets to be forwarded are distributed to the corresponding unit transmission time, the waste of bandwidth resources is caused.
In this embodiment, unit length of unit transmission time = network speed limit value. According to the length of the data packet to be forwarded and the unit length of the unit transmission time, the invention determines the target position of each data packet to be forwarded in the unit transmission time, thereby obtaining a transmission sequence. The length of the time occupied by the target position is equal to the length of the data packet to be forwarded, so that bandwidth resources are utilized to the greatest extent, the bandwidth specified by the network speed limit value is not exceeded, and the network jitter phenomenon is avoided.
Optionally, when the length of the data packet to be forwarded is greater than the length accommodated in the unit transmission time, the remaining time of the unit transmission time corresponding to the previous and/or the next data packet to be forwarded is occupied, and the remaining time and the unit transmission time corresponding to the data packet to be forwarded are taken as the target position of the data packet to be forwarded, so that the time occupied by the target position can accommodate the length of the data packet to be forwarded without exceeding the bandwidth specified by the network speed limit value, thereby avoiding the occurrence of the network jitter phenomenon.
Optionally, when the length of the data packet to be forwarded is smaller than the length accommodated in the unit transmission time, the corresponding position of the unit transmission time is inserted according to the length of the data packet to be forwarded, and the remaining time of the unit transmission time is left as the next data packet to be forwarded for use, or the remaining time is emptied, which is not specifically limited in this embodiment.
Step S50: and forwarding the data packet to be forwarded according to the sending sequence of the data packet to be forwarded.
In this embodiment, the present invention determines the duty ratio of the unit transmission time according to the ratio of the length of the data packet to be forwarded in each unit transmission time to the unit length of the unit transmission time, and then forwards the data packet to be forwarded according to the duty ratio of each unit transmission time in the transmission sequence.
Optionally, according to the duty ratio, the unused time in each unit transmission time can be determined, so that when the data packet to be forwarded in the unit transmission time is forwarded, the unused time in the unit transmission time is emptied according to the duty ratio, so as to ease the load of the network, avoid the loss of the data packet, and improve the stability and reliability of the network.
In the technical scheme provided by the embodiment, the number of the data packets to be forwarded is determined according to the network speed limit value, the data packets to be forwarded which are consistent with the number are obtained, then the total forwarding time for forwarding the data packets to be forwarded is determined according to the total length of the data packets to be forwarded and the network speed limit value, the unit transmission time corresponding to the data packets to be forwarded is determined according to the total forwarding time and the number, the sending sequence of the data packets to be forwarded is determined according to the length of the data packets to be forwarded and the unit length of the unit transmission time, and the data packets to be forwarded are forwarded according to the sending sequence of the data packets to be forwarded. According to the network speed limit value and the length of the data packet to be forwarded, the transmission sequence of the data packet to be forwarded is reasonably planned, so that the bandwidth in each unit transmission time is utilized to the greatest extent, the bandwidth specified by the network speed limit value is not exceeded, and the network jitter phenomenon is avoided.
Referring to fig. 2, in the second embodiment, based on the first embodiment, the step S40 includes:
step S41: determining a target data packet to be forwarded, wherein the length of the data packet to be forwarded is greater than the unit length of the unit transmission time;
in this embodiment, the length of each data packet to be forwarded is obtained, and the length of the data packet to be forwarded is compared with the unit length of the unit transmission time, so as to determine the target data packet to be forwarded, where the length of the data packet to be forwarded is greater than the unit length of the unit transmission time.
Step S42: determining a target position of the target forwarding data packet in the sending sequence according to the forwarding sequence and the target length of the target forwarding data packet, and inserting the target forwarding data packet into the target position;
in this embodiment, according to the forwarding sequence of the target data packet to be forwarded, the target unit transmission time corresponding to the target data packet to be forwarded is determined. And then forward operation is carried out on the front-end to-be-forwarded data packet of the target to-be-forwarded data packet or backward operation is carried out on the rear-end to-be-forwarded data packet of the target to-be-forwarded data packet, so that whether the front-end or rear-end of the target to-be-forwarded data packet has residual time or not is determined, if the residual time exists, the residual time and the target unit transmission time are used as target positions of the target to-be-forwarded data packet, the condition that the target to-be-forwarded data packet occupies transmission time of a plurality of to-be-forwarded data packets at the same time is avoided, the target to-be-forwarded data packet is split into a plurality of parts to be transmitted during forwarding, and data loss is easy to cause in the transmission process.
Step S43: and taking the unit transmission time corresponding to the forwarding sequence of the rest data packets to be forwarded as the position of the rest data packets to be forwarded in the sending sequence, and inserting the rest data packets to be forwarded into the position to obtain the sending sequence.
In this embodiment, after determining the target positions of all the target data packets to be forwarded, determining the corresponding target unit transmission time according to the forwarding sequence of the remaining data packets to be forwarded, so as to directly insert the remaining data packets to be forwarded into the corresponding positions of the target unit transmission time, thereby obtaining the transmission sequence of the data packets to be forwarded.
It can be understood that, because the target data packet to be forwarded occupies a part of the transmission time of the previous unit or occupies a part of the transmission time of the next unit, when the data packet to be forwarded of the previous unit is inserted, the part of the time occupied by the target data packet to be forwarded is automatically avoided, and overlapping among the data packets to be forwarded is avoided, thereby causing phenomena such as network unevenness, jitter, and the like.
In the technical solution provided in this embodiment, the transmission sequence is obtained by determining a target to-be-forwarded data packet with a length greater than a unit length of a unit transmission time of the to-be-forwarded data packet, determining a target position of the target to-be-forwarded data packet in the transmission sequence according to a forwarding sequence of the target to-be-forwarded data packet and the target length, inserting the target to-be-forwarded data packet into the target position, using the unit transmission time corresponding to the forwarding sequence of the remaining to-be-forwarded data packet as a position of the remaining to-be-forwarded data packet in the transmission sequence, and inserting the remaining to-be-forwarded data packet into the position. The method has the advantages that the target position of the target data packet to be forwarded with the length longer than the unit transmission time is preferentially determined, the target data packet to be forwarded is prevented from occupying excessive transmission time of the data packet to be forwarded at one time, the target data packet to be forwarded is prevented from being split into a plurality of parts to be transmitted during forwarding, and data loss is easy to cause in the transmission process.
Referring to fig. 3, in a third embodiment, based on any of the above embodiments, the step S42 includes:
step S421: determining a target unit transmission time corresponding to the target data packet to be forwarded according to the forwarding sequence of the target data packet to be forwarded;
step S422: if the forwarding sequence of the target data packet to be forwarded is smaller than a preset threshold, forward operation is carried out on the preamble data packet to be forwarded of the target data packet to be forwarded, and whether the preamble of the target data packet to be forwarded has first remaining time is determined, wherein the preamble data packet to be forwarded is the data packet to be forwarded of which the forwarding sequence is earlier than the forwarding sequence of the target data packet to be forwarded, and the preset threshold is half of the number;
in this embodiment, forward operation refers to pre-positioning a data packet to be forwarded with a preamble, that is, determining, in advance, a position of each data packet to be forwarded with a preamble in a transmission sequence according to a forwarding sequence of the data packet to be forwarded with the preamble, so as to determine whether a first remaining time exists in the preamble of the data packet to be forwarded with the preamble. In order to improve the calculation efficiency, if the forwarding sequence of the target data packets to be forwarded is smaller than a preset threshold value, the sequence of the target data packets to be forwarded is characterized as being earlier, the number of preceding data packets of the target data packets to be forwarded is smaller than the number of subsequent data packets to be forwarded, and at this time, forward operation can be preferentially performed on the target data packets to be forwarded.
When there are a plurality of target to-be-forwarded data packets, in the process of sequentially determining the target positions corresponding to the target to-be-forwarded data packets according to the forwarding sequence of the target to-be-forwarded data packets, if the first target to-be-forwarded data packet exists in the preamble to-be-forwarded data packet of the currently determined target to-be-forwarded data packet, the target positions of the first target to-be-forwarded data packet are already determined, so that forward operation is only required to be performed on the preamble to-be-forwarded data packet of the first target to-be-forwarded data packet after the forwarding sequence, and forward operation is not required to be performed on all the preamble to-be-forwarded data packets, thereby rapidly determining the target positions of the target to-be-forwarded data packets.
Optionally, the number of occupied unit transmission time can be determined according to the number of the data packets to be forwarded, so as to calculate the total unit transmission time occupied by the data packets to be forwarded, and calculate the total length of the preamble corresponding to the total unit transmission time according to the network speed limit value. And then the length of each preamble data packet to be forwarded is obtained, and the total length corresponding to the preamble data packet to be forwarded is determined. And when the total length of the preamble is larger than the corresponding total length of the data packet to be forwarded, the first residual time is characterized to exist, so that the first residual time is determined according to the difference value between the total length of the preamble and the total length of the data packet to be forwarded. It should be noted that, during the forward operation, the arrangement of the data packets to be forwarded in the preamble is forward arrangement, that is, the data packets to be forwarded in the preamble are allocated from the starting point of the unit transmission time.
It can be understood that total unit transmission time = unit transmission time x number of data packets to be forwarded by the preamble; total preamble length corresponding to total unit transmission time = network speed limit value; the total length corresponding to the data packets to be forwarded by the preamble is the sum of the lengths of the data packets to be forwarded by the preamble.
Step S423: and if the first residual time exists and the total length accommodated by the first residual time and the target unit transmission time is greater than or equal to the target length of the target data packet to be forwarded, taking the first residual time and the target unit transmission time as the target position of the target data packet to be forwarded, and inserting the target data packet to be forwarded into the target position.
In this embodiment, if there is a first remaining time and the total length of the first remaining time and the target unit transmission time is greater than or equal to the target length of the target data packet to be forwarded, the first remaining time and the target unit transmission time may be used as the target position of the target data packet to be forwarded, and the target data packet to be forwarded may be inserted into the target position.
Optionally, if the first remaining time does not exist, or the total length accommodated by the first remaining time and the target unit transmission time is smaller than the target length of the target data packet to be forwarded, performing backward operation on a subsequent data packet to be forwarded of the target data packet to be forwarded, and determining whether a second remaining time exists in the subsequent data packet to be forwarded of the target data packet to be forwarded, where the subsequent data packet to be forwarded is a data packet to be forwarded in a forwarding sequence of the target data packet to be forwarded after the forwarding sequence; and if the second residual time exists and the total length accommodated by the second residual time and the target unit transmission time is greater than or equal to the target length of the target data packet to be forwarded, taking the second residual time and the target unit transmission time as the target position of the target data packet to be forwarded, and inserting the target data packet to be forwarded into the target position.
In this embodiment, the backward operation refers to pre-positioning the to-be-forwarded data packets, that is, determining, in advance, the positions of each to-be-forwarded data packet in the transmission sequence according to the forwarding sequence of the to-be-forwarded data packets, so as to determine whether the second remaining time exists in the to-be-forwarded data packets. If the second remaining time exists and the total length of the second remaining time and the target unit transmission time is greater than or equal to the target length of the target data packet to be forwarded, the second remaining time and the target unit transmission time are used as target positions of the target data packet to be forwarded.
It should be noted that, during backward operation, the arrangement of the data packets to be forwarded in the backward direction is reverse arrangement, that is, the data packets to be forwarded in the backward direction are distributed from the end point of the unit transmission time, and the data packets to be forwarded in the backward direction are preset according to the reverse order of the data packets to be forwarded in the backward direction.
It can be understood that when the preamble of the target data packet to be forwarded is not available or the preamble is insufficient in remaining time, backward operation is performed on the data packet to be forwarded subsequent to the target data packet to be forwarded to determine whether the second remaining time exists in the sequence of the target data packet to be forwarded, so that the second remaining time and the target unit transmission time are used as the target position of the target data packet to be forwarded, the target data packet to be forwarded does not occupy the transmission time of a plurality of data packets to be forwarded at one time, the target data packet to be forwarded is prevented from being split into a plurality of parts to be sent during forwarding, and data loss is easy to cause in the transmission process. The subsequent data packets to be forwarded are the data packets to be forwarded in the forwarding sequence of the target data packets to be forwarded after the forwarding sequence.
Optionally, after the step of performing backward operation on the data packet to be forwarded subsequent to the target data packet to be forwarded to determine whether the second remaining time exists in the target data packet to be forwarded subsequent to the target data packet, the method further includes: if the second remaining time exists and the total length accommodated by the second remaining time and the target unit transmission time is smaller than the target length of the target data packet to be forwarded, the first remaining time, the second remaining time and the target unit transmission time are used as target positions of the target data packet to be forwarded, the target data packet to be forwarded is inserted into the target positions, and the purpose of ensuring that the transmission time of other data packets to be forwarded is enough without exceeding the bandwidth specified by the network speed limit value while ensuring that the target length of the target data packet to be forwarded is consistent with the length accommodated by the occupied transmission time is achieved. According to the network speed limiting method provided by the invention, even under the condition of encountering abrupt network traffic change, the forwarded data packet can be prevented from exceeding the bandwidth specified by the network speed limiting value, and the bandwidth resource can be utilized to the greatest extent.
In the technical solution provided in this embodiment, the target unit transmission time corresponding to the target to-be-forwarded data packet is determined according to the forwarding sequence of the target to-be-forwarded data packet, if the forwarding sequence of the target to-be-forwarded data packet is smaller than a preset threshold, forward operation is performed on the preamble to-be-forwarded data packet of the target to-be-forwarded data packet, and whether the first remaining time exists in the preamble of the target to-be-forwarded data packet is determined, where the preamble to-be-forwarded data packet is the to-be-forwarded data packet whose forwarding sequence precedes the forwarding sequence of the target to-be-forwarded data packet, the preset threshold is half of the number of to-be-forwarded data packets, and if the first remaining time exists, and the total length of the first remaining time and the target unit transmission time is greater than or equal to the target length of the target to-be-forwarded data packet, and the first remaining time and the target unit transmission time are used as the target position of the target to-be-forwarded data packet, and the target to-be-forwarded data packet is inserted into the target position. When the forwarding sequence of the target data packet to be forwarded is smaller than a preset threshold value, forward operation is performed on the preamble data packet to be forwarded to determine the target position corresponding to the target data packet to be forwarded, so that the calculation efficiency can be improved, the target data packet to be forwarded does not occupy the transmission time of a plurality of data packets to be forwarded at one time, the situation that the target data packet to be forwarded is split into a plurality of parts to be sent during forwarding is avoided, and data loss is easy to occur in the transmission process.
Referring to fig. 4, in a fourth embodiment, after step S421, based on any of the above embodiments, the method further includes:
step S424: if the target to-be-forwarded data packet is larger than the preset threshold value, performing backward operation on a subsequent to-be-forwarded data packet of the target to-be-forwarded data packet, and determining whether a third residual time exists in the subsequent to-be-forwarded data packet, wherein the subsequent to-be-forwarded data packet is a to-be-forwarded data packet in a forwarding sequence of the target to-be-forwarded data packet after the forwarding sequence;
in this embodiment, the backward operation refers to pre-positioning the to-be-forwarded data packets, that is, determining, in advance, the positions of each to-be-forwarded data packet in the transmission sequence according to the forwarding sequence of the to-be-forwarded data packets, so as to determine whether the second remaining time exists in the to-be-forwarded data packets. In order to improve the calculation efficiency, if the forwarding sequence of the target data packets to be forwarded is greater than a preset threshold, the sequence of the target data packets to be forwarded is characterized as being later, the number of the subsequent data packets of the target data packets to be forwarded is smaller than the number of the preceding data packets to be forwarded, and then the backward operation can be preferentially performed on the target data packets to be forwarded.
Optionally, the number of occupied unit transmission time can be determined according to the number of the data packets to be forwarded in the subsequent sequence, so as to calculate the total unit transmission time occupied by the data packets to be forwarded in the subsequent sequence, and calculate the total length of the subsequent sequence corresponding to the total unit transmission time according to the network speed limit value. And then acquiring the length of each subsequent data packet to be forwarded, and determining the corresponding total length of the subsequent data packets to be forwarded. And when the total length of the follow-up sequence is larger than the corresponding total length of the data packet to be forwarded, the existence of the third residual time is represented, so that the third residual time is determined according to the difference value between the total length of the follow-up sequence and the total length of the data packet to be forwarded. It should be noted that, during backward operation, the arrangement of the data packets to be forwarded in the subsequent sequence is reverse arrangement, that is, the data packets to be forwarded in the subsequent sequence are distributed from the end point of the unit transmission time, and the positions corresponding to the data packets to be forwarded in the subsequent sequence are sequentially determined according to the reverse sequence of the data packets to be forwarded in the subsequent sequence.
It can be understood that total unit transmission time = unit transmission time x number of subsequent data packets to be forwarded; total length of the subsequent sequence corresponding to the total unit transmission time=network speed limit value; the corresponding total length of the data packets to be forwarded in the follow-up sequence is the sum of the lengths of the data packets to be forwarded in the follow-up sequence.
Step S425: and if the third remaining time exists and the total length accommodated by the third remaining time and the target unit transmission time is greater than or equal to the target length of the target data packet to be forwarded, taking the third remaining time and the target unit transmission time as the target position of the target data packet to be forwarded, and inserting the target data packet to be forwarded into the target position.
In this embodiment, if the third remaining time exists and the total length of the third remaining time and the target unit transmission time is greater than or equal to the target length of the target data packet to be forwarded, the third remaining time and the target unit transmission time may be used as the target position of the target data packet to be forwarded, and the target data packet to be forwarded is inserted into the target position.
Optionally, if the third remaining time does not exist, or the total length accommodated by the third remaining time and the target unit transmission time is smaller than the target length of the target to-be-forwarded data packet, performing the forward operation on the to-be-forwarded data packet of the preamble of the target to-be-forwarded data packet, and determining whether the preamble of the target to-be-forwarded data packet has a fourth remaining time; and if the fourth remaining time exists and the total length accommodated by the fourth remaining time and the target unit transmission time is greater than or equal to the target length of the target data packet to be forwarded, taking the fourth remaining time and the target unit transmission time as the target position of the target data packet to be forwarded, and inserting the target data packet to be forwarded into the target position.
In this embodiment, when no remaining time is available in the subsequent sequence of the target data packet to be forwarded or the remaining time of the subsequent sequence is insufficient, forward operation is performed on the preamble data packet to be forwarded of the target data packet to determine whether a fourth remaining time exists in the preamble of the target data packet to be forwarded, so that the fourth remaining time and the target unit transmission time are used as the target position of the target data packet to be forwarded, so that the target data packet to be forwarded does not occupy the transmission time of a plurality of data packets to be forwarded at one time, and the problem that the target data packet to be forwarded is split into a plurality of parts to be sent during forwarding is avoided, and data loss is easy to cause in the transmission process. The subsequent data packets to be forwarded are the data packets to be forwarded in the forwarding sequence of the target data packets to be forwarded after the forwarding sequence.
Optionally, after the step of performing the forward operation on the data packet to be forwarded subsequent to the target data packet to be forwarded to determine whether the fourth remaining time exists in the preamble of the target data packet to be forwarded, the method further includes: and if the fourth remaining time exists and the total length accommodated by the fourth remaining time and the target unit transmission time is smaller than the target length of the target data packet to be forwarded, taking the third remaining time, the fourth remaining time and the target unit transmission time as the target position of the target data packet to be forwarded, and inserting the target data packet to be forwarded into the target position. The method aims at ensuring that the transmission time of other data packets to be forwarded is enough without exceeding the bandwidth specified by the network speed limit value while ensuring that the target length of the target data packet to be forwarded is consistent with the length accommodated by the occupied transmission time, thereby ensuring the smoothness of the network. According to the network speed limiting method provided by the invention, even under the condition of encountering abrupt network traffic change, the forwarded data packet can be prevented from exceeding the bandwidth specified by the network speed limiting value, and the bandwidth resource can be utilized to the greatest extent.
In the technical solution provided in this embodiment, the transmission time of the target unit corresponding to the target to-be-forwarded data packet is determined according to the forwarding sequence of the target to-be-forwarded data packet, if the target to-be-forwarded data packet is greater than the preset threshold, backward operation is performed on the subsequent to-be-forwarded data packet of the target to-be-forwarded data packet, and whether the third remaining time exists in the subsequent to-be-forwarded data packet, where the subsequent to-be-forwarded data packet is the to-be-forwarded data packet in the forwarding sequence of the target to-be-forwarded data packet after the forwarding sequence, and if the third remaining time exists, and the total length accommodated by the third remaining time and the target unit transmission time is greater than or equal to the target length of the target to-be-forwarded data packet, the third remaining time and the target unit transmission time are taken as the target position of the target to-be-forwarded data packet, and the target to-be-forwarded data packet is inserted into the target position, so that the calculation efficiency can be improved, and the target to-be-forwarded data packet does not occupy the transmission time of the multiple to-forwarded data packets at one time, and the target to be-forwarded data packet is prevented from being split into multiple parts to be transmitted during forwarding, and the data loss is easy to be caused in the transmission process.
Referring to fig. 5, fig. 5 is a schematic diagram of a terminal structure of a hardware running environment according to an embodiment of the present invention.
The terminal of the embodiment of the invention can be a mobile phone, a computer and a server.
As shown in fig. 5, the terminal may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), a mouse, etc., and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
It will be appreciated by those skilled in the art that the terminal structure shown in fig. 5 is not limiting of the terminal and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
As shown in fig. 5, an operating system, a network communication module, a user interface module, and a network speed limit program may be included in a memory 1005 as one type of computer storage medium.
In the terminal shown in fig. 5, the network interface 1004 is mainly used for connecting to a background server and performing data communication with the background server; the processor 1001 may be configured to call a network speed limit program stored in the memory 1005 and perform the following operations:
determining the quantity of data packets to be forwarded according to a network speed limit value, and acquiring the data packets to be forwarded which are consistent with the quantity;
determining the total forwarding time for forwarding the data packet to be forwarded according to the total length of the data packet to be forwarded and the network speed limit value;
determining unit transmission time corresponding to the data packet to be forwarded according to the total forwarding time and the number;
determining a transmission sequence of the data packet to be forwarded according to the length of the data packet to be forwarded and the unit length of the unit transmission time;
and forwarding the data packet to be forwarded according to the sending sequence of the data packet to be forwarded.
Further, the processor 1001 may call the network speed limit program stored in the memory 1005, and further perform the following operations:
determining a target data packet to be forwarded, wherein the length of the data packet to be forwarded is greater than the unit length of the unit transmission time;
determining a target position of the target forwarding data packet in the sending sequence according to the forwarding sequence and the target length of the target forwarding data packet, and inserting the target forwarding data packet into the target position;
And taking the unit transmission time corresponding to the forwarding sequence of the rest data packets to be forwarded as the position of the rest data packets to be forwarded in the sending sequence, and inserting the rest data packets to be forwarded into the position to obtain the sending sequence.
Further, the processor 1001 may call the network speed limit program stored in the memory 1005, and further perform the following operations:
determining a target unit transmission time corresponding to the target data packet to be forwarded according to the forwarding sequence of the target data packet to be forwarded;
if the forwarding sequence of the target data packet to be forwarded is smaller than a preset threshold, forward operation is carried out on the preamble data packet to be forwarded of the target data packet to be forwarded, and whether the preamble of the target data packet to be forwarded has first remaining time is determined, wherein the preamble data packet to be forwarded is the data packet to be forwarded of which the forwarding sequence is earlier than the forwarding sequence of the target data packet to be forwarded, and the preset threshold is half of the number;
and if the first residual time exists and the total length accommodated by the first residual time and the target unit transmission time is greater than or equal to the target length of the target data packet to be forwarded, taking the first residual time and the target unit transmission time as the target position of the target data packet to be forwarded, and inserting the target data packet to be forwarded into the target position.
Further, the processor 1001 may call the network speed limit program stored in the memory 1005, and further perform the following operations:
if the first remaining time does not exist, or the total length contained in the first remaining time and the target unit transmission time is smaller than the target length of the target data packet to be forwarded, performing backward operation on the subsequent data packet to be forwarded of the target data packet to be forwarded, and determining whether a second remaining time exists in the subsequent data packet to be forwarded of the target data packet, wherein the subsequent data packet to be forwarded is a data packet to be forwarded in a forwarding sequence of the target data packet to be forwarded after the forwarding sequence;
and if the second residual time exists and the total length accommodated by the second residual time and the target unit transmission time is greater than or equal to the target length of the target data packet to be forwarded, taking the second residual time and the target unit transmission time as the target position of the target data packet to be forwarded, and inserting the target data packet to be forwarded into the target position.
Further, the processor 1001 may call the network speed limit program stored in the memory 1005, and further perform the following operations:
If the target to-be-forwarded data packet is larger than the preset threshold value, performing backward operation on a subsequent to-be-forwarded data packet of the target to-be-forwarded data packet, and determining whether a third residual time exists in the subsequent to-be-forwarded data packet, wherein the subsequent to-be-forwarded data packet is a to-be-forwarded data packet in a forwarding sequence of the target to-be-forwarded data packet after the forwarding sequence;
and if the third remaining time exists and the total length accommodated by the third remaining time and the target unit transmission time is greater than or equal to the target length of the target data packet to be forwarded, taking the third remaining time and the target unit transmission time as the target position of the target data packet to be forwarded, and inserting the target data packet to be forwarded into the target position.
Further, the processor 1001 may call the network speed limit program stored in the memory 1005, and further perform the following operations:
if the third remaining time does not exist, or the total length accommodated by the third remaining time and the target unit transmission time is smaller than the target length of the target data packet to be forwarded, performing the forward operation on the preamble data packet to be forwarded of the target data packet to be forwarded, and determining whether a fourth remaining time exists in the preamble of the target data packet to be forwarded;
And if the fourth remaining time exists and the total length accommodated by the fourth remaining time and the target unit transmission time is greater than or equal to the target length of the target data packet to be forwarded, taking the fourth remaining time and the target unit transmission time as the target position of the target data packet to be forwarded, and inserting the target data packet to be forwarded into the target position.
Further, the processor 1001 may call the network speed limit program stored in the memory 1005, and further perform the following operations:
acquiring the network speed limit value and the average length of the data packet;
and obtaining the quantity of the data packets to be forwarded according to the network speed limit value and the average length of the data packets, and obtaining the data packets to be forwarded, the quantity of which is consistent with the quantity, from a queue to be forwarded.
Further, the processor 1001 may call the network speed limit program stored in the memory 1005, and further perform the following operations:
determining the duty cycle of each unit transmission time in the transmission sequence;
and forwarding the data packets to be forwarded corresponding to each unit transmission time in sequence according to the duty ratio.
In addition, in order to achieve the above object, the present invention further provides a terminal device, including: the system comprises a memory, a processor and a network speed limiting program stored on the memory and capable of running on the processor, wherein the network speed limiting program realizes the steps of the network speed limiting method when being executed by the processor.
In addition, in order to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon a network speed limiting program which, when executed by a processor, implements the steps of the network speed limiting method as described above.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system 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 system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of embodiments, it will be clear to a person skilled in the art that the above embodiment method may be implemented by means of software plus a necessary general hardware platform, but may of course also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above, comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (8)

1. A network speed limiting method, characterized in that the network speed limiting method comprises:
determining the quantity of data packets to be forwarded according to a network speed limit value, and acquiring the data packets to be forwarded which are consistent with the quantity;
determining the total forwarding time for forwarding the data packet to be forwarded according to the total length of the data packet to be forwarded and the network speed limit value;
determining unit transmission time corresponding to the data packet to be forwarded according to the total forwarding time and the number;
determining a target data packet to be forwarded, wherein the length of the data packet to be forwarded is greater than the unit length of the unit transmission time;
determining a target unit transmission time corresponding to the target data packet to be forwarded according to the forwarding sequence of the target data packet to be forwarded;
if the forwarding sequence of the target data packet to be forwarded is smaller than a preset threshold, forward operation is carried out on the preamble data packet to be forwarded of the target data packet to be forwarded, and whether the preamble of the target data packet to be forwarded has first remaining time is determined, wherein the preamble data packet to be forwarded is the data packet to be forwarded of which the forwarding sequence is earlier than the forwarding sequence of the target data packet to be forwarded, and the preset threshold is half of the number;
If the first remaining time exists and the total length accommodated by the first remaining time and the target unit transmission time is greater than or equal to the target length of the target data packet to be forwarded, taking the first remaining time and the target unit transmission time as the target position of the target data packet to be forwarded, and inserting the target data packet to be forwarded into the target position;
taking the unit transmission time corresponding to the forwarding sequence of the rest data packets to be forwarded as the position of the rest data packets to be forwarded in a sending sequence, and inserting the rest data packets to be forwarded into the position to obtain the sending sequence of the data packets to be forwarded;
and forwarding the data packet to be forwarded according to the sending sequence of the data packet to be forwarded.
2. The network speed limiting method according to claim 1, wherein if the forwarding order of the target to-be-forwarded data packet is smaller than a preset threshold, performing a forward operation on a preamble to-be-forwarded data packet of the target to-be-forwarded data packet, and after the step of determining whether the preamble of the target to-be-forwarded data packet has a first remaining time, further includes:
if the first remaining time does not exist, or the total length contained in the first remaining time and the target unit transmission time is smaller than the target length of the target data packet to be forwarded, performing backward operation on the subsequent data packet to be forwarded of the target data packet to be forwarded, and determining whether a second remaining time exists in the subsequent data packet to be forwarded of the target data packet, wherein the subsequent data packet to be forwarded is a data packet to be forwarded in a forwarding sequence of the target data packet to be forwarded after the forwarding sequence;
And if the second residual time exists and the total length accommodated by the second residual time and the target unit transmission time is greater than or equal to the target length of the target data packet to be forwarded, taking the second residual time and the target unit transmission time as the target position of the target data packet to be forwarded, and inserting the target data packet to be forwarded into the target position.
3. The network speed limiting method according to claim 2, wherein after the step of determining a target unit transmission time corresponding to the target data packet to be forwarded according to the forwarding order of the target data packet to be forwarded, the method further comprises:
if the target to-be-forwarded data packet is larger than the preset threshold value, performing backward operation on a subsequent to-be-forwarded data packet of the target to-be-forwarded data packet, and determining whether a third residual time exists in the subsequent to-be-forwarded data packet, wherein the subsequent to-be-forwarded data packet is a to-be-forwarded data packet in a forwarding sequence of the target to-be-forwarded data packet after the forwarding sequence;
and if the third remaining time exists and the total length accommodated by the third remaining time and the target unit transmission time is greater than or equal to the target length of the target data packet to be forwarded, taking the third remaining time and the target unit transmission time as the target position of the target data packet to be forwarded, and inserting the target data packet to be forwarded into the target position.
4. The network speed limiting method according to claim 3, wherein if the target to-be-forwarded packet is greater than the preset threshold, performing a backward operation on a to-be-forwarded packet subsequent to the target to-be-forwarded packet, and determining whether a third remaining time exists in the to-be-forwarded packet subsequent to the target to-be-forwarded packet, further includes:
if the third remaining time does not exist, or the total length accommodated by the third remaining time and the target unit transmission time is smaller than the target length of the target data packet to be forwarded, performing the forward operation on the preamble data packet to be forwarded of the target data packet to be forwarded, and determining whether a fourth remaining time exists in the preamble of the target data packet to be forwarded;
and if the fourth remaining time exists and the total length accommodated by the fourth remaining time and the target unit transmission time is greater than or equal to the target length of the target data packet to be forwarded, taking the fourth remaining time and the target unit transmission time as the target position of the target data packet to be forwarded, and inserting the target data packet to be forwarded into the target position.
5. The network speed limiting method according to claim 1, wherein the step of determining the number of data packets to be forwarded according to the network speed limiting value and acquiring the data packets to be forwarded corresponding to the number includes:
Acquiring the network speed limit value and the average length of the data packet;
and obtaining the quantity of the data packets to be forwarded according to the network speed limit value and the average length of the data packets, and obtaining the data packets to be forwarded, the quantity of which is consistent with the quantity, from a queue to be forwarded.
6. The network speed limiting method according to claim 1, wherein the step of forwarding the data packet to be forwarded according to the transmission sequence of the data packet to be forwarded includes:
determining the duty cycle of each unit transmission time in the transmission sequence;
and forwarding the data packets to be forwarded corresponding to each unit transmission time in sequence according to the duty ratio.
7. A terminal device, characterized in that the terminal device comprises: memory, a processor and a network speed limiting program of a terminal device stored on the memory and operable on the processor, which when executed by the processor implements the steps of the network speed limiting method according to any one of claims 1 to 6.
8. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a network speed limiting program of a terminal device, which when executed by a processor implements the steps of the network speed limiting method according to any one of claims 1 to 6.
CN202311534948.0A 2023-11-17 2023-11-17 Network speed limiting method, terminal equipment and storage medium Active CN117255058B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311534948.0A CN117255058B (en) 2023-11-17 2023-11-17 Network speed limiting method, terminal equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311534948.0A CN117255058B (en) 2023-11-17 2023-11-17 Network speed limiting method, terminal equipment and storage medium

Publications (2)

Publication Number Publication Date
CN117255058A CN117255058A (en) 2023-12-19
CN117255058B true CN117255058B (en) 2024-02-23

Family

ID=89129885

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311534948.0A Active CN117255058B (en) 2023-11-17 2023-11-17 Network speed limiting method, terminal equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117255058B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103036804A (en) * 2011-10-08 2013-04-10 腾讯科技(深圳)有限公司 Method and system for controlling network upload speed
WO2017162117A1 (en) * 2016-03-25 2017-09-28 阿里巴巴集团控股有限公司 Accurate speed limiting method and apparatus for cluster
CN111030940A (en) * 2019-12-19 2020-04-17 深圳市网心科技有限公司 Network data packet transmission method and device, electronic equipment and storage medium
CN116016369A (en) * 2022-12-09 2023-04-25 广东润联信息技术有限公司 Data transmission method, system, node and readable storage medium
CN116366554A (en) * 2023-03-28 2023-06-30 新华三技术有限公司 Flow speed limiting method, device and equipment
CN116896511A (en) * 2023-09-11 2023-10-17 中移(苏州)软件技术有限公司 Special line cloud service speed limiting method, device, equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103036804A (en) * 2011-10-08 2013-04-10 腾讯科技(深圳)有限公司 Method and system for controlling network upload speed
WO2017162117A1 (en) * 2016-03-25 2017-09-28 阿里巴巴集团控股有限公司 Accurate speed limiting method and apparatus for cluster
CN111030940A (en) * 2019-12-19 2020-04-17 深圳市网心科技有限公司 Network data packet transmission method and device, electronic equipment and storage medium
CN116016369A (en) * 2022-12-09 2023-04-25 广东润联信息技术有限公司 Data transmission method, system, node and readable storage medium
CN116366554A (en) * 2023-03-28 2023-06-30 新华三技术有限公司 Flow speed limiting method, device and equipment
CN116896511A (en) * 2023-09-11 2023-10-17 中移(苏州)软件技术有限公司 Special line cloud service speed limiting method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN117255058A (en) 2023-12-19

Similar Documents

Publication Publication Date Title
US7724750B2 (en) Expedited data transmission in packet based network
US8000247B2 (en) Bandwidth management apparatus
EP3764609B1 (en) Message sending method, network node and system
CA2410773C (en) Packet scheduling apparatus
EP3787244B1 (en) Packet sending method, network node, and system
US11968111B2 (en) Packet scheduling method, scheduler, network device, and network system
CN113225196B (en) Service level configuration method and device
US9160669B2 (en) Method and device for leaky bucket speed-limitation
CN111835649B (en) Data transmission method, device and related components
CN111628940B (en) Flow scheduling method, device, system, switch and computer storage medium
CN112395067A (en) Task scheduling method, system, device and medium
US10536321B2 (en) Message attack defense method and apparatus
CN111343097B (en) Link load balancing method and device, electronic equipment and storage medium
EP1730903B1 (en) Expedited data transmission in packet based network
CN117255058B (en) Network speed limiting method, terminal equipment and storage medium
WO2021101640A1 (en) Method and apparatus of packet wash for in-time packet delivery
EP3806410A1 (en) Message control method, flow table updating method, and node device
CN112311678B (en) Method and device for realizing message distribution
CN114117287A (en) Message resending method and device
CN115884109A (en) Real-time short message task scheduling method, terminal device and medium
CN115915279A (en) Multilink flow distribution method and device, storage medium and electronic device
Ko et al. Collision reduction random access using m-ary split algorithm in wireless access network
CN114285803A (en) Congestion control method and device
CN116801391A (en) Shared slice interaction management method, network architecture, NSMF and storage medium
CN113949674A (en) Data transmission method, system, network equipment, media equipment and receiving equipment

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