Data transmission method, device, electronic device and storage medium
By performing multi-stage speed limit control on the transmission of data streams in physical ports, the problem of poor flow control effect of physical ports in the prior art is solved, and more efficient and accurate data transmission is achieved.
Patent Information
- Application Number
- CN202010529000.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-11
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2040-06-11
AI Technical Summary
When the prior art performs traffic transmission control through the token bucket algorithm, the traffic control effect for physical ports is poor.
By analyzing the data stream to be transmitted, obtaining its characteristic parameters, determining the first speed limit parameter based on the characteristic parameters, coloring the packets of the data stream once, and determining the second speed limit parameter based on the physical port, and secondaryly coloring the packets in the data stream that are not colored as the first preset color, and finally transmitting the target packets to the next node through the physical port.
The traffic control effect on physical ports is improved and the accuracy of data transmission is ensured. Especially when multiple data streams are transmitted simultaneously under the physical port, the data transmission of each data stream can be accurately controlled.
Smart Images

Figure CN113810308B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of communications, and in particular to a data transmission method, device, electronic device and storage medium. Background Art
[0002] With the development of communication networks and transmission technologies, PTN equipment (packet transport network equipment, mainly used for the backhaul of mobile or data services, belonging to the category of transmission network) has been widely deployed and applied in the transmission networks of operators. With the continuous expansion of the number and scale of services on the network, in order to provide better service quality, the traffic accessing the transmission equipment will be controlled accordingly. QoS (Quality of Service) as a quality service mechanism has been well applied to solve network delays and congestion through various basic technologies. When the data packet in the PTN network needs rate control after coming in from a certain port of the device, Tongchang will use the token bucket algorithm to control the traffic transmission.
[0003] However, when traffic transmission control is performed through the token bucket algorithm, the traffic control effect on the physical port is poor. Summary of the invention
[0004] The purpose of the embodiments of the present invention is to provide a data transmission method, device, electronic device and storage medium, which can improve the flow control effect of the physical port by accurately controlling the transmission of each data stream in the physical port.
[0005] To achieve the above-mentioned purpose, an embodiment of the present invention provides a data transmission method, comprising: parsing a data stream to be transmitted and obtaining characteristic parameters of the data stream; determining a first speed limit parameter according to the characteristic parameters, and coloring the messages of the data stream once according to the first speed limit parameter; determining a physical port for transmitting the data stream according to the characteristic parameters, and determining a second speed limit parameter according to the physical port; performing a second coloring on the messages in the data stream that are colored with a color other than the first preset color in the first coloring according to the second speed limit parameter; transmitting the target message to the next node through the physical port; wherein the target message includes the message in the data stream that is colored with the first preset color.
[0006] To achieve the above-mentioned purpose, an embodiment of the present invention further proposes a data transmission device, including: a parsing module, used to parse the data stream to be transmitted and obtain the characteristic parameters of the data stream; a first speed limit module, used to determine the first speed limit parameter according to the characteristic parameters, and color the messages of the data stream once according to the first speed limit parameter; an acquisition module, used to determine the physical port for transmitting the data stream according to the characteristic parameters, and determine the second speed limit parameter according to the physical port; a second speed limit module, used to perform a second coloring on the messages in the data stream that are colored with a color other than the first preset color in the first coloring according to the second speed limit parameter; a control module, used to transmit the target message to the next node through the physical port; wherein the target message includes the message in the data stream that is colored with the first preset color.
[0007] To achieve the above-mentioned purpose, the present invention provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned data transmission method.
[0008] In order to achieve the above-mentioned purpose, an embodiment of the present invention further provides a computer-readable storage medium storing a computer program, and the computer program implements the above-mentioned data transmission method when executed by a processor.
[0009] Compared with the prior art, the embodiments of the present invention, when performing data transmission, color the message once according to the first speed limit parameter, then determine the second speed limit parameter according to the physical port identifier of the transmission data stream, and color the message for a second time according to the second speed limit parameter, and then transmit the message according to the result of the second coloring, by obtaining the second speed limit parameter to color the message for a second time and selectively transmitting the message according to the coloring result, accurately color the message of the transmission data stream by using a multi-level speed limit method, and selectively transmit the message according to the result after the message is colored, thereby avoiding the erroneous transmission of the message in the data stream that is colored with a color other than the first preset color, and improving the accuracy of data transmission, especially when there are multiple data streams transmitting simultaneously under the physical port, the data transmission of each data stream can be accurately controlled, thereby achieving the purpose of improving the accuracy of data transmission of the physical port. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 Schematic diagram of data speed limit transmission of PTN equipment according to the first embodiment of the present invention;
[0011] Figure 2 is a flow chart of a data transmission method according to a first embodiment of the present invention;
[0012] Figure 3is a flow chart of a primary coloring method according to a first embodiment of the present invention;
[0013] Figure 4 is a flow chart of a data transmission method according to a second embodiment of the present invention;
[0014] Figure 5 is a schematic structural diagram of a data transmission device according to a third embodiment of the present invention;
[0015] Figure 6 FIG. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention. DETAILED DESCRIPTION
[0016] To make the purpose, technical scheme and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings. However, it will be appreciated by those skilled in the art that in the embodiments of the present invention, many technical details are proposed in order to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present application can be implemented. The division of the following embodiments is for the convenience of description, and should not constitute any limitation on the specific implementation of the present invention. The various embodiments can be combined and referenced with each other without contradiction.
[0017] The first embodiment of the present invention relates to a data transmission method, which analyzes a data stream to be transmitted, obtains characteristic parameters of the data stream; determines a first speed limit parameter according to the characteristic parameters, and performs a primary coloring on a message of the data stream according to the first speed limit parameter; determines a physical port for transmitting the data stream according to the characteristic parameters, and determines a second speed limit parameter according to the physical port; performs a secondary coloring on a message in the data stream that is colored as a color other than the first preset color in the primary coloring according to the second speed limit parameter; transmits a target message to a next node through a physical port; wherein the target message includes a message in the data stream that is colored as the first preset color. The message is colored multiple times by obtaining the first speed limit parameter and the second speed limit parameter, and the message is selectively transmitted according to the coloring result, and the data stream is speed-limited by a multi-level speed limit method. By selectively transmitting the message according to the result after the secondary coloring, the erroneous transmission of the message colored as a color other than the first preset color in each logical sub-interface is avoided, and the accuracy of data transmission in the logical sub-interface is improved, thereby realizing accurate control of data transmission of multiple logical sub-interfaces under the physical port.
[0018] The implementation details of the data transmission method in this embodiment are described below. The following content is only the implementation details provided for the convenience of understanding and is not necessary for implementing this solution.
[0019] This embodiment is described by taking the PTN device transmitting video data at a limited speed as an example. The schematic diagram of the PTN device transmitting data at a limited speed is shown in FIG. Figure 1 As shown, after receiving the video data flow that needs to be transmitted, the PTN device 1 colors the message in the video data flow through the rate limiting module in the line card 1 and the configured rate limiting mode, and then the forwarding module transmits the colored message to the traffic management TM (traffic management) module, shapes the data flow according to the coloring of the message, and transmits the data flow to the line card 2, and then sends the video data flow to the PTN device 2 through the line card 2.
[0020] The specific process of the data transmission method used in the speed-limited transmission in the PTN device 1 in this embodiment is as follows: Figure 2 As shown, the specific steps include:
[0021] Step 101: parse the data stream to be transmitted and obtain characteristic parameters of the data stream.
[0022] Specifically, the line card of the PTN device (packet transport network device) can be bound to multiple logical sub-interfaces. When the line card receives the data stream to be transmitted in any logical sub-interface, the line card parses the data stream to be transmitted, obtains the characteristic parameters of the data stream, and identifies the data stream to be transmitted.
[0023] In one example, the characteristic parameters of the data stream include at least one of the following: a flow characteristic identifier of the data stream, and a logical sub-interface identifier of the transmission data stream. By parsing the data stream to be transmitted to obtain the flow characteristic identifier of the data stream itself and / or the logical sub-interface identifier of the transmission data stream, so as to obtain the rate limit parameters of the data stream later, the accuracy of data transmission control of a specific data stream or a specific logical sub-interface is improved.
[0024] For example, parse the messages in the data stream to be transmitted, detect the MAC address, VLAN (virtual local area network) identifier, IP address or UDP (user datagram protocol) address and other information contained in the messages of the data stream to be transmitted, so as to obtain the traffic characteristic identifier of the data stream, or parse the messages in the data stream to be transmitted, obtain the logical sub-interface identifier carried in the data stream messages, and determine the logical sub-interface through which the data stream passes. During the application process, only the traffic characteristic identifier of the data stream or the logical sub-interface identifier of the transmission data stream can be obtained, or both identifiers can be obtained. The message parsing of the data stream can be set according to the actual situation. This embodiment does not limit the characteristic parameters obtained.
[0025] Step 102: determine a first rate limit parameter according to the characteristic parameter, and perform coloring on the packets of the data flow according to the first rate limit parameter.
[0026] Specifically, after obtaining the characteristic parameters of the data flow, the data flow itself or the logical sub-interface that transmits the data flow is identified according to the obtained characteristic parameters, the first speed limit parameter pre-stored for the logical sub-interface or traffic characteristic identifier is obtained, and the data flow message is colored once according to the obtained first speed limit parameter.
[0027] In one example, a specific flow chart of coloring the packets of a data stream according to the first rate limit parameter is as follows: Figure 3 As shown, the specific steps include:
[0028] Sub-step 1021, selecting a first candidate message in the data stream, and coloring the first candidate message into a first preset color.
[0029] Specifically, when the first speed limit parameter is obtained according to the characteristic parameter to color the message of the data flow, when the characteristic parameter obtained by parsing the data flow includes the traffic characteristic identifier of the data flow, the first speed limit parameter includes the first committed information rate corresponding to the traffic characteristic identifier; the message of the data flow is colored once according to the first speed limit parameter, including: selecting a first alternative message in the data flow whose data sum is equal to the first committed information rate, and coloring the first alternative message with a first preset color; or, when the characteristic parameter includes a logical sub-interface identifier of the transmission data flow, the first speed limit parameter includes the second committed information rate corresponding to the logical sub-interface identifier; the message of the data flow is colored once according to the first speed limit parameter, including: selecting a second alternative message in the data flow whose data sum is equal to the second committed information rate, and coloring the second alternative message with the first preset color.
[0030] In one example, three different layer 3 sub-interface services are configured under physical port 1 of line card 1, namely, l3vpn1, l3vpn2 and l3vpn3, that is, three video data streams are transmitted under physical port 1, and the traffic of the three video data streams is 100M, 100M and 200M respectively, and the first preset color is green. The IP address of each data stream is obtained by parsing the messages of the three video data streams, and then the encapsulation addresses of the three video data streams l3vpn1, l3vpn2 and l3vpn3 are obtained as 10.10.10.10, 20.20.20.20 and 30.30.30.30 respectively. The three data streams are transmitted through their corresponding logical sub-interfaces 1, 2 and 3 respectively. After parsing the data flow, a match query is performed through ACL rule 1 in the TCAM table according to the dip values of the three data flows. The carid of the data flow l3vpn1 with a dip of 10.10.10.10 is 1, the carid of the data flow l3vpn2 with a dip of 20.20.20.20 is 2, and the carid of the data flow l3vpn3 with a dip of 30.30.30.30 is 3. Then, according to the carid of the data flow, a pre-established table containing the first speed limit parameters of each data flow is queried to obtain the first speed limit parameters corresponding to different carids. For example, the first committed information rate CIR1=50M corresponding to carid=1, the first committed information rate CIR2=50M corresponding to carid=2, and the first committed information rate CIR3=100M corresponding to carid=3. Then, the packets in the data flow l3vpn1 are colored green with 50M, the packets in the data flow l3vpn2 are also colored green with 50M, and the packets in the data flow l3vpn3 are colored green with 100M.
[0031] In another example, three different layer 2 sub-interface services are configured under physical port 1 of line card 1, namely evpl1, evpl2, and evpl3. The VLANids of the three logical sub-interfaces are 1, 2, and 3, respectively. The video traffic to be transmitted in evpl1 is 200M, the video traffic to be transmitted in evpl2 is 200M, and the video traffic to be transmitted in evpl3 is 400M. By parsing the messages in each data stream, the logical sub-interface identifier carried in each data stream message is obtained, and the logical sub-interface identifier for transmitting evpl1 is 1, the logical sub-interface identifier for transmitting evpl2 is 2, and the logical sub-interface identifier for transmitting evpl3 is 3. Then, according to the logical sub-interface identifier corresponding to each data stream, the pre-created sub-interface information table is queried, and the carid corresponding to the data stream with VLANid=1 is 1, the carid corresponding to the data stream with VLANid=2 is 2, and the carid corresponding to the data stream with VLANid=3 is 3. Then, according to the carid corresponding to each data stream, the pre-created first rate limit parameter information table is queried to obtain the first committed information rate of each data stream. For example, the first committed information rate of the data flow with VLANid=1 is 100M, the first committed information rate of the data flow with VLANid=2 is 100M, and the first committed information rate of the data flow with VLANid=3 is 400M. Then the data flow in the logical sub-interface with VLANid=1 is colored with 100M green packets, the data flow in the logical sub-interface with VLANid=2 is colored with 100M green packets, and the data flow in the logical sub-interface with VLANid=3 is colored with 400M green packets.
[0032] By obtaining the response committed information rate according to the traffic characteristic identifier of the data flow or the logical sub-interface identifier of the transmitted data flow, and then coloring the messages in the data flow according to the obtained committed information rate to limit the speed of data transmission, the data transmission speed of each data flow or logical sub-interface can be accurately limited to improve the accuracy of data transmission.
[0033] Sub-step 1022: obtaining an information rate difference according to the first rate limit parameter.
[0034] Specifically, when obtaining the first speed limit parameter of the data flow according to the characteristic parameter, if the first speed limit parameter is the first committed information rate corresponding to the traffic characteristic identifier, the first speed limit parameter also includes the first maximum information rate corresponding to the traffic characteristic identifier, and after obtaining the first committed information rate and the first maximum information rate corresponding to the traffic characteristic identifier, the first information rate difference between the first committed information rate and the first maximum information rate is obtained; if the first speed limit parameter is the second committed information rate corresponding to the logical sub-interface identifier of the transmission data flow, the first speed limit parameter also includes the second maximum information rate corresponding to the logical sub-interface identifier, and after obtaining the second committed information rate and the second maximum information rate corresponding to the traffic characteristic identifier, the second information rate difference between the second committed information rate and the second maximum information rate is obtained.
[0035] Sub-step 1023, checks whether the total data of the uncolored messages in the data stream is not greater than the information rate difference. If the total data of the uncolored messages in the data stream is not greater than the information rate difference, proceeds to sub-step 1024; if the total data of the uncolored messages in the data stream is greater than the information rate difference, proceeds to sub-step 1025.
[0036] Specifically, after obtaining the first speed limit parameter according to the characteristic parameters and obtaining the information rate difference between the maximum information rate and the committed information rate in the speed limit parameter, the total data of the uncolored messages in the data stream is obtained. When the total data of the uncolored messages is not greater than the information rate difference, step 1024 is entered to directly and uniformly color the remaining messages in the data stream. When the total data of the uncolored messages is greater than the information rate difference, the remaining uncolored messages are colored according to the information rate difference.
[0037] Sub-step 1024, coloring the uncolored messages in the data stream into a second preset color.
[0038] Specifically, after obtaining the corresponding speed limit parameters and information rate difference based on the characteristic parameters obtained through analysis, if the total sum of uncolored message data in the data flow is not greater than the first information rate difference corresponding to the traffic characteristic identifier, or the total sum of uncolored message data in the data flow is not greater than the second information rate difference corresponding to the logical sub-interface identifier, then all uncolored messages in the data flow will be colored as a second preset color.
[0039] Sub-step 1025, coloring the uncolored messages in the data stream according to the information rate difference.
[0040] Specifically, after obtaining the corresponding speed limit parameters and information rate difference according to the characteristic parameters obtained by analysis, if the total data of the uncolored messages in the data flow is greater than the first information rate difference corresponding to the traffic characteristic identifier, a third alternative message whose data total is equal to the first information rate difference is selected from the uncolored messages, the third alternative message is colored as the second preset color, and the remaining uncolored messages are colored as the third preset color; or if the total data of the uncolored messages in the data flow is greater than the second information rate difference corresponding to the logical sub-interface identifier, a fourth alternative message whose data total is equal to the second information rate difference is selected from the uncolored messages, the fourth alternative message is colored as the second preset color, and the remaining uncolored messages are colored as the third preset color.
[0041] In an example, the first speed limit parameter is the speed limit parameter corresponding to the traffic characteristic identifier of the data flow, the first preset color is green, the second preset color is yellow, and the third preset color is red. After analysis, the video traffic of the data flow with dip of 10.10.10.10 is 100M. According to the carid of the data flow with dip of 10.10.10.10, the pre-established speed limit parameter table is queried to obtain the first committed information rate of the data flow of 50M, and the first maximum information rate of the data flow is 80M. The information rate difference between the first committed information rate and the first maximum information rate corresponding to the data flow with carid of 1 is 30M. Therefore, in the video data stream with carid of 1, the first alternative message of 50M is selected and colored green, and then the second alternative message of 30M is selected and colored yellow, and then the remaining 20M message is colored red.
[0042] In another example, the first speed limit parameter is the speed limit parameter corresponding to the logical sub-interface identifier of the transmission data stream, the first preset color is green, the second preset color is yellow, and the third preset color is red. After analysis, the flow of the video data stream in the logical sub-interface with the logical sub-interface identifier VLANid=3 is 500M. According to the VLANid, the pre-created first speed limit parameter table is queried to obtain the second committed information rate of the data stream as 400M, and the second maximum information rate is also 400M. The second information rate difference corresponding to the data stream with VLANid 3 is 0. After selecting the 400M first alternative message in the video data stream in the logical sub-interface with VLANid=3 and coloring it green, since the second information rate difference is 0M, no message is selected as the third alternative message and colored yellow, and the remaining 100M is directly colored as a red message.
[0043] By coloring the data stream once according to the traffic characteristic identifier of the data stream or the committed information rate corresponding to the logical sub-interface identifier of the transmitted data stream, and accurately coloring the uncolored messages in the data stream according to the information rate difference between the committed information rate and the maximum information rate and the total data of the uncolored messages, accurate control of the data transmission process of the data stream to be transmitted is achieved, thereby improving the accuracy of data transmission.
[0044] In addition, in actual operation, according to actual conditions or needs, the first alternative message can be directly selected from the messages of the data flow according to the committed information rate corresponding to the traffic characteristic identifier or the logical sub-interface identifier, and the first alternative message can be colored with the first preset color. This embodiment does not limit the specific method selected in the message coloring process.
[0045] In addition, after the packets of the data stream are colored, the packets colored as a third preset color can also be discarded, thereby reducing the data size of the data stream to be processed in the subsequent processing process by directly discarding the packets of the third preset color, thereby reducing the processing burden of the device in the subsequent processing process.
[0046] Step 103: determine a physical port for transmitting the data stream according to the characteristic parameter, and determine a second rate limit parameter according to the physical port.
[0047] Specifically, after the data stream is colored once by obtaining the first speed limit parameter based on the characteristic parameters obtained by parsing the data, the logical sub-interface to which the data stream belongs is determined based on the characteristic parameters of the data stream, and then the physical port bound to the logical sub-interface is determined based on the logical sub-interface identifier, thereby determining the physical port for transmitting the data stream, and then determining the second speed limit parameter of the data stream based on the speed limit parameter of the physical port.
[0048] Step 104: Perform secondary coloring on the packets in the data stream that are colored with a color other than the first preset color in the first coloring according to the second rate limit parameter.
[0049] Specifically, after obtaining the second speed limit parameter of the data flow corresponding to the speed limit parameter of the physical port, the first coloring result of the obtained data flow is detected, and the messages in the data flow except the first preset color are secondarily colored according to the second speed limit parameter.
[0050] In one example, the second speed limit parameter includes the maximum port information rate of the physical port. According to the second speed limit parameter, the packets in the data stream that are colored as a color other than the first preset color in the first coloring are secondary colored, including: obtaining the current information rate of the packets colored as the first preset color; detecting whether the physical port has a redundant information rate according to the maximum port information rate and the current information rate of the physical port; if the physical port has a redundant information rate, then according to the redundant information rate, a part of the packets in the data stream that are not colored as the first preset color are colored as the first preset color, and the remaining part of the packets are colored as the third preset color, or all the packets in the data stream that are not colored as the first preset color are colored as the first preset color; if the physical port does not have a redundant information rate, then all the packets in the data stream that are not colored as the first preset color are colored as the third preset color.
[0051] For example, physical port 1 is bound to three logical sub-interfaces. Among the three logical sub-interfaces, logical sub-interface 1 contains 100M green packets and 100M yellow packets, logical sub-interface 2 contains 80M green packets, and logical sub-interface 3 contains 400M green packets. The first preset color is green, the second preset color is yellow, and the third preset color is red. According to the identifier of the physical port, the car id corresponding to the physical port identifier is obtained as 4. According to the car id of the physical port, the pre-created second speed limit parameter table is queried to obtain the maximum information rate of the physical port as 600M. At this time, the information rate of the packets colored green in the physical port is 580M, which is less than the maximum information rate of the physical port. The physical port has a redundant information rate of 20M. At this time, 20M packets are selected from the 100M yellow packets in logical sub-interface 1 and colored as green packets, and the remaining 80M yellow packets are colored as red packets. The packets in logical sub-interface 1 and logical sub-interface 3 are still colored green. By determining whether there is a redundant information rate based on the maximum information rate of the physical port and the information rate of the current first preset color message, and re-coloring the message based on the redundant information rate, the message that cannot be transmitted in time is colored into the third preset color, while maximizing the utilization of the physical port information rate.
[0052] In addition, after the messages of the data stream are colored twice, the messages colored with the third preset color may be discarded, thereby completely avoiding the erroneous transmission of the messages with the first preset color.
[0053] In actual applications, all yellow messages in the logical sub-interface can be directly colored red according to the operator's management policy, or all yellow messages can be colored green when the redundant information rate is sufficient. This embodiment does not limit the specific method of utilizing the redundant information rate.
[0054] Step 105: Transmit the target message to the next node through the physical port.
[0055] Specifically, after the messages of each data flow are secondary colored according to the second speed limit parameter, the target message for transmission is selected from each data flow according to the coloring result of each message, and the target message is transmitted to the next node through the physical port, wherein the target message includes the message in the data flow colored as the first preset color.
[0056] For example, there are two logical sub-interfaces under physical port 1, there are 200M green packets in logical sub-interface 1, and there are 300M green packets in logical sub-interface 2. Then, according to the 200M green packets in logical sub-interface 1 and the 300M green packets in logical sub-interface 2, the corresponding number of tokens in the token bucket are consumed, and the packets in the two logical sub-interfaces are transmitted to the next node.
[0057] Therefore, this embodiment provides a data transmission method, which performs a first coloring on the messages in the data stream by obtaining a first speed limit parameter based on the characteristic parameters obtained by analyzing the data stream, and then determines a second speed limit parameter based on the physical port of the transmitted data stream to perform a second coloring on the data stream, and selectively transmits the messages in the data stream based on the coloring result. Through the secondary coloring and selective transmission, the erroneous transmission of messages in the data stream that do not belong to the first preset color due to insensitivity to the color of the colored messages is avoided, thereby improving the accuracy of data transmission of each data stream and logical sub-interface, and further realizing accurate control of data transmission on the physical port.
[0058] The second embodiment of the present invention relates to a data transmission method. The second embodiment of the present invention is roughly the same as the first embodiment. In this embodiment, the acquired characteristic parameters include a logical sub-interface identifier and a traffic characteristic identifier. When performing a coloring, the message of the data flow is pre-colored according to the speed limit parameter corresponding to the traffic characteristic identifier, and then the coloring is completed according to the speed limit parameter corresponding to the logical sub-interface. While accurately controlling each data flow, the resource utilization rate of the logical sub-interface and the physical port is improved. After each message in the data flow is colored, the message colored as the third preset color will be discarded, so as to completely avoid the erroneous transmission of the message and improve the accuracy of data transmission.
[0059] The data transmission method flow chart of this embodiment is as follows Figure 4 As shown, the specific steps include:
[0060] Step 201: parse the data stream to be transmitted and obtain characteristic parameters of the data stream.
[0061] Specifically, the line card of the PTN equipment (packet transport network equipment) can be bound to multiple logical sub-interfaces. When the line card receives the data stream to be transmitted in any logical sub-interface, the line card parses the data stream to be transmitted and obtains the flow characteristic identifier for the source of the data stream and the logical sub-interface identifier corresponding to the transmission channel of the data stream. That is, the characteristic parameters of the data stream include the flow characteristic identifier of the data stream and the logical sub-interface identifier for transmitting the data stream.
[0062] Step 202: pre-color the packets of the data flow according to the rate limit parameters corresponding to the traffic feature identifier.
[0063] Specifically, after the PTN device obtains the characteristic parameters, it first determines the first committed information rate and the first maximum information rate of the data flow according to the traffic characteristic identifier of the data flow, and pre-colors the data flow message according to the first committed information rate and the first maximum information rate.
[0064] For example, the traffic size of data flow 1 is 220M, the first preset color is green, the second preset color is yellow, and the third preset color is red. The characteristic identifier of data flow 1 is analyzed to be A, and the data flow is determined to belong to the traffic of user A. The pre-created speed limit parameter table is queried according to the traffic characteristic identifier, and the first committed information rate of data flow 1 is 80M, and the first maximum information rate is 150M. The first information rate difference is 70M. According to the obtained first committed information rate, first maximum information rate and first information rate difference, data flow 1 is colored as a data flow containing 80M green packets, 70M yellow packets and 70M red packets.
[0065] In addition, after the packets of the data flow are colored, the packets colored with the third preset color are discarded, that is, the packets colored with red are discarded. Thus, by directly discarding the packets with the third preset color, the flow size of the data flow is reduced, thereby reducing the processing burden of the device in the subsequent processing process.
[0066] Step 203: Color the pre-colored message according to the rate limit parameter corresponding to the logical sub-interface identifier of the transmission data flow.
[0067] Specifically, after pre-coloring the data flow message according to the first committed information rate and the first maximum information rate corresponding to the traffic characteristic identifier, the second committed information rate and the second maximum information rate of the data flow are obtained according to the logical sub-interface identifier of the transmitted data flow, and the message is colored once according to the second committed information rate and the second maximum information rate; wherein, the first committed information rate is less than the second committed information rate, and the first maximum information rate is less than the second maximum information rate.
[0068] In one example, the first preset color is green, the second preset color is yellow, and the third preset color is red. The logical sub-interface 1 contains pre-colored data stream 1, and data stream 1 contains green messages of 80M and yellow messages of 70M. The speed limit parameter table is queried according to the logical sub-interface identifier, and the second committed information rate of the data stream is obtained as 100M, and the second maximum information rate is 200M. Then the messages in data stream 1 are recolored as 100M green messages and 50M yellow messages. By pre-coloring the messages according to the speed limit parameters corresponding to the traffic feature identifier, and then coloring them once according to the speed limit parameters corresponding to the logical sub-interface, the speed limit accuracy of each data stream under the same service interface during the transmission process is improved by pre-coloring, and then coloring them once according to the speed limit parameters of the service interface, while ensuring the speed limit effect, the bandwidth resource utilization of the service interface is improved as much as possible.
[0069] In addition, in the actual application logical sub-interface, multiple data streams from different users or IP addresses can be included. The messages of each data stream can be colored once according to whether there is redundant information rate and operator policy of the logical sub-interface. This embodiment does not restrict how to use the redundant information rate of the logical sub-interface.
[0070] Step 204: Perform secondary coloring on the packets in the data flow that are colored with a color other than the first preset color in the primary coloring according to the second rate limit parameter.
[0071] Step 205: Transmit the target message to the next node through the physical port.
[0072] Step 204 and step 205 of this embodiment are similar to step 104 and step 105 of the first embodiment, and are not described in detail here.
[0073] In addition, after any coloring of the messages in the data stream, it is possible to detect whether there are messages of the third preset color in the data stream. If a message of the third preset color is detected, the message of the third preset color is discarded, thereby reducing the total amount of data in the subsequent processing process, thereby reducing the processing burden.
[0074] Therefore, this embodiment provides a data transmission method, which pre-colors the data flow according to the traffic characteristic identifier of the data flow and then colors the pre-colored message according to the speed limit parameter corresponding to the logical sub-interface. While ensuring the accuracy of control of each data flow, the information rate of the logical sub-interface is utilized as much as possible, and by discarding the message of the third preset color, the total amount of data in the subsequent processing process is reduced, thereby reducing the processing burden.
[0075] In addition, those skilled in the art can understand that the step division of the above methods is only for clear description. When implemented, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are all within the protection scope of this patent; adding insignificant modifications to the algorithm or process or introducing insignificant designs without changing the core design of the algorithm and process are all within the protection scope of this patent.
[0076] A third embodiment of the present invention relates to a data transmission device, such as Figure 5 As shown, including:
[0077] The parsing module 301 is used to parse the data stream to be transmitted and obtain characteristic parameters of the data stream;
[0078] A first rate limiting module 302, configured to determine a first rate limiting parameter according to the characteristic parameter, and perform a coloring operation on the packets of the data flow according to the first rate limiting parameter;
[0079] An acquisition module 303 is used to determine a physical port for transmitting a data stream according to the characteristic parameter, and determine a second rate limit parameter according to the physical port;
[0080] A second rate limiting module 304, configured to perform secondary coloring on the packets in the data stream that are colored in a color other than the first preset color in the first coloring according to the second rate limiting parameter;
[0081] The control module 305 is used to transmit the target message to the next node through the physical port; wherein the target message includes the message in the data flow that is colored as a first preset color.
[0082] In one example, the characteristic parameter includes one of the following or any combination thereof: a traffic characteristic identifier of a data flow, and an identifier of a logical sub-interface for transmitting the data flow.
[0083] In another example, the characteristic parameters include a traffic characteristic identifier of the data flow, and the first speed limit parameter includes a first committed information rate of the data flow; the first speed limit module 302 colors the message of the data flow according to the first speed limit parameter, including: selecting a first alternative message in the data flow whose data sum is equal to the first committed information rate, and coloring the first alternative message as a first preset color; or, the characteristic parameters include a logical sub-interface identifier of the transmission data flow, and the first speed limit parameter includes a second committed information rate of the data flow; coloring the message of the data flow according to the first speed limit parameter, including: selecting a second alternative message in the data flow whose data sum is equal to the second committed information rate, and coloring the second alternative message as the first preset color.
[0084] In another example, when the characteristic parameter includes a traffic characteristic identifier of a data flow, the first speed limit parameter also includes: a first maximum information rate corresponding to the traffic characteristic identifier; the first speed limit module 302 colors the message of the data flow according to the first speed limit parameter, and also includes: obtaining a first information rate difference between the first committed information rate and the first maximum information rate; if the sum of data of the uncolored messages of the data flow is not greater than the first information rate difference, coloring the uncolored messages in the data flow with a second preset color; if the sum of data of the uncolored messages in the data flow is greater than the information rate difference, selecting a third alternative message whose data sum is equal to the first information rate difference from the uncolored messages, coloring the third alternative message with the second preset color, and coloring the remaining uncolored messages with The third preset color; or, when the characteristic parameter includes the logical sub-interface identifier of the transmitted data stream, the first speed limit parameter also includes the second maximum information rate corresponding to the logical sub-interface identifier; coloring the data stream message according to the first speed limit parameter, also includes: obtaining the second information rate difference between the second committed information rate and the second maximum information rate; if the total data of the uncolored messages in the data stream is not greater than the second information rate difference, coloring the uncolored messages to the second preset color; if the total data of the uncolored messages in the data stream is greater than the second information rate difference, selecting a fourth alternative message whose data total is equal to the second information rate difference from the uncolored messages, coloring the fourth alternative message to the second preset color, and coloring the remaining uncolored messages to the third preset color.
[0085] In another example, the characteristic parameters include a logical sub-interface identifier of a transmission data stream and a characteristic identifier of the data stream, and the first speed limit parameter includes a first committed information rate and a first maximum information rate corresponding to the traffic characteristic identifier, and a second committed information rate and a second maximum information rate corresponding to the logical sub-interface identifier; the first speed limit module 302 pre-colors the message of the data stream according to the first committed information rate and the first maximum information rate; and colors the pre-colored message once according to the second committed information rate and the second maximum information rate; wherein the first committed information rate is less than the second committed information rate, and the first maximum information rate is less than the second maximum information rate.
[0086] In another example, the second speed limit parameter includes the maximum port information rate of the physical port, and the second speed limit module 304 performs secondary coloring on the messages in the data stream that are colored as other than the first preset color in the first coloring according to the second speed limit parameter, including: obtaining the current information rate of the messages colored as the first preset color; detecting whether the physical port has a redundant information rate according to the maximum port information rate and the current information rate of the physical port; if the physical port has a redundant information rate, coloring some of the messages that are not colored as the first preset color as the first preset color according to the redundant information rate, and coloring the remaining messages as the third preset color, or coloring all the messages that are not colored as the first preset color as the first preset color; if the physical port does not have a redundant information rate, coloring the messages that are not colored as the first preset color as the third preset color.
[0087] In another example, after each rate limiting module colors the packets of the data flow, it discards the packets colored with a third preset color.
[0088] It is not difficult to find that this embodiment is a device embodiment corresponding to the first embodiment, and this embodiment can be implemented in conjunction with the first embodiment. The relevant technical details mentioned in the first embodiment are still valid in this embodiment, and in order to reduce repetition, they are not repeated here. Accordingly, the relevant technical details mentioned in this embodiment can also be applied in the first embodiment.
[0089] It is worth mentioning that all modules involved in this embodiment are logic modules. In practical applications, a logic unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. In addition, in order to highlight the innovative part of the present invention, this embodiment does not introduce units that are not closely related to solving the technical problem proposed by the present invention, but this does not mean that there are no other units in this embodiment.
[0090] A fourth embodiment of the present invention relates to an electronic device, such as Figure 6 As shown, it includes: at least one processor 401; and a memory 402 that is communicatively connected to the at least one processor 401; wherein the memory 402 stores instructions that can be executed by the at least one processor 401, and the instructions are executed by the at least one processor 401 so that the at least one processor 401 can execute the above-mentioned data transmission method.
[0091] Among them, the memory and the processor are connected in a bus manner, and the bus may include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors and memories together. The bus can also connect various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. The data processed by the processor is transmitted on a wireless medium via an antenna, and further, the antenna also receives data and transmits the data to the processor.
[0092] The processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory can be used to store data used by the processor when performing operations.
[0093] A fifth embodiment of the present invention relates to a computer-readable storage medium storing a computer program, which implements the above method embodiment when executed by a processor.
[0094] That is, those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0095] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the present invention is not limited thereby. Any modification, equivalent substitution and improvement made by those skilled in the art without departing from the scope and essence of the present invention shall be within the scope of the present invention.
Claims
1. A data transmission method, characterized in that: include: Parsing the data stream to be transmitted, and obtaining characteristic parameters of the data stream, wherein the characteristic parameters are identification parameters of the data stream; Determine a first rate limit parameter according to the characteristic parameter, and color the message of the data flow according to the first rate limit parameter, wherein the first rate limit parameter is a rate control parameter of the data flow; Determine a physical port for transmitting the data stream according to the characteristic parameter, and determine a second rate limit parameter according to the physical port; performing secondary coloring on the packets in the data flow that are colored with a color other than the first preset color in the primary coloring according to the second rate limit parameter; The target message is transmitted to the next node through the physical port; wherein the target message includes the message in the data stream that is colored as the first preset color.
2. The data transmission method according to claim 1, characterized in that: The characteristic parameters include at least one of the following: The traffic characteristic identifier of the data flow and the logical sub-interface identifier for transmitting the data flow.
3. The data transmission method according to claim 2, characterized in that: In the case where the characteristic parameter includes a traffic characteristic identifier of the data flow, the first rate limit parameter includes a first committed information rate of the data flow; The coloring of the message of the data flow according to the first rate limit parameter includes: Selecting a first candidate message having a data sum equal to the first committed information rate in the data stream, and coloring the first candidate message with the first preset color; or, In the case where the characteristic parameter includes the identifier of the logical sub-interface for transmitting the data flow, the first rate limit parameter includes a second committed information rate of the data flow; A second candidate message having a data sum equal to the second committed information rate is selected from the data stream, and the second candidate message is colored with the first preset color.
4. The data transmission method according to claim 3, characterized in that: In the case where the characteristic parameter includes a flow characteristic identifier of the data flow, the first rate limit parameter further includes: a first maximum information rate corresponding to the flow characteristic identifier; The coloring of the message of the data flow according to the first rate limit parameter once also includes: Obtaining a first information rate difference between the first committed information rate and the first maximum information rate; If the total amount of data in the uncolored messages of the data stream is not greater than the first information rate difference, coloring the uncolored messages in the data stream into a second preset color; If the sum of data of the uncolored messages in the data stream is greater than the information rate difference, selecting a third candidate message whose sum of data is equal to the first information rate difference from the uncolored messages, coloring the third candidate message with the second preset color, and coloring the remaining uncolored messages with the third preset color; In the case where the characteristic parameter includes the logical sub-interface identifier for transmitting the data stream, the first rate limit parameter also includes a second maximum information rate corresponding to the logical sub-interface identifier; Obtaining a second information rate difference between the second committed information rate and the second maximum information rate; If the total amount of data of the uncolored messages in the data stream is not greater than the second information rate difference, coloring the uncolored messages into a second preset color; If the total data of the uncolored messages in the data stream is greater than the second information rate difference, a fourth alternative message whose total data is equal to the second information rate difference is selected from the uncolored messages, the fourth alternative message is colored the second preset color, and the remaining uncolored messages are colored the third preset color.
5. The data transmission method according to claim 2, characterized in that: In the case where the characteristic parameter includes the logical sub-interface identifier for transmitting the data flow and the traffic characteristic identifier of the data flow, the first rate limit parameter includes a first committed information rate and a first maximum information rate corresponding to the traffic characteristic identifier, and a second committed information rate and a second maximum information rate corresponding to the logical sub-interface identifier; and coloring the message of the data flow according to the first rate limit parameter once includes: pre-coloring the packets of the data flow according to the first committed information rate and the first maximum information rate; Coloring the pre-colored message once according to the second committed information rate and the second maximum information rate; Among them, the first committed information rate is smaller than the second committed information rate, and the first maximum information rate is smaller than the second maximum information rate.
6. The data transmission method according to claim 1, characterized in that: The second rate limit parameter includes the maximum port information rate of the physical port; The second coloring of the packets in the data flow that are colored with a color other than the first preset color in the first coloring according to the second rate limit parameter includes: Obtaining a current information rate of the message colored as the first preset color; According to the port maximum information rate and the current information rate of the physical port, detecting whether the physical port has a redundant information rate; If the physical port has a redundant information rate, then according to the redundant information rate, a portion of the messages in the data stream that are not colored with the first preset color are colored with the first preset color, and the remaining messages are colored with a third preset color, or all the messages in the data stream that are not colored with the first preset color are colored with the first preset color; If the physical port does not have a redundant information rate, all messages in the data stream that are not colored with the first preset color are colored with the third preset color.
7. The data transmission method according to claim 4 or 6, characterized in that: Also includes: After the packets of the data flow are colored, the packets colored with the third preset color are discarded.
8. A data transmission device, characterized in that: include: A parsing module, used for parsing the data stream to be transmitted, and obtaining characteristic parameters of the data stream, wherein the characteristic parameters are identification parameters of the data stream; A first rate limiting module, configured to determine a first rate limiting parameter according to the characteristic parameter, and color the message of the data flow according to the first rate limiting parameter, wherein the first rate limiting parameter is a rate control parameter of the data flow; An acquisition module, configured to determine a physical port for transmitting the data stream according to the characteristic parameter, and determine a second rate limit parameter according to the physical port; A second rate limiting module, configured to perform secondary coloring on the packets in the data stream that are colored with a color other than the first preset color in the primary coloring according to the second rate limiting parameter; A control module is used to transmit the target message to the next node through the physical port; wherein the target message includes the message in the data stream that is colored as the first preset color.
9. An electronic device, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the data transmission method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the data transmission method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Method and device for realizing stream filtration
CN101834785A
Service bandwidth determining method in IP network and network device
CN105812286A