Search

CN-119652831-B - Flow control method, device, medium and electronic equipment

CN119652831BCN 119652831 BCN119652831 BCN 119652831BCN-119652831-B

Abstract

The disclosure provides a flow control method, a flow control device, a flow control medium and electronic equipment. The flow control method comprises the steps of obtaining a flow controller index associated with a message, carrying out search processing on a flow controller configuration table memory and a next transmission available time memory based on the flow controller index to obtain the flow controller rate configuration state and the next transmission available time, carrying out flow control on the flow through the flow controller based on the flow controller rate configuration state and the next transmission available time, obtaining a new next transmission available time based on the current time and the next transmission available time, and writing the new next transmission available time back to the next transmission available time memory. The flow control method can improve the utilization rate of hardware resources and rapidly complete the demand of flow control.

Inventors

  • Ruan Zhaosong

Assignees

  • 南京金阵微电子技术有限公司

Dates

Publication Date
20260512
Application Date
20241210

Claims (8)

  1. 1. A flow control method, comprising: Acquiring a flow controller index associated with a message, wherein the flow of the message is an incoming flow or an outgoing flow, and the incoming flow and the outgoing flow share the flow controller; based on the flow controller index, searching a flow controller configuration table memory and a next transmission available time memory to acquire the flow controller rate configuration state and the next transmission available time; based on the rate configuration state of the flow controller and the next transmission available time, controlling the flow of the message through the flow controller; Acquiring new next transmission available time based on the current time and the next transmission available time, and writing the new next transmission available time back to the next transmission available time memory; the realization method for obtaining the flow controller index associated with the message comprises the steps of obtaining the flow controller port index associated with the message, searching a flow controller selection table based on the flow controller port index to obtain the flow controller index; The implementation method for acquiring the flow controller index by searching the flow controller selection table based on the flow controller port index comprises the steps of searching the flow controller selection table based on the flow controller port index to acquire the flow controller index under the outbound flow in a first period, searching the flow controller selection table based on the flow controller port index under the inbound flow in a second period to acquire the flow controller index, wherein the clock in the first period is an even clock, and the clock in the second period is an odd clock.
  2. 2. The flow control method according to claim 1, wherein the implementation method for performing a lookup process on the flow controller configuration table memory and the next transmission available time memory based on the flow controller index to obtain the flow controller rate configuration state and the next transmission available time includes: Acquiring the number of flow control memory units based on the flow controller index; And searching the memory of the flow controller configuration table and the memory of the next transmission available time based on the number of the flow control memory units and the index of the flow controller to acquire the rate configuration state of the flow controller and the next transmission available time.
  3. 3. The flow control method according to claim 1, wherein the implementation method for acquiring a new next transmission available time based on the current time and the next transmission available time includes: When the current time is greater than the next transmission available time, acquiring the new next transmission available time based on the current time and the next transmission available time, wherein the new next transmission available time is the current time; And when the current time is not greater than the next transmission available time, acquiring the new next transmission available time based on the current time and the next transmission available time, wherein the new next transmission available time is the next transmission available time.
  4. 4. The flow control method according to claim 1, wherein the implementation method for performing a lookup process on the flow controller configuration table memory and the next transmission available time memory based on the flow controller index to obtain the flow controller rate configuration state and the next transmission available time includes the steps of: in a third period: the first step, under the outgoing flow, searching the memory of the flow controller configuration table based on the flow controller index to obtain the rate configuration state of the flow controller; step two, under the outgoing flow, searching the next transmission available time memory based on the flow controller index to acquire the next transmission available time; Thirdly, reading the state of the flow controller under the outlet flow; Fourth, under the outgoing flow, reading the QoS table of the flow controller; In the fourth period: The first step, under the incoming flow, searching the memory of the flow controller configuration table based on the flow controller index to obtain the rate configuration state of the flow controller; Step two, under the incoming flow, searching the next transmission available time memory based on the flow controller index to acquire the next transmission available time; thirdly, reading the state of the flow controller under the incoming flow; fourth, reading the Qos table of the flow controller under the incoming flow; the clock of the third period is an even number clock, and the clock of the fourth period is an odd number clock.
  5. 5. The flow control method according to claim 4, wherein the implementation method of acquiring a new next transmission available time based on the current time and the next transmission available time and writing back the new next transmission available time to the next transmission available time memory includes the steps of: in the fourth period: fifthly, under the outbound flow, acquiring a new next transmission available time based on the current time and the next transmission available time, and writing the new next transmission available time back to the next transmission available time memory; sixth, updating the state of the flow controller under the outlet flow; in the fifth cycle: The first step, under the incoming flow, based on the current time and the next transmission available time, acquiring a new next transmission available time, and writing the new next transmission available time back to the next transmission available time memory; Second, updating the state of the flow controller under the incoming flow; The clock of the fifth period is an even number clock.
  6. 6. A flow control device, comprising: the system comprises an index acquisition module, a message processing module and a message processing module, wherein the index acquisition module is used for acquiring a message-associated flow controller index, the flow of the message is an incoming flow or an outgoing flow, and the incoming flow and the outgoing flow share the flow controller; The searching processing module is used for searching the memory of the flow controller configuration table and the memory of the next transmission available time based on the index of the flow controller so as to acquire the rate configuration state of the flow controller and the next transmission available time; The flow processing module is used for controlling the flow of the message through the flow controller based on the rate configuration state of the flow controller and the next transmission available time; the memory write-back module is used for acquiring new next transmission available time based on the current time and the next transmission available time, and writing the new next transmission available time back to the next transmission available time memory; the realization method for obtaining the flow controller index associated with the message comprises the steps of obtaining the flow controller port index associated with the message, searching a flow controller selection table based on the flow controller port index to obtain the flow controller index; The implementation method for acquiring the flow controller index by searching the flow controller selection table based on the flow controller port index comprises the steps of searching the flow controller selection table based on the flow controller port index to acquire the flow controller index under the outbound flow in a first period, searching the flow controller selection table based on the flow controller port index under the inbound flow in a second period to acquire the flow controller index, wherein the clock in the first period is an even clock, and the clock in the second period is an odd clock.
  7. 7. A computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the flow control method according to any of claims 1-5.
  8. 8. An electronic device, comprising: a memory; a processor coupled to the memory and configured to perform the flow control method of any of claims 1-5.

Description

Flow control method, device, medium and electronic equipment Technical Field The disclosure belongs to the field of flow control, and relates to a flow control method, in particular to a flow control method, a flow control device, a flow control medium and electronic equipment. Background Currently, in a common switch design, an ASIC (application specific integrated circuit) specifically designed for a network application is generally used for processing, forwarding, analyzing and the like of a service flow of the switch, and a CPU (central processing unit) of the switch is mainly responsible for overall management of the switch, such as a hardware working state and the like. In order to control the functions of the ASIC, the CPU of the switch also needs to process some messages sent by the ASIC, such as control related messages of LLDP (link layer discovery protocol), STP (spanning tree protocol), ARP (address resolution protocol), or related messages of routing protocol. In a high-speed network, the demand for large-scale flow control is stronger, and the current flow control method has the problem of low flow control efficiency. Disclosure of Invention The disclosure aims to provide a flow control method, a flow control device, a flow control medium and an electronic device, which are used for solving the problem of low flow control efficiency in the current flow control method. In a first aspect, an embodiment of the present disclosure provides a flow control method, including obtaining a flow controller index associated with a packet, where the flow of the packet is an ingress flow or an egress flow, where the ingress flow and the egress flow share the flow controller, performing a lookup process on a flow controller configuration table memory and a next transmission available time memory based on the flow controller index to obtain the flow controller rate configuration state and a next transmission available time, performing flow control on the flow of the packet by the flow controller based on the flow controller rate configuration state and the next transmission available time, obtaining a new next transmission available time based on a current time and the next transmission available time, and writing the new next transmission available time back to the next transmission available time memory. In the flow control method, the incoming flow and the outgoing flow share the flow controller, and on the basis, the flow controller is provided with a table memory and a next transmission available time memory for searching and processing, and the new next transmission available time is written back, so that the utilization rate of hardware resources can be improved, and the requirement on flow control can be rapidly met. In one embodiment of the disclosure, the method for obtaining the message-associated flow controller index includes obtaining the message-associated flow controller port index, and performing a lookup process on a flow controller selection table based on the flow controller port index to obtain the flow controller index. In one embodiment of the disclosure, the method for searching the flow controller configuration table memory and the next transmission available time memory based on the flow controller index to obtain the flow controller rate configuration state and the next transmission available time includes obtaining a flow control memory unit number based on the flow controller index, and searching the flow controller configuration table memory and the next transmission available time memory based on the flow control memory unit number and the flow controller index to obtain the flow controller rate configuration state and the next transmission available time. In an embodiment of the present disclosure, the method for obtaining a new next transmission available time based on a current time and the next transmission available time includes obtaining the new next transmission available time based on the current time and the next transmission available time when the current time is greater than the next transmission available time, the new next transmission available time being the current time, and obtaining the new next transmission available time based on the current time and the next transmission available time when the current time is not greater than the next transmission available time. In an embodiment of the disclosure, the implementation method for searching the flow controller selection table based on the flow controller port index to obtain the flow controller index includes searching the flow controller selection table based on the flow controller port index to obtain the flow controller index under the outbound flow in a first period, searching the flow controller selection table based on the flow controller port index under the inbound flow in a second period to obtain the flow controller index, wherein the clock in the first period is an even clock, and the clock in the