CN110138610B - Service message sending method and device - Google Patents

Service message sending method and device Download PDF

Info

Publication number
CN110138610B
CN110138610B CN201910390140.7A CN201910390140A CN110138610B CN 110138610 B CN110138610 B CN 110138610B CN 201910390140 A CN201910390140 A CN 201910390140A CN 110138610 B CN110138610 B CN 110138610B
Authority
CN
China
Prior art keywords
service
service class
class
bandwidth
preset
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
CN201910390140.7A
Other languages
Chinese (zh)
Other versions
CN110138610A (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.)
New H3C Security Technologies Co Ltd
Original Assignee
New H3C Security Technologies 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 New H3C Security Technologies Co Ltd filed Critical New H3C Security Technologies Co Ltd
Priority to CN201910390140.7A priority Critical patent/CN110138610B/en
Publication of CN110138610A publication Critical patent/CN110138610A/en
Application granted granted Critical
Publication of CN110138610B publication Critical patent/CN110138610B/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
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0896Bandwidth or capacity management, i.e. automatically increasing or decreasing capacities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/24Traffic characterised by specific attributes, e.g. priority or QoS
    • H04L47/2408Traffic characterised by specific attributes, e.g. priority or QoS for supporting different services, e.g. a differentiated services [DiffServ] type of service
    • 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/24Traffic characterised by specific attributes, e.g. priority or QoS
    • H04L47/2425Traffic characterised by specific attributes, e.g. priority or QoS for supporting services specification, e.g. SLA
    • H04L47/2433Allocation of priorities to traffic types

Landscapes

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

Abstract

The embodiment of the application provides a method and a device for sending a service message, and relates to the technical field of communication. The method comprises the following steps: identifying the service type of each received service message according to a preset service type identification rule; determining the priority of each service type according to the corresponding relation between the preset service type and the priority; determining the distribution bandwidth of each service class according to the priority of each service class, the preset total bandwidth of an outlet and a preset bandwidth distribution algorithm; and aiming at each service class, sending each service message belonging to the service class according to the distribution bandwidth of the service class. The method and the device can meet the transmission requirement of the service message.

Description

Service message sending method and device
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for sending a service packet.
Background
In the prior art, a network device usually receives service messages sent by a plurality of terminals, and then sends the received service messages to target devices corresponding to the service messages. The service messages have different types and different transmission requirements, for example, the service message of the interactive video type allows higher delay, and the service message of the voice over Internet Protocol (IP) type requires low delay.
The service messages of different service classes are transmitted to the network equipment at different rates, and under the condition that the rate of the service message allowing higher delay is higher, and the rate of the service message requiring low delay is lower, the network equipment receives more service messages allowing higher delay than the received service messages requiring low delay in the same time period. Because the network device mostly adopts the message first-in first-out processing strategy, the bandwidth allocated to the service message allowing higher delay by the network device is higher, and the bandwidth allocated to the service message requiring low delay is lower, so that the transmission delay of the service message requiring low delay is higher, and the transmission requirement of the service message cannot be met.
Disclosure of Invention
An object of the embodiments of the present application is to provide a method and an apparatus for sending a service packet, which can meet a transmission requirement of the service packet. The specific technical scheme is as follows:
in a first aspect, a method for sending a service packet is provided, where the method includes:
identifying the service type of each received service message according to a preset service type identification rule;
determining the priority of each service type according to the corresponding relation between the preset service type and the priority;
determining the distribution bandwidth of each service class according to the priority of each service class, the preset total bandwidth of an outlet and a preset bandwidth distribution algorithm;
and aiming at each service class, sending each service message belonging to the service class according to the distribution bandwidth of the service class.
Optionally, the determining the allocated bandwidth of each service class according to the priority of each service class, a preset total bandwidth of an outlet, and a preset bandwidth allocation algorithm includes:
aiming at the service class of each service message, taking the sum of the priority value of each service class and a first preset value as a reference value corresponding to the service class;
calculating the sum of reference values corresponding to all service classes;
for each service class, taking the ratio of the priority value of the service class to the sum of the reference values as the bandwidth ratio of the service class;
and aiming at each service class, calculating the distribution bandwidth of the service class according to the bandwidth proportion of the service class and the preset total bandwidth of the outlet.
Optionally, before the step of identifying the service type of each received service packet according to the preset service type identification rule, the method further includes:
judging whether the total data volume of the currently received service message is larger than a preset threshold value or not;
if yes, executing the step of identifying the service type of each received service message according to a preset service type identification rule.
Optionally, the service class identification rule is a port identification rule, a payload feature identification rule, or a flow statistics feature identification rule.
Optionally, the sending, for each service class, each service packet belonging to the service class according to the allocated bandwidth of the service class includes:
aiming at each service class, storing each service message belonging to the service class into a packet queue corresponding to the service class;
and aiming at each service class, sending the message in the packet queue corresponding to the service class according to the distribution bandwidth of the service class.
Optionally, the sending, for each service class, a packet in a packet queue corresponding to the service class according to the allocated bandwidth of the service class includes:
for each service class, taking the proportion of the distribution bandwidth of the service class to the preset total bandwidth of the outlet as the message sending proportion of the service class;
aiming at each service class, calculating the message sending number of the service class according to the message sending proportion of the service class and a preset message sending threshold;
and according to the priority of each service class, sequentially sending the service messages with the number of the front messages sent in the packet queue corresponding to each service class.
In a second aspect, an apparatus for sending a service packet is provided, where the apparatus includes:
the identification module is used for identifying the service type of each received service message according to a preset service type identification rule;
the first determining module is used for determining the priority of each service type according to the corresponding relation between the preset service type and the priority;
the second determining module is used for determining the distribution bandwidth of each service class according to the priority of each service class, the preset total bandwidth of the outlet and the preset bandwidth distribution algorithm;
and the sending module is used for sending each service message belonging to each service class according to the distribution bandwidth of the service class.
Optionally, the second determining module is specifically configured to:
aiming at the service class of each service message, taking the sum of the priority value of each service class and a first preset value as a reference value corresponding to the service class;
calculating the sum of reference values corresponding to all service classes;
for each service class, taking the ratio of the priority value of the service class to the sum of the reference values as the bandwidth ratio of the service class;
and aiming at each service class, calculating the distribution bandwidth of the service class according to the bandwidth proportion of the service class and the preset total bandwidth of the outlet.
Optionally, the apparatus further includes a determining module; the judging module is used for judging whether the total data volume of the currently received service message is larger than a preset threshold value; if yes, triggering the identification module to execute the step of identifying the service type of each received service message according to the preset service type identification rule.
Optionally, the service class identification rule is a port identification rule, a payload feature identification rule, or a flow statistics feature identification rule.
Optionally, the sending module includes:
the storage unit is used for storing each service message belonging to each service class into a packet queue corresponding to the service class;
and the sending unit is used for sending the message in the packet queue corresponding to the service class according to the distribution bandwidth of the service class aiming at each service class.
Optionally, the sending unit is specifically configured to:
for each service class, taking the proportion of the distribution bandwidth of the service class to the preset total bandwidth of the outlet as the message sending proportion of the service class;
aiming at each service class, calculating the message sending number of the service class according to the message sending proportion of the service class and a preset message sending threshold;
and according to the priority of each service class, sequentially sending the service messages with the number of the front messages sent in the packet queue corresponding to each service class.
In a third aspect, there is provided an electronic device comprising a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being caused by the machine-executable instructions to: the method steps of the first aspect are implemented.
In a fourth aspect, a computer-readable storage medium is provided, having stored thereon a computer program which, when being executed by a processor, carries out the method steps of the first aspect.
In a fifth aspect, there is provided a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method of the first aspect.
According to the method and the device for sending the service messages, the service types of the received service messages can be identified according to the preset service type identification rule; determining the priority of each service type according to the corresponding relation between the preset service type and the priority; determining the distribution bandwidth of each service class according to the priority of each service class, the preset total bandwidth of an outlet and a preset bandwidth distribution algorithm; and aiming at each service class, sending each service message belonging to the service class according to the distribution bandwidth of the service class. Compared with the prior art, the method and the device have the advantages that the service types of the received service messages are identified, the priority of each service type is determined, then the bandwidth is distributed to the service messages of each service type according to the priority of each service type, the bandwidth distribution is reasonable, each service message belonging to each service type is sent according to the distributed bandwidth of each service type, and the transmission requirements of the service messages can be met.
Of course, not all advantages described above need to be achieved at the same time in the practice of any one product or method of the present application.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a method for sending a service packet according to an embodiment of the present application;
fig. 2 is a schematic diagram illustrating a service packet transmission provided in an embodiment of the present application;
fig. 3 is a flowchart of a method for sending a service packet according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a device for sending a service packet according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The embodiment of the application provides a method for sending a service message, which is applied to network equipment such as a gateway, a router, a switch and the like. The network device may identify the service type of each received service packet according to a preset service type identification rule. Then, the network device determines the priority of each service class according to the corresponding relation between the preset service class and the priority, and determines the distribution bandwidth of each service class according to the priority of each service class, the preset total bandwidth of an outlet and the preset bandwidth distribution algorithm. And then, aiming at each service type, the network equipment sends each service message belonging to the service type according to the distribution bandwidth of the service type. Compared with the prior art, the method and the device have the advantages that the service types of the received service messages are identified, the priority of each service type is determined, then the bandwidth is distributed to the service messages of each service type according to the priority of each service type, the bandwidth distribution is reasonable, each service message belonging to each service type is sent according to the distributed bandwidth of each service type, and the transmission requirements of the service messages can be met.
A detailed description will be given below of a method for sending a service packet according to an embodiment of the present application, with reference to fig. 1, which includes the following specific steps.
Step 101, identifying the service type of each received service message according to a preset service type identification rule.
The service type identification rule is a port identification rule, a payload characteristic identification rule or a flow statistical characteristic identification rule.
In the embodiment of the application, the network device can receive the service messages sent by each terminal. The service messages may be service messages of an IP voice category, service messages of an interactive video category, service messages of a streaming video category, service messages of a key data service category, service messages of an interactive data category, service messages of a transaction category, service messages of a bulk data transmission category, and the like. For example, the network device may identify a service packet for data synchronization and a service packet for transmitting an email as a bulk data transmission category. The network device may also identify traffic packets other than the above categories as best effort categories.
For example, the service packet of the IP Voice category is a VoIP (Voice over Internet Protocol) packet, the service packet of the Interactive video category is an Interactive motion picture Game (Interactive Flash Game) packet, the service packet of the streaming video category is a live broadcast video packet, the service packet of the key data service category is an SMTP (Simple Mail Transfer Protocol) packet, the service packet of the Interactive data category is a Telnet (remote login) packet, the service packet of the transaction processing category is a DNS (Domain Name System) Protocol packet, and the service packet of the bulk data transmission category is an FTP (File Transfer Protocol) packet. The above are merely examples and are not particularly limited.
The network device can identify the service type of each service packet according to a port identification rule, a payload characteristic identification rule or a flow statistic characteristic identification rule.
For each service packet, after identifying the service type of the service packet, the network device may mark the service type of the service packet in the service packet. For example, the network device may mark the service class of the service packet on a DSCP (Differentiated Services Code Point) field of the service packet.
Optionally, before identifying the service type of each received service packet according to a preset service type identification rule, the method further includes: judging whether the total data amount of the currently received service message is larger than a preset threshold value or not; if yes, executing the step of identifying the service type of each received service message according to a preset service type identification rule.
In the embodiment of the application, before identifying the service type of each received service packet according to the preset service type identification rule, the network device may count the total data amount of each received service packet in a preset time period before the current time, and determine whether the total data amount is greater than a preset threshold.
If the bandwidth is larger than the preset bandwidth, the bandwidth of the network equipment is insufficient, and the network equipment needs to reasonably allocate the bandwidth to the service message of each service type. At this time, the network device executes a step of identifying the service type of each received service packet according to a preset service type identification rule.
If not, sending out each received service message according to a traditional message sending mode (such as message first-in first-out processing rule). For example, the network device may send out each received service packet according to the sequence of the receiving time of each service packet.
And 102, determining the priority of the service type of each service message according to the corresponding relation between the preset service type and the priority.
In the embodiment of the application, the network device stores the corresponding relation between the service type and the priority in advance. The higher the transmission requirement of the service message, the higher the priority of the corresponding service class. Referring to table 1, the priority of the service class of the IP voice is 8, the priority of the service class of the interactive video is 7, the priority of the service class of the streaming video is 6, the priority of the service class of the key data service is 5, the priority of the service class of the interactive data is 4, the priority of the service class of the transaction processing is 3, the priority of the service class of the bulk data transmission is 2, and the priority of the service class of the best effort service is 1.
TABLE 1
Priority level Class of service
8 Voice over IP
7 Interactive video
6 Streaming video
5 Key dataBusiness
4 Interactive data
3 Transaction processing
2 Bulk data transmission
1 Best effort service
The network device may determine the priority corresponding to each service category according to a preset correspondence between the service category and the priority, and use the priority as the priority of the service packet. For example, the service class is a bulk data transmission class, and the network device may determine that the priority corresponding to the service class is 2, and then the priority of the service packet of the bulk data transmission class is also 2.
And 103, determining the distribution bandwidth of each service class according to the priority of each service class, the preset total bandwidth of the outlet and the preset bandwidth distribution algorithm.
Here, the allocated bandwidth of a certain service class refers to the bandwidth allocated to the service packet of the service class.
In this embodiment, the network device may calculate a sum of the priority values of the identified traffic classes, and then multiply a ratio of the priority value of each traffic class to the calculated sum of the priority values by a preset total bandwidth of the outlet to serve as an allocated bandwidth of the traffic class. For example, the service type of the service packet received by the network device includes a service type a, a service type B, and a service type C, the priority of the service type a is 1, the priority of the service type B is 2, the priority of the service type C is 3, the preset total bandwidth of the outlet is M, the sum of the priority values of the service type a, the service type B, and the service type C is 6, the allocated bandwidth of the service type a is M × 1/6, the allocated bandwidth of the service type B is M × 2/6, and the allocated bandwidth of the service type C is M × 3/6.
In another example, in step 103, the network device may determine the sum of the value of the priority of each identified traffic class and the first preset value as the reference value corresponding to the traffic class. The first preset value may be set by a technician according to experience, for example, set to 1. Then, the network device calculates the sum of the reference values corresponding to all the traffic classes. For each service class, the network device takes the ratio of the sum of the priority value of the service class and the reference value as the bandwidth ratio of the service class, and then takes the product of the bandwidth ratio of the service class and the preset total bandwidth of the outlet as the allocated bandwidth of the service class.
For example, the service class identified by the network device includes a service class a, a service class B, and a service class C, where the priority of the service class a is 1, the priority of the service class B is 2, the priority of the service class C is 3, the preset total bandwidth of the outlet is M, the first preset value is 1, the reference value corresponding to the service class a is 2, the reference value corresponding to the service class B is 3, the reference value corresponding to the service class C is 4, the sum of the reference values of the service class a, the service class B, and the service class C is 9, the allocated bandwidth of the service class a is M × 1/9, the allocated bandwidth of the service class B is M × 2/9, and the allocated bandwidth of the service class C is M × 3/9.
As can be seen from the example, in the case that the first preset value is 1, the bandwidth allocated by the network device is M × 1/9+ M × 2/9+ M × 3/9 — M × 2/3, and the network device also reserves the bandwidth of M × 1/3 to deal with the emergency, so as to avoid network congestion caused by the emergency. The higher the first preset value is, the larger the bandwidth reserved by the network device is, and a technician can set the first preset value according to actual conditions. The user can also allocate the reserved bandwidth to the specified service class, and further ensure that the transmission quality of the service message belonging to the service class meets the requirement.
And 104, aiming at each service class, sending each service message belonging to the service class according to the distribution bandwidth of the service class.
In the embodiment of the application, for each service class, the network device uses the ratio of the allocated bandwidth of the service class to the preset total bandwidth of an outlet as the message sending ratio of the service class, and calculates the message sending number of the service class according to the message sending ratio of the service class and the preset message sending threshold. And then sequentially sending the message sending number of the service messages of each service class according to the sequence of the priority of the service class from high to low.
For example, the service class identified by the network device includes a service class a, a service class B, and a service class C, the priority of the service class a is 1, the priority of the service class B is 2, the priority of the service class C is 3, the preset total bandwidth of the outlet is M, the allocated bandwidth of the service class a is M × 1/9, the allocated bandwidth of the service class B is M × 2/9, the allocated bandwidth of the service class C is M × 3/9, the preset message sending threshold is N, the number of packets sent by traffic class a is N (M × 1/9)/M × N/9, the number of packets sent by traffic class B is N (M × 2/9)/M × N2/9, and the number of packets sent by traffic class C is N (M × 3/9)/M × 3/9.
In one example, the specific process of step 104 may be: aiming at each service class, storing each service message belonging to the service class into a packet queue corresponding to the service class; and aiming at each service class, sending the message in the packet queue corresponding to the service class according to the distribution bandwidth of the service class.
In this embodiment, for each service class, the network device may store the service packet belonging to the service class in the packet queue corresponding to the service class according to the sequence of the receiving time. Then, aiming at each service class, the network equipment sends the message in the packet queue corresponding to the service class according to the distribution bandwidth of the service class.
Optionally, for each service class, sending the packet in the packet queue corresponding to the service class according to the allocated bandwidth of the service class, where the specific process may be: for each service class, taking the proportion of the distribution bandwidth of the service class to the preset total bandwidth of an outlet as the message sending proportion of the service class; aiming at each service class, calculating the message sending number of the service class according to the message sending proportion of the service class and a preset message sending threshold; and according to the priority of each service class, sequentially sending the service messages with the number of the front messages sent in the packet queue corresponding to each service class.
In this embodiment, for each service class, the network device may use a ratio of the allocated bandwidth of the service class to a preset total bandwidth of an outlet as a message sending ratio of the service class, and calculate the number of messages sent by the service class according to the message sending ratio of the service class and a preset message sending threshold.
For example, the service class identified by the network device includes a service class a, a service class B, and a service class C, the priority of the service class a is 1, the priority of the service class B is 2, the priority of the service class C is 3, the preset total bandwidth of the outlet is M, the allocated bandwidth of the service class a is M × 1/9, the allocated bandwidth of the service class B is M × 2/9, the allocated bandwidth of the service class C is M × 3/9, the preset message sending threshold is N, the number of packets sent by traffic class a is N (M × 1/9)/M × N/9, the number of packets sent by traffic class B is N (M × 2/9)/M × N2/9, and the number of packets sent by traffic class C is N (M × 3/9)/M × 3/9.
Then, the network device may send the packet in the packet queue corresponding to each service class according to the priority of each service class, and the specific sending process may be: and sequentially moving the service messages with the number of the previous messages sent in the packet queue corresponding to each service class to a forwarding queue according to the sequence of the priority of each service class from high to low, and sequentially sending the service messages in the forwarding queue, wherein the network equipment can circularly execute the sending process.
For example, referring to fig. 2, a service class a corresponds to a packet queue a, a service class B corresponds to a packet queue B, a service class C corresponds to a packet queue C, the number of packets sent corresponding to the service class a is 1, the number of packets sent corresponding to the service class B is 2, the number of packets sent corresponding to the service class C is 4, the number of packets sent in the packet queue a is 1, 2, 3, 4, the number of packets sent in the packet queue B is 5, 6, 7, 8, 9, 10, and the number of packets sent in the packet queue C is 11, 12. The network equipment moves the service message 1 in the packet queue A, the service messages 5 and 6 in the packet queue B and the service messages 11 and 12 in the packet queue C to the forwarding queue in sequence, and then sends the messages in the forwarding queue in sequence. And in this case, the network device moves all the messages in the packet queue C to the forwarding queue in sequence.
Compared with the prior art, the method and the device have the advantages that the service types of the received service messages are identified, the priority of each service type is determined, then the bandwidth is distributed to the service messages of each service type according to the priority of each service type, the bandwidth distribution is reasonable, each service message belonging to each service type is sent according to the distributed bandwidth of each service type, and the transmission requirements of the service messages can be met.
The embodiment of the present application further provides an example of a method for sending a service packet, which refers to fig. 3.
Step 301, determining whether the total data amount of the currently received service packet is greater than a preset threshold.
And 302, if the number of the service messages is larger than the preset number of the service messages, identifying the service type of each received service message according to a preset service type identification rule.
Step 303, determining the priority of each service category according to the corresponding relationship between the preset service categories and the priorities.
And step 304, determining the distribution bandwidth of each service class according to the priority of each service class, the preset total bandwidth of the outlet and the preset bandwidth distribution algorithm.
Step 305, for each service class, sending each service packet belonging to the service class according to the allocated bandwidth of the service class.
Wherein, the steps 302-305 can refer to the steps 101-104, respectively, which are not described herein again.
The embodiment of the application can reasonably allocate the bandwidth to the service message of each service type under the condition that the bandwidth of the network equipment is insufficient. And sending each service message belonging to each service class according to the distribution bandwidth of each service class, so that the transmission requirement of the service message can be met.
Based on the same technical concept, as shown in fig. 4, an embodiment of the present application further provides a device for sending a service packet, where the device includes:
the identifying module 401 is configured to identify a service type of each received service packet according to a preset service type identification rule;
a first determining module 402, configured to determine a priority of each service category according to a preset correspondence between the service categories and the priorities;
a second determining module 403, configured to determine the allocated bandwidth of each service class according to the priority of each service class, a preset total bandwidth of the outlets, and a preset bandwidth allocation algorithm;
a sending module 404, configured to send, for each service category, each service packet belonging to the service category according to the allocated bandwidth of the service category.
Optionally, the second determining module 402 is specifically configured to:
aiming at the service class of each service message, taking the sum of the priority value of each service class and a first preset value as a reference value corresponding to the service class;
calculating the sum of reference values corresponding to all service classes;
for each service class, taking the ratio of the priority value of the service class to the sum of the reference values as the bandwidth ratio of the service class;
and aiming at each service class, calculating the distribution bandwidth of the service class according to the bandwidth proportion of the service class and the preset total bandwidth of the outlet.
Optionally, the apparatus further includes a determining module; the judging module is used for judging whether the total data volume of the currently received service message is larger than a preset threshold value; if yes, triggering the identification module to execute the step of identifying the service type of each received service message according to the preset service type identification rule.
Optionally, the service class identification rule is a port identification rule, a payload feature identification rule, or a flow statistics feature identification rule.
Optionally, the sending module 404 includes:
the storage unit is used for storing each service message belonging to each service class into a packet queue corresponding to the service class;
and the sending unit is used for sending the message in the packet queue corresponding to the service class according to the distribution bandwidth of the service class aiming at each service class.
Optionally, the sending unit is specifically configured to:
for each service class, taking the proportion of the distribution bandwidth of the service class to the preset total bandwidth of the outlet as the message sending proportion of the service class;
aiming at each service class, calculating the message sending number of the service class according to the message sending proportion of the service class and a preset message sending threshold;
and according to the priority of each service class, sequentially sending the service messages with the number of the front messages sent in the packet queue corresponding to each service class.
The embodiment of the present application further provides an electronic device, as shown in fig. 5, which includes a processor 501, a communication interface 502, a memory 503 and a communication bus 504, wherein the processor 501, the communication interface 502 and the memory 503 complete mutual communication through the communication bus 504,
a memory 503 for storing a computer program;
the processor 501, when executing the program stored in the memory 503, implements the following steps:
identifying the service type of each received service message according to a preset service type identification rule;
determining the priority of each service type according to the corresponding relation between the preset service type and the priority;
determining the distribution bandwidth of each service class according to the priority of each service class, the preset total bandwidth of an outlet and a preset bandwidth distribution algorithm;
and aiming at each service class, sending each service message belonging to the service class according to the distribution bandwidth of the service class.
Optionally, the determining the allocated bandwidth of each service class according to the priority of each service class, a preset total bandwidth of an outlet, and a preset bandwidth allocation algorithm includes:
aiming at the service class of each service message, taking the sum of the priority value of each service class and a first preset value as a reference value corresponding to the service class;
calculating the sum of reference values corresponding to all service classes;
for each service class, taking the ratio of the priority value of the service class to the sum of the reference values as the bandwidth ratio of the service class;
and aiming at each service class, calculating the distribution bandwidth of the service class according to the bandwidth proportion of the service class and the preset total bandwidth of the outlet.
Optionally, before the step of identifying the service type of each received service packet according to the preset service type identification rule, the method further includes:
judging whether the total data volume of the currently received service message is larger than a preset threshold value or not;
if yes, executing the step of identifying the service type of each received service message according to a preset service type identification rule.
Optionally, the service class identification rule is a port identification rule, a payload feature identification rule, or a flow statistics feature identification rule.
Optionally, the sending, for each service class, each service packet belonging to the service class according to the allocated bandwidth of the service class includes:
aiming at each service class, storing each service message belonging to the service class into a packet queue corresponding to the service class;
and aiming at each service class, sending the message in the packet queue corresponding to the service class according to the distribution bandwidth of the service class.
Optionally, the sending, for each service class, a packet in a packet queue corresponding to the service class according to the allocated bandwidth of the service class includes:
for each service class, taking the proportion of the distribution bandwidth of the service class to the preset total bandwidth of the outlet as the message sending proportion of the service class;
aiming at each service class, calculating the message sending number of the service class according to the message sending proportion of the service class and a preset message sending threshold;
and according to the priority of each service class, sequentially sending the service messages with the number of the front messages sent in the packet queue corresponding to each service class.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
In another embodiment provided by the present application, a computer-readable storage medium is further provided, where a computer program is stored in the computer-readable storage medium, and when executed by a processor, the computer program implements the steps of any of the foregoing service packet sending methods.
In another embodiment provided by the present application, there is also provided a computer program product containing instructions, which when run on a computer, causes the computer to execute the method for sending a service packet according to any one of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
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 an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus, the electronic device, the computer-readable storage medium, and the computer program product embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiments.
The above description is only for the preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims (12)

1. A method for sending a service packet is characterized in that the method comprises the following steps:
identifying the service type of each received service message according to a preset service type identification rule;
determining the priority of each service type according to the corresponding relation between the preset service type and the priority;
determining the distribution bandwidth of each service class according to the priority of each service class, the preset total bandwidth of an outlet and a preset bandwidth distribution algorithm;
aiming at each service class, sending each service message belonging to the service class according to the distribution bandwidth of the service class;
the determining the allocated bandwidth of each service class according to the priority of each service class, the preset total bandwidth of the outlet and the preset bandwidth allocation algorithm comprises:
aiming at the service class of each service message, taking the sum of the priority value of each service class and a first preset value as a reference value corresponding to the service class;
calculating the sum of reference values corresponding to all service classes;
for each service class, taking the ratio of the priority value of the service class to the sum of the reference values as the bandwidth ratio of the service class;
and aiming at each service class, calculating the distribution bandwidth of the service class according to the bandwidth proportion of the service class and the preset total bandwidth of the outlet.
2. The method according to claim 1, wherein before the step of identifying the service class of each received service packet according to the preset service class identification rule, the method further comprises:
judging whether the total data volume of the currently received service message is larger than a preset threshold value or not;
if yes, executing the step of identifying the service type of each received service message according to a preset service type identification rule.
3. The method of claim 1, wherein the traffic class identification rule is a port identification rule or a payload feature identification rule or a flow statistics feature identification rule.
4. The method of claim 1, wherein the sending, for each service class, each service packet belonging to the service class according to the allocated bandwidth of the service class comprises:
aiming at each service class, storing each service message belonging to the service class into a packet queue corresponding to the service class;
and aiming at each service class, sending the message in the packet queue corresponding to the service class according to the distribution bandwidth of the service class.
5. The method of claim 4, wherein the sending, for each service class, the packet in the packet queue corresponding to the service class according to the allocated bandwidth of the service class comprises:
for each service class, taking the proportion of the distribution bandwidth of the service class to the preset total bandwidth of the outlet as the message sending proportion of the service class;
aiming at each service class, calculating the message sending number of the service class according to the message sending proportion of the service class and a preset message sending threshold;
and according to the priority of each service class, sequentially sending the service messages with the number of the front messages sent in the packet queue corresponding to each service class.
6. An apparatus for transmitting a service packet, the apparatus comprising:
the identification module is used for identifying the service type of each received service message according to a preset service type identification rule;
the first determining module is used for determining the priority of each service type according to the corresponding relation between the preset service type and the priority;
the second determining module is used for determining the distribution bandwidth of each service class according to the priority of each service class, the preset total bandwidth of the outlet and the preset bandwidth distribution algorithm;
a sending module, configured to send, for each service class, each service packet belonging to the service class according to the allocated bandwidth of the service class;
the second determining module is specifically configured to:
aiming at the service class of each service message, taking the sum of the priority value of each service class and a first preset value as a reference value corresponding to the service class;
calculating the sum of reference values corresponding to all service classes;
for each service class, taking the ratio of the priority value of the service class to the sum of the reference values as the bandwidth ratio of the service class;
and aiming at each service class, calculating the distribution bandwidth of the service class according to the bandwidth proportion of the service class and the preset total bandwidth of the outlet.
7. The apparatus of claim 6, further comprising a determination module; the judging module is used for judging whether the total data volume of the currently received service message is larger than a preset threshold value; if yes, triggering the identification module to execute the step of identifying the service type of each received service message according to the preset service type identification rule.
8. The apparatus of claim 6, wherein the traffic class identification rule is a port identification rule or a payload feature identification rule or a flow statistics feature identification rule.
9. The apparatus of claim 6, wherein the sending module comprises:
the storage unit is used for storing each service message belonging to each service class into a packet queue corresponding to the service class;
and the sending unit is used for sending the message in the packet queue corresponding to the service class according to the distribution bandwidth of the service class aiming at each service class.
10. The apparatus according to claim 9, wherein the sending unit is specifically configured to:
for each service class, taking the proportion of the distribution bandwidth of the service class to the preset total bandwidth of the outlet as the message sending proportion of the service class;
aiming at each service class, calculating the message sending number of the service class according to the message sending proportion of the service class and a preset message sending threshold;
and according to the priority of each service class, sequentially sending the service messages with the number of the front messages sent in the packet queue corresponding to each service class.
11. An electronic device comprising a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being caused by the machine-executable instructions to: carrying out the method steps of any one of claims 1 to 5.
12. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of the claims 1-5.
CN201910390140.7A 2019-05-10 2019-05-10 Service message sending method and device Active CN110138610B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910390140.7A CN110138610B (en) 2019-05-10 2019-05-10 Service message sending method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910390140.7A CN110138610B (en) 2019-05-10 2019-05-10 Service message sending method and device

Publications (2)

Publication Number Publication Date
CN110138610A CN110138610A (en) 2019-08-16
CN110138610B true CN110138610B (en) 2022-04-22

Family

ID=67573480

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910390140.7A Active CN110138610B (en) 2019-05-10 2019-05-10 Service message sending method and device

Country Status (1)

Country Link
CN (1) CN110138610B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110765059A (en) * 2019-09-29 2020-02-07 苏州浪潮智能科技有限公司 PCIE data priority management method and device
CN111030943A (en) * 2019-12-13 2020-04-17 迈普通信技术股份有限公司 Message processing method and device, forwarding equipment and storage medium
CN113055306B (en) * 2019-12-26 2022-10-28 北京华为数字技术有限公司 Message forwarding method and related equipment
CN112055020A (en) * 2020-09-04 2020-12-08 北京明朝万达科技股份有限公司 Message screening method and device and data transmission system
CN112565108B (en) * 2020-12-07 2024-04-05 中国平安人寿保险股份有限公司 Service flow control method, device, equipment and storage medium
CN113285886B (en) * 2021-06-11 2021-10-15 北京天融信网络安全技术有限公司 Bandwidth allocation method and device, electronic equipment and readable storage medium
CN115002033B (en) * 2022-05-25 2023-06-20 建信金融科技有限责任公司 Flow control method, device, equipment, storage medium and computer product
CN117544577A (en) * 2023-12-11 2024-02-09 北京火山引擎科技有限公司 Network flow control method, device and equipment based on distributed storage system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104079501A (en) * 2014-06-05 2014-10-01 深圳市邦彦信息技术有限公司 Queue scheduling method based on multiple priorities
CN105591970A (en) * 2015-08-31 2016-05-18 杭州华三通信技术有限公司 Traffic control method and device
CN105721350A (en) * 2016-03-04 2016-06-29 深圳市共进电子股份有限公司 Intelligent bandwidth allocation method and apparatus
CN108600118A (en) * 2018-03-30 2018-09-28 新华三技术有限公司 Message processing method, device and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104079501A (en) * 2014-06-05 2014-10-01 深圳市邦彦信息技术有限公司 Queue scheduling method based on multiple priorities
CN105591970A (en) * 2015-08-31 2016-05-18 杭州华三通信技术有限公司 Traffic control method and device
CN105721350A (en) * 2016-03-04 2016-06-29 深圳市共进电子股份有限公司 Intelligent bandwidth allocation method and apparatus
CN108600118A (en) * 2018-03-30 2018-09-28 新华三技术有限公司 Message processing method, device and electronic equipment

Also Published As

Publication number Publication date
CN110138610A (en) 2019-08-16

Similar Documents

Publication Publication Date Title
CN110138610B (en) Service message sending method and device
CN111836079B (en) Video code stream transmission method and device
CN109951347B (en) Service identification method, device and network equipment
US20050201373A1 (en) Packet output-controlling device, packet transmission apparatus
US11258717B2 (en) Method for sending service packet, network device, and system
KR20090077816A (en) Method and apparatus for policing bandwidth usage of a home network
JP2013034164A (en) Relay device, and relay method
CN113225196B (en) Service level configuration method and device
EP2273736A1 (en) Method of managing a traffic load
CN111741249B (en) Network congestion detection method and device
CN111324886A (en) Service request processing method and device and server
JP7211765B2 (en) PACKET TRANSFER DEVICE, METHOD AND PROGRAM
CN111083050A (en) Data stream transmission method and device based on software defined network
CN112737940B (en) Data transmission method and device
TWI658715B (en) Communication device, available bandwidth calculation system, available bandwidth calculation method, and program
CN106921588B (en) Flow control method, device and equipment
US10819582B2 (en) Traffic optimization device and traffic optimization method
CN110661722B (en) Flow control method and device
CN115580568B (en) Method and system for realizing network service quality guarantee based on IPv6 flow label
CN113395612A (en) Data forwarding method in optical fiber communication and related device
CN111385667A (en) Video data processing method, device and computer readable storage medium
US7933204B2 (en) Method for organizing packets belonging to streams, and associated equipment
CN114827018B (en) SDN route selection method and device based on service class and electronic equipment
WO2014101047A1 (en) Method, device, and system for identifying network packet loss type
CN113676341A (en) Quality difference evaluation method and related 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