Flow control method and device, electronic equipment and storage medium

By dynamically allocating the third cache area, the problem that existing traffic control methods cannot distinguish service priority and resource waste when network congestion is performed is solved, and more efficient cache resource utilization and data transmission smoothness are achieved.

CN119172339APending Publication Date: 2024-12-20VISIONVERA INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411193540.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-28
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

The existing traffic control methods cannot distinguish the priority of different services when network congestion, resulting in a decline in service quality and a problem of wasted resource in business channel.

Method used

By obtaining channel information of each service channel, dynamically determine whether it is necessary to add a third cache area to the current service channel, and allocate the third cache area and the first cache area of ​​the target service channel with a priority lower than the current service channel. The cache area avoids sending paused frames directly and optimizes cache resource utilization.

Benefits of technology

Effectively utilize the cache area resources, reduce the frequency of paused frames, ensure the smooth progress of data services, avoid resource waste, and improve network stability and service quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119172339A_ABST
    Figure CN119172339A_ABST
Patent Text Reader

Abstract

The invention provides a flow control method and device, electronic equipment and a storage medium. The flow control method comprises the steps that channel information of each service channel is acquired, the channel information comprises data flow, cache information of a first cache region and cache information of a second cache region, and different service channels correspond to different priorities; aiming at the channel information of each service channel and the data flow of the current service channel, judging whether a third cache region needs to be added to the current service channel or not; when it is judged that a third cache region needs to be added to the current service channel, according to the channel information of the current service channel and the channel information of a target service channel with the priority lower than that of the current service channel, the third cache region is added to the current service channel from a second cache region of the current service channel, a second cache region of the target service channel and a first cache region of the target service channel; and distributing the third cache region for the current service channel. According to the invention, the resource waste of the cache region is avoided, and the use frequency of the pause frame is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network technology, and in particular to a flow control method, device, electronic equipment and storage medium. Background Art

[0002] Traffic control refers to the process of managing and regulating data traffic in a network. Traffic control aims to manage, control or reduce network traffic to ensure network stability and reliability. Through traffic control, network congestion, delays and packet loss can be reduced, thereby optimizing the utilization of network resources.

[0003] The current flow control method usually adopts a Pause frame mechanism or a PFC (Priority-based Flow Control) mechanism.

[0004] In the Pause frame mechanism, when the receiving buffer of the receiving device is about to overflow, a Pause frame is sent to the sending device to request it to stop sending data to avoid packet loss. However, when network congestion occurs, the Pause frame mechanism will suspend all traffic on the link and cannot distinguish the priorities of different services, which is unacceptable for network applications with high service quality requirements.

[0005] In the PFC mechanism, it adds the distinction and independent control of traffic of different priorities on the basis of the Pause frame mechanism, and establishes a mapping of service channels of different priorities between the sending device and the receiving device. The receiving device sends a Pause frame to the sending device for a service channel according to the cache status of each service channel when the cache of a service channel is about to overflow. After receiving the Pause frame, the sending device only pauses the traffic of the corresponding service channel without affecting other service channels. However, the PFC mechanism still sends a Pause frame when the cache is about to overflow, which leads to a high frequency of Pause frame use and waste of service channel resources. Summary of the invention

[0006] In view of the above problems, embodiments of the present invention are proposed to provide a flow control method, device, electronic device and storage medium that overcome the above problems or at least partially solve the above problems.

[0007] In a first aspect, an embodiment of the present invention discloses a flow control method, the method comprising:

[0008] Acquire channel information of each service channel, the channel information including data traffic, cache information of the first cache area, and cache information of the second cache area, and different service channels correspond to different priorities;

[0009] Based on the channel information of each service channel and the data flow of the current service channel, determining whether it is necessary to add a third buffer area for the current service channel;

[0010] When it is determined that a third cache area needs to be added to the current business channel, the third cache area is allocated to the current business channel from the second cache area of ​​the current business channel, the second cache area of ​​the target business channel, and the first cache area of ​​the target business channel based on the channel information of the current business channel and the channel information of the target business channel with a lower priority than the current business channel.

[0011] Optionally, the cache information includes occupied cache space, unoccupied cache space, and allocated service channels; the channel information for each service channel, and the data flow of the current service channel, determining whether it is necessary to add a third cache area for the current service channel, comprises:

[0012] When the data flow of the current service channel is greater than or equal to a set ratio of the total unoccupied buffer space allocated to the current service channel, it is determined that a third buffer area needs to be added to the current service channel.

[0013] Optionally, the cache information includes occupied cache space, unoccupied cache space, and allocated service channels; and the allocating the third cache area to the current service channel from the second cache area of ​​the current service channel, the second cache area of ​​the target service channel, and the first cache area of ​​the target service channel according to the channel information of the current service channel and the channel information of the target service channel having a lower priority than the current service channel, comprises:

[0014] The third cache area is allocated to the current business channel in the order of the second cache area of ​​the current business channel, the second cache area of ​​the target business channel, and the first cache area of ​​the target business channel, until the data flow of the current business channel is less than a set proportion of the total unoccupied cache space allocated to the current business channel, or the second cache area of ​​the current business channel, the second cache area of ​​the target business channel, and the first cache area of ​​the target business channel are all allocated.

[0015] Optionally, the method also includes: after the second cache area of ​​the current business channel, the second cache area of ​​the target business channel and the first cache area of ​​the target business channel are allocated, when the data traffic of the current business channel still cannot be met, sending a flow control frame corresponding to the current business channel to a sending device to notify the sending device to suspend data transmission of the current business channel, or to reduce the data transmission rate of the current business channel.

[0016] Optionally, after allocating the third buffer area to the current service channel, the method further includes:

[0017] The channel information of each service channel is obtained, and the channel information for each service channel and the data flow of the current service channel are returned to determine whether a third buffer area needs to be added for the current service channel.

[0018] Optionally, the method further comprises:

[0019] When it is determined that there is no need to add a third buffer area for the current service channel, determining whether it is necessary to release the third buffer area for the current service channel according to the data flow of the current service channel;

[0020] When it is determined that the third cache area needs to be released for the current business channel, the third cache area is released for the current business channel from the second cache area of ​​the current business channel, the second cache area of ​​the target business channel, and the first cache area of ​​the target business channel according to the channel information of the current business channel and the channel information of the target business channel.

[0021] Optionally, the cache information includes occupied cache space, unoccupied cache space, and allocated service channels; and judging whether it is necessary to release the third cache area for the current service channel according to the data flow of the current service channel includes:

[0022] When the difference between the sum of the unoccupied cache space allocated to the current service channel and the data flow of the current service channel is greater than or equal to the unoccupied cache space latest allocated to the current service channel, it is determined that the third cache area needs to be released for the current service channel.

[0023] Optionally, the cache information includes occupied cache space, unoccupied cache space, and allocated service channels; and releasing the third cache area for the current service channel from the second cache area of ​​the current service channel, the second cache area of ​​the target service channel, and the first cache area of ​​the target service channel according to the channel information of the current service channel and the channel information of the target service channel having a lower priority than the current service channel, comprises:

[0024] The third cache area allocated to the current business channel is released in sequence in the order of the first cache area of ​​the target business channel, the second cache area of ​​the target business channel, and the second cache area of ​​the current business channel, until the difference between the sum of the unoccupied cache space allocated to the current business channel and the data flow of the current business channel is less than the unoccupied cache space allocated to the current business channel at the latest.

[0025] In a second aspect, an embodiment of the present invention discloses a flow control device, the device comprising:

[0026] A first acquisition module is used to acquire channel information of each service channel, wherein the channel information includes data flow, cache information of the first cache area, and cache information of the second cache area, and different service channels correspond to different priorities;

[0027] A first judgment module, used for judging whether it is necessary to add a third buffer area for the current service channel according to the channel information of each service channel and the data flow of the current service channel;

[0028] The first adjustment module is used to allocate the third cache area for the current business channel from the second cache area of ​​the current business channel, the second cache area of ​​the target business channel and the first cache area of ​​the target business channel according to the channel information of the current business channel and the channel information of the target business channel with a lower priority than the current business channel when the first judgment module determines that a third cache area needs to be added to the current business channel.

[0029] Optionally, the cache information includes occupied cache space, unoccupied cache space and allocated service channels; the first judgment module is specifically used to determine the need to add a third cache area for the current service channel when the data traffic of the current service channel is greater than or equal to a set proportion of the total unoccupied cache space allocated to the current service channel.

[0030] Optionally, the cache information includes occupied cache space, unoccupied cache space and allocated service channels; the first adjustment module is specifically configured to

[0031] The third cache area is allocated to the current business channel in the order of the second cache area of ​​the current business channel, the second cache area of ​​the target business channel, and the first cache area of ​​the target business channel, until the data flow of the current business channel is less than a set proportion of the total unoccupied cache space allocated to the current business channel, or the second cache area of ​​the current business channel, the second cache area of ​​the target business channel, and the first cache area of ​​the target business channel are all allocated.

[0032] Optionally, the device also includes: a sending module, which is used to send a flow control frame corresponding to the current business channel to the sending device to notify the sending device to suspend data transmission of the current business channel, or reduce the data transmission rate of the current business channel when the data flow of the current business channel still cannot be met after the second buffer area of ​​the current business channel, the second buffer area of ​​the target business channel and the first buffer area of ​​the target business channel are allocated.

[0033] Optionally, the device further includes: a second acquisition module, configured to acquire channel information of each service channel and return the information to the first determination module after the first adjustment module allocates the third buffer area to the current service channel.

[0034] Optionally, the device further comprises:

[0035] A second judgment module, configured to judge whether it is necessary to release the third buffer area for the current service channel according to the data flow of the current service channel when the first judgment module judges that it is not necessary to add a third buffer area for the current service channel;

[0036] A second adjustment module is used to release the third cache area for the current business channel from the second cache area of ​​the current business channel, the second cache area of ​​the target business channel and the first cache area of ​​the target business channel according to the channel information of the current business channel and the channel information of the target business channel when the second judgment module determines that the third cache area needs to be released for the current business channel.

[0037] Optionally, the cache information includes occupied cache space, unoccupied cache space and allocated service channels; the second judgment module is specifically used to determine that the third cache area needs to be released for the current service channel when the difference between the total unoccupied cache space allocated to the current service channel and the data traffic of the current service channel is greater than or equal to the unoccupied cache space latest allocated to the current service channel.

[0038] Optionally, the cache information includes occupied cache space, unoccupied cache space and allocated service channels; the second adjustment module is specifically used to release the third cache area allocated to the current service channel in the order of the first cache area of ​​the target service channel, the second cache area of ​​the target service channel and the second cache area of ​​the current service channel, until the difference between the total unoccupied cache space allocated to the current service channel and the data flow of the current service channel is less than the unoccupied cache space allocated to the current service channel at the latest.

[0039] In a third aspect, an embodiment of the present invention discloses an electronic device, comprising a processor and a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium; when the computer program is executed by the processor, the processor executes a flow control method as described in any one of the above items.

[0040] In a fourth aspect, an embodiment of the present invention discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the processor executes a flow control method as described in any one of the above items.

[0041] In an embodiment of the present invention, the cache area of ​​each service channel is divided into a first cache area and a second cache area. According to the data flow of the current service channel, it is determined whether it is necessary to add a third cache area for the current service channel. When it is determined that the third cache area needs to be added to the current service channel, it means that the data flow of the current service channel cannot be cached normally. At this time, the pause frame will not be sent directly to the sending device. Instead, the third cache area is dynamically allocated to the current service channel from the second cache area of ​​the current service channel, the second cache area of ​​the target service channel with a lower priority than the current service channel, and the first cache area of ​​the target service channel. This not only effectively utilizes the second cache area of ​​the current service channel, the second cache area of ​​the target service channel, and the first cache area of ​​the target service channel, avoiding waste of resources in these cache areas, but also reduces the frequency of use of pause frames, thereby ensuring smooth data services.

[0042] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solution of the embodiment of the present invention, the drawings required for use in the description of the embodiment of the present invention will be briefly introduced below. Obviously, the drawings described below are only some drawings of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0044] Figure 1 is a flow chart of the steps of a flow control method according to an embodiment of the present invention;

[0045] Figure 2 is a flow chart of another flow control method according to an embodiment of the present invention;

[0046] Figure 3 is a schematic diagram of a flow control architecture according to an embodiment of the present invention;

[0047] Figure 4 is a schematic diagram of a flow control process according to an embodiment of the present invention;

[0048] Figure 5 is a structural block diagram of a flow control device according to an embodiment of the present invention;

[0049] Figure 6 is a structural block diagram of an electronic device according to an embodiment of the present invention;

[0050] Figure 7 It is a structural block diagram of a computer-readable storage medium according to an embodiment of the present invention. DETAILED DESCRIPTION

[0051] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0052] The embodiment of the present invention is an improvement based on the Pause frame mechanism and the PFC mechanism.

[0053] First, the Pause frame mechanism and PFC mechanism are introduced.

[0054] (1) Pause frame mechanism:

[0055] In the Pause frame mechanism, when the receiving buffer of the receiving device is about to overflow, a Pause frame is sent to the sending device to request it to pause sending data to avoid packet loss. The Pause frame mechanism is used to implement flow control in full-duplex Ethernet connections.

[0056] Purpose of the Pause frame mechanism: The Pause frame is used to prevent the buffer of the receiving device from overflowing. When the buffer of the receiving device is about to overflow, it sends a Pause frame to the sending device, requesting the sending device to stop sending data for a period of time.

[0057] Contents of the Pause frame mechanism: The Pause frame contains a pause duration, which specifies the duration for which the sending device needs to pause sending data.

[0058] The working principle of the Pause frame mechanism is as follows: When the receiving device detects that the cache is close to overflowing, it sends a Pause frame to the sending device; after receiving the Pause frame, the sending device suspends sending data according to the pause duration in the Pause frame; when the pause duration ends or another Pause frame is received, data sending is resumed.

[0059] The main features of the Pause frame mechanism:

[0060] Full-duplex mode: The Pause frame mechanism works in full-duplex mode (that is, data can be sent and received in both directions simultaneously).

[0061] Link scope: Pause frames are valid on a single Ethernet link and are not propagated to other parts of the network.

[0062] No priority distinction: The Pause frame mechanism does not distinguish the priorities of different services, and all traffic on the link is uniformly paused.

[0063] The Pause frame mechanism avoids buffer overflow and data loss in a simple and direct way, but it also has some limitations when dealing with network congestion, such as the inability to distinguish between traffic of different priorities, which may lead to a decrease in service quality.

[0064] (2) PFC mechanism

[0065] The PFC mechanism is an improved Ethernet flow control mechanism that adds differentiation and independent control of traffic of different priorities based on the traditional Pause frame mechanism. PFC is designed to better meet the needs of service quality and traffic management in modern network applications.

[0066] The main features of the PFC mechanism:

[0067] Priority division: Ethernet links are divided into multiple service channels, each channel represents a different service priority.

[0068] Independent Pause frame control: Each service channel performs Pause frame behavior independently. When the receiving buffer of a service channel is about to overflow, only the traffic transmission of the service channel is paused without affecting the traffic of other service channels.

[0069] Improve service quality: Through an independent Pause frame control mechanism, PFC can ensure that high-priority traffic can still be guaranteed when the network is congested, while low-priority traffic can be paused, thereby improving the network's service quality.

[0070] Application scenarios: PFC is suitable for application scenarios with high requirements for traffic management and service quality, such as HPC (High Performance Computing), data centers, and AI (Artificial Intelligence) computing.

[0071] Working principle of PFC mechanism:

[0072] A mapping of service channels of different priorities is established between the sending device and the receiving device. The receiving device sends Pause frames to the sending device according to the cache status of each service channel. After receiving the Pause frame, the sending device only pauses the traffic of the corresponding service channel without affecting other service channels.

[0073] Cache management of the PFC mechanism: Guarantee storage space and shared storage space are set up for each service channel. The guaranteed storage space reserves the minimum cache amount for each service channel and is not occupied by other service channels; the shared storage space is used for shared allocation, and each service channel preempts the use of it according to traffic demand.

[0074] Among them, the minimum buffer size (that is, guaranteed storage space) of the service channel is a fixed value and is not occupied by other channels. This static allocation mechanism cannot be adjusted according to changes in actual service needs, resulting in resource waste when the service load is uneven or the traffic changes. When the traffic of one service channel is low and the traffic of another service channel is high, the fixed minimum buffer size cannot effectively utilize the available resources, thereby increasing the frequency of Pause frames and affecting the overall performance of the network and data transmission efficiency.

[0075] In an embodiment of the present invention, in order to solve the above problems, a dynamic cache occupancy strategy is provided, which can dynamically adjust the cache allocation of service channels of different priorities according to real-time service needs and priorities, reduce the waste of fixed resources, optimize network performance, and reduce the frequency of use of Pause frames.

[0076] The flow control method in the embodiment of the present invention is described in detail below.

[0077] The flow control method in the embodiment of the present invention can be applied to any receiving device in the network that can receive data sent by a sending device.

[0078] Reference Figure 1 , shows a flow chart of the steps of a flow control method according to an embodiment of the present invention.

[0079] like Figure 1 As shown, the flow control method may include the following steps:

[0080] Step 101, obtaining channel information of each service channel, wherein the channel information includes data flow, buffer information of a first buffer area, and buffer information of a second buffer area, and different service channels correspond to different priorities.

[0081] In an embodiment of the present invention, a data link between a sending device and a receiving device is divided into multiple service channels, different service channels correspond to different priorities, and the service channels are used to transmit data of corresponding priorities sent by the sending device to the receiving device.

[0082] In the embodiment of the present invention, for each service channel, the cache area corresponding to the service channel is divided into a first cache area and a second cache area by the guaranteed storage space in the PFC mechanism. The first cache area may be a service cache area, and the second cache area may be a dynamic cache area. The service cache area is used to cache the data of the service channel, and the dynamic cache area is used to dynamically allocate according to the data traffic. The dynamic cache area can be allocated to the service channel corresponding to itself, or to other service channels. In some cases, the service cache area can also be allocated to other service channels, which will be described in detail below.

[0083] In the embodiment of the present invention, the receiving device may obtain channel information of each service channel, wherein the channel information may include but is not limited to: data flow, buffer information of the first buffer area, buffer information of the second buffer area, and so on.

[0084] Exemplarily, the data traffic may include but is not limited to: the traffic difference value obtained by subtracting the sent data traffic from the received data traffic, etc. The cache information may include but is not limited to: occupied cache space, unoccupied cache space, allocated service channels, service channels occupying the occupied cache space, etc. Specifically, the cache information of the first cache area may include but is not limited to: occupied cache space of the first cache area, unoccupied cache space of the first cache area, service channels allocated to the first cache area, service channels occupying the occupied cache space of the first cache area, etc. The cache information of the second cache area may include but is not limited to: occupied cache space of the second cache area, unoccupied cache space of the second cache area, service channels allocated to the second cache area, service channels occupying the occupied cache space of the second cache area, etc.

[0085] Exemplarily, the receiving device may obtain the channel information of each service channel at a fixed time. The time interval for obtaining the channel information of each service channel may be set according to actual needs, such as 20 seconds, 30 seconds, 1 minute, etc., which is not limited in this embodiment.

[0086] Step 102: Based on the channel information of each service channel and the data flow of the current service channel, determine whether it is necessary to add a third buffer area for the current service channel.

[0087] In the embodiment of the present invention, after acquiring the channel information of each service channel, the receiving device determines whether it is necessary to add a third buffer area for the current service channel according to the channel information of each service channel and the data flow of the current service channel.

[0088] Exemplarily, the process of determining whether it is necessary to add a third cache area for the current business channel based on the channel information of each business channel and the data traffic of the current business channel may include: when the data traffic of the current business channel is greater than or equal to a set proportion of the total unoccupied cache space allocated to the current business channel, determining that it is necessary to add a third cache area for the current business channel.

[0089] When the data traffic of the current business channel is greater than or equal to the set ratio of the total unoccupied cache space allocated to the current business channel, it means that the unoccupied cache space allocated to the current business channel cannot carry the data traffic of the current business channel, that is, the cache space allocated to the current business channel is about to overflow. Therefore, it can be determined that a third cache area needs to be added for the current business channel.

[0090] The above-mentioned setting ratio can be set according to actual needs. For example, the setting ratio can be set to 80%, 90%, 100%, etc., and this embodiment does not limit this.

[0091] Step 103, when it is determined that a third cache area needs to be added to the current business channel, the third cache area is allocated to the current business channel from the second cache area of ​​the current business channel, the second cache area of ​​the target business channel, and the first cache area of ​​the target business channel according to the channel information of the current business channel and the channel information of the target business channel with a lower priority than the current business channel.

[0092] In the embodiment of the present invention, a service channel with a lower priority than the current service channel is referred to as a target service channel. When the receiving device determines that a third buffer area needs to be added to the current service channel, the receiving device can allocate a third buffer area to the current service channel from the second buffer area of ​​the current service channel, the second buffer area of ​​the target service channel, and the first buffer area of ​​the target service channel according to the channel information of the current service channel and the channel information of the target service channel with a lower priority than the current service channel. When it is determined that a third buffer area does not need to be added to the current service channel, no other processing is performed temporarily.

[0093] Exemplarily, according to the channel information of the current service channel and the channel information of the target service channel having a lower priority than the current service channel, the process of allocating the third buffer area to the current service channel from the second buffer area of ​​the current service channel, the second buffer area of ​​the target service channel, and the first buffer area of ​​the target service channel may include:

[0094] The third cache area is allocated to the current business channel in the order of the second cache area of ​​the current business channel, the second cache area of ​​the target business channel, and the first cache area of ​​the target business channel, until the data flow of the current business channel is less than a set proportion of the total unoccupied cache space allocated to the current business channel, or the second cache area of ​​the current business channel, the second cache area of ​​the target business channel, and the first cache area of ​​the target business channel are all allocated.

[0095] Exemplarily, after the second buffer area of ​​the current business channel, the second buffer area of ​​the target business channel, and the first buffer area of ​​the target business channel are allocated, when the data traffic of the current business channel still cannot be met, a flow control frame corresponding to the current business channel is sent to a sending device to notify the sending device to suspend data transmission of the current business channel, or to reduce the data transmission rate of the current business channel.

[0096] In the process of allocating the third cache area to the current service channel in the order of the second cache area of ​​the current service channel, the second cache area of ​​the target service channel, and the first cache area of ​​the target service channel, the third cache area can be allocated in the order of the priority of the target service channels from low to high.

[0097] Specifically, first allocate the second buffer area of ​​the current service channel; if it still cannot be satisfied, then allocate the second buffer area of ​​the target service channel with the lowest priority; if it still cannot be satisfied, then allocate the second buffer area of ​​the target service channel with the second lowest priority; and so on. If the second buffer areas of all the target service channels are allocated and it still cannot be satisfied, then allocate the first buffer area of ​​the target service channel with the lowest priority; if it still cannot be satisfied, then allocate the first buffer area of ​​the target service channel with the second lowest priority, and so on. The above-mentioned inability to satisfy specifically refers to the inability to satisfy the data flow of the current service channel, which is less than the set ratio of the total unoccupied buffer space allocated to the current service channel.

[0098] In an embodiment of the present invention, the cache area of ​​each service channel is divided into a first cache area and a second cache area. According to the data flow of the current service channel, it is determined whether it is necessary to add a third cache area for the current service channel. When it is determined that the third cache area needs to be added to the current service channel, it means that the data flow of the current service channel cannot be cached normally. At this time, the pause frame will not be sent directly to the sending device. Instead, the third cache area is dynamically allocated to the current service channel from the second cache area of ​​the current service channel, the second cache area of ​​the target service channel with a lower priority than the current service channel, and the first cache area of ​​the target service channel. This not only effectively utilizes the second cache area of ​​the current service channel, the second cache area of ​​the target service channel, and the first cache area of ​​the target service channel, avoiding waste of resources in these cache areas, but also reduces the frequency of use of pause frames, thereby ensuring smooth data services.

[0099] Reference Figure 2 , shows a step flow chart of another flow control method according to an embodiment of the present invention.

[0100] like Figure 2 As shown, the flow control method may include the following steps:

[0101] Step 201, obtaining channel information of each service channel, wherein the channel information includes data flow, buffer information of a first buffer area, and buffer information of a second buffer area, and different service channels correspond to different priorities.

[0102] Step 202 , judging whether it is necessary to add a third buffer area for the current service channel based on the channel information of each service channel and the data flow of the current service channel. If yes, executing step 203 ; if no, executing step 205 .

[0103] Step 203, when it is determined that a third cache area needs to be added to the current business channel, the third cache area is allocated to the current business channel from the second cache area of ​​the current business channel, the second cache area of ​​the target business channel, and the first cache area of ​​the target business channel according to the channel information of the current business channel and the channel information of the target business channel with a lower priority than the current business channel.

[0104] Step 204 , obtaining channel information of each service channel, and returning to step 202 .

[0105] In the embodiment of the present invention, considering that there may be a delay in the process of obtaining the channel information of each service channel in step 201, and that the channel information of each service channel may change after the third buffer area is allocated to the current service channel, after the third buffer area is allocated to the current service channel, the channel information of each current service channel can also be obtained, and return to step 202 for re-judgment, thereby further improving the real-time performance of flow control.

[0106] The process of obtaining the channel information of each service channel in step 204 is the same as the process of obtaining the channel information of each service channel in step 101. For details, please refer to the relevant description in the above embodiment, which will not be discussed in detail in this embodiment.

[0107] Step 205: When it is determined that it is not necessary to add a third buffer area for the current service channel, it is determined whether it is necessary to release the third buffer area for the current service channel according to the data flow of the current service channel. If yes, step 206 is executed; if no, no other processing is performed.

[0108] In an embodiment of the present invention, when the receiving device determines that there is no need to add a third cache area for the current service channel, it can also determine whether it is necessary to release the third cache area for the current service channel based on the data traffic of the current service channel, thereby being able to release the third cache area in a timely manner, avoiding invalid occupation of the third cache area, and improving resource utilization.

[0109] Exemplarily, the process of determining whether it is necessary to release the third cache area for the current business channel based on the data traffic of the current business channel may include: when the difference between the sum of the unoccupied cache space allocated to the current business channel and the data traffic of the current business channel is greater than or equal to the unoccupied cache space latest allocated to the current business channel, determining that it is necessary to release the third cache area for the current business channel.

[0110] Step 206, when it is determined that the third cache area needs to be released for the current business channel, based on the channel information of the current business channel and the channel information of the target business channel, the third cache area is released for the current business channel from the second cache area of ​​the current business channel, the second cache area of ​​the target business channel and the first cache area of ​​the target business channel.

[0111] In an embodiment of the present invention, when the receiving device determines that the third cache area needs to be released for the current service channel, the receiving device releases the third cache area for the current service channel from the second cache area of ​​the current service channel, the second cache area of ​​the target service channel, and the first cache area of ​​the target service channel based on the channel information of the current service channel and the channel information of the target service channel.

[0112] Exemplarily, according to the channel information of the current service channel and the channel information of the target service channel having a lower priority than the current service channel, the process of releasing the third buffer area for the current service channel from the second buffer area of ​​the current service channel, the second buffer area of ​​the target service channel, and the first buffer area of ​​the target service channel may include:

[0113] The third cache area allocated to the current business channel is released in sequence in the order of the first cache area of ​​the target business channel, the second cache area of ​​the target business channel, and the second cache area of ​​the current business channel, until the difference between the sum of the unoccupied cache space allocated to the current business channel and the data flow of the current business channel is less than the unoccupied cache space allocated to the current business channel at the latest in the third cache area allocated to the current business channel.

[0114] In the process of releasing the third cache area allocated to the current business channel in the order of the first cache area of ​​the target business channel, the second cache area of ​​the target business channel, and the second cache area of ​​the current business channel, the third cache area can be released in a descending order of priority of the target business channels.

[0115] Specifically, the first buffer area of ​​the target service channel with the highest priority is released first; if it still cannot be satisfied, the first buffer area of ​​the target service channel with the second highest priority is released; and so on, if the first buffer areas of all the target service channels are released and it still cannot be satisfied, the second buffer area of ​​the target service channel with the highest priority is released; if it still cannot be satisfied, the second buffer area of ​​the target service channel with the second highest priority is released; and so on, if the second buffer areas of all the target service channels are released and it still cannot be satisfied, the second buffer area of ​​the current service channel is released. The above-mentioned failure to satisfy specifically refers to the difference between the sum of the unoccupied buffer space allocated to the current service channel and the data flow of the current service channel, which is less than the unoccupied buffer space allocated to the current service channel at the latest in the third buffer area allocated to the current service channel.

[0116] Step 207 , obtaining channel information of each service channel, and returning to step 202 .

[0117] In the embodiment of the present invention, considering that there may be a delay in the process of obtaining the channel information of each service channel in step 201, and that the channel information of each service channel will change after the third buffer area is released for the current service channel, after the third buffer area is released for the current service channel, the channel information of each current service channel can also be obtained, and the process returns to step 202 for re-judgment, thereby further improving the real-time performance of flow control.

[0118] The process of obtaining the channel information of each service channel in step 207 is the same as the process of obtaining the channel information of each service channel in step 101. For details, please refer to the relevant description in the above embodiment, which will not be discussed in detail in this embodiment.

[0119] Reference Figure 3 , showing a schematic diagram of a flow control architecture according to an embodiment of the present invention.

[0120] like Figure 3 As shown, the flow control architecture may include flow monitoring, cache management, and real-time feedback, and a total of 8 service channels are set from channel 1 to channel 8, and different service channels have different priorities. It is understandable that the number of service channels in the embodiment of the present invention is not limited to 8.

[0121] (1) Traffic monitoring

[0122] Data inflow: Network traffic data enters the traffic monitoring part in real time.

[0123] Data processing: real-time monitoring of the channel information of each service channel, which may specifically correspond to the above step 201.

[0124] Data outflow: The channel information of each monitored service channel is transmitted to the cache management part.

[0125] (2) Cache Management

[0126] Data inflow: Receives channel information of each service channel transmitted from the traffic monitoring part.

[0127] Data processing: According to the channel information of each service channel, dynamically adjust the cache allocation of each service channel to ensure efficient use of cache resources. Specifically, it may correspond to the above steps 202 to 203, and steps 205 to 206.

[0128] Data outflow: The results of dynamically adjusting cache allocation are transmitted to the real-time feedback part.

[0129] (3) Real-time feedback

[0130] Data inflow: Receives the results of dynamically adjusting cache allocation transmitted from the cache management part.

[0131] Data processing: reacquire the channel information of each service channel, which may specifically correspond to the above steps 204 and 207.

[0132] Data outflow: The acquired channel information of each service channel is transmitted to the cache management part, thus forming a closed-loop management, continuously optimizing the cache management algorithm, and ensuring network performance and data transmission efficiency.

[0133] Reference Figure 4 , showing a schematic diagram of a flow control process according to an embodiment of the present invention.

[0134] like Figure 4 As shown, a certain network intermediate node device is virtually divided into 8 service channels, each channel is composed of a service cache area and a dynamic cache area (in practice, the service cache area occupies most of the memory space, and in the figure for the convenience of description, the service cache area size = dynamic cache area size), and the service priority decreases from channel 1 to channel 8.

[0135] As shown in ①, services are in progress on channels 1 to 7, and channel 8 is idle. The gray part represents service data.

[0136] When network congestion or network or equipment failure occurs, the service buffer area in channel 6 is filled up.

[0137] As shown in ②, in the above case, channel 6 enables its own dynamic buffer area for data occupation.

[0138] As shown in ③, if the dynamic buffer area of ​​channel 6 is not enough to solve the problem, find the lowest priority channel among other channels with a lower priority than channel 6, such as the dynamic buffer area of ​​channel 8 for allocation. If the problem is still not solved, further find the second lowest priority channel among other channels with a lower priority than channel 6, such as the dynamic buffer area of ​​channel 7 for allocation.

[0139] As shown in ④, when the dynamic cache areas of all other channels with a priority lower than channel 6 are occupied and the problem still cannot be completely solved, the service cache area of ​​the channel with the lowest priority among other channels with a priority lower than channel 6, such as channel 8, can be found for allocation.

[0140] When the problem still cannot be completely solved in the above situation, a flow control frame may be sent to the sending device to notify the sending device to suspend the data transmission of the current service channel or reduce the data transmission rate of the current service channel.

[0141] Through the dynamic cache adjustment strategy of the embodiment of the present invention, the cache of service channels of different priorities can flexibly adapt to service needs, significantly reduce the waste of resources, improve the efficiency and service quality of the network, effectively reduce the number of Pause frames, ensure the smooth progress of data services, and provide higher flexibility and reliability for network operations.

[0142] Reference Figure 5 , shows a structural block diagram of a flow control device according to an embodiment of the present invention.

[0143] like Figure 5 As shown, the flow control device may include the following modules:

[0144] A first acquisition module 501 is used to acquire channel information of each service channel, wherein the channel information includes data flow, cache information of the first cache area, and cache information of the second cache area, and different service channels correspond to different priorities;

[0145] A first judgment module 502 is used to judge whether it is necessary to add a third buffer area for the current service channel based on the channel information of each service channel and the data flow of the current service channel;

[0146] The first adjustment module 503 is used to allocate the third cache area to the current business channel from the second cache area of ​​the current business channel, the second cache area of ​​the target business channel and the first cache area of ​​the target business channel according to the channel information of the current business channel and the channel information of the target business channel with a lower priority than the current business channel when the first judgment module determines that a third cache area needs to be added to the current business channel.

[0147] Optionally, the cache information includes occupied cache space, unoccupied cache space and allocated service channels; the first judgment module 502 is specifically used to determine the need to add a third cache area for the current service channel when the data flow of the current service channel is greater than or equal to a set proportion of the total unoccupied cache space allocated to the current service channel.

[0148] Optionally, the cache information includes occupied cache space, unoccupied cache space and allocated service channels; the first adjustment module 503 is specifically used to allocate the third cache area to the current service channel in the order of the second cache area of ​​the current service channel, the second cache area of ​​the target service channel and the first cache area of ​​the target service channel, until the data flow of the current service channel is less than a set proportion of the total unoccupied cache space allocated to the current service channel, or the second cache area of ​​the current service channel, the second cache area of ​​the target service channel and the first cache area of ​​the target service channel are allocated.

[0149] Optionally, the device also includes: a sending module, which is used to send a flow control frame corresponding to the current business channel to the sending device to notify the sending device to suspend data transmission of the current business channel, or reduce the data transmission rate of the current business channel when the data flow of the current business channel still cannot be met after the second buffer area of ​​the current business channel, the second buffer area of ​​the target business channel and the first buffer area of ​​the target business channel are allocated.

[0150] Optionally, the device further includes: a second acquisition module, configured to acquire channel information of each service channel and return the information to the first determination module after the first adjustment module 503 allocates the third buffer area to the current service channel.

[0151] Optionally, the device further comprises:

[0152] A second judgment module, configured to judge whether it is necessary to release the third buffer area for the current service channel according to the data flow of the current service channel when the first judgment module 502 judges that it is not necessary to add a third buffer area for the current service channel;

[0153] A second adjustment module is used to release the third cache area for the current business channel from the second cache area of ​​the current business channel, the second cache area of ​​the target business channel and the first cache area of ​​the target business channel according to the channel information of the current business channel and the channel information of the target business channel when the second judgment module determines that the third cache area needs to be released for the current business channel.

[0154] Optionally, the cache information includes occupied cache space, unoccupied cache space and allocated service channels; the second judgment module is specifically used to determine that the third cache area needs to be released for the current service channel when the difference between the total unoccupied cache space allocated to the current service channel and the data traffic of the current service channel is greater than or equal to the unoccupied cache space latest allocated to the current service channel.

[0155] Optionally, the cache information includes occupied cache space, unoccupied cache space and allocated service channels; the second adjustment module is specifically used to release the third cache area allocated to the current service channel in the order of the first cache area of ​​the target service channel, the second cache area of ​​the target service channel and the second cache area of ​​the current service channel, until the difference between the total unoccupied cache space allocated to the current service channel and the data flow of the current service channel is less than the unoccupied cache space allocated to the current service channel at the latest.

[0156] In an embodiment of the present invention, the cache area of ​​each service channel is divided into a first cache area and a second cache area. According to the data flow of the current service channel, it is determined whether it is necessary to add a third cache area for the current service channel. When it is determined that the third cache area needs to be added to the current service channel, it means that the data flow of the current service channel cannot be cached normally. At this time, the pause frame will not be sent directly to the sending device. Instead, the third cache area is dynamically allocated to the current service channel from the second cache area of ​​the current service channel, the second cache area of ​​the target service channel with a lower priority than the current service channel, and the first cache area of ​​the target service channel. This not only effectively utilizes the second cache area of ​​the current service channel, the second cache area of ​​the target service channel, and the first cache area of ​​the target service channel, avoiding waste of resources in these cache areas, but also reduces the frequency of use of pause frames, thereby ensuring smooth data services.

[0157] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0158] In an embodiment of the present invention, an electronic device is further provided. The electronic device may include a processor and a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium; when the computer program is executed by the processor, the processor executes the flow control method of any of the above embodiments.

[0159] Reference Figure 6 , shows a structural block diagram of an electronic device according to an embodiment of the present invention. Figure 6As shown, the electronic device 60 includes a processor 601 and a computer-readable storage medium 602 , on which a computer program 6021 is stored.

[0160] Processor 601 is used to execute a computer program 6021 stored on a computer-readable storage medium 602. When executing computer program 6021, processor 601 implements the flow control method of any of the above-mentioned embodiments and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0161] The processor 601 mentioned above may include but is not limited to: a central processing unit (CPU), a network processor (NP), a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0162] The computer-readable storage medium 602 mentioned above may include but is not limited to: read-only memory (ROM), random access memory (RAM), compact disc read-only memory (CD-ROM), electronic erasable programmable read-only memory (EEPROM), hard disk, floppy disk, flash memory, etc.

[0163] In an embodiment of the present invention, a computer-readable storage medium is also provided, on which a computer program is stored. The computer program can be executed by a processor of an electronic device. When the computer program is executed by the processor, the processor executes the flow control method described in any of the above embodiments.

[0164] Reference Figure 7 , shows a block diagram of a computer-readable storage medium according to an embodiment of the present invention. Figure 7As shown, a computer program 701 is stored on a computer-readable storage medium 70. When the computer program 701 is executed by a processor, the processor executes the flow control method described in any of the above embodiments and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0165] It should be noted that all actions of acquiring signals, information or data in the present invention are performed in compliance with the corresponding data protection laws and policies of the country where the device is located and with the authorization given by the owner of the corresponding device.

[0166] The various embodiments in this specification are interrelated, and each embodiment is described in a progressive manner. Each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referenced to each other.

[0167] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product 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 codes.

[0168] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0169] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0170] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0171] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0172] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0173] The flow control method, device, electronic device and storage medium provided by the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A flow control method, characterized in that: The method comprises: Acquire channel information of each service channel, the channel information including data traffic, cache information of the first cache area, and cache information of the second cache area, and different service channels correspond to different priorities; Based on the channel information of each service channel and the data flow of the current service channel, determining whether it is necessary to add a third buffer area for the current service channel; When it is determined that a third cache area needs to be added to the current business channel, the third cache area is allocated to the current business channel from the second cache area of ​​the current business channel, the second cache area of ​​the target business channel, and the first cache area of ​​the target business channel based on the channel information of the current business channel and the channel information of the target business channel with a lower priority than the current business channel.

2. The method according to claim 1, characterized in that The cache information includes occupied cache space, unoccupied cache space, and allocated service channels; the channel information for each service channel, and the data flow of the current service channel, and determining whether it is necessary to add a third cache area for the current service channel, including: When the data flow of the current service channel is greater than or equal to a set ratio of the total unoccupied buffer space allocated to the current service channel, it is determined that a third buffer area needs to be added to the current service channel.

3. The method according to claim 1, characterized in that The cache information includes occupied cache space, unoccupied cache space, and allocated service channels; the allocating the third cache area to the current service channel from the second cache area of ​​the current service channel, the second cache area of ​​the target service channel, and the first cache area of ​​the target service channel according to the channel information of the current service channel and the channel information of the target service channel having a lower priority than the current service channel, comprises: The third cache area is allocated to the current business channel in the order of the second cache area of ​​the current business channel, the second cache area of ​​the target business channel, and the first cache area of ​​the target business channel, until the data flow of the current business channel is less than a set proportion of the total unoccupied cache space allocated to the current business channel, or the second cache area of ​​the current business channel, the second cache area of ​​the target business channel, and the first cache area of ​​the target business channel are all allocated.

4. The method according to claim 3, characterized in that The method further comprises: After the second buffer area of ​​the current business channel, the second buffer area of ​​the target business channel and the first buffer area of ​​the target business channel are allocated, if the data flow of the current business channel still cannot be met, a flow control frame corresponding to the current business channel is sent to a sending device to notify the sending device to suspend data transmission of the current business channel, or to reduce the data transmission rate of the current business channel.

5. The method according to claim 1, characterized in that After allocating the third buffer area to the current service channel, the method further includes: The channel information of each service channel is obtained, and the channel information for each service channel and the data flow of the current service channel are returned to determine whether a third buffer area needs to be added for the current service channel.

6. The method according to claim 1, characterized in that The method further comprises: When it is determined that there is no need to add a third buffer area for the current service channel, determining whether it is necessary to release the third buffer area for the current service channel according to the data flow of the current service channel; When it is determined that the third cache area needs to be released for the current business channel, the third cache area is released for the current business channel from the second cache area of ​​the current business channel, the second cache area of ​​the target business channel, and the first cache area of ​​the target business channel according to the channel information of the current business channel and the channel information of the target business channel.

7. The method according to claim 6, characterized in that The cache information includes occupied cache space, unoccupied cache space, and allocated service channels; and judging whether it is necessary to release the third cache area for the current service channel according to the data flow of the current service channel includes: When the difference between the sum of the unoccupied cache space allocated to the current service channel and the data flow of the current service channel is greater than or equal to the unoccupied cache space latest allocated to the current service channel, it is determined that the third cache area needs to be released for the current service channel.

8. The method according to claim 6, characterized in that The cache information includes occupied cache space, unoccupied cache space, and allocated service channels; the releasing the third cache area for the current service channel from the second cache area of ​​the current service channel, the second cache area of ​​the target service channel, and the first cache area of ​​the target service channel according to the channel information of the current service channel and the channel information of the target service channel having a lower priority than the current service channel, comprises: The third cache area allocated to the current business channel is released in sequence in the order of the first cache area of ​​the target business channel, the second cache area of ​​the target business channel, and the second cache area of ​​the current business channel, until the difference between the sum of the unoccupied cache space allocated to the current business channel and the data flow of the current business channel is less than the unoccupied cache space allocated to the current business channel at the latest.

9. A flow control device, characterized in that: The device comprises: A first acquisition module is used to acquire channel information of each service channel, wherein the channel information includes data flow, cache information of the first cache area, and cache information of the second cache area, and different service channels correspond to different priorities; A first judgment module, used for judging whether it is necessary to add a third buffer area for the current service channel according to the channel information of each service channel and the data flow of the current service channel; The first adjustment module is used to allocate the third cache area for the current business channel from the second cache area of ​​the current business channel, the second cache area of ​​the target business channel and the first cache area of ​​the target business channel according to the channel information of the current business channel and the channel information of the target business channel with a lower priority than the current business channel when the first judgment module determines that a third cache area needs to be added to the current business channel.

10. An electronic device, characterized in that: The electronic device includes a processor and a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium; when the computer program is executed by the processor, the processor executes the flow control method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the flow control method according to any one of claims 1 to 8.