A message control method, a flow table update method, and a node device.

By setting up a first queue and a second queue in the network device, combined with dynamic updates of the flow table and queue priority levels, the queue congestion problem is solved, and flexible scheduling and fair transmission of isolated flow packets are achieved.

CN116614442BActive Publication Date: 2026-05-26HUAWEI TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUAWEI TECH CO LTD
Filing Date
2018-07-09
Publication Date
2026-05-26

Smart Images

  • Figure CN116614442B_ABST
    Figure CN116614442B_ABST
Patent Text Reader

Abstract

A message control method, a flow table update method, and a node device are disclosed. The node device includes a first queue and a second queue. The method includes: the node device acquiring a first message; the node device determining that the data flow to which the first message belongs is marked as an isolated flow; if the first queue and / or the second queue meet a first preset condition, the node device controlling the first message to enter the first queue for scheduling; if the first queue and / or the second queue meet a second preset condition, the node device controlling the first message to enter the second queue for scheduling. In this way, the node device can flexibly control which queue a message from a data flow marked as an isolated flow enters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data transmission, and in particular to a message control method, a flow table update method, and a node device. Background Technology

[0002] With the widespread adoption of the internet, information exchange has become an indispensable part of people's daily lives. Consequently, the transmission of information (such as business data streams) between network devices is gradually increasing. Currently, network devices can transmit data streams using queues (following a first-in, first-out mechanism). For example, a network device can store multiple packets of data streams to be sent in a queue. When a packet at the head of the queue is dequeued, the network device sends that packet to other network devices.

[0003] However, if the number of packets in a data stream in a queue is large, the packets at the tail of the queue may be unable to leave the queue for a long time, leading to queue congestion. Summary of the Invention

[0004] This application provides a message control method, a flow table update method, and a node device to solve the technical problem of alleviating queue congestion.

[0005] In a first aspect, embodiments of this application provide a message control method, which can be executed by a node device, such as a switch or server in a data center network. The node device includes a first queue and a second queue; the method includes: the node device acquiring a first message; the node device determining that the data stream to which the first message belongs is marked as an isolated stream; if the first queue and / or the second queue meet a first preset condition, the node device controlling the first message to enter the first queue to await scheduling; if the first queue and / or the second queue meet a second preset condition, the node device controlling the first message to enter the second queue to await scheduling.

[0006] In some embodiments of this application, if the data stream to which the first packet belongs is marked as an isolated stream, the node can control whether the first packet enters the first queue or the second queue based on the different conditions of the first queue and / or the second queue. For example, when the first queue and / or the second queue meet a first preset condition, the node controls the first packet to enter the first queue. When the first queue and / or the second queue meet a second preset condition, the node controls the first packet to enter the second queue. In this way, the node can flexibly control which queue the packets of the data stream marked as an isolated stream enter.

[0007] In one possible design, the first queue and / or the second queue satisfy a first preset condition, including: the first queue and / or the second queue satisfying one or more of the following conditions: the current count of pending messages in the first queue is less than or equal to a first threshold; the current count of pending messages in the first queue is less than the first threshold; the current count of pending messages in the second queue is less than or equal to a second threshold; the current count of pending messages in the second queue is less than the second threshold; the sum of the current counts of pending messages in the second queue and the first queue is less than or equal to a third threshold; the sum of the current counts of pending messages in the second queue and the first queue is less than the third threshold.

[0008] In some embodiments of this application, the node device can determine whether the first queue and / or the second queue meet a first preset condition based on the packet count of the first queue and / or the second queue. For example, when the packet count in the first queue is low, i.e., the first queue meets the first preset condition, the node device controls the first packet to enter the first queue. In this way, the node can flexibly control which queue the packets of the data stream marked as an isolated stream enter.

[0009] In one possible design, the first threshold and / or the second threshold and / or the third threshold are less than the queue switching threshold of the first queue; wherein, if the number of messages currently waiting to be scheduled in the first queue exceeds the queue switching threshold of the first queue, subsequent messages in the first queue enter the second queue.

[0010] In some embodiments of this application, when a node sets the specific values ​​of the first threshold and / or the second threshold and / or the third threshold, it can refer to the queue switching threshold of the first queue. For example, the first threshold can be less than the queue switching threshold of the first queue. Since the first threshold is less than the queue switching threshold of the first queue, when the number of packets currently stored in the first queue is less than or equal to the first threshold, it indicates that the current congestion level of the first queue is relatively low, and the probability that subsequent packets of this data stream will exceed the first queue switching threshold after entering the first queue is relatively low, that is, the probability of triggering a switch to the second queue again is relatively low. In this way, it helps to improve the accuracy of the first threshold set by the node device.

[0011] In one possible design, the node device determines that the data stream to which the first message belongs is marked as an isolated stream by: the node device querying the flow table to see if the data stream identification information of the data stream exists; if the data stream identification information of the data stream exists in the flow table, the node device determines that the data stream is marked as an isolated stream.

[0012] In some embodiments of this application, a node device can determine whether a first packet is marked as an isolated flow by querying a flow table. The flow table may only include data flow identification information; that is, data flows whose data flow identification information exists in the flow table are marked as isolated flows, and data flows whose data flow identification information does not exist in the flow table are non-isolated flows. In this approach, the flow table is relatively simple and consumes fewer resources (such as storage hardware resources).

[0013] In one possible design, the node device determines that the data stream to which the first message belongs is marked as an isolated stream, including: if the node device finds in the flow table that the isolation identifier of the data stream is a first isolation identifier, the node device determines that the data stream is marked as an isolated stream.

[0014] In some embodiments of this application, a node device can determine whether a first packet is marked as an isolated flow by querying a flow table. The flow table may include data flow identification information for each data flow and an isolation identifier corresponding to the data flow identification information. When the isolation identifier is the first isolation identifier, it indicates that the data flow corresponding to the data flow identification information is marked as an isolated flow. This flow table clearly records whether each data flow is isolated or non-isolated, making it easy to understand and use.

[0015] In one possible design, the flow table also includes a packet count for the data flow. After the node device controls the first packet to enter the second queue, the node device increments the packet count in the flow table; when a packet of the data flow in the second queue is dequeued, the node device decrements the packet count.

[0016] In some embodiments of this application, nodes can update the flow table in real time. When a packet from a data flow is dequeued from the second queue, the packet count of that data flow is decreased; when a packet from a data flow is enqueued from the second queue, the packet count of that data flow is increased. Dynamic updates to the flow table facilitate real-time counting of the packet count for each data flow in the second queue, making it convenient to use.

[0017] In one possible design, the flow table also includes a packet count for the data flow. After the node device controls the first packet to enter the second queue, the node device increments the packet count in the flow table; when a packet of the data flow in the second queue is dequeued, the node device decrements the packet count.

[0018] In some embodiments of this application, nodes can update the flow table in real time. When a packet from a data flow is dequeued from the second queue, the packet count of that data flow is decreased; when a packet from a data flow is enqueued from the second queue, the packet count of that data flow is increased. Dynamic updates to the flow table facilitate real-time counting of the packet count for each data flow in the second queue, making it convenient to use.

[0019] In one possible design, when the packet count of the data stream in the flow table decreases to zero, the node device removes the data stream identification information of the data stream from the flow table.

[0020] In some embodiments of this application, the flow table can be dynamically updated. When all packets of a data flow in the second queue have been dequeued, the node can delete the information of that data flow from the flow table. In this way, on the one hand, hardware resources are saved, and on the other hand, the data flow can be restored from an isolated flow to a non-isolated flow in a timely manner (the data flow identification information does not exist and the data flow in the flow table is not a non-isolated flow).

[0021] In one possible design, when the packet count of the data flow in the flow table decreases to zero, the node device modifies the first isolation identifier of the data flow to a second isolation identifier, which is used to indicate that the data flow is a non-isolated flow.

[0022] In some embodiments of this application, the flow table can be dynamically updated. Once all packets for a data flow in the second queue have been dequeued, the first isolation identifier of that data flow can be modified to the second isolation identifier. In this way, the node can promptly restore the data flow from an isolated flow to a non-isolated flow.

[0023] In one possible design, the node device determines that the data stream to which the first packet belongs is marked as a non-isolated stream; the node device controls the first packet to enter the first queue to wait for scheduling.

[0024] In some embodiments of this application, when a data stream to which a packet belongs is marked as a non-isolated stream, the node places the packet into a first queue. When a data stream to which a packet belongs is marked as an isolated stream, the node determines whether the packet should enter the first or second queue based on the specific conditions of the first and second queues. In this way, the node can flexibly control which queue packets from isolated or non-isolated streams enter.

[0025] In one possible design, the first queue has the same priority as the data stream, and the second queue has a lower priority than the first queue.

[0026] In some embodiments of this application, nodes can establish a mapping relationship between the priority level of a data stream and the priority level of a queue. For example, packets from a data stream with a higher priority can enter a first queue with a higher priority, and packets from a data stream with a lower priority can enter a second queue with a lower priority. In the prior art, packets from a data stream with a higher priority enter the first queue. If the number of packets currently existing in the first queue exceeds the queue switching threshold (the data stream is marked as an isolated stream), subsequent packets from that data stream enter the second queue. Therefore, for subsequent packets from a data stream marked as an isolated stream, they can only enter the second queue with a lower priority, meaning that subsequent packets from a data stream with a higher priority can only enter the second queue with a lower priority, resulting in a loss of fairness for that data stream. However, in this embodiment, the node obtains the first packet. If the data stream to which the first packet belongs is marked as an isolated stream, the node can control whether the first packet enters the first queue or the second queue based on the different situations of the first queue and / or the second queue. In other words, the solution in this application embodiment can realize the queue recovery of the data stream marked as an isolated stream, that is, the subsequent packets of the data stream marked as an isolated stream enter the first queue.

[0027] In one possible design, the message count includes the total number of all messages in the data stream in the second queue or the total number of bytes occupied by all messages.

[0028] In some embodiments of this application, message counting may also be other counting methods, and this application does not limit this method.

[0029] Secondly, embodiments of this application provide a flow table update method, which can be executed by a node device, such as a switch or server in a data center network. The method includes: the node device acquiring a first packet; if the data flow to which the first packet belongs is marked as an isolated flow, the node device controlling the first packet to enter a first queue awaiting scheduling; the node device incrementing the first packet count of the data flow in the flow table; wherein the first packet count indicates the total number of packets belonging to the data flow existing in the first queue before the first packet enters the first queue; and when a packet of the data flow is dequeued from the first queue, the node device decrements the first packet count.

[0030] In some embodiments of this application, nodes can update the flow table in real time. When a packet from a data flow is dequeued from the first queue, the packet count of that data flow is decreased; when a packet from a data flow is enqueued into the first queue, the packet count of that data flow is increased. Dynamic updates to the flow table facilitate real-time counting of the packet count for each data flow in the first queue, making it convenient to use.

[0031] In one possible design, when the count of the first message recorded in the flow table decreases to zero, the node device marks the data flow as a non-isolated flow.

[0032] In some embodiments of this application, the node can update the flow table in real time. When the count of the first packet recorded in the flow table decreases to zero, the node device marks the data flow as a non-isolated flow. In this way, the node can promptly restore the data flow marked as an isolated flow to a non-isolated flow.

[0033] In one possible design, the node device marks the data stream as a non-isolated stream by: the node device modifying a first isolation identifier corresponding to the data stream in the flow table to a second isolation identifier; wherein the first isolation identifier is used to indicate that the data stream is an isolated stream, and the second isolation identifier is used to indicate that the data stream is a non-isolated stream.

[0034] In some embodiments of this application, if the flow table includes an isolation identifier for a data flow, then when the first packet count of the data flow recorded in the flow table decreases to zero, the node device modifies the first isolation identifier corresponding to the data flow in the flow table to a second isolation identifier. In this way, the node can promptly restore a data flow marked as an isolated flow to a non-isolated flow.

[0035] In one possible design, the flow table includes data flow identification information of the data flow and a packet count corresponding to the data flow identification information. The node device increments the first packet count of the data flow in the flow table by: the node device determining a first packet count corresponding to the first data flow identification information of the data flow in the flow table, and the node device incrementing the first packet count; after the node device decrements the first packet count, the method further includes: when the first packet count recorded in the flow table decreases to zero, the node device deleting the first packet count and the first data flow identification information from the flow table.

[0036] In some embodiments of this application, when the first packet count of the data stream recorded in the flow table decreases to zero, the node device deletes the first packet count and the first data stream identification information of the data stream from the flow table. In this way, on the one hand, hardware resources occupied by the flow table can be saved; on the other hand, isolated flows can be promptly restored to non-isolated flows (data streams whose data stream identification information does not exist in the flow table are non-isolated flows).

[0037] Thirdly, embodiments of this application provide a node device that implements the functions of the node device in the above-described method design. These functions can be implemented in hardware or by hardware executing corresponding software. The hardware or software includes one or more units corresponding to the above-described functions.

[0038] In one possible design, the specific structure of the node device may include an acquisition unit and a processing unit. The acquisition unit and the processing unit may perform the corresponding functions in the method provided by the first aspect or any possible design of the first aspect described above.

[0039] Fourthly, embodiments of this application provide a node device that implements the functions of the node device in the above-described method design. These functions can be implemented in hardware or by hardware executing corresponding software. The hardware or software includes one or more units corresponding to the above-described functions.

[0040] In one possible design, the specific structure of the node device may include an acquisition unit and a processing unit. The acquisition unit and the processing unit may perform the corresponding functions in the method provided by the second aspect or any possible design of the second aspect described above.

[0041] Fifthly, a node device is provided. The node device includes: a memory for storing computer-executable program code; a transceiver; and a processor coupled to the memory and the transceiver. The program code stored in the memory includes instructions that, when executed by the processor, cause the node device to perform the methods described in the first aspect or any possible design of the first aspect.

[0042] Sixthly, a node device is provided. The node device includes: a memory for storing computer-executable program code; a transceiver; and a processor coupled to the memory and the transceiver. The program code stored in the memory includes instructions that, when executed by the processor, cause the node device to perform the methods described in the second aspect or any possible design of the second aspect.

[0043] In a seventh aspect, embodiments of this application also provide a computer-readable storage medium comprising a computer program that, when executed on a node device, causes the node device to perform the method of the first aspect or any possible design of the first aspect described above.

[0044] Eighthly, this application also provides a computer-readable storage medium comprising a computer program that, when run on a node device, causes the node device to perform the method of the second aspect or any possible design of the second aspect described above.

[0045] In a ninth aspect, embodiments of this application also provide a method comprising a computer program product, which, when the computer program product is run on a node device, causes the node device to perform the first aspect or any possible design of the first aspect described above.

[0046] In a tenth aspect, embodiments of this application also provide a method comprising a computer program product, which, when the computer program product is run on a node device, causes the node device to perform the second aspect or any possible design of the second aspect described above. Attached Figure Description

[0047] Figure 1 A schematic diagram of a data center network provided in an embodiment of this application;

[0048] Figure 2 A schematic diagram of another data center network provided in an embodiment of this application;

[0049] Figure 3 A schematic diagram illustrating queue congestion isolation provided in an embodiment of this application;

[0050] Figure 4 A schematic diagram illustrating an application scenario provided in an embodiment of this application;

[0051] Figure 5 A schematic diagram illustrating the flow of a message control method provided in an embodiment of this application;

[0052] Figure 6 A schematic diagram of a flow table provided in an embodiment of this application;

[0053] Figure 7 A schematic diagram of another flow table provided in an embodiment of this application;

[0054] Figure 8 A schematic diagram illustrating the process of a message entering a first queue or a second queue, as provided in the embodiments of this application;

[0055] Figure 9 A flowchart illustrating a flow table update method provided in an embodiment of this application;

[0056] Figure 10 A schematic diagram of another flow table provided in an embodiment of this application;

[0057] Figure 11A schematic diagram of yet another flow table provided in an embodiment of this application;

[0058] Figure 12 A schematic diagram illustrating the flow table update process provided in an embodiment of this application;

[0059] Figure 13 A schematic diagram illustrating the flow table update process provided in an embodiment of this application;

[0060] Figure 14 A schematic diagram illustrating the flow table update process provided in an embodiment of this application;

[0061] Figure 15 This is a schematic diagram of the structure of a node device provided in an embodiment of this application;

[0062] Figure 16 This is a schematic diagram of another node device provided in an embodiment of this application;

[0063] Figure 17 This is a schematic diagram of the structure of another node device provided in an embodiment of this application. Detailed Implementation

[0064] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.

[0065] The following explanations of some terms used in this application are provided to facilitate understanding by those skilled in the art.

[0066] The node devices involved in the embodiments of this application include devices capable of network communication. These include, for example, base stations (e.g., access points), terminal devices (also referred to as user equipment (UE)), and other devices with communication functions; this embodiment of the invention does not limit the scope of these devices. Terminal devices include mobile phones (or "cellular" phones), or vehicle-mounted mobile devices, smart wearable devices, personal digital assistants (PDAs), smartwatches, smart helmets, smart glasses, smart bracelets, and other devices. Base stations may include evolved NodeBs (NodeBs, eNBs, or e-NodeBs) in Long Term Evolution (LTE) systems or evolved LTE-Advanced (LTE-A) systems, or may include next-generation node Bs (gNBs) in 5G systems; this embodiment of the invention does not limit the scope of these devices.

[0067] It should be noted that the node devices involved in the embodiments of this application can also be other node devices (for ease of description, device nodes will be referred to as nodes in the following text). For example, node devices can also include any device in a data center network or other non-data center network. The device can be a switch, router, network card, etc. Among them, there can be various network architectures of data center networks or non-data center networks, such as CLOS architecture, Mesh architecture, or Torus architecture, etc., and this application does not limit them in the embodiments. For ease of description, the following description only uses a data center network with CLOS architecture as an example.

[0068] Figure 1 A schematic diagram of a data center network with a CLOS architecture is shown. Figure 1 The example shown is a secondary CLOS network for the data center. Figure 1 As shown, the data center network may include servers for providing various services. In addition to servers, it also includes various types of switches such as TOR switches and SPINE switches. The TOR switches are configured on the links between the servers and the SPINE switches. The uplink ports of the TOR switches are used to connect to the SPINE switches, while the downlink ports are used to connect to the servers. Each TOR switch can connect to multiple SPINE switches through multiple uplink ports. Each server can also connect to at least one TOR switch through at least one network interface card (NIC).

[0069] When the data center is large and contains many servers and TOR switches, an AGG switch can also be installed on the link between the TOR switch and the SPINE switch (see [link]). Figure 2 As shown, Figure 2 (Taking the data center network as a three-level CLOS network as an example). The downlink port of the AGG switch is used to connect to at least one TOR switch, and the uplink port is used to connect to at least one SPINE switch.

[0070] The data stream involved in the embodiments of this application includes at least one message. Information exchange between two nodes typically involves the transmission of a data stream between them. For example, a sending node sends multiple messages of a data stream to a receiving node separately. After receiving the multiple messages, the receiving node integrates them into a data stream.

[0071] The data flow identification information involved in this application embodiment can be used to determine information or combinations of information for a data flow. Through this identification information, a node can uniquely identify a data flow corresponding to that identification information. For example, a data flow may include multiple packets, each packet may include a 5-tuple consisting of source IP, destination IP, protocol number, source port number, and destination port number, such as in an overlay network. If the 5-tuples included in each of the multiple packets are the same, then the multiple packets belong to the same data flow. Of course, each packet can also be a triple or other types of information or combinations of information, such as a six-tuple. Taking VXLAN as an example, each packet may include a six-tuple consisting of source IP, destination IP, protocol number, source port number, destination port number, and VNI. If the six-tuples included in each of the multiple packets are the same, then the multiple packets belong to the same data flow. In this application embodiment, the number of tuples included in each packet is not limited.

[0072] In this application, "multiple" refers to two or more.

[0073] In addition, it should be understood that in the description of this application, the words "first" and "second" are used only for the purpose of distinguishing descriptions and should not be construed as indicating or implying relative importance or order.

[0074] The following section introduces the background technology related to this application.

[0075] Currently, nodes can schedule data stream transmissions using queues (following a first-in, first-out mechanism). For example, a node stores multiple packets from a data stream to be sent in a queue. When a packet at the head of the queue is dequeued, the node sends that packet to other nodes. However, if a queue contains a large number of data stream packets, packets at the tail of the queue may be unable to dequeue for a long time, leading to queue congestion.

[0076] To minimize queue congestion, nodes can currently employ congestion isolation (CI) technology. This means that when the total number of packets in a queue exceeds the queue switching threshold, the node marks that data stream as an isolated stream. When a data stream is marked as isolated, subsequent packets from that stream are stored in a second queue.

[0077] For example, please see Figure 3 ,like Figure 3In (a) of the diagram, after packets 1-6 of a data stream enter the first queue, if the packet count in the first queue exceeds the queue switching threshold (which is 5), the data stream is marked as an isolated stream. That is, subsequent packets of this data stream (e.g., packets 7-9) enter the second queue. If more packets follow this data stream, those additional packets also enter the second queue. Therefore, for a data stream marked as an isolated stream, subsequent packets will always be transmitted through the second queue. This method is relatively simple and inflexible. For example, please refer to [link to relevant documentation]. Figure 1 In (b), if the first queue is not currently congested (e.g., the first queue is empty) or the congestion level is low (e.g., the number of packets currently existing in the first queue is low), subsequent packets of the data stream marked as an isolated flow can only enter the second queue. That is, the first queue is idle but not being used properly.

[0078] In this embodiment, a node may include a first queue and a second queue, and the node acquires a first packet. If the data stream to which the first packet belongs is marked as an isolated stream, the node can control whether the first packet enters the first queue or the second queue based on the different conditions of the first queue and / or the second queue. For example, when the first queue and / or the second queue meet a first preset condition, the node controls the first packet to enter the first queue. When the first queue and / or the second queue meet a second preset condition, the node controls the first packet to enter the second queue, instead of allowing all packets from data streams marked as isolated streams to enter only the second queue. In this way, the node can more flexibly control which queue the data streams marked as isolated streams enter.

[0079] The application scenarios of this application embodiment can be: Figure 1 or Figure 2 The data center network shown can also be other data center networks or other non-data center networks. For the sake of illustrating the scheme of this application, Figure 4 This illustrates a simple application scenario. Figure 4 In this example, we take an application scenario involving two nodes, specifically the first switch and the second switch. Figure 4 The first and second switches in the system can be Figure 1 or Figure 2 Any two adjacent switches in the array. It should be understood that... Figure 4 This is just one example of an application scenario. In actual applications, nodes are not limited to switches.

[0080] In this system, the first switch sends data stream packets to the second switch via a sending queue, and the second switch receives the data stream packets sent by the first switch via a receiving buffer queue. The first switch's sending queue includes two queues: a first queue and a second queue. After receiving a first packet, if the data stream to which the first packet belongs is marked as an isolated stream, the node device can control whether the first packet enters the first queue or the second queue, depending on the status of the first queue and / or the second queue. Similarly, the second switch's receiving buffer queue includes two queues: a third queue and a fourth queue. After receiving a first packet from the first switch, if the data stream to which the first packet belongs is marked as an isolated stream, the second switch can control whether the first packet enters the third queue or the fourth queue, depending on the status of the third queue and / or the fourth queue.

[0081] The technical solutions provided by the embodiments of the present invention will be described below with reference to the accompanying drawings. In the following description, the technical solutions provided by the present invention will be applied to... Figure 4 The example shown is an application scenario.

[0082] Please see Figure 5 An embodiment of the present invention provides a message control method, the process of which is described below.

[0083] S501: The node obtains the first message, the node including the first queue and the second queue.

[0084] In the embodiments of this application, there are several ways for a node to obtain the first message. For example, a node can generate the first message itself (e.g., when the node is the source of the data stream, it can generate the first message). Another example is that a node can receive the first message sent by other nodes, such as when the node is... Figure 4 Taking the second switch as an example, the second switch can receive the first message sent from the first switch.

[0085] In this embodiment, the node has two queues, namely a first queue and a second queue. The node can be... Figure 2 The node is either a first switch or a second switch. If the node is a first switch, the first queue and the second queue are sending queues; if the node is a second switch, the first queue and the second queue are receiving buffer queues. That is, the first queue and the second queue involved in this application embodiment can be either sending queues or receiving buffer queues in a node. In this application embodiment, the first queue can be one queue or multiple queues; similarly, the second queue can be one queue or multiple queues, and this application embodiment does not limit this.

[0086] In this embodiment, the priority levels of the first queue and the second queue can be different. Taking the example where the first queue has a higher priority than the second queue, nodes can process packets in the higher-priority queue first. Nodes can assign different priority levels to data streams of different services based on their urgency. For example, data streams of more urgent services (such as those requiring low latency) have a higher priority, while data streams of non-urgent services (such as those without latency requirements) have a lower priority. Nodes can establish a mapping relationship between the priority levels of data streams and the priority levels of queues. For example, packets from a higher-priority data stream can enter the higher-priority first queue, and packets from a lower-priority data stream can enter the lower-priority second queue. In this example, if the number of packets currently existing in the first queue exceeds the queue switching threshold, subsequent packets from that data stream enter the second queue.

[0087] In existing technologies, packets from higher-priority data streams enter a first queue. If the number of packets currently existing in the first queue exceeds a queue switching threshold, subsequent packets from that data stream enter a second queue. Therefore, subsequent packets from a data stream marked as an isolated stream can only enter the lower-priority second queue, resulting in a loss of fairness for that data stream. However, in this embodiment, the node obtains the first packet. If the data stream to which the first packet belongs is marked as an isolated stream, the node can control whether the first packet enters the first or second queue based on the different situations of the first and / or second queues. In other words, the solution in this embodiment can restore the queues of data streams marked as isolated, meaning that subsequent packets from data streams marked as isolated enter the first queue.

[0088] In this embodiment, the first queue and the second queue can have the same priority. For example, the first queue can be the main queue, and the second queue can be the backup queue. A data stream's packets first enter the first queue. When the number of packets currently existing in the first queue exceeds the queue switching threshold, subsequent packets of that data stream enter the second queue.

[0089] After a node obtains the first message, it can control whether the first message enters the first queue or the second queue, depending on whether the data stream to which the first message belongs is marked as an isolated stream.

[0090] S502: The node determines that the data stream to which the first message belongs is marked as an isolated stream.

[0091] In this application embodiment, there may be a variety of reasons why a data stream to which a message belongs is marked as an isolated stream.

[0092] Example 1: After a data stream's packets enter the first queue, if the current packet count stored in the first queue exceeds the queue switching threshold, the node marks the data stream as an isolated stream, meaning subsequent packets from this data stream enter the second queue. Example 2: After a data stream's packets enter the first queue, the node can determine if the number of bytes occupied by the data stream to which the packets belong is greater than a preset number of bytes (elephant stream). If so, the node can mark the data stream as an isolated stream, meaning subsequent packets from this data stream enter the second queue. Example 3: If multiple packets from a data stream enter the first queue consecutively within a short period, the node can mark this data stream as an isolated stream.

[0093] In this embodiment, a node can mark a data stream as an isolated stream using flow table records. One possible implementation is as follows: as in Example 1 above, after a data stream's packet enters the first queue, if the current packet count stored in the first queue exceeds the queue switching threshold, the node adds the data stream's identification information to the flow table, i.e., the data stream is marked as an isolated stream. If another data stream's packet enters the first queue, and the current packet count stored in the first queue does not exceed the queue switching threshold, the node does not add the data stream's identification information to the flow table. In this approach, the flow table only includes the identification information of isolated streams; that is, data streams whose identification information exists in the flow table are marked as isolated streams, and data streams whose identification information does not exist in the flow table are non-isolated streams. For example, please refer to... Figure 6 This is a schematic diagram of a possible flow table provided in an embodiment of this application. Figure 6 In the flow table, data flow identification information is included.

[0094] It should be understood that when a node starts, the flow table can be empty or there is no flow table. When a data flow's packet enters the first queue and the current packet count stored in the first queue exceeds the queue switching threshold of the first queue, the node device creates a flow table and adds the data flow identification information of the data flow to the created flow table; or the node device adds the data flow identification information of the data flow to an existing empty flow table.

[0095] Another possible implementation is that the node stores the data stream identification information of each data stream in a flow table, with each data stream identification information corresponding to an isolation identifier. The isolation identifier indicates whether the data stream corresponding to the identifier is an isolated stream or a non-isolated stream. For example, when the isolation identifier is 1, it indicates that the data stream corresponding to the identifier is an isolated stream; when the isolation identifier is 0, it indicates that the data stream corresponding to the identifier is a non-isolated stream. Of course, the isolation identifier can have other identifiers besides 1 and 0, such as using the words "isolated stream" and "non-isolated stream," which is not limited in this embodiment. As in Example 1 above, after a packet from a data stream enters the first queue, if the current packet count stored in the first queue exceeds the queue switching threshold of the first queue, the node marks the isolation identifier of that data stream as 1 in the flow table. If a packet from another data stream enters the first queue, and the current packet count stored in the first queue does not exceed the queue switching threshold of the first queue, the node marks the isolation identifier of that data stream as 0 in the flow table. In this method, the flow table includes the data stream identification information and the isolation identifier for each data stream. For example, please refer to Figure 5 This is a schematic diagram of another possible flow table provided in an embodiment of this application. Figure 7 In the flow table, each data flow includes its own data flow identification information and isolation identifier.

[0096] In this embodiment of the application, after a node obtains the first message, it can determine the data stream to which the first message belongs based on the information carried in the message (for example, each message can carry data stream identification information of the data stream to which each message belongs). Then, the node determines whether the data stream to which the first message belongs is marked as an isolated stream.

[0097] As an example, nodes can set data flow identification information for the data flow of a service based on its type. For instance, the data flow identification information for a web search service's data flow might be "Data Flow Identification Information 1," while the data flow identification information for an emergency call service's data flow might be "Data Flow Identification Information 2." These "Data Flow Identification Information 1" and "Data Flow Identification Information 2" are just examples; in practice, data flow identification information can have various naming conventions. For instance, it can be a binary number, with each binary number corresponding to a service type. Typically, a data flow can include multiple messages, and each message within a data flow carries the data flow identification information for that data flow. For example, each message in the web search service's data flow carries "Data Flow Identification Information 1," and each message in the emergency call service's data flow carries "Data Flow Identification Information 2." Since a data flow can contain more than one message, each message can also carry a message identifier to distinguish between different messages. For example, the data flow of a web search service consists of 10 messages. The first message carries data flow identification information, namely "data flow identification information 1", as well as the message identifier of the first message.

[0098] As discussed above, a node can mark a data stream as an isolated stream through flow table records. Therefore, after a node obtains the first packet and determines the data stream to which the first packet belongs based on the information carried in the packet, it can determine that the data stream is marked as an isolated stream by looking up the flow table.

[0099] For example, please continue to see Figure 6 .exist Figure 6 In the flow table, the identification information of the data flow is included. After the node determines the data flow to which the first message belongs, it then... Figure 6 The flow table shown is used to check if the identification information of the data flow to which the first packet belongs exists. If it exists, the data flow to which the first packet belongs is marked as an isolated flow. If it does not exist, the data flow to which the first packet belongs is not marked as an isolated flow, i.e., a non-isolated flow. In this method, the data flow identification information exists in the flow table, the data flow is an isolated flow, and the data flow identification information does not exist in the flow table, the data flow is a non-isolated flow. The flow table is relatively simple and occupies fewer resources (such as storage hardware resources).

[0100] For example, please continue to see Figure 7 .exist Figure 7 In the flow table, data flow identification information and isolation identifiers are included. After a node determines the data flow to which the first packet belongs, it then... Figure 5The flow table shown is used to query the isolation identifier corresponding to the data flow identification information to which the first message belongs. If the isolation identifier is 1, the data flow to which the first message belongs is an isolated flow; if the isolation identifier is 0, the data flow to which the first message belongs is a non-isolated flow.

[0101] After a node determines that the data stream to which the first packet belongs has been marked as a non-isolated stream, the node controls the first packet to enter the first queue. After a node determines that the data stream to which the first packet belongs has been marked as an isolated stream, the node can control the first packet to enter either the first queue or the second queue, depending on the different conditions of the first queue and / or the second queue.

[0102] S503: If the first queue and / or the second queue meet the first preset condition, the node controls the first queue to enter the first queue to wait for scheduling.

[0103] In the embodiments of this application, the first queue and / or the second queue satisfying the first preset condition may include various situations, which will be illustrated below.

[0104] In the first scenario, the first queue meets a first preset condition. For example, the number of messages waiting to be scheduled in the first queue is relatively small, meaning the first queue meets the first preset condition.

[0105] In this embodiment, a first threshold may be stored in the node. When the current packet count in the first queue is less than or equal to the first threshold, the node determines that the first queue meets a first preset condition; or, when the current packet count in the first queue is less than the first threshold, the node determines that the first queue meets the first preset condition. In this embodiment, the first threshold may be set at the factory or customized by the user during use. In this way, when the current packet count stored in the first queue is less than or equal to the first threshold, it indicates that the current congestion level of the first queue is relatively low. The node can control subsequent packets marked as isolated flows to enter the first queue.

[0106] In this embodiment of the application, when setting the specific value of the first threshold, the queue switching threshold of the first queue can be referenced. For example, the first threshold can be less than the queue switching threshold of the first queue (as can be seen from the foregoing, when the current packet count in the first queue exceeds the queue switching threshold of the first queue, the subsequent packets of the first queue enter the second queue).

[0107] For example, please see Figure 8 ,like Figure 8In (a), when packets 1-5 of a data stream enter the first queue, since the queue switching threshold of the first queue is 5, the data stream is marked as an isolated stream, meaning that subsequent packets of this data stream (such as packet 6) enter the second queue. Figure 8 In (b), packets in the first queue are gradually dequeued. When there are currently two packets remaining in the first queue (packets 5 and 6), meaning the current packet count is less than the first threshold (the first threshold is 3), subsequent packets from the data stream marked as an isolated flow (e.g., packet 7) can enter the first queue. In this method, since the first threshold is less than the queue switching threshold of the first queue, when the current packet count stored in the first queue is less than or equal to the first threshold, it indicates that the current congestion level of the first queue is relatively low. Moreover, the probability that subsequent packets from this data stream will exceed the first queue switching threshold after entering the first queue is relatively low, meaning the probability of triggering a switch to the second queue is relatively low.

[0108] In the second scenario, the second queue meets the first preset condition. For example, the number of messages waiting to be scheduled in the second queue is relatively small, meaning the second queue meets the first preset condition.

[0109] In this embodiment, a second threshold can be stored in the node. When the current packet count in the second queue is less than or equal to the second threshold, the node determines that the second queue meets a first preset condition; or, when the current packet count in the second queue is less than the second threshold, the node determines that the second queue meets the first preset condition. In this embodiment, the second threshold can be factory-set or user-defined. In this approach, when the current packet count in the second queue is less than or equal to the second threshold, it indicates that the current packet count in the second queue is low. To clear the packets in the second queue as quickly as possible, the node can control packets marked as isolated flows to enter the first queue.

[0110] This is because, by Figure 6 As shown in the flow table, this flow table records the identification information of the data flows in the second queue. If all packets of a certain data flow can be dequeued from the second queue as quickly as possible, the node can delete the identification information of that data flow from the second queue. This saves hardware resources, and since the identification information of that data flow is no longer in the flow table, the data flow is restored from an isolated flow to a non-isolated flow. Therefore, in this way, the node can promptly restore data flows marked as isolated flows to non-isolated flows. (This part will be described in detail in another embodiment).

[0111] In this embodiment, when setting the second threshold, the node can refer to the queue switching threshold of the first queue. For example, the second threshold can be less than the queue switching threshold of the first queue. Continuing with... Figure 8 For example, the queue switching threshold for the first queue is 5, and the second threshold is 2. When the current packet count in the second queue is less than the second threshold (the second threshold is 2), the node controls the packets of the data stream marked as isolated to enter the first queue.

[0112] The third scenario is that the first queue and the second queue meet the first preset condition. For example, when the sum of the counts of messages waiting to be scheduled in the second queue and the first queue is small, that is, when the first queue and the second queue meet the first preset condition.

[0113] In this embodiment, a third threshold may be stored in the node. When the count of pending packets in the second queue and the first queue is less than or equal to the third threshold, the node determines that the first queue and the second queue meet a first preset condition; or, when the count of pending packets in the second queue and the first queue is less than the third threshold, the node determines that the first queue and the second queue meet the first preset condition. In this embodiment, the third threshold may be set at the factory or customized by the user during use. In this way, when the sum of the packet count currently stored in the first queue and the packet count currently stored in the second queue is less than or equal to the third threshold, it indicates that the congestion level of the first queue and the second queue is relatively low. The node can control packets marked as isolated flows to enter the first queue.

[0114] In this embodiment, when setting the third threshold, the node can refer to the queue switching threshold of the first queue. For example, the third threshold can be less than the queue switching threshold of the first queue. Continuing with... Figure 8 Taking (b) as an example, the queue switching threshold for the first queue is 5, and the third threshold can be 4. When the sum of the current packet counts in the first and second queues (i.e., 3) is less than the third threshold (the third threshold is 4), the node controls the packets of the data stream marked as isolated flow to enter the first queue.

[0115] S304: If the first queue and / or the second queue meet the second preset condition, the node controls the first message to enter the second queue to wait for scheduling.

[0116] In the embodiments of this application, the second preset conditions for the first queue and / or the second queue can be of various kinds, which will be described below.

[0117] In the first scenario, the first queue meets the second preset condition, namely, the count of messages currently waiting to be scheduled in the first queue is greater than a fourth threshold. The fourth threshold can be greater than or equal to the first threshold.

[0118] In the second scenario, the second queue meets a second preset condition, namely, the count of messages currently waiting to be scheduled in the second queue is greater than a fifth threshold. The fifth threshold can be greater than or equal to the second threshold.

[0119] In the third scenario, the first queue and the second queue meet the second preset condition, namely, the sum of the counts of currently waiting-to-be-scheduled messages in the second queue and the first queue is greater than a sixth threshold. The sixth threshold may be greater than or equal to the third threshold.

[0120] As described above, in this embodiment, a node may include a first queue and a second queue, and the node acquires a first packet. If the data stream to which the first packet belongs is marked as an isolated stream, the node can control whether the first packet enters the first queue or the second queue based on the different conditions of the first queue and / or the second queue. For example, when the first queue and / or the second queue meet a first preset condition, the node controls the first packet to enter the first queue. When the first queue and / or the second queue meet a second preset condition, the node controls the first packet to enter the second queue. In this way, the node can flexibly control whether packets from data streams marked as isolated streams enter the first queue or the second queue.

[0121] exist Figure 5 In the illustrated embodiment, the node determines whether the data flow to which the first packet belongs is marked as an isolated flow or a non-isolated flow using the flow table. Another embodiment is described below, illustrating how the node updates the flow table.

[0122] Please see Figure 9 An embodiment of the present invention provides a flow table update method, the process of which is described as follows.

[0123] S901: The node obtains the first message.

[0124] S902: If the data stream to which the first message belongs is marked as an isolated stream, the node controls the first message to enter the first queue to wait for scheduling.

[0125] In this embodiment, if a data stream to which a packet belongs enters the second queue, and the current packet count in the second queue exceeds the queue switching threshold of the second queue, then the data stream is marked as an isolated stream, meaning that subsequent packets of that data stream enter the first queue. (It should be understood that in this embodiment, the first queue is...) Figure 5 The second queue in the illustrated embodiment, the second queue is... Figure 5 The first queue in the illustrated embodiment).

[0126] S903: The node increments the first message count of the data flow in the flow table, wherein the first message count is used to indicate the total number of messages belonging to the data flow that exist in the first queue before the first message enters the first queue.

[0127] S904: When a message from the data stream is dequeued from the first queue, the node decrements the first message count.

[0128] In this embodiment, the node can count the number of packets currently existing in the first queue or the second queue. For example, the node can do so in the aforementioned flow table (e.g., Figure 6 or Figure 8 Add a packet count (e.g., the packet count for each data stream in the first or second queue) to the flow table shown. Nodes can count only the packets currently existing in the first queue, or only the packets currently existing in the second queue, or count the packets currently existing in both the first and second queues separately.

[0129] In the first scenario, the node only counts the packets currently existing in the first queue; that is, the node only counts the packets from data streams marked as isolated flows. Please refer to [link / reference]. Figure 10 This application provides a schematic diagram of a possible flow table in an embodiment. Figure 8 As shown, the flow table includes data flow identification information and the corresponding packet count.

[0130] When a node counts the number of packets currently existing in the first queue, it can do so separately when packets are enqueued and dequeued. For example, when a packet from a data stream enters the first queue, the node can determine the first data stream identification information of that data stream, and then... Figure 8 The node queries the flow table to find the first packet count corresponding to the first data stream identification information. For example, if the data stream identification information of a data stream is "data stream identification information 1", then the node increments the first packet count corresponding to "data stream identification information 1". Another example is when a packet from a data stream is dequeued from the first queue, the node determines the first data stream identification information of that data stream, and then... Figure 10 The flow table shown is used to query the first packet count corresponding to the first data flow identification information. For example, if the data flow identification information of a data flow is "data flow identification information 1", then the node reduces the first packet count corresponding to "data flow identification information 1".

[0131] In the first scenario, since the flow table only records the packet count currently existing in the first queue, it is not necessary to add a queue identifier for the first queue to the flow table to save resources. Of course, in practical applications, a queue identifier for the first queue can be added to the flow table, and this embodiment does not limit this.

[0132] In the second scenario, the node counts the number of messages currently existing in the first and second queues, respectively.

[0133] Figure 11 A schematic diagram of a possible flow table provided in an embodiment of this application is shown. For example... Figure 11 As shown, the flow table includes queue identifiers, data flow identification information, isolation identifiers, and packet counts. The first queue is identified as queue 1, and the second queue is identified as queue 2. The first queue includes data flow 1 and data flow 2, and an isolation identifier of 1 indicates that data flow 1 and data flow 2 are isolated flows.

[0134] When a message enters the first queue, if Figure 11 The flow table shown contains identification information for the data flow to which the packet belongs, and the node increments the packet count corresponding to that data flow identification information. If Figure 11 If the flow table shown does not contain identification information for the data flow to which a packet belongs, the node can add the identification information for that data flow and increment the packet count corresponding to that identification information. When a packet is dequeued from the first queue, the node decrements the packet count of the data flow to which that packet belongs. The same applies to the second queue.

[0135] In this embodiment, the message count can be the number of messages, the number of bytes occupied by the messages, or other forms; this embodiment does not limit the specific form. Taking the message count as the number of messages as an example, after a message enters the first queue, the node increments the message count by one; after a message is dequeued from the first queue, the node decrements the message count by one. Taking the message count as the number of bytes occupied by the messages as an example, after a message enters the first queue, the node increments the message count by the number of bytes occupied by the message; after a message is dequeued from the first queue, the node decrements the message count by the number of bytes occupied by the message.

[0136] In the third scenario, the node only counts the packets currently existing in the second queue; that is, the node only counts the packets from the non-isolated data stream. Similar to the first scenario, it will not be elaborated upon here for the sake of brevity.

[0137] Once all packets of a data stream in a queue have been dequeued, meaning the packet count for that data stream is zero, the node can delete the relevant information for that data stream from the flow table.

[0138] If the flow table is Figure 10As shown in the flow table, once all packets with the data flow identification information "Data Flow Identification Information 1" have been dequeued from the second queue, the packet count corresponding to data flow identification information 1 becomes 0. A node can delete information related to a data flow from this flow table, such as deleting the first row. As explained above, data flow identification information exists... Figure 10 The data streams shown in the flow table are isolated streams; the data stream identification information is not present in the data stream table. Figure 10 The data flows shown in the flow table are non-isolated flows. Therefore, when all packets of a data flow in the first queue have been dequeued, the node removes the information of that data flow from the flow table, meaning that the data flow changes from an isolated flow to a non-isolated flow. In other words, subsequent packets of that data flow enter the second queue, thus completing the state recovery process of that data flow (changing from an isolated flow to a non-isolated flow).

[0139] For example, please see Figure 12 In (a) of the diagram, after packets from data flow 2 (unshaded squares in the diagram) (packets 0-3) enter the second queue, packets from data flow 1 (shaded squares in the diagram) (packets 0-1) also enter the second queue. When packet 1 from data flow 1 enters the second queue, the current packet count in the second queue exceeds the queue switching threshold (the queue switching threshold is 5). The node adds the identification information of data flow 1 and the packet count to the flow table (data flow 1 is marked as an isolated flow). For example, subsequent packets from data flow 1 (such as packets 2-3) enter the first queue. The node adds the packet count of data flow 1 to the flow table, that is, the packet count corresponding to data flow identification information 1 in the flow table is 2 (packets 2 + packets 3).

[0140] At this point, packet 4 from data flow 2 enters the second queue, but the number of packets currently in the second queue still exceeds the queue switching threshold. Therefore, the node adds the data flow identification information 2 and packet count of data flow 2 to the flow table; that is, data flow 2 is also marked as an isolated flow, and subsequent packets from data flow 2 enter the first queue. Figure 12 In (b), the subsequent message (message 5) of data stream 2 enters the first queue. The node adds a message count of data stream 2 to the flow table, with a value of 1 (message 5). When message 2 of data stream 1 is dequeued from the first queue, the node decrements the message count corresponding to data stream identification information 1 in the flow table by one.

[0141] like Figure 12 In step (c), after all packets of data flow 1 in the first queue have been dequeued, the node deletes the relevant information of data flow identification information 1 from the flow table, that is, data flow 1 changes from an isolated flow to a non-isolated flow. After that, subsequent packets of data flow 1 (such as packet 4) enter the second queue.

[0142] like Figure 12In step (d), after all packets of data flow 2 in the first queue have been dequeued, the node deletes the relevant information for data flow 2 from the flow table, meaning data flow 2 changes from an isolated flow to a non-isolated flow. Afterwards, subsequent packets of data flow 2 (such as packet 6) enter the second queue.

[0143] In existing technology, a node will only delete all information from the flow table when all packets in the first queue have been dequeued, i.e., when the first queue is empty. Figure 12 In processes (a)-(c), even if packets from data flow 1 (packets 2-3) have been dequeued from the first queue, the node will not delete the information of data flow 1 from the flow table because packet 5 from data flow 2 still exists in the first queue. That is, data flow 1 is still marked as an isolated flow, and subsequent packets from data flow 1 (such as packet 4) will still enter the first queue. Therefore, in the existing technology, the time required to clear all packets in the first queue may be long. If packets from a certain data flow have already been dequeued from the first queue, but because the first queue is not empty, the information of that data flow continues to exist in the flow table. In the existing technology, because the time required to clear all packets in the first queue may be long, on the one hand, the data flow cannot be restored to a non-isolated flow as soon as possible; on the other hand, the continued existence of the information of that data flow in the flow table occupies more resources (such as storage hardware resources), resulting in resource waste.

[0144] Depend on Figure 12 As shown in (a)-(c) of this application embodiment, the node updates the packet count of each data flow in the flow table in real time. When all packets of a certain data flow in the first queue have been dequeued, the relevant information of that data flow is deleted from the flow table, that is, the data flow is restored from an isolated flow to a non-isolated flow, and the subsequent packets of that data flow enter the second queue.

[0145] In this example, if the flow table is Figure 11 As shown in the flow table, once all packets with the data flow identification information "Identification Information 1" have been dequeued from the first queue, the packet count corresponding to data flow identification information 1 becomes 0. A node can then modify the isolation flag corresponding to "Identification Information 1" in the flow table from 1 to 0, meaning the data flow is restored from an isolated flow to a non-isolated flow, allowing subsequent packets of this data flow to enter the second queue.

[0146] by Figure 10 Using the flow table shown as an example, here is another example. Figure 13In (a) of the diagram, after packets from data flow 2 (unshaded squares in the diagram) (packets 0-3) enter the second queue, packets from data flow 1 (shaded squares in the diagram) (packets 0) also enter the second queue. When packet 0 from data flow 1 enters the second queue, the current packet count in the second queue equals the queue switching threshold of the second queue (the queue switching threshold is 5). Then, the data flow identification information and packet count of the data flow to which subsequent packets enter the second queue belong will be added to the flow table, meaning that the data flow to which the subsequent packets enter the second queue belong is an isolated flow. For example, if subsequent packets from data flow 1 (such as packets 1-2) enter the first queue, the node adds the data flow identification information 1 of data flow 1 and the corresponding packet count to the flow table, meaning that the packet count corresponding to data flow identification information 1 in the flow table is 2 (packets 1 + packets 2). For example, when a subsequent message of data flow 2 (such as message 4) enters the first queue, the node adds the data flow identification information of data flow 2 and the corresponding message count to the flow table. That is, the message count corresponding to data flow identification information 2 in the flow table is 1 (message 4).

[0147] like Figure 13 In (b), message 1 of data stream 1 in the first queue is dequeued, and the node modifies the message count corresponding to data stream identification information 1 in the flow table to 1 (message 2).

[0148] like Figure 13 In step (c), all packets of data stream 1 in the first queue are dequeued, and the node deletes the relevant information of data stream 1 in the flow table, that is, deletes the data stream identification information 1 and the packet count of data stream 1, that is, data stream 1 is restored from an isolated flow to a non-isolated flow.

[0149] like Figure 13 In step (d), all packets of data flow 2 in the first queue are dequeued, and the node deletes the relevant information of data flow 2 from the flow table, that is, it deletes the data flow identification information 2 and the packet count of data flow 2, that is, data flow 2 is restored from an isolated flow to a non-isolated flow. Subsequent packets of data flow 1 (such as packet 3) enter the second queue, and subsequent packets of data flow 2 (such as packet 5) enter the second queue.

[0150] by Figure 11 Taking the flow table shown as an example, let's take another example, such as... Figure 14 As shown in (a), packets from data flow 2 (unshaded cells in the diagram) (packets 0-3) enter the second queue. Then, packets from data flow 1 (shaded cells in the diagram) (packet 0) enter the second queue. At this point, the packet count in the second queue reaches the queue switching threshold (5), meaning that the data flow to which subsequent packets entering the second queue belong needs to be marked as an isolated flow. Therefore, the isolation flags for data flow 1 and data flow 2 in the flow table in (a) are 1 (isolated flow), so subsequent packets from data flow 1 or data flow 2 enter the first queue.

[0151] like Figure 14 As shown in (b), subsequent packets of data flow 1 (packets 1-2) enter the first queue, followed by subsequent packets of data flow 2 (packets 4). Therefore, in the flow table of (b), in the first queue, the packet count for data flow 1 is 2 (packets 1-2), and the packet count for data flow 2 is 1 (packets 1).

[0152] like Figure 14 As shown in (c), all packets of data stream 1 in the first queue are dequeued. Therefore, in the flow table of (c), the packet count of data stream 1 in the first queue is 0, that is, data stream 1 is restored from an isolated flow to a non-isolated flow. Therefore, in the flow table, the isolation flag of data stream 1 is changed from 1 (isolated flow) to 0 (non-isolated flow).

[0153] like Figure 14 As shown in (d), all packets of data flow 2 in the first queue are dequeued. Therefore, in the flow table of (d), the packet count of data flow 2 in the first queue is 0, meaning that data flow 2 has been restored from an isolated flow to a non-isolated flow. Thus, the isolation flag of data flow 2 in the flow table is changed from 1 (isolated flow) to 0 (non-isolated flow). Therefore, the subsequent packet of data flow 1 (packet 3) enters the second queue, and the subsequent packet of data flow 2 (packet 5) enters the second queue.

[0154] As described above, in this embodiment, nodes can update the flow table in real time. When a data flow's packets are dequeued, the packet count for that data flow is decreased; when a data flow's packets are enqueued, the packet count for that data flow is increased. When all packets for a data flow in the first queue have been dequeued, the information for that data flow can be deleted from the flow table. This helps save hardware resources and allows the data flow to be promptly restored from an isolated flow to a non-isolated flow.

[0155] The various embodiments of this application can be combined arbitrarily to achieve different technical effects.

[0156] The methods provided in the embodiments of this application above are described from the perspective of a node as the execution subject. To implement the functions of the methods provided in the embodiments of this application above, a node may include a hardware structure and / or a software module, implementing the above functions in the form of a hardware structure, a software module, or a combination of hardware and software modules. Whether a particular function is executed in the form of a hardware structure, a software module, or a combination of hardware and software modules depends on the specific application and design constraints of the technical solution.

[0157] The device provided in the embodiments of the present invention will now be described with reference to the accompanying drawings.

[0158] Figure 15 A schematic diagram of a node device 1500 is shown. This node device 1500 can implement the functions of the node devices mentioned above. The node device 1500 may include an acquisition unit 1501 and a processing unit 1502. The acquisition unit 1501 can be used to perform… Figure 5 S501 in the illustrated embodiment, and / or other processes used to support the techniques described herein. Processing unit 1502 can be used to execute... Figure 5 The embodiments shown include S502-S504, and / or other processes used to support the technology described herein. All relevant content regarding each step in the above method embodiments can be found in the functional descriptions of the corresponding functional modules, and will not be repeated here.

[0159] Figure 16 A schematic diagram of a node device 1600 is shown. This node device 1600 can implement the functions of the node devices mentioned above. The node device 1600 may include an acquisition unit 1601 and a processing unit 1602. The acquisition unit 1601 can be used to execute... Figure 9 S901 in the illustrated embodiment, and / or other processes used to support the techniques described herein. Processing unit 1602 can be used to execute... Figure 9 The embodiments shown include S902-S904, and / or other processes used to support the technology described herein. All relevant content regarding each step in the above method embodiments can be found in the functional descriptions of the corresponding functional modules, and will not be repeated here.

[0160] In this embodiment of the invention, node devices 1500 to 1600 are presented in the form of functional modules corresponding to each function, or they can be presented in an integrated manner. Here, "module" or "unit" can refer to an application-specific integrated circuit (ASIC), a processor and memory that executes one or more software or firmware programs, integrated logic circuits, and / or other devices that can provide the above functions.

[0161] In a simplified embodiment, those skilled in the art will recognize that any one of the node devices 1500 to 1600 can also be connected via, for example... Figure 17 The structure shown is implemented.

[0162] like Figure 17As shown, node device 1700 may include: memory 1701, processor 1702, system bus 1703, and communication interface 1704. The processor 1702, memory 1701, and communication interface 1704 are connected via system bus 1703. Memory 1701 stores computer-executable instructions. When node device 1700 is running, processor 1702 executes the computer-executable instructions stored in memory 1701 to cause node device 1700 to perform... Figure 5 The illustrated embodiments or Figure 9 The illustrated embodiment provides the method steps. Specific methods can be found in the description above and in the accompanying drawings, and will not be repeated here. The communication interface 1704 can be a transceiver, or a separate receiver and transmitter.

[0163] Optionally, the node device 1700 can be a field-programmable gate array (FPGA), an application-specific integrated circuit (ASIC), a system-on-chip (SoC), a central processing unit (CPU), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), or a programmable logic device (PLD) or other integrated chip. Alternatively, the node device 1700 can also be a standalone network element, such as a network device or a terminal device.

[0164] This invention also provides a computer storage medium, which may include a memory that stores a program, and the program, when executed, includes the aforementioned... Figure 5 All steps performed by the node device as described in the method embodiment shown.

[0165] This invention also provides a computer storage medium, which may include a memory that stores a program, and the program, when executed, includes the aforementioned... Figure 9 All steps performed by the node device as described in the method embodiment shown.

[0166] This invention also provides a computer program product that, when run on a node device, causes the node device to perform the aforementioned operations. Figure 5All steps performed by the node device as described in the method embodiment shown.

[0167] This invention also provides a computer program product that, when run on a node device, causes the node device to perform the aforementioned operations. Figure 9 All steps performed by the node device as described in the method embodiment shown.

[0168] Since the node devices 1500 to 1700 provided in this embodiment of the invention can be used to execute the above-described message control method, the technical effects they can achieve can be referred to the above-described method embodiments, and will not be repeated here.

[0169] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0170] Embodiments of the present invention are described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0171] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0172] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0173] Obviously, those skilled in the art can make various modifications and variations to the embodiments of the present invention without departing from the spirit and scope of this application. Therefore, if these modifications and variations to the embodiments of the present invention fall within the scope of the claims of this application and their equivalents, this application also intends to include these modifications and variations.

Claims

1. A message control method, characterized in that, The method is applied to a node device, the node device including a first queue and a second queue; the method includes: The node device acquires the first message; When the data stream to which the first message belongs is marked as an isolated stream, the node device controls the first message to enter the first queue or the second queue to wait for scheduling based on whether the first queue and / or the second queue meet preset conditions. Specifically, after the data stream to which the first message belongs enters the first queue, if the message count of the first queue exceeds the queue switching threshold of the first queue, or the number of bytes occupied by the data stream is greater than a preset number of bytes, or multiple messages of the data stream continuously enter the first queue within a first time period, the data stream is marked as an isolated stream. The node device controls the first message to enter the first queue or the second queue to wait for scheduling based on whether the first queue and / or the second queue meet preset conditions, including: If the first queue and / or the second queue meet the first preset condition, the node device controls the first message to enter the first queue to wait for scheduling; If the first queue and / or the second queue meet the second preset condition, the node device controls the first message to enter the second queue to wait for scheduling.

2. The method as described in claim 1, characterized in that, The first queue and / or the second queue satisfy a first preset condition, including: the first queue and / or the second queue satisfy one or more of the following conditions: The number of messages currently waiting to be scheduled in the first queue is less than or equal to the first threshold; The number of messages currently waiting to be scheduled in the first queue is less than the first threshold; The number of messages currently waiting to be scheduled in the second queue is less than or equal to the second threshold; The number of messages currently waiting to be scheduled in the second queue is less than the second threshold; The sum of the counts of messages currently waiting to be scheduled in the second queue and the first queue is less than or equal to the third threshold; The sum of the counts of messages currently waiting to be scheduled in the second queue and the first queue is less than the third threshold.

3. The method as described in claim 2, characterized in that, The first threshold and / or the second threshold and / or the third threshold are less than the queue switching threshold of the first queue; If the number of messages waiting to be scheduled in the first queue exceeds the queue switching threshold of the first queue, the subsequent messages in the first queue will enter the second queue.

4. The method according to any one of claims 1-3, characterized in that, The method further includes: The node device queries the flow table to see if the data flow identification information of the data flow exists; If the data flow identification information of the data flow exists in the flow table, the node device determines that the data flow is marked as an isolated flow.

5. The method as described in any one of claims 1-3, characterized in that, The method further includes: If the node device finds that the isolation identifier of the data flow is the first isolation identifier in the flow table, the node device determines that the data flow is marked as an isolated flow.

6. The method as described in claim 4, characterized in that, The flow table also includes a packet count of the data flow. After the node device controls the first packet to enter the second queue, the method further includes: The node device adds the packet count to the flow table; When a packet from the data stream in the second queue is dequeued, the node device decrements the packet count in the flow table.

7. The method as described in claim 5, characterized in that, The flow table also includes a packet count of the data flow. After the node device controls the first packet to enter the second queue, the method further includes: The node device adds the packet count to the flow table; When a packet from the data stream in the second queue is dequeued, the node device decrements the packet count in the flow table.

8. The method as described in claim 6, characterized in that, The method further includes: When the packet count of the data stream in the flow table decreases to zero, the node device removes the data stream identification information of the data stream from the flow table.

9. The method as described in claim 7, characterized in that, The method further includes: When the packet count of the data flow in the flow table decreases to zero, the node device modifies the first isolation identifier of the data flow to the second isolation identifier, which is used to indicate that the data flow is a non-isolated flow.

10. The method according to any one of claims 1-3, characterized in that, The method further includes: The node device determines that the data stream to which the first message belongs is marked as a non-isolated stream; The node device controls the first message to enter the first queue and wait for scheduling.

11. The method as described in claim 4, characterized in that, The method further includes: The node device determines that the data stream to which the first message belongs is marked as a non-isolated stream; The node device controls the first message to enter the first queue and wait for scheduling.

12. The method as described in claim 5, characterized in that, The method further includes: The node device determines that the data stream to which the first message belongs is marked as a non-isolated stream; The node device controls the first message to enter the first queue and wait for scheduling.

13. The method as described in claim 6, characterized in that, The method further includes: The node device determines that the data stream to which the first message belongs is marked as a non-isolated stream; The node device controls the first message to enter the first queue and wait for scheduling.

14. The method as described in claim 7, characterized in that, The method further includes: The node device determines that the data stream to which the first message belongs is marked as a non-isolated stream; The node device controls the first message to enter the first queue and wait for scheduling.

15. The method as described in claim 8, characterized in that, The method further includes: The node device determines that the data stream to which the first message belongs is marked as a non-isolated stream; The node device controls the first message to enter the first queue and wait for scheduling.

16. The method as described in claim 9, characterized in that, The method further includes: The node device determines that the data stream to which the first message belongs is marked as a non-isolated stream; The node device controls the first message to enter the first queue and wait for scheduling.

17. A node device, characterized in that, The node device includes: a processor and a memory; The memory is used to store one or more computer programs; when the one or more computer programs stored in the memory are executed by the processor, the node device causes the node device to perform the method as described in any one of claims 1 to 16.

18. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a computer program that, when run on a node device, causes the node device to perform the method as described in any one of claims 1 to 16.

19. A computer program product containing instructions, characterized in that, When the instructions are executed on a computer, the computer causes the computer to perform the method as described in any one of claims 1-16.