The present disclosure relates to the field of switching networks, and in particular, to a node matching method and apparatus, a device, and a medium.
Along with the increase of demand for high capacity and high expandability of a switching network, a single-stage switching network is no longer applicable, and it is difficult to meet the requirements of a large-scale switching system simply by increasing the number of ports or increasing the line rate; therefore, a multi-stage switching architecture emerges in response to the demand.
The multi-stage switching network architecture is formed by cascading a plurality of single-stage architecture switching units; in the multi-stage switching network architecture, only an input port of a first-stage switching unit and an output port of a last-stage switching unit are direct input and output ports of the switching architecture; however, input and output ports of switching units between stages are indirect input and output ports. Obviously, in the multi-stage switching architecture, the fewer the stages, the shorter the switching delay, but the switching path is also correspondingly decreased, which renders that internal collision blocking easily occurs. Therefore, the determination of the multi-stage switching architecture has a compromise among various performances, wherein a multi-stage CLOS network is the most representative, especially a three-stage CLOS architecture.
In order to avoid internal collision and blocking, the CLOS network architecture usually adopts a polling arbitration matching policy for matching. Specifically, each input port sends a transmission “request” signal to a corresponding output port according to transmission requirements of a current time slot group thereof, and each output port sends out a “grant” signal in a certain manner (e.g. periodic rotation) to indicate accept of the request; upon receiving the grant signal from the output port, the input port then “accepts” certain grant in a certain manner (e.g. periodic rotation), thereby forming matching between the input port and the output port. In order to achieve matching between ports, an arbitrator needs to be set up at each port for selection among a plurality of signals.
The polling arbitration matching policy has defects: first, the input/output ports use a request-grant-accept form in each matching period, which not only increases the switching delay, but also generates a large amount of arbitration information requiring to be maintained; and the other is that it is very difficult to obtain the maximum matching between the input port and the output port from one matching period, and a plurality of matching periods may be needed, or even the maximum matching can never be obtained.
Therefore, how to provide a solution for solving the described technical problems is a problem to be currently solved by a person skilled in the art.
In view of this, an object of some embodiments of the present disclosure is to provide a node matching method and apparatus, a device and a medium, so as to obtain a better matching result in a shorter time. A specific solution thereof is as follows:
In an embodiment, the preset calculation rule is specifically:
In an embodiment, after matching the allowed input ports and the allowed output ports, which have corresponding serial numbers, to obtain matching relationships, the method further comprises:
In an embodiment, the node matching method further comprises:
In an embodiment, the multi-stage switching network is specifically a three-stage switching network, and the target node is specifically an input node.
In an embodiment, the dynamic priority serial number of each allowed input port is the priority of the allowed input port among all the allowed input ports, and is globally visible; and the dynamic priority serial number of each allowed output port is the priority of the allowed output port among all the allowed output ports, and is globally visible.
Correspondingly, some embodiments of the present disclosure further disclose a node matching apparatus, applied to a target node in a multi-stage switching network, the target node comprising a plurality of allowed input ports and a plurality of allowed output ports, the node matching apparatus comprising:
In an embodiment, the determination module comprises a first determination sub-module and a second determination sub-module;
In an embodiment, the node matching apparatus further includes:
In an embodiment, the matching module is further configured to:
In an embodiment, the dynamic priority serial number of each allowed input port is the priority of the allowed input port among all the allowed input ports, and is globally visible; and the dynamic priority serial number of each allowed output port is the priority of the allowed output port among all the allowed output ports, and is globally visible.
In an embodiment, the preset calculation rule is specifically:
Correspondingly, some embodiments of the present disclosure further disclose a computer device, including:
Correspondingly, some embodiments of the present disclosure further disclose a computer-readable storage medium, the computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the described method.
Some embodiments of the present disclosure disclose a node matching method, including: acquiring real-time state parameters of a plurality of allowed input ports and a plurality of allowed output ports of a target node; according to the real-time state parameters and a preset calculation rule, determining serial numbers of all the allowed input ports in an idle state, and determining serial numbers of all the allowed output ports in an idle state; matching the allowed input ports and the allowed output ports, which have corresponding serial numbers, to obtain matching relationships; and performing data transmission according to the matching relationships. In some embodiments of the present disclosure, the basis for matching the input and output ports is whether the serial numbers are the same, and serial numbers on the same side are determined without polling, and can be determined at once, which greatly saves the time consumed in original polling arbitration; in addition, because the matching is carried out when all input and output states are consistent, a more ideal matching result can be achieved.
In order to describe the technical solutions in the embodiments of the present disclosure or in the related art more clearly, hereinafter, accompanying drawings requiring to be used for describing the embodiments or the related art are introduced briefly. Apparently, the accompanying drawings in the following description merely relate to embodiments of the present disclosure, and for a person of ordinary skill in the art, other accompanying drawings can also be obtained according to the provided accompanying drawings without involving any inventive effort.
Hereinafter, the technical solutions in embodiments of the present disclosure will be described clearly and thoroughly with reference to the accompanying drawings of the embodiments of the present disclosure. Obviously, the embodiments as described are only some of the embodiments of the present disclosure, and are not all of the embodiments of the present disclosure. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present disclosure without any inventive effort shall all fall within the scope of protection of the present disclosure.
A traditional polling arbitration matching policy has defects: first, input/output ports use a request-grant-accept form in each matching period, which not only increases the switching delay, but also generates a large amount of arbitration information requiring to be maintained; and the other is that it is very difficult to obtain the maximum matching between the input port and the output port from one matching period, and a plurality of matching periods may be needed, or even the maximum matching can never be obtained.
In some embodiments of the present disclosure, the basis for matching the input and output ports is whether the serial numbers are the same, and serial numbers on the same side are determined without polling, and can be determined at once, which greatly saves the time from original polling arbitration; in addition, because the matching is carried out when all input and output states are consistent, a more ideal matching result can be achieved.
Embodiments of the present disclosure disclose a node matching method, applied to a target node in a multi-stage switching network, the target node comprising a plurality of allowed input ports and a plurality of allowed output ports. In an embodiment, when at a certain node, there are at least two input ports receiving data, there is one piece of data, and there are at least two output ports, that is, both input ports and output ports that are allowed to be matched when data passes through the node are not unique; in this case, the node is a target node, and input ports and output ports that are allowed to be matched are respectively allowed input ports and allowed output ports. In an embodiment, taking a three-stage switching network of a CLOS architecture as an example, generally, all input nodes are target nodes. As shown in
As shown in
In an embodiment, the state information of each port comprises an idle state and a busy state, and the busy state can also be described by a non-idle state or a locked state; the dynamic priority serial number of each port refers to the priority of the port among all ports at the same side, and the priority is not necessarily associated with a port number of the port itself; however, during use, there is a mapping relationship between dynamic priority serial numbers and port numbers, and the priority is configured correspondingly according to a dynamic instruction; a user may configure and adjust the priority of each port on the target node according to actual requirements, but generally, the dynamic priority serial number has a low configuration frequency and does not change frequently.
It can be understood that in step S2, first, according to the state information whether each port is idle, it is determined that a range of matchable ports are: all allowed input ports in an idle state and all allowed output ports in an idle state; then a serial number of each port at a corresponding side is determined according to the preset calculation rule, wherein the preset calculation rule is related to the dynamic priority serial number, the serial number can be obtained by ranking all idle ports according to the dynamic priority serial numbers, and the serial numbers can also be obtained by summing the number of ports within a certain range of the dynamic priority serial number of the port. In conjunction with the global visibility advantage of the dynamic priority serial numbers, serial numbers are marked for matchable ports at each side, and the serial numbers can be determined according to the dynamic priority serial numbers of idle ports at the side in a descending order or an ascending order; the sequences at both sides can be consistent or opposite, as long as there is a corresponding matchable relationship; certainly, in order to avoid mistakes, the serial numbers on both sides should use the same sequence and basis as far as possible.
It can be understood that, in this embodiment, all the matchable allowed input ports and allowed output ports are known, and as to how to match ports in an idle state at two sides, it is not necessary to perform polling iteration in sequence, and all matching relationships of all maximum matching degrees can be obtained by directly matching ports having corresponding serial numbers at two sides. Here, the allowed input ports and allowed output ports having corresponding serial numbers may be allowed input ports and allowed output ports having corresponding serial numbers, and may also be allowed input ports and allowed output ports with the same sequence of serial numbers of matchable ports at the same side. The specific detail differences lie in the arrangement sequence of numerical values in a descending order or an ascending order and an initial value being 0 or 1; and these differences do not affect the implementation of the actual method in this embodiment, and can achieve the object of globally matching ports in an idle state in this embodiment.
It can be understood that, after the matching relationships are determined, actual data transmission can be performed according to the matching relationships.
In an embodiment, after matching the allowed input ports and the allowed output ports, which have corresponding serial numbers, to obtain matching relationships in step S3, the method further comprises:
It can be understood that once the matching relationships are determined, the matching relationships should not be disconnected until complete whole frame data is sent completely; and a real-time state during sending is non-idle, and the non-idle port will not be considered during re-matching. Therefore, in order to achieve this effect, after the matching relationships are determined, locked grant is performed the corresponding ports, thereby avoiding mistaken inclusion of said ports into a matching range during next matching.
In an embodiment, the node matching method further comprises:
It can be understood that, along with transmission of data in the multi-stage switching network, the real-time state parameters in this embodiment may change; and in order to avoid mistakes during subsequent matching, the real-time state parameters should be updated in time according to an actual state of the multi-stage switching network.
Some embodiments of the present disclosure disclose a node matching method, comprising: acquiring real-time state parameters of a plurality of allowed input ports and a plurality of allowed output ports of a target node; according to the real-time state parameters and a preset calculation rule, determining serial numbers of all the allowed input ports in an idle state, and determining serial numbers of all the allowed output ports in an idle state; matching the allowed input ports and the allowed output ports, which have corresponding serial numbers, to obtain matching relationships; and performing data transmission according to the matching relationships. In some embodiments of the present disclosure, the basis for matching the input and output ports is whether the serial numbers are the same, and serial numbers on the same side are determined without polling, and can be determined at once, which greatly saves a lot of time consumed in original polling arbitration; in addition, because the matching is carried out when all input and output states are consistent, a more ideal matching result can be achieved.
Embodiments of the present disclosure disclose a specific node matching method; compared with the previous embodiment, the present embodiment further describes and optimizes the technical solution.
In this embodiment, the same calculation rule is set for allowed input ports in an idle state of an input end and allowed output ports in an idle state of an output end, comprising the same calculation mode and count starting point. The preset calculation rule is specifically:
In an embodiment, hereinafter, the first rule of the preset calculation rule is exemplified, that is, the number of all ports at a certain side of which the dynamic priority serial numbers are not higher than that of said port is recorded as the serial number of said port. A target node with six allowed input ports and six allowed output ports is taken as an example, and the relevant parameters are as shown in Table 1 and Table 2.
It can be understood that all real-time state parameters of the target node are acquired, that is, data in rows 1-3 of Table 1 and data in rows 1-3 of Table 2 are obtained; wherein the port number and the dynamic priority serial number are both counted from 0, and regarding the state signal, the idle state is 1, and the non-idle state is 0. Then, a serial number of each port is calculated, in which each serial number herein is a sum of the number of idle ports of which the priority is not higher than that of said port; for example, in Table 1, as for an allowed input port number is 4, a dynamic priority serial number is 5, the dynamic priority serial number is not higher than the number of ports of all idle ports of said port, that is, the dynamic priority serial number is not higher than sum of state information of all ports of said port: 0+1+1+0+1+0=3; the same applies to other ports. During system calculation, the serial numbers of all ports may be determined, i.e., the fourth row of Table 1 and the fourth row of Table 2 are full. However, in a subsequent matching process, only ports in an idle state can be matched, that is, subsequent matching is performed only when the state information is 1 (allowed input port numbers 4, 3, 1 and allowed output port numbers 5, 4, 2 and 0). As one matching relationship corresponds to one allowed input port and one allowed output port, the maximum matching takes a smaller value of the number of matchable ports on both sides, and thus in the current example, 3 is taken, that is, 3 matching relationships are selected. Optionally, the serial numbers of the ports at both sides are known herein, and the ports with the same serial number can be matched, and the result of port number matching at both sides is shown in Table 1.
Refer to
In this embodiment, matching of ports, i.e. inputs #0-#3 and outputs #0-#3 in
Hence, in the polling arbitration policy, matching of each input port needs to know matching information of a previous port, which is a process requiring continuous iteration; the higher the number of matched input and output ports, the more iteration information, and the longer the calculation period. According to the method in this embodiment, regardless of the number of input and output ports, it is only necessary to add, in parallel, a counter for calculating serial numbers, and the serial numbers of all input and output ports can be calculated concurrently in parallel, without generating iteration information of the polling arbitration matching policy, and direct matching can be performed after calculation of the serial numbers. Hence, the more input and output ports, the more obvious the time advantage of the node matching method in this embodiment.
Correspondingly, some embodiments of the present disclosure further disclose a node matching apparatus, applied to a target node in a multi-stage switching network, the target node comprising a plurality of allowed input ports and a plurality of allowed output ports. With reference to
In some specific embodiments, the node matching apparatus further comprises:
In an embodiment, referring to
In some specific embodiments, the matching module 3 is further configured to:
The dynamic priority serial number herein is briefly described as priority, and the same parameters of all ports at the same side may be input in the form of an array or a linked list.
It can be understood that internal logic of the first logical unit U1 and the second logical unit U2 may be selected according to a specific definition value of each parameter, and calculation under the parameter definitions of Table 1 and Table 2 in the embodiments above may be implemented by using the example in
In embodiments of the present disclosure, the basis for matching the input and output ports is whether the serial numbers are the same, and serial numbers on the same side are determined without polling, and can be determined at once, which greatly saves the time consumed in original polling arbitration; in addition, because the matching is carried out when all input and output states are consistent, a more ideal matching result can be achieved.
Based on the same inventive concept, according to another aspect of some embodiments of the present disclosure, as shown in
Based on the same inventive concept, according to another aspect of some embodiments of the present disclosure, as shown in
Finally, it should be noted that in the present text, 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 actual relationship or sequence between these entities or operations. Furthermore, the terms “comprise”, “comprising”, or any other variations thereof are intended to cover a non-exclusive inclusion, so that a process, a method, an article, or a device that comprises a series of elements not only comprises those elements, but also comprises other elements that are not explicitly listed, or further comprises inherent elements of the process, the method, the article, or the device. Without further limitation, an element defined by a sentence “comprising a . . . ” does not exclude other same elements existing in a process, a method, an article, or a device that comprises the element.
Hereinabove, a node matching method and apparatus, a device and a medium provided in some embodiments of the present disclosure are introduced in detail. The principle and embodiments of the present disclosure are described herein through specific examples, and the description of the embodiments above is only used to help understand the method and core ideas of the present disclosure; meanwhile, a person of ordinary skill in the art may make modifications to the specific embodiments and application ranges according to the idea of the present disclosure. In conclusion, the content of the description shall not be construed as limitation to the present disclosure.
Number | Date | Country | Kind |
---|---|---|---|
202111237445.8 | Oct 2021 | CN | national |
The present application is a National Stage Application of PCT International Application No. PCT/CN2022/090178, filed on Apr. 29, 2023, which claims the benefit of priority to Chinese Patent Application No. 202111237445.8, filed to the China National Intellectual Property Administration on Oct. 25, 2021 and entitled “Node Matching Method and Apparatus”, which is incorporated herein by reference in its entirety. To the extent appropriate, a claim of priority is made to each of the above-disclosed applications.
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/CN2022/090178 | 4/29/2022 | WO |