Link election method and device, switching equipment and storage medium
By acquiring the target link in real time based on the link quality evaluation algorithm on the switching chip and allocating the links using polling methods, the election problem when multiple links are of the same quality is solved, reducing costs and improving user experience.
Patent Information
- Application Number
- CN202411699116.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-11-26
AI Technical Summary
When the switching chip supports DLB, it faces the problem of how to efficiently elect the target link when multiple links have the same quality, which leads to large circuit design overhead and may lead to some links not being selected, affecting the user experience.
A link quality evaluation algorithm is used to obtain the target link that meets the conditions in real time, and when there are multiple target links, the target link is allocated to the to-process traffic based on polling.
The cost of randomly selecting links from the target link is reduced, and the existence of unselected links in the target link is avoided, thereby improving the user experience.
Smart Images

Figure CN119520385A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communications, and in particular to a link election method, device, switching equipment and storage medium. Background Art
[0002] When the switch chip supports DLB (Dynamic Load Balancing), it will face the problem of selecting from among multiple member links with the same link quality.
[0003] At this time, what we often think of is to randomly select one as the exit of a certain flow. However, the common way to implement randomness in ASIC (Application-Specific Integrated Circuit) is the pseudo-random form of LFSR (Linear Feedback Shift Register). LFSR is a sequence generator that generates pseudo-random sequences or specific sequences through a simple hardware structure. This method leads to high circuit design overhead, especially for each ECMP (Equal Cost Multi-Path) to design an LFSR circuit, the design overhead will be even greater. Secondly, when multiple member ports have the same load and then a corresponding number of multiple flows come in at the same time, pseudo-randomness may cause some of the ports to not be selected, affecting the user experience. Summary of the invention
[0004] The object of the present invention is to provide a link election method, device, switching equipment and storage medium, which can reduce costs and improve user experience.
[0005] In order to achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:
[0006] In a first aspect, an embodiment of the present application provides a link election method, which is applied to a switching chip, and the method includes:
[0007] Based on the link quality evaluation algorithm, the target link that meets the conditions is obtained from multiple links in real time;
[0008] Receive multiple flows to be processed;
[0009] When there are multiple target links, the target link is allocated to each of the to-be-processed flows based on a polling method.
[0010] In an optional implementation, the traffic to be processed includes a first traffic to be processed and a second traffic to be processed, the target link includes a first target link and a second target link, and when there are multiple target links, the step of allocating the target link to each of the traffic to be processed based on a polling manner includes:
[0011] Determine a first receiving time of the first to-be-processed traffic and a second receiving time of the second to-be-processed traffic;
[0012] When the first receiving time is earlier than the second receiving time, sending the first to-be-processed traffic based on the first target link in a polling manner;
[0013] Based on the polling method, the second to-be-processed traffic is sent out based on the second target link.
[0014] In an optional implementation, when there are multiple target links, the step of allocating the target link to each of the to-be-processed flows based on a polling method includes:
[0015] Constructing a rr bitmap based on a plurality of the links;
[0016] Setting the bit value of the target link to a first value;
[0017] Setting the bit value of each link among the plurality of links except the target link to a second value;
[0018] The target link whose bit value is the first value is polled in the rr bitmap through a pointer, so as to sequentially allocate links to each of the to-be-processed flows.
[0019] In an optional embodiment, the method further comprises:
[0020] When the polling state of the subsequent message of the first to-be-processed traffic is configured as the first state, the polling sequence of the second to-be-processed traffic is the second target link and the first target link, wherein the first state indicates not participating in the polling of the target link;
[0021] When the polling state of subsequent messages of the first to-be-processed traffic is configured as a second state, the polling sequence of the second to-be-processed traffic is the first target link and the second target link, wherein the second state indicates participation in the polling of the target link.
[0022] In an optional implementation, the switching chip includes a plurality of ECMP Groups, and each of the ECMP Groups includes a plurality of links;
[0023] The step of acquiring a target link that meets the conditions from multiple links in real time based on the link quality evaluation algorithm includes:
[0024] For each of the ECMP Groups, based on a link quality evaluation algorithm, obtaining a first target link that meets the conditions from multiple links of the ECMP Group in real time;
[0025] When there are multiple target links, the step of allocating the target link to each of the to-be-processed flows based on a polling method includes:
[0026] When there are multiple first target links, determining a polling sequence for each of the first target links;
[0027] Each of the ECMP Groups allocates the first target link to each of the to-be-processed flows based on a corresponding polling sequence.
[0028] In an optional implementation, when there are multiple target links, the step of allocating the target link to each of the to-be-processed flows based on a polling method includes:
[0029] Each of the ECMP Groups allocates the first target link to each of the to-be-processed flows based on the polling sequence.
[0030] In an optional implementation, the step of acquiring a target link that meets the conditions from multiple links in real time based on a link quality evaluation algorithm includes:
[0031] Obtaining the throughput of each link in unit time;
[0032] A preset number of links with throughputs greater than a preset number are obtained as target links.
[0033] In a second aspect, an embodiment of the present application provides a link election device, which is applied to a switching chip, and the device includes:
[0034] An acquisition module is used to acquire target links that meet the conditions from multiple links in real time based on a link quality evaluation algorithm;
[0035] A receiving module, used for receiving multiple flows to be processed;
[0036] The allocation module is used to allocate the target link to each of the to-be-processed flows based on a polling method when there are multiple target links.
[0037] In a third aspect, an embodiment of the present application provides a switching device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the link election method when executing the computer program.
[0038] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the link election method when executed by a processor.
[0039] This application has the following beneficial effects:
[0040] The present application obtains target links that meet the conditions from multiple links in real time based on a link quality assessment algorithm, receives multiple flows to be processed, and when there are multiple target links, allocates target links to each flow to be processed based on a polling method, which can reduce the cost of random links from the target links and avoid the existence of unselected links in the target links, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0042] Figure 1 A block diagram of a switching device provided in an embodiment of the present invention;
[0043] Figure 2 One of the flowcharts of a link election method provided by an embodiment of the present invention;
[0044] Figure 3 A second flowchart of a link election method provided by an embodiment of the present invention;
[0045] Figure 4 A third flowchart of a link election method provided by an embodiment of the present invention;
[0046] Figure 5 A schematic diagram of the rr bitmap provided in an embodiment of the present invention;
[0047] Figure 6 A fourth flowchart of a link election method provided by an embodiment of the present invention;
[0048] Figure 7 A fifth flow chart of a link election method provided in an embodiment of the present invention;
[0049] Figure 8 A structural block diagram of a link election device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions 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. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0051] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. 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] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0053] In the description of the present invention, it should be noted that if the terms "upper", "lower", "inside", "outside", etc. appear to indicate an orientation or position relationship, they are based on the orientation or position relationship shown in the accompanying drawings, or are the orientation or position relationship in which the product of the invention is usually placed when used. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.
[0054] In addition, the terms “first”, “second”, etc., if used, are merely used to distinguish between the descriptions and should not be understood as indicating or implying relative importance.
[0055] In the description of this application, it should also be noted that, unless otherwise clearly specified and limited, the terms "set", "install", "connect", and "connect" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two elements. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.
[0056] After extensive research, the inventors found that when a switch chip supports DLB (Dynamic Load Balancing), it faces the problem of selecting from multiple member links with the same link quality.
[0057] At this time, what we often think of is to randomly select one as the exit of a certain flow. However, the common way to implement randomness in ASIC (Application-Specific Integrated Circuit) is the pseudo-random form of LFSR (Linear Feedback Shift Register). LFSR is a sequence generator that generates pseudo-random sequences or specific sequences through a simple hardware structure. This method leads to high circuit design overhead, especially for each ECMP (Equal Cost Multi-Path) to design an LFSR circuit, the design overhead will be even greater. Secondly, when multiple member ports have the same load and then a corresponding number of multiple flows come in at the same time, pseudo-randomness may cause some of the ports to not be selected, affecting the user experience.
[0058] In view of the discovery of the above problems, the present embodiment provides a link selection method, apparatus, switching equipment and storage medium, which can obtain target links that meet the conditions from multiple links in real time based on a link quality evaluation algorithm, receive multiple traffic to be processed, and when there are multiple target links, allocate target links to each traffic to be processed based on polling. This can reduce the cost of random links from the target links and avoid the existence of unselected links in the target links, thereby improving the user experience. The solution provided in this embodiment is described in detail below.
[0059] This embodiment provides a switching device that can elect a link. In a possible implementation, the switching device can be a user terminal, for example, the switching device can be, but is not limited to, a server, a smart phone, a personal computer (PC), a tablet computer, a personal digital assistant (PDA), a mobile Internet device (MID), and a switch.
[0060] Please refer to Figure 1 , Figure 1 1 is a schematic diagram of the structure of the switching device 100 provided in the embodiment of the present application. The switching device 100 may also include Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown. Figure 1 Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0061] The switching device 100 includes a link selection device 110 , a memory 120 and a processor 130 .
[0062] The components of the memory 120 and the processor 130 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines. The link election device 110 includes at least one software function module that can be stored in the memory 120 in the form of software or firmware or solidified in the operating system (OS) of the switching device 100. The processor 130 is used to execute the executable modules stored in the memory 120, such as the software function modules and computer programs included in the link election device 110.
[0063] The memory 120 may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc. The memory 120 is used to store a program, and the processor 130 executes the program after receiving an execution instruction.
[0064] Please refer to Figure 2 , Figure 2 For application Figure 1 A flow chart of a link election method of a switching device 100 is shown, and the method including various steps is described in detail below.
[0065] S201: Based on a link quality evaluation algorithm, a target link that meets the conditions is obtained from multiple links in real time.
[0066] S202: receiving a plurality of flows to be processed.
[0067] S203: When there are multiple target links, a target link is allocated to each to-be-processed traffic based on a round-robin manner.
[0068] When there are multiple target links, each target link has the same load and the lowest load.
[0069] There are multiple implementation methods for obtaining a target link that meets the conditions from multiple links based on the link quality evaluation algorithm. In one implementation method:
[0070] Based on Round-Trip Time, target links that meet the conditions are obtained from multiple links. The time required for each link data packet to be sent from the sender to the receiver and then returned to the sender is determined, and a preset number of links with a time less than the preset time are obtained as target links.
[0071] Specifically, it can be calculated by sending an ICMP Echo Request (ping) and measuring the response time.
[0072] Based on Packet Loss Rate (PLR), a target link that meets the conditions is obtained from multiple links. Packet Loss Rate (PLR) is the proportion of data packets lost during network transmission.
[0073] Specifically, the PLR may be calculated by sending a series of data packets and counting the number of unreceived response packets, and a preset number of links with a packet loss rate less than a preset number may be obtained as target links.
[0074] The target link that meets the conditions is obtained from multiple links based on jitter. Jitter refers to the change in the arrival time of data packets.
[0075] Specifically, the jitter is calculated by measuring the arrival time difference between consecutive data packets, and a preset number of links with a jitter smaller than a preset jitter are obtained as target links.
[0076] Obtain a target link that meets the conditions from multiple links based on Bandwidth. Bandwidth indicates the maximum transmission rate in the link.
[0077] Specifically, the Bandwidth of each link is calculated by sending a large amount of data and measuring the transmission time, and a preset number of links with a transmission rate greater than or equal to a preset maximum transmission rate are obtained as target links.
[0078] Based on Throughput, the target link that meets the conditions is obtained from multiple links. Throughput indicates the amount of data successfully transmitted per unit time, which is throughput.
[0079] Specifically, a large amount of data is sent and the actual transmission rate is measured to calculate the amount of data successfully transmitted per unit time, and a preset number of links with a throughput greater than or equal to a preset throughput are obtained as target links.
[0080] A target link that meets the conditions is obtained from multiple links based on Quality of Service (QoS) Parameters. Quality of Service (QoS) Parameters are service quality parameters, such as priority, bandwidth guarantee, or delay guarantee.
[0081] Specifically, the service quality parameters are evaluated by configuring and monitoring the QoS parameters, and a preset number of links greater than or equal to the preset service quality parameters are obtained as target links.
[0082] It should be noted that the preset number can be set to 3, 4, or 5, and the setting of the preset number can be freely selected based on actual conditions, and the embodiments of the present application do not impose specific restrictions on this.
[0083] When multiple to-be-processed flows are received at the same time, target links are allocated to each to-be-processed flow in a round-robin manner, that is, each to-be-processed flow selects a corresponding target link from multiple target links in turn.
[0084] Exemplarily, when multiple traffic to be processed includes a first traffic to be processed, a second traffic to be processed, and a third traffic to be processed, and the target links include a first target link, a second target link, and a third target link, the first traffic to be processed selects the first target link, the second traffic to be processed selects the second target link, and the third traffic to be processed selects the third target link.
[0085] When there are multiple target links, there are multiple implementations of allocating target links to each to-be-processed flow based on polling. In one implementation, Figure 3 As shown, the following steps are included:
[0086] The following is an example based on that the to-be-processed traffic includes a first to-be-processed traffic and a second to-be-processed traffic, and the target link includes a first target link and a second target link.
[0087] S301: Determine a first receiving time of a first flow to be processed and a second receiving time of a second flow to be processed.
[0088] S302: When the first receiving time is earlier than the second receiving time, send the first to-be-processed traffic based on the first target link in a polling manner.
[0089] S303: Based on a polling method, the second to-be-processed traffic is sent out based on the second target link.
[0090] Polling is to distribute the pending traffic evenly to multiple target links to avoid overloading a single link and improve the performance and stability of the overall system. Each target link has the opportunity to process the pending traffic, ensuring that each unit in the system can get reasonable resource allocation.
[0091] When the first receiving time of the first traffic to be processed is earlier than the second receiving time of the second traffic to be processed, that is, when the switching chip first receives the first traffic to be processed and then receives the second traffic to be processed, when the polling sequence of the first target link and the second target link is the first target link and the second target link, then based on the polling method, the first target link processes the first traffic to be processed and the second target link processes the second traffic to be processed.
[0092] When the multiple traffic to be processed includes the first traffic to be processed, the second traffic to be processed and the third traffic to be processed, and the first traffic to be processed, the second traffic to be processed and the third traffic to be processed are received sequentially by the switching chip, and the target link includes the first target link and the second target link. The first target link processes the first traffic to be processed, the second target link processes the second traffic to be processed, and the first target link processes the third traffic to be processed.
[0093] When there are multiple target links, another implementation method of allocating target links to each flow to be processed based on polling is as follows: Figure 4 As shown, the following steps are included:
[0094] S401: constructing a rr bitmap based on multiple links.
[0095] S402: Set the bit value of the target link to the first value.
[0096] S403: Set the bit value of each link among the multiple links except the target link to the second value.
[0097] S404: polling the target link whose bit value is the first value in the rr bitmap through a pointer, so as to sequentially allocate links to each of the to-be-processed flows.
[0098] like Figure 5 As shown in the figure, it is a schematic diagram of rr bitmap. Based on the link quality assessment algorithm, the target link that meets the conditions is obtained from multiple links in real time, and the bit corresponding to the target link is set to 1 in the rr bitmap, and the other members are set to 0. At the same time, a pointer is used to record the index of the last selected member in the bitmap. When multiple new traffic to be processed arrives, they can be selected from the above members in turn, and finally multiple target links can be selected by the traffic to be processed.
[0099] Polling is to distribute the pending traffic evenly to multiple target links to avoid overloading a single link and improve the performance and stability of the overall system. Each target link has the opportunity to process the pending traffic, ensuring that each unit in the system can get reasonable resource allocation.
[0100] The principle of polling is as follows: all tasks or requests are put into a queue, that is, multiple pending traffic is put into a queue to be processed. There are multiple processing units in the system, that is, multiple target links, and each processing unit has the ability to process tasks. The scheduler is responsible for taking the pending traffic from the task queue and assigning the tasks to the target links in a round-robin manner. The scheduler maintains a pointer to the target link that should currently process the pending traffic. Each time a pending traffic is taken out of the task queue, the scheduler assigns the pending traffic to the target link pointed to by the current pointer. After allocating the pending traffic, the pointer moves to the next target link. If all target links have processed the pending traffic, the pointer returns to the first target link and continues polling.
[0101] Different states can be set for the traffic to be processed after the link has been allocated. When the polling state of the first traffic to be processed is configured as the first state, the polling sequence of the second traffic to be processed is the second target link and the first target link, wherein the first state indicates not participating in the polling of the target link; when the polling state of the second traffic to be processed is configured as the second state, the polling sequence of the second traffic to be processed is the first target link and the second target link, wherein the second state indicates participating in the polling of the target link.
[0102] Exemplarily, the first message of the first traffic to be processed has selected a target link, for example, the first message of the first traffic to be processed has selected target link No. 0, when the polling state of the subsequent messages of the first traffic to be processed is configured to not participate in the polling of the target link, when the target links include target link No. 0 and target link No. 1, the polling sequence for the target path of the second traffic to be processed is 1, 0. Among them, 0 represents target link No. 0, and 1 represents target link No. 1.
[0103] When the first message of the first traffic to be processed has selected a target link, for example, the first message of the first traffic to be processed has selected target link No. 0, and the polling state of subsequent messages of the first traffic to be processed is to participate in the polling of the target link, when the target links include target link No. 0 and target link No. 1, the polling sequence for the target path of the second traffic to be processed is 0, 1. Among them, 0 represents target link No. 0, and 1 represents target link No. 1.
[0104] The packet-by-packet behavior of all packets participating in the polling election means that each packet that queries the ECMPGroup will cause the pointer on the rr bitmap to slide. The non-new flow that has already selected the link will not use this selected result to update its first selected port. By configuring the subsequent packets of the first to-be-processed flow to participate in the polling of the target link, the random effect is superimposed when the polling sequence election is realized, that is, the packets that do not need to be re-selected interfere with the polling sequence of the packets that need to be elected.
[0105] Only packets that need to be elected participate in the polling election, that is, when the subsequent packets of the first pending traffic that has selected the target link will all select the corresponding target link, it can avoid the problem that the flow that needs to be elected is "randomly" sent to the same member port, causing some ports to be unloaded. When multiple loads are the same and the lightest, when new flows enter the switching chip in sequence or at the same time, they can be evenly distributed to the target link, especially when the number of new flows entering is equal to the number of target links, the target link selected by each flow is not repeated. In this way, from the user's perspective, the "random" route selection is more dispersed and uniform, and the member link utilization rate is high.
[0106] The above-mentioned superimposed random influences may cause some target links to never be selected when synchronization effects occur. For example, the traffic rate of the interference factor is always twice that of the new flow. From a microscopic point of view, it will always occupy an additional polling sequence element, and it will not use this element result. When the number of flows and the number of target links are in a certain proportion, it will appear that the additionally occupied target links have no flows. In order to avoid synchronization effects that cause some target links to be idle during polling elections, each ECMP Group can be supported to control a certain number of packet intervals to participate in the election, and the packet interval supports dynamic changes, such as increments, timestamp values, etc.
[0107] The switching chip contains multiple ECMP Groups, each ECMP Group contains multiple links, and the link election is based on multiple ECMPGroups, such as Figure 6 As shown, the following steps are included:
[0108] S501: For each ECMP Group, based on a link quality evaluation algorithm, a first target link that meets the conditions is obtained in real time from multiple links in the ECMP Group.
[0109] S502: Receive multiple flows to be processed.
[0110] S503: When there are multiple first target links, determine a polling sequence for each first target link.
[0111] S504: Each ECMP Group allocates a first target link to each to-be-processed flow based on a corresponding polling sequence.
[0112] Exemplarily, the ECMP Group includes a first ECMP Group and a second ECMP Group, the first ECMP Group includes 1234 links, the second ECMP Group includes 5678 links, the first target link determined from the first ECMP Group based on the link quality assessment algorithm includes 123 first target links, and the second target link determined from the second ECMP Group based on the link quality assessment algorithm includes 567 second target links, then the polling sequence of the first target link is 123, and the polling sequence of the second target link is 567. When the first ECMP Group processes the received traffic to be processed, it allocates the first target link to each traffic to be processed based on the 123 polling sequence, and when the second ECMP Group processes the received traffic to be processed, it allocates the second target link to each traffic to be processed based on the 567 polling sequence.
[0113] The switching chip contains multiple ECMP Groups, each ECMP Group contains multiple links, and the link election is based on multiple ECMPGroups, such as Figure 7 As shown, the following steps are included:
[0114] S601: For each ECMP Group, based on a link quality evaluation algorithm, a first target link that meets the conditions is obtained in real time from multiple links in the ECMP Group.
[0115] S602: Receive multiple flows to be processed.
[0116] S603: When there are multiple first target links, determine a polling sequence for each first target link.
[0117] S604: Each ECMP Group allocates a first target link to each to-be-processed traffic based on a polling sequence.
[0118] Exemplarily, the ECMP Group includes a first ECMP Group and a second ECMP Group, the first ECMP Group contains 1234 links, the second ECMP Group contains 5678 links, the first target link determined from the first ECMP Group based on the link quality assessment algorithm contains 123 first target links, and the second target link determined from the second ECMP Group based on the link quality assessment algorithm contains 567 second target links, then the polling sequence of the first target link is 123.
[0119] When the first ECMP Group processes the received traffic to be processed, it allocates the first target link to each traffic to be processed based on the 123 polling sequence. When the second ECMP Group processes the received traffic to be processed, it also allocates the second target link to each traffic to be processed based on the 123 polling sequence. Here, 1 represents the second target link corresponding to 5, 2 represents the second target link corresponding to 6, and 3 represents the second target link corresponding to 7.
[0120] Please refer to Figure 8 The present application embodiment also provides a method for applying Figure 1 The link election device 110 of the switching device 100 includes:
[0121] An acquisition module 111 is used to acquire a target link that meets the conditions from multiple links in real time based on a link quality evaluation algorithm;
[0122] A receiving module 112, configured to receive a plurality of flows to be processed;
[0123] The allocation module 113 is used to allocate the target link to each of the to-be-processed flows based on a polling method when there are multiple target links.
[0124] The present application also provides a switching device 100, which includes a processor 130 and a memory 120. The memory 120 stores computer executable instructions, and when the computer executable instructions are executed by the processor 130, the link election method is implemented.
[0125] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by the processor 130, the link election method is implemented.
[0126] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of boxes in the block diagram and / or the flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0127] In addition, each functional module in each embodiment of the present application can be integrated together to form an independent part, or each module can exist separately, or two or more modules can be integrated to form an independent part. If the function is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk.
[0128] 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 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 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 device including the elements.
[0129] The above are only various implementations of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A link election method, characterized in that: Applied to a switching chip, the method comprises: Based on the link quality evaluation algorithm, the target link that meets the conditions is obtained from multiple links in real time; Receive multiple flows to be processed; When there are multiple target links, the target link is allocated to each of the to-be-processed flows based on a polling method.
2. The method according to claim 1, characterized in that The to-be-processed traffic includes a first to-be-processed traffic and a second to-be-processed traffic, the target link includes a first target link and a second target link, and when there are multiple target links, the step of allocating the target link to each of the to-be-processed traffic based on a polling method includes: Determine a first receiving time of the first to-be-processed traffic and a second receiving time of the second to-be-processed traffic; When the first receiving time is earlier than the second receiving time, sending the first to-be-processed traffic based on the first target link in a polling manner; Based on the polling method, the second to-be-processed traffic is sent out based on the second target link.
3. The method according to claim 1, characterized in that When there are multiple target links, the step of allocating the target link to each of the to-be-processed flows based on a polling method includes: Constructing a rr bitmap based on a plurality of the links; Setting the bit value of the target link to a first value; Setting the bit value of each link among the plurality of links except the target link to a second value; The target link whose bit value is the first value is polled in the rr bitmap through a pointer, so as to sequentially allocate links to each of the to-be-processed flows.
4. The method according to claim 2, characterized in that: The method further comprises: When the polling state of the subsequent message of the first to-be-processed traffic is configured as the first state, the polling sequence of the second to-be-processed traffic is the second target link and the first target link, wherein the first state indicates not participating in the polling of the target link; When the polling state of subsequent messages of the first to-be-processed traffic is configured as a second state, the polling sequence of the second to-be-processed traffic is the first target link and the second target link, wherein the second state indicates participation in the polling of the target link.
5. The method according to claim 1, characterized in that The switching chip includes a plurality of ECMP Groups, and each of the ECMP Groups includes a plurality of links; The step of acquiring a target link that meets the conditions from multiple links in real time based on the link quality evaluation algorithm includes: For each of the ECMP Groups, based on a link quality evaluation algorithm, obtaining a first target link that meets the conditions from multiple links of the ECMP Group in real time; When there are multiple target links, the step of allocating the target link to each of the to-be-processed flows based on a polling method includes: When there are multiple first target links, determining a polling sequence for each of the first target links; Each of the ECMP Groups allocates the first target link to each of the to-be-processed flows based on a corresponding polling sequence.
6. The method according to claim 5, characterized in that When there are multiple target links, the step of allocating the target link to each of the to-be-processed flows based on a polling method includes: Each of the ECMP Groups allocates the first target link to each of the to-be-processed flows based on the polling sequence.
7. The method according to claim 1, characterized in that The step of acquiring a target link that meets the conditions from multiple links in real time based on the link quality evaluation algorithm includes: Obtaining the throughput of each link in unit time; A preset number of links with throughputs greater than a preset number are obtained as target links.
8. A link election device, characterized in that: Applied to a switching chip, the device comprises: An acquisition module is used to acquire target links that meet the conditions from multiple links in real time based on a link quality evaluation algorithm; A receiving module, used for receiving multiple flows to be processed; The allocation module is used to allocate the target link to each of the to-be-processed flows based on a polling method when there are multiple target links.
9. A switching device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method according to any one of claims 1 to 7 when executing the computer program.
10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Exchange network multicast route implementation method and device
CN106470161A
Multi-path equipment detection method and device, equipment and storage medium
CN115202580A
Vehicle-mounted Ethernet ring network link switching method and system, vehicle and storage medium
CN116455699A
Multi-path transmission method, device, equipment, readable storage medium and program product
CN117135113A
Chip routing method, device, equipment and medium
CN117834537A