Data stream transmission method, device, computer equipment and storage medium
By calculating the candidate offsets and scores of data flows in delay-sensitive networks and optimizing the transmission order of data flows, the problem of low transmission efficiency of traditional switch ports is solved, and more efficient data flow transmission is achieved.
Patent Information
- Application Number
- CN202211622138.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-16
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2042-12-16
AI Technical Summary
In traditional delay-sensitive networks, when a switch port sorts and transmits multiple delay-sensitive data streams, there is a problem of low transmission efficiency.
By obtaining the transmission interval period, frame capacity, routing path and maximum delay of multiple data streams to be transmitted at the target port, the candidate offsets are determined, and the score of each data stream is calculated based on the queue length and frame capacity. The target offset with the highest score is selected for data stream transmission to optimize the sending order of data frames.
It improves the transmission efficiency of data streams, reduces the waste of time slices, and improves the scheduling performance of switches and the transmission rate of data streams.
Smart Images

Figure CN116248597B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data stream transmission method, apparatus, computer equipment, storage medium, and computer program product. Background Art
[0002] With the development of computer technology, services are becoming increasingly sensitive to latency. To meet this requirement, time-sensitive networking (TSN) has emerged. TSN is a set of data link layer protocol specifications that defines a time-sensitive mechanism for Ethernet data transmission, enabling the construction of a more reliable, low-latency, and low-jitter Ethernet network.
[0003] In traditional technologies, a switch port that transmits on a delay-sensitive network sorts multiple delay-sensitive data flows and transmits the delay-sensitive data flows in sequence according to the sorting results, resulting in low transmission efficiency. Summary of the Invention
[0004] Based on this, it is necessary to provide a data stream transmission method, apparatus, computer equipment, computer-readable storage medium and computer program product that can improve the efficiency of data stream transmission in order to address the above technical problems.
[0005] In a first aspect, the present application provides a data stream transmission method. The method comprises:
[0006] Acquire multiple data streams to be transmitted corresponding to the target port, as well as the transmission interval period, frame capacity, routing path and maximum delay corresponding to each of the data streams to be transmitted;
[0007] Determining a candidate offset corresponding to the data stream to be transmitted based on a transmission interval period, a routing path, and a maximum delay corresponding to the data stream to be transmitted;
[0008] Obtaining a queue length of the target port, and calculating a score for each candidate offset corresponding to each data flow to be transmitted based on the queue length, the candidate offset corresponding to each data flow to be transmitted, and the frame capacity;
[0009] For each of the data streams to be transmitted, comparing the scores of the candidate offsets to determine a target offset of the data stream to be transmitted;
[0010] The multiple data streams to be transmitted are transmitted based on the target offset of each of the data streams to be transmitted.
[0011] In one embodiment, determining the candidate offset corresponding to the data stream to be transmitted based on the transmission interval period, routing path, and maximum delay corresponding to the data stream to be transmitted includes:
[0012] Determining a reference offset corresponding to the data stream to be transmitted based on a transmission interval period corresponding to the data stream to be transmitted; the reference offset is smaller than the transmission interval period, the reference offset is an integer multiple of a time slice, the transmission interval period is an integer multiple of the time slice, and the time slice is a set duration for the target port to transmit a data frame;
[0013] Based on the routing path corresponding to the data stream to be transmitted, obtaining the number of transmission nodes included in the routing path;
[0014] Based on the number of transmission nodes and the maximum delay corresponding to the data stream to be transmitted, a candidate offset is determined from the reference offsets corresponding to the data stream to be transmitted.
[0015] In one embodiment, determining the candidate offset from the reference offset corresponding to the data stream to be transmitted based on the number of transmission nodes and the maximum delay corresponding to the data stream to be transmitted includes:
[0016] Merging the number of transmission nodes and the time slice to obtain the transmission time corresponding to the routing path;
[0017] For each of the reference offsets, performing statistics on the reference offset and the transmission time to obtain a reference delay for transmitting the data stream to be transmitted at the reference offset;
[0018] A reference offset corresponding to the reference delay that is less than or equal to the maximum delay is determined as a candidate offset.
[0019] In one embodiment, calculating a score of each candidate offset corresponding to each data stream to be transmitted based on the queue length, the candidate offset corresponding to each data stream to be transmitted, and the frame capacity includes:
[0020] Obtaining a target data stream to be transmitted from the plurality of data streams to be transmitted, and obtaining an offset to be scored from candidate offsets corresponding to the target data stream to be transmitted;
[0021] Calculating a maximum available queue length corresponding to the offset to be scored based on the offset to be scored, and a candidate offset and a frame capacity corresponding to the non-target data flow to be transmitted;
[0022] The score of the offset to be scored is obtained according to the ratio of the maximum available queue length to the frame capacity corresponding to the target data flow to be transmitted.
[0023] In one embodiment, the calculating, based on the offset to be scored, the candidate offset and the frame capacity corresponding to the non-target to-be-transmitted data flow, the maximum available queue length corresponding to the offset to be scored includes:
[0024] Obtaining a maximum candidate offset for each of the non-target data streams to be transmitted;
[0025] Comparing the maximum candidate offset of the non-target to-be-transmitted data stream with the offset to be scored, and determining the frame capacity corresponding to the non-target to-be-transmitted data stream whose maximum candidate offset is less than or equal to the offset to be scored as the capacity to be counted;
[0026] Performing statistics on the capacity to be counted to obtain the minimum occupied capacity corresponding to the offset to be scored;
[0027] According to the difference between the queue length and the minimum occupied capacity, a maximum available queue length corresponding to the offset to be scored is obtained.
[0028] In one embodiment, transmitting the multiple data streams to be transmitted based on the target offset of each of the data streams to be transmitted includes:
[0029] Determining a transmission time slot and a transmission time slice corresponding to each data frame in the data stream to be transmitted based on a target offset and a transmission interval period corresponding to the data stream to be transmitted;
[0030] Determining a sending order of each data frame in the plurality of data streams to be transmitted based on a sending time slot and a sending time slice corresponding to the data frame;
[0031] Based on the sending order, each data frame in the multiple data streams to be transmitted is transmitted.
[0032] In one embodiment, determining the transmission time slot and transmission time slice corresponding to each data frame in the data stream to be transmitted based on the target offset and the transmission interval period corresponding to the data stream to be transmitted includes:
[0033] Determining a sending time slice of a first data frame in the data stream to be transmitted based on a target offset corresponding to the data stream to be transmitted;
[0034] Determine, based on the sending time slice of the first data frame and the transmission interval period corresponding to the data stream to be transmitted, a sending time slice corresponding to each data frame in the data stream to be transmitted;
[0035] Based on the sending time slice corresponding to the data frame, a sending time slot corresponding to the sending time slice is determined; the sending time slot refers to the first idle state time slot in the time slot queue corresponding to the sending time slice.
[0036] In a second aspect, the present application further provides a data stream transmission device. The device comprises:
[0037] An acquisition module is used to acquire multiple data streams to be transmitted corresponding to the target port, as well as the transmission interval period, frame capacity, routing path and maximum delay corresponding to each of the data streams to be transmitted;
[0038] A candidate module, configured to determine a candidate offset corresponding to the data stream to be transmitted based on a transmission interval period, a routing path, and a maximum delay corresponding to the data stream to be transmitted;
[0039] a scoring module, configured to obtain a queue length of the target port, and calculate a score for each candidate offset corresponding to each data flow to be transmitted based on the queue length, the candidate offset corresponding to each data flow to be transmitted, and the frame capacity;
[0040] a comparison module, configured to compare the scores of the candidate offsets for each of the data streams to be transmitted, and determine a target offset for the data stream to be transmitted;
[0041] The transmission module is configured to transmit the plurality of data streams to be transmitted based on a target offset of each of the data streams to be transmitted.
[0042] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are performed:
[0043] Acquire multiple data streams to be transmitted corresponding to the target port, as well as the transmission interval period, frame capacity, routing path and maximum delay corresponding to each of the data streams to be transmitted;
[0044] Determining a candidate offset corresponding to the data stream to be transmitted based on a transmission interval period, a routing path, and a maximum delay corresponding to the data stream to be transmitted;
[0045] Obtaining a queue length of the target port, and calculating a score for each candidate offset corresponding to each data flow to be transmitted based on the queue length, the candidate offset corresponding to each data flow to be transmitted, and the frame capacity;
[0046] For each of the data streams to be transmitted, comparing the scores of the candidate offsets to determine a target offset of the data stream to be transmitted;
[0047] The multiple data streams to be transmitted are transmitted based on the target offset of each of the data streams to be transmitted.
[0048] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the following steps:
[0049] Acquire multiple data streams to be transmitted corresponding to the target port, as well as the transmission interval period, frame capacity, routing path and maximum delay corresponding to each of the data streams to be transmitted;
[0050] Determining a candidate offset corresponding to the data stream to be transmitted based on a transmission interval period, a routing path, and a maximum delay corresponding to the data stream to be transmitted;
[0051] Obtaining a queue length of the target port, and calculating a score for each candidate offset corresponding to each data flow to be transmitted based on the queue length, the candidate offset corresponding to each data flow to be transmitted, and the frame capacity;
[0052] For each of the data streams to be transmitted, comparing the scores of the candidate offsets to determine a target offset of the data stream to be transmitted;
[0053] The multiple data streams to be transmitted are transmitted based on the target offset of each of the data streams to be transmitted.
[0054] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the following steps: obtaining multiple data streams to be transmitted corresponding to a target port, and a transmission interval period, frame capacity, routing path, and maximum delay corresponding to each of the data streams to be transmitted;
[0055] Determining a candidate offset corresponding to the data stream to be transmitted based on a transmission interval period, a routing path, and a maximum delay corresponding to the data stream to be transmitted;
[0056] Obtaining a queue length of the target port, and calculating a score for each candidate offset corresponding to each data flow to be transmitted based on the queue length, the candidate offset corresponding to each data flow to be transmitted, and the frame capacity;
[0057] For each of the data streams to be transmitted, comparing the scores of the candidate offsets to determine a target offset of the data stream to be transmitted;
[0058] The multiple data streams to be transmitted are transmitted based on the target offset of each of the data streams to be transmitted.
[0059] The data stream transmission method, apparatus, computer device, storage medium, and computer program product calculate each candidate offset for each data stream to be transmitted to obtain a score for each candidate offset. The score is the ratio of the maximum available queue length to the frame capacity corresponding to the data stream to be transmitted. A larger maximum available queue length indicates higher queue resource availability, and a smaller frame capacity corresponding to the data stream to be transmitted indicates a higher transmission rate for the data stream to be transmitted. A higher score indicates a lower impact of the data stream on delay-sensitive network resources during transmission, higher switch scheduling performance, and a higher transmission rate for the data stream to be transmitted. For each data stream to be transmitted, a target offset for the data stream to be transmitted is determined based on the score of each candidate offset corresponding to the data stream to be transmitted. The highest target offset score indicates that the switch has the highest scheduling performance when transmitting the data stream to be transmitted at the target offset. The transmission order of each data frame in multiple data streams to be transmitted is determined based on the target offsets of each data stream to be transmitted. This fully utilizes the transmission interval time slices between data frames in the same data stream to be transmitted, reduces time slice waste, and further improves data stream transmission efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 A diagram illustrating an application environment of a data stream transmission method according to an embodiment;
[0061] Figure 2 1 is a flow chart of a data stream transmission method according to an embodiment;
[0062] Figure 3 FIG. 1 is a flow chart of a step of determining a candidate offset in one embodiment;
[0063] Figure 4 FIG. 1 is a flow chart of a candidate offset scoring step in one embodiment;
[0064] Figure 5 A schematic flow chart of the steps for calculating the maximum available queue length in one embodiment;
[0065] Figure 6 1 is a flow chart of a data stream transmission step in an embodiment;
[0066] Figure 7 is a scheduling table of data frames in a data stream to be transmitted in one embodiment;
[0067] Figure 8 is a structural block diagram of a data stream transmission device in one embodiment;
[0068] Figure 9 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0069] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0070] The data stream transmission method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the switch 104 through the network. The data storage system can store data that the switch 104 needs to process. The data storage system can be integrated on the switch 104, or it can be placed on the cloud or other network servers. The terminal and the switch are used in conjunction to execute the data stream transmission method provided in the embodiment of the present application. For example, the terminal sends a data stream to be transmitted to the switch, and the switch obtains multiple data streams to be transmitted corresponding to the target port, as well as the transmission interval period, frame capacity, routing path and maximum delay corresponding to each data stream to be transmitted. Based on the transmission interval period, routing path and maximum delay corresponding to the data stream to be transmitted, the candidate offset corresponding to the data stream to be transmitted is determined, the queue length of the target port is obtained, and based on the queue length, the candidate offset corresponding to each data stream to be transmitted and the frame capacity, the score of each candidate offset corresponding to each data stream to be transmitted is calculated. For each data stream to be transmitted, the scores of each candidate offset are compared to determine the target offset of the data stream to be transmitted. Based on the target offset of each data stream to be transmitted, the multiple data streams to be transmitted are transmitted. Terminal 102 may include, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices may include smart speakers, smart TVs, smart air conditioners, and smart car devices. Portable wearable devices may include smart watches, smart bracelets, and head-mounted devices. Switch 104 may be implemented as a standalone switch or a server cluster consisting of multiple switches.
[0071] In one embodiment, Figure 2 As shown, a data stream transmission method is provided, which can be applied to a switch. This embodiment takes the method applied to a switch as an example for description, and includes steps 202 to 210.
[0072] Step 202: Acquire multiple data streams to be transmitted corresponding to the target port, as well as the transmission interval period, frame capacity, routing path and maximum delay corresponding to each data stream to be transmitted.
[0073] A switch is a network device used to forward electrical or optical signals. A switch can be an Ethernet switch. Hosts can communicate with each other through multiple switches. A switch has multiple ports. A destination port is the port that forwards the data stream to be transmitted. A destination port contains multiple queues, which temporarily store the data stream to be transmitted. A data stream is a sequence of data with a starting point and an end point. Data streams are categorized as byte streams and character streams. A byte stream is a data stream whose smallest unit of data is a byte, while a character stream is a data stream whose smallest unit of data is a character. The transmission interval is the interval between data frames in a data stream to be transmitted. It can be understood that after the previous data frame is forwarded, the next data frame must wait for the transmission interval before it can be forwarded. The transmission interval is an integer multiple of the time slot. A time slot is a time period. A time slot is the time it takes a switch to transmit a data frame. In delay-sensitive network round-robin forwarding, if a switch receives a data frame in a certain time slot, the frame is forwarded to the next switch in the next time slot. Frame capacity is the number of bytes or characters contained in a data frame in a data stream to be transmitted. The routing path refers to the path along which data flows from the sending host to the receiving host. This path includes, but is not limited to, the sending address, the receiving address, and the addresses of the switches along the path. Maximum latency refers to the maximum end-to-end delay in data transmission. This can be understood as the maximum time interval between data transmission from the sending host to the receiving host.
[0074] Exemplarily, the switch obtains multiple data flows to be transmitted corresponding to the target port, and then obtains the transmission interval period, frame capacity, routing path and maximum delay corresponding to each data flow to be transmitted.
[0075] Step 204: Determine a candidate offset corresponding to the data stream to be transmitted based on the transmission interval period, routing path, and maximum delay corresponding to the data stream to be transmitted.
[0076] The offset is the time the switch's destination port waits before forwarding the first data frame in a data stream to be transmitted. The offset is an integer multiple of the time slice. The candidate offset is the offset that the data stream can use. There can be one or more candidate offsets.
[0077] Exemplarily, the switch determines the candidate offset corresponding to the data flow to be transmitted according to the transmission interval period, routing path, and maximum delay corresponding to the data flow to be transmitted.
[0078] In one embodiment, the switch determines a reference offset for a data stream to be transmitted based on a transmission interval and offset constraints. Based on the routing path, maximum delay, and deadline constraints, the switch determines a candidate offset for the data stream to be transmitted from the reference offset. The offset constraint requires that the reference offset must be less than the transmission interval, and the deadline constraint requires that the sum of the offset and the routing path transmission time must be less than the maximum delay.
[0079] Step 206 : Obtain the queue length of the target port, and calculate the score of each candidate offset corresponding to each data flow to be transmitted based on the queue length, the candidate offset corresponding to each data flow to be transmitted, and the frame capacity.
[0080] The queue length refers to the total amount of data that can be accommodated in the cache queue. Queues are used to temporarily store data flows to be transmitted. The score is the ratio of the maximum available queue length to the frame capacity of the data flow to be transmitted. A higher score indicates a lesser impact on latency-sensitive network resources during transmission, better switch scheduling performance, and a higher transmission rate for the data flow to be transmitted.
[0081] Exemplarily, the switch obtains the queue length of the target port, and calculates a score for each candidate offset corresponding to each data flow to be transmitted based on the queue length, the candidate offset corresponding to each data flow to be transmitted, and the frame capacity.
[0082] Step 208 : For each data stream to be transmitted, the scores of the candidate offsets are compared to determine the target offset of the data stream to be transmitted.
[0083] The target offset is the offset used to transmit the data stream to be transmitted. It can be understood that the target offset is the highest-scoring candidate offset among the candidate offsets corresponding to the data stream to be transmitted. The target offset determines the waiting time for the first data frame in the data stream to be transmitted.
[0084] Exemplarily, for each data flow to be transmitted, the switch compares the scores of the candidate offsets corresponding to each data flow to be transmitted, and determines the target offset of each data flow to be transmitted.
[0085] Step 210: Transmit multiple data streams to be transmitted based on the target offset of each data stream to be transmitted.
[0086] Exemplarily, the switch transmits multiple data flows to be transmitted based on the target offset of each data flow to be transmitted.
[0087] In one embodiment, the switch determines the transmission order of each data frame in each data stream to be transmitted based on the target offset and transmission interval period of each data stream to be transmitted, and transmits the data frames in each data stream to be transmitted based on the transmission order.
[0088] In the above-mentioned data stream transmission method, a score for each candidate offset of each data stream to be transmitted is calculated. The score is the ratio of the maximum available queue length to the frame capacity corresponding to the data stream to be transmitted. A larger maximum available queue length indicates higher queue resource availability, and a smaller frame capacity corresponding to the data stream to be transmitted indicates a higher transmission rate for the data stream to be transmitted. A higher score indicates a lower impact of the data stream on delay-sensitive network resources during transmission, higher switch scheduling performance, and a higher transmission rate for the data stream to be transmitted. For each data stream to be transmitted, a target offset for the data stream to be transmitted is determined based on the score of each candidate offset corresponding to the data stream to be transmitted. The highest target offset score indicates that the switch has the highest scheduling performance when transmitting the data stream to be transmitted at the target offset. The transmission order of each data frame in multiple data streams to be transmitted is determined based on the target offsets of each data stream to be transmitted. This fully utilizes the transmission interval time slices between data frames in the same data stream to be transmitted, reduces time slice waste, and further improves data stream transmission efficiency.
[0089] In one embodiment, Figure 3 As shown, based on the transmission interval period, routing path and maximum delay corresponding to the data stream to be transmitted, determining the candidate offset corresponding to the data stream to be transmitted includes:
[0090] Step 302, based on the transmission interval period corresponding to the data stream to be transmitted, determine the reference offset corresponding to the data stream to be transmitted; the reference offset is less than the transmission interval period, the reference offset is an integer multiple of the time slice, the transmission interval period is an integer multiple of the time slice, and the time slice is the set duration for the target port to transmit a data frame.
[0091] The reference offset is an offset less than the transmission interval. There can be one or more reference offsets. For example, if the transmission interval of the data stream to be transmitted is 4T, where T is the time slice, then the reference offsets of the data stream to be transmitted are 0T, 1T, 2T, and 3T.
[0092] Exemplarily, the switch determines, based on the transmission interval period corresponding to the data stream to be transmitted, a time slice that is smaller than an integer multiple of the transmission interval period as a reference offset corresponding to the data stream to be transmitted.
[0093] Step 304: Based on the routing path corresponding to the data flow to be transmitted, the number of transmission nodes included in the routing path is obtained.
[0094] The number of transmission nodes refers to the number of switches that the routing path passes through. The number of transmission nodes can be one or more.
[0095] Exemplarily, the switch obtains the transmission nodes included in the routing path corresponding to the data flow to be transmitted, and counts the included transmission nodes to obtain the number of transmission nodes.
[0096] Step 306: Determine a candidate offset from reference offsets corresponding to the data stream to be transmitted based on the number of transmission nodes and the maximum delay corresponding to the data stream to be transmitted.
[0097] Exemplarily, the switch determines the candidate offset from the reference offsets corresponding to the data flow to be transmitted according to the number of transmission nodes and the maximum delay corresponding to the data flow to be transmitted.
[0098] In one embodiment, the switch determines the transmission delay based on the number of transmission nodes and the time slice, determines a reference delay corresponding to the candidate offset based on the transmission delay and the candidate offset, compares the reference delay with the maximum delay, and if the reference delay is less than the maximum delay, determines that the reference offset corresponding to the reference delay is the candidate offset.
[0099] In this embodiment, a time slice that is an integer multiple smaller than the transmission interval period is determined as a reference time slice, and then a candidate offset is determined from the reference offset based on the routing path and the maximum delay. Even if the data stream to be transmitted is transmitted based on the candidate offset, the transmission delay of the data stream to be transmitted is guaranteed to not exceed the maximum delay, thereby improving the rationality of the candidate offset.
[0100] In one embodiment, based on the number of transmission nodes and the maximum delay corresponding to the data stream to be transmitted, determining the candidate offset from the reference offset corresponding to the data stream to be transmitted includes:
[0101] The number of transmission nodes and time slices are combined to obtain the transmission time corresponding to the routing path; for each reference offset, the reference offset and transmission time are counted to obtain the reference delay of the data stream to be transmitted under the reference offset; the reference offset corresponding to the reference delay that is less than or equal to the maximum delay is determined as the candidate offset.
[0102] Here, convergence refers to multiplication. Transmission time refers to the time interval between the transmission of a data stream from the switch to the receiving host. Reference latency refers to the time interval between the transmission of a data stream from the switch to the receiving host at the reference offset. In other words, reference latency is the sum of transmission time and reference offset.
[0103] Exemplarily, the switch multiplies the number of transmission nodes corresponding to the data stream to be transmitted by the time slice to obtain the transmission time of the data stream to be transmitted from the switch to the receiving node. For each reference offset, the reference offset and the transmission time are added to obtain the reference delay for transmission of the data stream to be transmitted under the reference offset. The reference delay corresponding to each reference offset is compared with the maximum delay. If the reference delay is less than or equal to the maximum delay, the reference offset corresponding to the reference delay is determined as the candidate offset.
[0104] In this embodiment, a reference offset corresponding to a reference delay that is less than or equal to the maximum delay is determined as a candidate offset. This ensures that when the data stream to be transmitted is transmitted based on the candidate offset, the reference delay of the data stream to be transmitted from the switch to the receiving host will not exceed the maximum delay. The transmission of the data stream to be transmitted meets the maximum delay requirement, thereby improving the rationality of the candidate offset.
[0105] In one embodiment, Figure 4 As shown, based on the queue length, the candidate offset corresponding to each data flow to be transmitted, and the frame capacity, calculating the score of each candidate offset corresponding to each data flow to be transmitted includes:
[0106] Step 402: Obtain a target data stream to be transmitted from a plurality of data streams to be transmitted, and obtain an offset to be scored from candidate offsets corresponding to the target data stream to be transmitted.
[0107] The target data stream to be transmitted refers to the data stream to be transmitted corresponding to the candidate offset for which the score is to be calculated. The offset to be scored refers to the candidate offset corresponding to the target data stream to be transmitted corresponding to which the score is to be calculated.
[0108] Exemplarily, the switch obtains a target data flow to be transmitted from multiple data flows to be transmitted, and obtains an offset to be scored from candidate offsets corresponding to the target data flow to be transmitted.
[0109] In one embodiment, the switch randomly obtains a target data flow to be transmitted from multiple data flows to be transmitted, and randomly obtains an offset to be scored from candidate offsets corresponding to the target data flow to be transmitted.
[0110] Step 404 : Calculate the maximum available queue length corresponding to the offset to be scored based on the offset to be scored, and the candidate offset and frame capacity corresponding to the non-target data flow to be transmitted.
[0111] The term "non-target data streams" refers to all data streams excluding the target data stream. The maximum available queue length is the remaining queue length after storing all data frames in the non-target data streams that must be stored before the first data frame of the target data stream, after combining the candidate offsets corresponding to the non-target data streams and the offset to be scored of the target data stream.
[0112] Exemplarily, the switch calculates the maximum available queue length corresponding to the offset to be scored based on the offset to be scored of the target data flow to be transmitted, and the candidate offsets and frame capacities corresponding to the non-target data flow to be transmitted.
[0113] In one embodiment, the switch determines a statistical data flow to be transmitted from the non-target data flow to be transmitted based on a size relationship between a maximum candidate offset corresponding to the non-target data flow to be transmitted and the offset to be scored; determines the number of statistical frames corresponding to the statistical data flow to be transmitted based on a size relationship between a transmission interval period corresponding to the statistical data flow to be transmitted and the offset to be scored; multiplies the number of statistical frames by the frame capacity corresponding to the statistical data flow to be transmitted to obtain a capacity to be counted corresponding to the statistical data flow to be transmitted; adds the capacities to be counted corresponding to the various statistical data flows to be transmitted to obtain a minimum occupied capacity; and subtracts the minimum occupied capacity from the queue length to obtain a maximum available queue length corresponding to the offset to be scored.
[0114] Step 406 : Obtain a score for the offset to be scored based on a ratio of the maximum available queue length to the frame capacity corresponding to the target data flow to be transmitted.
[0115] Exemplarily, the switch divides the maximum available queue length corresponding to the offset to be scored by the frame capacity corresponding to the target data flow to be transmitted to obtain the score of the offset to be scored.
[0116] In this embodiment, the score of the offset to be scored is determined based on the ratio of the maximum available queue length of the offset to be scored to the frame capacity corresponding to the target data flow to be transmitted, wherein a larger maximum available queue length indicates a higher availability of queue resources, and a smaller frame capacity corresponding to the data flow to be transmitted indicates a higher transmission rate of the data flow to be transmitted. The score can represent the impact of the data flow to be transmitted on delay-sensitive network resources during transmission, the scheduling performance of the switch, and the transmission rate of the data flow to be transmitted, providing an accurate basis for determining the target offset of the data flow to be transmitted.
[0117] In one embodiment, Figure 5 As shown, based on the offset to be scored, and the candidate offset and frame capacity corresponding to the non-target data flow to be transmitted, calculating the maximum available queue length corresponding to the offset to be scored includes:
[0118] Step 502: Obtain the maximum candidate offset of each non-target data stream to be transmitted.
[0119] The maximum candidate offset refers to the largest candidate offset among the candidate offsets corresponding to the non-target data stream to be transmitted.
[0120] Exemplarily, for each non-target data flow to be transmitted, the switch compares the candidate offsets corresponding to the non-target data flow to be transmitted, and determines a maximum candidate offset of the non-target data flow to be transmitted.
[0121] Step 504 : compare the maximum candidate offset of the non-target data stream to be transmitted with the offset to be scored, and determine the frame capacity corresponding to the non-target data stream to be transmitted whose maximum candidate offset is less than or equal to the offset to be scored as the capacity to be counted.
[0122] The capacity to be counted may be one or more.
[0123] Exemplarily, the switch compares the maximum candidate offset of each non-target data flow to be transmitted with the offset to be scored. If the maximum candidate offset of the non-target data flow to be transmitted is less than or equal to the offset to be scored, the frame capacity corresponding to the non-target data flow to be transmitted is determined as the capacity to be counted.
[0124] Step 506: Count the capacity to be counted to obtain the minimum occupied capacity corresponding to the offset to be scored.
[0125] The minimum occupied capacity refers to the minimum capacity occupied by a data frame in a non-target data stream to be transmitted before the first data frame in the target data stream to be transmitted is stored.
[0126] Exemplarily, the switch performs statistics on the determined capacity to be counted to obtain the minimum occupied capacity corresponding to the offset to be scored.
[0127] Step 508: Obtain the maximum available queue length corresponding to the offset to be scored based on the difference between the queue length and the minimum occupied capacity.
[0128] Exemplarily, the switch subtracts the minimum occupied capacity corresponding to the offset to be scored from the queue length corresponding to the target port to obtain the maximum available queue length corresponding to the offset to be scored.
[0129] In this embodiment, the maximum available queue length corresponding to the offset to be scored is calculated based on the offset to be scored, and the candidate offset and frame capacity corresponding to the non-target data flow to be transmitted, thereby improving the accuracy of the calculation of the maximum available queue length corresponding to the offset to be scored.
[0130] In one embodiment, Figure 6As shown, based on the target offset of each data stream to be transmitted, transmitting multiple data streams to be transmitted includes:
[0131] Step 602: Determine the transmission time slot and transmission time slice corresponding to each data frame in the data stream to be transmitted based on the target offset and transmission interval period corresponding to the data stream to be transmitted.
[0132] A time slot is a specific time period. A time slot is an integer multiple of a time slice. The time of the target transmission port is divided into multiple time slots, and each time slot is divided into multiple time slices. A sending time slot is a time slot in which a data frame is sent. A sending time slice is a time slice in which a data frame is sent. For example, there are three time slots, namely the first time slot, the second time slot, and the third time slot. Each time slot includes three time slices, and the first time slot includes T 11 、T 12 and T 13 , the second time slot includes T 21 、T 22 and T 23 , the third time slot includes T 31 、T 32 and T 33 , determine the second time slot as the sending time slot of the target data frame, and determine T 22 It is the sending time slice of the target data frame.
[0133] Exemplarily, the switch determines the transmission time slot and transmission time slice corresponding to each data frame in the data stream to be transmitted according to the target offset and the transmission interval period corresponding to the data stream to be transmitted.
[0134] Step 604 : determining a sending order of each data frame in a plurality of data streams to be transmitted based on the sending time slots and sending time slices corresponding to the data frames.
[0135] The sending order is the order in which the data frames are sent. This can be understood as the order in which the data frames are sent among all the data frames included in multiple data streams to be sent. The sending order can be identified by numbers or letters.
[0136] Exemplarily, the switch determines the sending order of each data frame in the plurality of data streams to be transmitted according to the sending time slot and the sending time slice corresponding to the data frame.
[0137] In one embodiment, the switch sorts the data frames according to the order of the time slots in the time slot queue and the time slice order in the time slots, obtains the arrangement order of all data frames in the multiple data streams to be transmitted, and determines the sending order of each data frame in the multiple data streams to be transmitted based on the arrangement order.
[0138] Step 606: Transmit each data frame in the multiple data streams to be transmitted based on the transmission order.
[0139] Exemplarily, the switch transmits each data frame in the plurality of data flows to be transmitted according to the transmission order of the data frames.
[0140] In this embodiment, the sending order of each data frame in multiple data streams to be transmitted is determined based on the sending time slots and sending time slices corresponding to the data frames. According to the sending order of the data frames, each data frame in the multiple data streams to be transmitted is transmitted, thereby fully utilizing the transmission interval time slices between data frames in the same data stream to be transmitted, reducing the waste of time slices, and improving the transmission efficiency of the data stream.
[0141] In one embodiment, determining a transmission time slot and a transmission time slice corresponding to each data frame in the data stream to be transmitted based on a target offset and a transmission interval period corresponding to the data stream to be transmitted includes:
[0142] Based on the target offset corresponding to the data stream to be transmitted, the sending time slice of the first data frame in the data stream to be transmitted is determined; based on the sending time slice of the first data frame and the transmission interval period corresponding to the data stream to be transmitted, the sending time slice corresponding to each data frame in the data stream to be transmitted is determined; based on the sending time slice corresponding to the data frame, the sending time slot corresponding to the sending time slice is determined; the sending time slot refers to the first idle time slot in the time slot queue corresponding to the sending time slice.
[0143] Among them, the time slot queue refers to a queue composed of multiple time slots corresponding to the target port. The multiple time slots in the time slot queue have a time sequence, and the time slots in the time slot queue can be increased according to actual needs. For example, the current time slot sequence includes a total of 3 time slots, namely the first time slot, the second time slot and the third time slot. The time period corresponding to the first time slot is from the first second to the tenth second, the time period corresponding to the second time slot is from the eleventh second to the twentieth second, and the time period corresponding to the third time slot is from the twenty-first second to the thirtieth second. The idle state time slot refers to the time slot where the first idle state time slot is located. For example, the sending time slot of the data frame is the first time slot, the first time slot of the first time slot is in the occupied state, the first time slot of the second time slot is in the occupied state, and the first time slot of the third time slot is in the idle state, then the third time slot is determined to be the sending time slot of the above-mentioned data frame.
[0144] Exemplarily, the switch determines the sending time slice of the first data frame in the data stream to be transmitted based on the target offset corresponding to the data stream to be transmitted, and then determines the sending time slice corresponding to each data frame in the data stream to be transmitted based on the sending time slice of the first data frame and the transmission interval period corresponding to the data stream to be transmitted, and finally determines the sending time slot corresponding to the sending time slice according to the sending time slice corresponding to the data frame.
[0145] In one embodiment, for a data stream to be transmitted, the switch determines the transmission time slice of the first data frame in the data stream to be transmitted based on the target offset corresponding to the data stream to be transmitted, determines the relative interval time slices of subsequent data frames based on the transmission interval period corresponding to the data stream to be transmitted and the order of subsequent data frames in the data stream to be transmitted, adds the relative interval time slice to the transmission time slice of the first data frame, and obtains the transmission time slices corresponding to the subsequent data frames. In this way, the transmission time slices of each data frame in the data stream to be transmitted are obtained. Then, based on the arrangement order of the time slots in the time slot queue, the current time slot is obtained, and the status of the transmission time slice in the current time slot is obtained. If the status of the transmission time slice in the current time slot is occupied, the next time slot of the current time slot is obtained as the current time slot. The above process is repeated until the status of the transmission time slice in the current time slot is idle or the status of the transmission time slice of the last time slot is occupied. If the status of the transmission time slice in the current time slot is idle, the current time slot corresponding to the idle state is determined as the transmission time slot. If the status of the transmission time slice of the last time slot is occupied, a new time slot is added to the time slot sequence and the new time slot is determined as the transmission time slot. For example, there are three data streams to be transmitted at the target port A, f1, f2 and f3, and f1 includes data frame f 11 、f 12 and f 13 , f2 includes the data frame f 21 、f 22 and f 23 , f3 includes the data frame f 31 and f 32 , the transmission intervals of f1, f2 and f3 are 1T, 2T and 4T respectively, the target offsets of f1, f2 and f3 are 0T, 1T and 3T respectively, where T is the time slice, the frame capacity of f1, f2 and f3 are 24 bits, 25 bits and 26 bits respectively. If the transmission of data frames in the data stream to be transmitted is arranged in the order of frame capacity from small to large, the following is obtained: Figure 7 The schedule shown.
[0146] In this embodiment, based on the target offset corresponding to the data stream to be transmitted and the transmission interval period corresponding to the data stream to be transmitted, the sending time slice corresponding to each data frame in the data stream to be transmitted is determined, and based on the sending time slice corresponding to the data frame, the first idle time slot in the time slot queue corresponding to the sending time slice is determined to be the sending time slot corresponding to the data frame, thereby fully utilizing the transmission interval time slices between data frames in the same data stream to be transmitted, reducing the waste of time slices, and improving the transmission efficiency of the data stream.
[0147] In an exemplary embodiment, the data stream transmission method includes the following steps:
[0148] The switch obtains multiple data streams to be transmitted corresponding to the target port, and then obtains the transmission interval period, frame capacity, routing path, and maximum delay corresponding to each data stream to be transmitted. For each data stream to be transmitted, a time slice that is less than an integer multiple of the transmission interval period is determined as the reference offset corresponding to the data stream to be transmitted, based on the transmission interval period corresponding to the data stream to be transmitted. The transmission nodes included in the routing path corresponding to the data stream to be transmitted are obtained, and the number of transmission nodes included is counted to obtain the number of transmission nodes. The number of transmission nodes corresponding to the data stream to be transmitted is multiplied by the time slice to obtain the transmission time of the data stream to be transmitted from the switch to the receiving node. For each reference offset, the reference offset and the transmission time are added to obtain the reference delay of the data stream to be transmitted at the reference offset. The reference delay corresponding to each reference offset is compared with the maximum delay. If the reference delay is less than or equal to the maximum delay, the reference offset corresponding to the reference delay is determined as a candidate offset. The candidate offset corresponding to each data stream to be transmitted is obtained using the above method.
[0149] A target data stream to be transmitted is obtained from multiple data streams to be transmitted, and an offset to be scored is obtained from the candidate offsets corresponding to the target data stream to be transmitted. The switch compares the candidate offsets corresponding to the non-target data streams to be transmitted, determines the maximum candidate offset of the non-target data streams to be transmitted, and compares the maximum candidate offset of each non-target data stream to be transmitted with the offset to be scored. If the maximum candidate offset of the non-target data stream to be transmitted is less than or equal to the offset to be scored, the frame capacity corresponding to the non-target data stream to be transmitted is determined as the capacity to be counted. The determined capacity to be counted is counted to obtain the minimum occupied capacity corresponding to the offset to be scored. The queue length corresponding to the target port is subtracted from the minimum occupied capacity corresponding to the offset to be scored to obtain the maximum available queue length corresponding to the offset to be scored. The maximum available queue length corresponding to the offset to be scored is divided by the frame capacity corresponding to the target data stream to obtain the score of the offset to be scored. The above method is used to calculate the score of each candidate offset corresponding to each data stream to be transmitted.
[0150] For each data stream to be transmitted, the scores of the candidate offsets corresponding to each data stream to be transmitted are compared, and the candidate offset corresponding to the largest score is determined as the target offset of the data stream to be transmitted, thereby obtaining the target offset of each data stream to be transmitted.
[0151] For a data stream to be transmitted, the switch determines the sending time slice of the first data frame in the data stream to be transmitted based on the target offset corresponding to the data stream to be transmitted, determines the relative interval time slices of subsequent data frames based on the transmission interval period corresponding to the data stream to be transmitted and the order of subsequent data frames in the data stream to be transmitted, adds the relative interval time slice to the sending time slice of the first data frame, and obtains the sending time slices corresponding to the subsequent data frames. In this way, the sending time slice of each data frame in the data stream to be transmitted is obtained. Then, based on the order of the time slots in the time slot queue, the current time slot is obtained, and the status of the transmission time slot in the current time slot is obtained. If the status of the transmission time slot in the current time slot is occupied, the next time slot of the current time slot is obtained as the current time slot. The above process is repeated until the status of the transmission time slot in the current time slot is idle or the status of the transmission time slot of the last time slot is occupied. If the status of the transmission time slot in the current time slot is idle, the current time slot corresponding to the idle state is determined as the transmission time slot. If the status of the transmission time slot of the last time slot is occupied, a new time slot is added to the time slot sequence and determined as the transmission time slot. Using the above method, the transmission time slot and transmission time slot corresponding to each data frame in multiple data streams to be transmitted are obtained.
[0152] The switch sorts the data frames according to the order of the time slots in the time slot queue corresponding to the target port and the time slice order in the time slot, obtains the arrangement order of all data frames in multiple data streams to be transmitted, determines the sending order of each data frame in the multiple data streams to be transmitted based on the arrangement order, and transmits each data frame in the multiple data streams to be transmitted according to the sending order of the data frames.
[0153] In the above-mentioned data stream transmission method, a score for each candidate offset of each data stream to be transmitted is calculated. The score is the ratio of the maximum available queue length to the frame capacity corresponding to the data stream to be transmitted. A larger maximum available queue length indicates higher queue resource availability, and a smaller frame capacity corresponding to the data stream to be transmitted indicates a higher transmission rate for the data stream to be transmitted. A higher score indicates a lower impact of the data stream on delay-sensitive network resources during transmission, higher switch scheduling performance, and a higher transmission rate for the data stream to be transmitted. For each data stream to be transmitted, a target offset for the data stream to be transmitted is determined based on the score of each candidate offset corresponding to the data stream to be transmitted. The highest target offset score indicates that the switch has the highest scheduling performance when transmitting the data stream to be transmitted at the target offset. The transmission order of each data frame in multiple data streams to be transmitted is determined based on the target offsets of each data stream to be transmitted. This fully utilizes the transmission interval time slices between data frames in the same data stream to be transmitted, reduces time slice waste, and further improves data stream transmission efficiency.
[0154] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0155] Based on the same inventive concept, embodiments of the present application further provide a data stream transmission device for implementing the aforementioned data stream transmission method. The implementation solution provided by this device is similar to the implementation solution described in the aforementioned method. Therefore, the specific limitations in one or more embodiments of the data stream transmission device provided below can be found in the above-mentioned limitations on the data stream transmission method and will not be further elaborated here.
[0156] In one embodiment, Figure 8 As shown, a data stream transmission device is provided, including: an acquisition module 802, a candidate module 804, a scoring module 806, a comparison module 808 and a transmission module 810, wherein:
[0157] An acquisition module 802 is configured to acquire multiple data streams to be transmitted corresponding to a target port, as well as a transmission interval period, frame capacity, routing path, and maximum delay corresponding to each data stream to be transmitted;
[0158] A candidate module 804 is configured to determine a candidate offset corresponding to the data stream to be transmitted based on a transmission interval period, a routing path, and a maximum delay corresponding to the data stream to be transmitted;
[0159] Scoring module 806 is configured to obtain a queue length of a target port and calculate a score for each candidate offset corresponding to each data flow to be transmitted based on the queue length, the candidate offset corresponding to each data flow to be transmitted, and the frame capacity;
[0160] A comparison module 808 is configured to compare the scores of the candidate offsets for each data stream to be transmitted, and determine a target offset for the data stream to be transmitted;
[0161] The transmission module 810 is configured to transmit a plurality of data streams to be transmitted based on a target offset of each data stream to be transmitted.
[0162] In one embodiment, the candidate module 804 is further used to: determine a reference offset corresponding to the data stream to be transmitted based on the transmission interval period corresponding to the data stream to be transmitted; the reference offset is less than the transmission interval period, the reference offset is an integer multiple of the time slice, the transmission interval period is an integer multiple of the time slice, and the time slice is a set duration for the target port to transmit a data frame; based on the routing path corresponding to the data stream to be transmitted, obtain the number of transmission nodes included in the routing path; based on the number of transmission nodes corresponding to the data stream to be transmitted and the maximum delay, determine the candidate offset from the reference offset corresponding to the data stream to be transmitted.
[0163] In one embodiment, the candidate module 804 is further used to: merge the number of transmission nodes and the time slice to obtain the transmission time corresponding to the routing path; for each reference offset, perform statistics on the reference offset and the transmission time to obtain the reference delay for transmitting the data stream to be transmitted under the reference offset; and determine the reference offset corresponding to the reference delay that is less than or equal to the maximum delay as the candidate offset.
[0164] In one embodiment, the scoring module 806 is further used to: obtain a target data stream to be transmitted from multiple data streams to be transmitted, and obtain an offset to be scored from the candidate offsets corresponding to the target data stream to be transmitted; calculate the maximum available queue length corresponding to the offset to be scored based on the offset to be scored, and the candidate offsets and frame capacity corresponding to the non-target data stream to be transmitted; and obtain a score for the offset to be scored based on the ratio of the maximum available queue length to the frame capacity corresponding to the target data stream to be transmitted.
[0165] In one embodiment, the scoring module 806 is further used to: obtain the maximum candidate offset of each non-target data flow to be transmitted respectively; compare the maximum candidate offset of the non-target data flow to be transmitted with the offset to be scored, and determine the frame capacity corresponding to the non-target data flow to be transmitted whose maximum candidate offset is less than or equal to the offset to be scored as the capacity to be counted; perform statistics on the capacity to be counted to obtain the minimum occupied capacity corresponding to the offset to be scored; and obtain the maximum available queue length corresponding to the offset to be scored based on the difference between the queue length and the minimum occupied capacity.
[0166] In one embodiment, the transmission module 810 is further used to: determine the transmission time slot and transmission time slice corresponding to each data frame in the data stream to be transmitted based on the target offset and transmission interval period corresponding to the data stream to be transmitted; determine the transmission order of each data frame in multiple data streams to be transmitted based on the transmission time slot and transmission time slice corresponding to the data frame; and transmit each data frame in multiple data streams to be transmitted based on the transmission order.
[0167] In one embodiment, the transmission module 810 is also used to: determine the sending time slice of the first data frame in the data stream to be transmitted based on the target offset corresponding to the data stream to be transmitted; determine the sending time slice corresponding to each data frame in the data stream to be transmitted based on the sending time slice of the first data frame and the transmission interval period corresponding to the data stream to be transmitted; determine the sending time slot corresponding to the sending time slice based on the sending time slice corresponding to the data frame; the sending time slot refers to the first idle time slot in the time slot queue corresponding to the sending time slice.
[0168] Each module in the above-mentioned data stream transmission device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0169] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 9As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface, the display unit and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a data stream transmission method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse.
[0170] Those skilled in the art will understand that Figure 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0171] In one embodiment, a computer device is further provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.
[0172] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0173] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0174] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0175] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.
[0176] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0177] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A data stream transmission method, characterized in that: The method comprises: Acquire multiple data streams to be transmitted corresponding to the target port, as well as the transmission interval period, frame capacity, routing path and maximum delay corresponding to each of the data streams to be transmitted; Determining a reference offset corresponding to the data stream to be transmitted based on a transmission interval period corresponding to the data stream to be transmitted; the reference offset is smaller than the transmission interval period, the reference offset is an integer multiple of a time slice, the transmission interval period is an integer multiple of the time slice, and the time slice is a set duration for the target port to transmit a data frame; Based on the routing path corresponding to the data stream to be transmitted, obtaining the number of transmission nodes included in the routing path; Merging the number of transmission nodes and the time slice to obtain the transmission time corresponding to the routing path; For each of the reference offsets, performing statistics on the reference offset and the transmission time to obtain a reference delay for transmitting the data stream to be transmitted at the reference offset; Determine a reference offset corresponding to the reference delay that is less than or equal to the maximum delay as a candidate offset; Obtaining a queue length of the target port, and calculating a score for each candidate offset corresponding to each data flow to be transmitted based on the queue length, the candidate offset corresponding to each data flow to be transmitted, and the frame capacity; For each of the data streams to be transmitted, comparing the scores of the candidate offsets to determine a target offset of the data stream to be transmitted; The multiple data streams to be transmitted are transmitted based on the target offset of each of the data streams to be transmitted.
2. The method according to claim 1, characterized in that The reference offset is one or more.
3. The method according to claim 1, characterized in that Calculating a score of each candidate offset corresponding to each data stream to be transmitted based on the queue length, the candidate offset corresponding to each data stream to be transmitted, and the frame capacity includes: Obtaining a target data stream to be transmitted from the plurality of data streams to be transmitted, and obtaining an offset to be scored from candidate offsets corresponding to the target data stream to be transmitted; Calculating a maximum available queue length corresponding to the offset to be scored based on the offset to be scored, and a candidate offset and a frame capacity corresponding to the non-target data flow to be transmitted; The score of the offset to be scored is obtained according to the ratio of the maximum available queue length to the frame capacity corresponding to the target data flow to be transmitted.
4. The method according to claim 3, characterized in that Calculating the maximum available queue length corresponding to the offset to be scored based on the offset to be scored, and the candidate offset and frame capacity corresponding to the non-target data flow to be transmitted includes: Obtaining a maximum candidate offset for each of the non-target data streams to be transmitted; Comparing the maximum candidate offset of the non-target to-be-transmitted data stream with the offset to be scored, and determining the frame capacity corresponding to the non-target to-be-transmitted data stream whose maximum candidate offset is less than or equal to the offset to be scored as the capacity to be counted; Performing statistics on the capacity to be counted to obtain the minimum occupied capacity corresponding to the offset to be scored; According to the difference between the queue length and the minimum occupied capacity, a maximum available queue length corresponding to the offset to be scored is obtained.
5. The method according to claim 1, characterized in that The transmitting the multiple data streams to be transmitted based on the target offset of each of the data streams to be transmitted includes: Determining a transmission time slot and a transmission time slice corresponding to each data frame in the data stream to be transmitted based on a target offset and a transmission interval period corresponding to the data stream to be transmitted; Determining a sending order of each data frame in the plurality of data streams to be transmitted based on a sending time slot and a sending time slice corresponding to the data frame; Based on the sending order, each data frame in the multiple data streams to be transmitted is transmitted.
6. The method according to claim 5, characterized in that The determining, based on the target offset and the transmission interval period corresponding to the data stream to be transmitted, a transmission time slot and a transmission time slice corresponding to each data frame in the data stream to be transmitted comprises: Determining a sending time slice of a first data frame in the data stream to be transmitted based on a target offset corresponding to the data stream to be transmitted; Determine, based on the sending time slice of the first data frame and the transmission interval period corresponding to the data stream to be transmitted, a sending time slice corresponding to each data frame in the data stream to be transmitted; Based on the sending time slice corresponding to the data frame, a sending time slot corresponding to the sending time slice is determined; the sending time slot refers to the first idle state time slot in the time slot queue corresponding to the sending time slice.
7. A data stream transmission device, characterized in that: The device comprises: An acquisition module is used to acquire multiple data streams to be transmitted corresponding to the target port, as well as the transmission interval period, frame capacity, routing path and maximum delay corresponding to each of the data streams to be transmitted; a candidate module, configured to determine a reference offset corresponding to the data stream to be transmitted based on a transmission interval period corresponding to the data stream to be transmitted; the reference offset is smaller than the transmission interval period, the reference offset is an integer multiple of a time slice, the transmission interval period is an integer multiple of the time slice, and the time slice is a set duration for the target port to transmit a data frame; based on a routing path corresponding to the data stream to be transmitted, obtain the number of transmission nodes included in the routing path; fuse the number of transmission nodes and the time slice to obtain a transmission time corresponding to the routing path; for each reference offset, perform statistics on the reference offset and the transmission time to obtain a reference delay for transmission of the data stream to be transmitted under the reference offset; determine a reference offset corresponding to the reference delay that is smaller than or equal to the maximum delay as a candidate offset; a scoring module, configured to obtain a queue length of the target port, and calculate a score for each candidate offset corresponding to each data flow to be transmitted based on the queue length, the candidate offset corresponding to each data flow to be transmitted, and the frame capacity; a comparison module, configured to compare the scores of the candidate offsets for each of the data streams to be transmitted, and determine a target offset for the data stream to be transmitted; The transmission module is configured to transmit the multiple data streams to be transmitted based on the target offset of each of the data streams to be transmitted.
8. The device according to claim 7, characterized in that The scoring module is also used to: Obtaining a target data stream to be transmitted from the plurality of data streams to be transmitted, and obtaining an offset to be scored from candidate offsets corresponding to the target data stream to be transmitted; Calculating a maximum available queue length corresponding to the offset to be scored based on the offset to be scored, and a candidate offset and a frame capacity corresponding to the non-target data flow to be transmitted; The score of the offset to be scored is obtained according to the ratio of the maximum available queue length to the frame capacity corresponding to the target data flow to be transmitted.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Optimized dynamic bandwidth scheduler
CN103430486A
Network flow control method and device
CN106789698A