Network switching method and related equipment
By shaping the rate matrix and periodic matrix of optical signal transmission, multiple constraints are met, and the problem of overlapping packets in optical signal transmission is solved, and the continuity and efficiency of data transmission are improved.
Patent Information
- Application Number
- CN202411372724.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2044-09-29
AI Technical Summary
During optical signal transmission, packet overlap leads to a large data exchange time slot interval, affecting the continuity of data. In the prior art, it is difficult to effectively avoid packet overlap, resulting in low transmission efficiency.
By obtaining the first rate matrix, calculating the first period matrix, and shaping it according to the preset period constraints, the second rate matrix and the second period matrix are obtained to ensure that there is no overlap of packets during data exchange. The specific method includes setting multiple constraints, such as difference constraints, mutual quality constraints and maximum common factor constraints, performing preliminary shaping of the matrix and element rate shaping until all constraints are met.
It effectively avoids packet overlap during data exchange, improves the continuity and efficiency of data transmission, reduces the computing volume during network exchange, and optimizes hardware performance and switching algorithm performance.
Smart Images

Figure CN119299386A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of communication data exchange, and in particular to a network exchange method and related equipment. Background Art
[0002] As the bandwidth and operating frequency of network switching equipment increase, the parasitic effects of interconnects on traditional network switching equipment chips, such as parasitic capacitance, delay time, and signal crosstalk, have become very significant. Compared with network equipment based on electrical signal transmission, on-chip optical networks have the advantages of high transmission bandwidth, low signal delay, low optical loss, and anti-interference. Therefore, traditional network switching equipment that transmits information through electrical signals is gradually being replaced by on-chip optical networks.
[0003] In traditional network switching equipment, due to the small amount of data transmitted in a single transmission and the small time slot interval, when packet overlap occurs, continuous data transmission can be achieved by waiting for the next time slot to transmit again, which has little impact on data continuity. In the process of optical signal transmission, in order to ensure the transmission rate, optical networks usually use a single transmission of a large amount of information to exchange data, and the transmission time slot interval is also large. At this time, if packet overlap occurs, it takes a long time to wait for the next time slot to transmit, which is not conducive to continuous data transmission. Summary of the invention
[0004] In view of this, the purpose of the present application is to propose a network switching method.
[0005] Based on the above purpose, the present application provides a network switching method, including: obtaining a first rate matrix, and calculating a first period matrix based on the first rate matrix. Wherein, each row element in the first rate matrix is used to represent the signal rate input from the port indicated by the current row to the port indicated by the current column. In response to the first period matrix not satisfying the preset period constraint condition, the first rate matrix is shaped to obtain a second rate matrix, so that the second period matrix corresponding to the second rate matrix satisfies the period constraint condition, and data is exchanged with the second rate matrix based on the second period matrix.
[0006] In some embodiments, the periodic constraint includes a first constraint and a second constraint. The first constraint includes: calculating the difference between any two elements in each row / column in the periodic matrix, and in response to the difference being not 1, the first periodic matrix satisfies the first constraint, otherwise, the first periodic matrix does not satisfy the periodic constraint. The second constraint includes: determining whether any two elements in each row / column in the first periodic matrix are coprime, and in response to the elements being not coprime, the first periodic matrix satisfies the second constraint, otherwise, the first periodic matrix does not satisfy the periodic constraint.
[0007] In some embodiments, the periodic constraint also includes a third constraint. In response to the first periodic matrix not satisfying the preset periodic constraint, the first rate matrix is reshaped to obtain a second rate matrix, specifically including: in response to the first periodic matrix not satisfying the first constraint and / or the second constraint, the first periodic matrix is preliminarily reshaped to obtain a third periodic matrix. The elements of each row of the third periodic matrix are arranged from large to small, and the greatest common divisor of the elements of each row is calculated. Determine whether the greatest common divisor satisfies the third constraint. The third constraint is represented by the following formula: Among them, Q l,k represents the greatest common factor, and N represents the order of the third period matrix. In response to the third period matrix failing to satisfy one or more of the first constraint, the second constraint, and the third constraint, the third rate matrix corresponding to the third period matrix is reshaped until the third period matrix satisfies the first constraint, the second constraint, and the third constraint. In response to the third period matrix satisfying the first constraint, the second constraint, and the third constraint, the third period matrix is used as the second period matrix.
[0008] In some embodiments, the first period matrix is preliminarily reshaped to obtain the third period matrix, specifically including: based on the position of the elements in the first period matrix that do not satisfy the first constraint condition and / or the second constraint condition, finding the position of the elements to be shaped in the first rate matrix that need to be shaped. Reshaping the rates of all the elements to be shaped to the closest size to them In response to the fact that the shaped element does not satisfy the first constraint and / or the second constraint, the element is further shaped into the element closest to the size. The integer power of is raised until all elements satisfy the first constraint and the second constraint, and the third periodic matrix is obtained.
[0009] In some embodiments, the rates of all elements to be shaped are shaped to the closest value to the element. The method comprises: amplifying the rate of the element to be shaped, and determining whether the element to be shaped after the amplified rate satisfies the first constraint condition and the second constraint condition. In response to the element to be shaped after the amplified rate does not satisfy the first constraint condition and / or the second constraint condition, reducing the rate of the element to be shaped.
[0010] In some embodiments, the rates of all elements to be shaped are shaped to the closest value to the element. In some embodiments, the first rate matrix is composed of a matrix R = [r(i, j)]N×N Indicates, r(i,j) indicates the transmission rate from port i to port j, and N indicates the order of the first rate matrix. The first rate matrix is reshaped to obtain a second rate matrix, and further includes: setting a rate constraint condition, and the rate constraint condition is expressed by the following formula: The first rate matrix is shaped based on the rate constraint.
[0011] The present application also provides a network switching device, including: a matrix calculation module, used to obtain a first rate matrix, and calculate a first period matrix based on the first rate matrix. A matrix shaping module, used to, in response to the first period matrix not satisfying a preset period constraint condition, shape the first rate matrix to obtain a second rate matrix, so that a second period matrix corresponding to the second rate matrix satisfies the period constraint condition, and perform data exchange with the second rate matrix based on the second period matrix.
[0012] The present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the above methods when executing the program.
[0013] The present application also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute any of the above methods.
[0014] From the above, it can be seen that the network switching method provided in the present application avoids packet overlap during data exchange by setting periodic constraints, shaping the first periodic matrix based on the periodic constraints, and exchanging data based on the shaped second periodic matrix and the second rate matrix. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the present application or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0016] Figure 1 A schematic diagram of a flow chart of a network switching method provided in an embodiment of the present application;
[0017] Figure 2 A schematic diagram of a flow chart of a matrix shaping method provided in an embodiment of the present application;
[0018] Figure 3 A schematic diagram of a process flow of a preliminary shaping method provided in an embodiment of the present application;
[0019] Figure 4 A schematic diagram of a process for shaping an element to be shaped provided in an embodiment of the present application;
[0020] Figure 5 A schematic diagram of the structure of a network switching device provided in an embodiment of the present application;
[0021] Figure 6 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0022] In order to make the objectives, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0023] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present application should be the usual meanings understood by people with ordinary skills in the field to which the present application belongs. The "first", "second" and similar words used in the embodiments of the present application do not represent any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing in front of the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0024] As the bandwidth and operating frequency of network switching equipment increase, the parasitic effects of interconnects on traditional network switching equipment chips, such as parasitic capacitance, delay time, and signal crosstalk, have become very significant. Compared with network equipment based on electrical signal transmission, on-chip optical networks have the advantages of high transmission bandwidth, low signal delay, low optical loss, and anti-interference. Therefore, traditional network switching equipment that transmits information through electrical signals is gradually being replaced by on-chip optical networks.
[0025] In traditional network switching equipment, due to the small amount of data transmitted in a single transmission and the small time slot interval, when packet overlap occurs, continuous data transmission can be achieved by waiting for the next time slot to transmit again, which has little impact on data continuity. In the process of optical signal transmission, in order to ensure the transmission rate, optical networks usually use a single transmission of a large amount of information to exchange data, and the transmission time slot interval is also large. At this time, if packet overlap occurs, it takes a long time to wait for the next time slot to transmit, which is not conducive to continuous data transmission.
[0026] The growing demand for large model training and cloud data analysis not only brings extremely high performance requirements to computing acceleration hardware, but also brings tremendous pressure to data interaction and transmission between computing nodes. In order to keep up with the growth rate of hardware computing power and design data center switching networks that match the working speed of computing hardware, it is necessary to meet the bandwidth requirements of tens or even hundreds of gigabits per second (Gbps) per port and hundreds of terabits per second (Tbps) of total bandwidth, as well as the latency requirements of tens of nanoseconds per hop and tens of microseconds of end-to-end latency.
[0027] A major bottleneck in the performance of data center switching networks lies in the hardware performance of switching equipment and the performance of packet switching algorithms. At present, switching equipment has a trend towards all-optical development, which can bring excellent hardware performance such as bandwidth transparency and nanosecond switching delay. At present, the hardware implementation scheme of on-chip all-optical switching networks is mainly based on integrated optical circuits based on devices such as microring resonators (MRRs), Mach-Zehnder interferometers (MZIs), and arrayed waveguide gratings (AWGs). Scholars at home and abroad have achieved bandwidth-transparent ultra-high-speed and ultra-low latency switching through on-chip integration of all-optical switching networks. Therefore, how to better schedule the transmission order between packets, reasonably use the switching port resources, and further improve the throughput of the optical switching network will be the key to maximizing the utilization of hardware performance.
[0028] like Figure 1 As shown, the present application provides a network switching method, including: step S1, obtaining a first rate matrix, and calculating a first period matrix based on the first rate matrix. Wherein, each row element in the first rate matrix is used to represent the signal rate input from the port indicated by the current row to the port indicated by the current column.
[0029] In this embodiment, each row element in the first period matrix is used to represent the signal period input from the port indicated by the current row to the port indicated by the current column. The elements in the first period matrix correspond to the elements in the first rate matrix one by one, and the elements in the first period matrix and the first rate matrix at corresponding positions are reciprocals of each other.
[0030] Step S2, in response to the first periodic matrix not satisfying the preset periodic constraint, reshaping the first rate matrix to obtain a second rate matrix, so that the second periodic matrix corresponding to the second rate matrix satisfies the periodic constraint, and exchanging data with the second rate matrix based on the second periodic matrix.
[0031] The second rate matrix is obtained by shaping the elements in the first rate matrix corresponding to the elements in the first period matrix that do not meet the period constraint condition, and the network data is exchanged based on the second rate matrix, thereby avoiding packet overlap during data exchange.
[0032] In some embodiments, the period constraint includes a first constraint and a second constraint.
[0033] The first constraint condition includes: calculating the difference between any two elements in each row / column in the periodic matrix, and in response to the difference not being 1, the first periodic matrix satisfies the first constraint condition, otherwise, the first periodic matrix does not satisfy the periodic constraint condition.
[0034] In this embodiment, if the difference between the periods of two input signals is 1, it is assumed that the packet arrival time slots of the two signals are n r ×T r +a r and n s ×T s +a S To satisfy the non-overlapping grouping, we have a r +n r ×T r ≠a s +n s ×T s , that is, a r -a s ≠n s ×T s -n r ×T r ,
[0035] When n s =n r When r -a s ≠n(T s -T r ),n∈N, and since T s With T r The difference is 1, then a r -a s ≠n,n∈N, that is, the difference between the initial arrival time slots of the two cannot be an arbitrary integer. There is no initial time slot that meets the conditions, and overlap is bound to occur.
[0036] The second constraint condition includes: determining whether any two elements in each row / column of the first periodic matrix are mutually prime. If the elements are not mutually prime, the first periodic matrix satisfies the second constraint condition. Otherwise, the first periodic matrix does not satisfy the periodic constraint condition.
[0037] Among them, when there are mutually prime elements in each row / column of the first periodic matrix, the greatest common divisor of the two signals is 1. If the greatest common divisor of the periods of two input signals is 1, it is assumed that the packet arrival time slots of the two signals are n r ×T r +a r and ns ×T s +a s To ensure that the groups do not overlap, the two signals must satisfy formula a r -a s ≠n s ×T s -n r ×T r . Due to T s With T r The greatest common divisor of is 1. According to Pei Zuo's theorem, there must be positive integers a and b such that a×T s -b×T r =1 holds. When n s =a n And n r =b n (n is any positive integer), a r -a s ≠n s ×T s -n r ×T r Transformed into a r -a s ≠n(aT s -bT r ), that is, a r -a s ≠n, n∈N, there is no initial time slot that meets the conditions, and the signals must overlap.
[0038] In some embodiments, Figure 2 As shown, the period constraint also includes a third constraint.
[0039] Step S2 specifically includes: Step S21, in response to the first periodic matrix failing to satisfy the first constraint condition and / or the second constraint condition, preliminarily reshaping the first periodic matrix to obtain a third periodic matrix.
[0040] Step S22, arranging the elements of each row of the third periodic matrix from large to small, and calculating the greatest common divisor of the elements of each row.
[0041] Step S23, determining whether the greatest common divisor satisfies the third constraint condition.
[0042] In this embodiment, since a periodic matrix that does not satisfy the first and second constraints usually cannot satisfy the third constraint either, the first periodic matrix is preliminarily reshaped to obtain a third periodic matrix. After the third periodic matrix satisfies the first and second constraints, it is determined whether the third period matrix satisfies the third constraint, thereby reducing the amount of computation required to determine whether the first periodic matrix satisfies the periodic constraint.
[0043] The third constraint is expressed by the following formula: Among them, Q l,k represents the greatest common factor, and N represents the order of the third periodic matrix.
[0044] If the third periodic matrix does not satisfy the third constraint, the network switching packets will inevitably overlap. The following mathematical induction method is used to prove:
[0045] When N = 2, only a i,1 -a i,2 ≠n i,2 ×T i,2 -n i,1 ×T i,1 According to Pei Zuo's theorem, the right side of the equation can be replaced by k×Q 2,1 , k∈Z, that is, a i,1 -a i,2 ≠k×Q 2,1 ,k∈Z. Since at this time That is Q 2,1 >1, there is obviously a that satisfies the condition i,1 =Q 2,1 、a i,2 =1 makes the groups non-overlapping, so when N=2, if the third constraint condition is met, the groups non-overlapping holds.
[0046] Now we only need to prove that when N=k, the third constraint is satisfied and the circuits do not overlap. Then when N=k+1, the third constraint is satisfied and the circuits do not overlap. Since the groups do not overlap when N=k, to prove that it also holds true when N=k+1, we only need to prove that the newly added signal when N=k+1 does not overlap with the remaining k signals compared to when N=k. The newly added signal is in the pth position (1≤p≤N) in the order of period from small to large among all the k+1 signals. Then for the initial time slot a of this signal, i,p The following k constraints must be met:
[0047]
[0048] For m1, its value cannot be LCM i In the congruence class of A, that is, a i,p The value cannot be LCM i In the congruence class of Similarly, for m2, its value cannot be LCM i In the congruence class of A, that is, a i,p The value cannot be LCM i In the congruence class of By analogy, a i,pThe value cannot be LCM i In the congruence class of Easy to know LCM i With LCM i congruence classes, so a i,p The possible value range is LCM i In the congruence class of Since the third constraint is satisfied, That is, a that does not overlap the groups i,p There must be no overlapping of groups.
[0049] Step S24, in response to the third period matrix failing to satisfy one or more of the first constraint, the second constraint and the third constraint, reshaping the third rate matrix corresponding to the third period matrix until the third period matrix satisfies the first constraint, the second constraint and the third constraint.
[0050] Step S25: in response to the third periodic matrix satisfying the first constraint condition, the second constraint condition and the third constraint condition, the third periodic matrix is used as the second periodic matrix.
[0051] The third periodic matrix is reshaped multiple times so that the third periodic matrix satisfies all periodic constraints, and the reshaped third periodic matrix is used as the second periodic matrix, thereby avoiding packet overlap during network switching.
[0052] In some embodiments, Figure 3 As shown, step S21 specifically includes:
[0053] Step S201: Find the position of the to-be-shaped element of the first rate matrix that needs to be shaped based on the position of the element that does not satisfy the first constraint condition and / or the second constraint condition in the first periodic matrix.
[0054] Step S202: shaping the rates of all elements to be shaped to the closest value. The integer power of is used to determine whether the shaped element satisfies the first constraint and the second constraint.
[0055] Step S203: In response to the reshaped element not satisfying the first constraint condition and / or the second constraint condition, continue to reshape the element into a size closest to the first constraint condition. The integer power of is raised until all elements satisfy the first constraint and the second constraint, and the third periodic matrix is obtained.
[0056] In this embodiment, the elements that do not meet the first constraint and the second constraint are shaped first, thereby reducing the amount of calculation required for optimization. Since the elements at corresponding positions in the period matrix and the rate matrix are reciprocals of each other, by shaping the rate of the element to be shaped into The integer power of is used to shape the number of cycles corresponding to the element to be shaped into an integer power of 2, thereby avoiding the situation of packet overlap during network data exchange.
[0057] In some embodiments, Figure 4 As shown, step S202 specifically includes:
[0058] Step S211, amplifying the rate of the element to be shaped, and determining whether the amplified rate of the element to be shaped satisfies the first constraint condition and the second constraint condition.
[0059] Step S212: in response to the element to be shaped not satisfying the first constraint condition and / or the second constraint condition after the rate is enlarged, the rate of the element to be shaped is reduced.
[0060] In this embodiment, the rate of the element to be shaped is amplified by giving priority, and when the rate of the element to be shaped cannot meet the first constraint and / or the second constraint after amplification, the rate of the element to be shaped is reduced, thereby ensuring that the maximum bandwidth can be allocated to each port during the network data exchange process. On the contrary, when there are too many ports to be exchanged, resulting in a long shaping time, the rate of the element to be shaped can also be reduced by giving priority to reduce the matrix shaping time. When solving similar problems, those skilled in the art can adjust the priorities of different shaping operations according to actual application needs without departing from the scope of disclosure of this application.
[0061] In some embodiments, step S202 further includes: step S221, determining whether the period of the element to be shaped is a prime number and / or an odd number, and preferentially shaping the elements to be shaped whose period is a prime number and / or an odd number.
[0062] In this embodiment, by preferentially shaping the elements to be shaped whose periods are prime numbers and / or odd numbers, the periodic matrix satisfies the first constraint and the second constraint before other elements are shaped, thereby reducing the amount of calculation for whether the periodic matrix satisfies the third constraint.
[0063] In some embodiments, the first rate matrix is represented by the matrix R = [r(i, j)] N×N Indicates that r(i,j) represents the transmission rate from port i to port j, and N represents the order of the first rate matrix.
[0064] Step S2 also includes:
[0065] Step S20, set the rate constraint condition, which is represented by the following formula:
[0066] Step S200, shape the first rate matrix based on the rate constraint condition.
[0067] In this embodiment, due to the limitation of the port rate during the network switching process, when shaping the elements to be shaped, the rate constraint condition also needs to be satisfied, so as to avoid overloading of the port rate.
[0068] As a preferred implementation manner, the method disclosed in this application can be implemented by the following steps in practical applications:
[0069] Obtain the first rate matrix R = [r(i,j)] N×N :
[0070]
[0071] Taking r(1,1) as an example, the rate of r(1,1) at this time is That is, the period for r(1,1) to transmit data is 2 time slots at this time. Similarly, it can be known that the period for r(1,2) to transmit data is 12 time slots, and the rest of the elements are类推. Calculate the first period matrix by taking the reciprocal:
[0072]
[0073] At this time, judge whether the first period matrix satisfies the first constraint condition and the second constraint condition. Since c(3,4) does not satisfy the first constraint condition and the second constraint condition, the rate of r(3,4) is expanded to After that, it satisfies the first constraint condition and the second constraint condition. Denote the matrix at this time as the third rate matrix, and the corresponding third period matrix of the third rate matrix:
[0074]
[0075] Judge whether the elements in the third period matrix satisfy the third constraint condition. Denote the signal period in the third period matrix as T i,j , sort the periods from small to large as T 1,1 = 2 < T 1,2 = 4 < T 1,3 = 8 < T 1,4 = 12, denote Q m,n as the greatest common factor of T i,m and T i,n (where m > n), define the set Q = {Q m,n |1 ≤ n < m ≤ N}. Denote LCM iis the least common multiple of all elements in the set Q corresponding to port i. Then the set Q corresponding to the first row of elements (ports that exchange with port 1) is {Q 4,1 ,Q 4,2 ,Q 4,3 ,Q 3,1 ,Q 3,2 ,Q 2,1}. When l in the constraint condition is 1, we have The third constraint is not satisfied, and the same operation is performed on the other rows.
[0076] Reshape the signal that does not meet the third constraint. Taking the first row of elements as an example, since r(1,1) is Cannot expand further, so shrink it to After reshaping, the period of the first row of elements is reordered, and T 1,1 =4 <T 1,2 =8 <T 1,3 =12. The shaped Q set is {Q 3,1 ,Q 3,2 ,Q 2,1}, when the third constraint l is 1, When l of the third constraint condition is 2, When l of the third constraint condition is 3, The port 1 after shaping satisfies the first constraint, the second constraint and the third constraint at the same time. At this time, the shaping of the first row elements is completed, and the other row elements are shaped according to the above steps to obtain the second period matrix C″ and the second rate matrix R″:
[0077]
[0078] Data is exchanged based on the second period matrix and the second rate matrix to avoid packet overlap.
[0079] As can be seen from the above embodiments of the present application, the present application sets periodic constraints, reshapes the first periodic matrix based on the periodic constraints, and exchanges data based on the reshaped second periodic matrix and the second rate matrix, thereby avoiding packet overlap during data exchange. By setting multiple constraints, and preliminarily reshaping the elements in the first periodic matrix and the first rate matrix, and verifying whether the third periodic matrix after the preliminary shaping satisfies the third constraint, it is avoided to verify whether the first periodic matrix satisfies the constraint multiple times, thereby reducing the amount of computation required in the network exchange process. And by preferentially expanding the rate of network exchange, the first rate matrix is reshaped, thereby reducing the transmission rate loss caused by service shaping, while providing QoS (Quality of Service) guarantee, reducing the performance loss.
[0080] It should be noted that the method of the embodiment of the present application can be performed by a single device, such as a computer or server. The method of this embodiment can also be applied to a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of the embodiment of the present application, and the multiple devices will interact with each other to complete the described method.
[0081] It should be noted that the above describes some embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0082] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a network switching device.
[0083] refer to Figure 5 The network switching device includes: a matrix calculation module 301, which is used to obtain a first rate matrix and calculate a first periodic matrix based on the first rate matrix.
[0084] The matrix shaping module 302 is used to shape the first rate matrix to obtain a second rate matrix in response to the first period matrix not satisfying the preset period constraint condition, so that the second period matrix corresponding to the second rate matrix satisfies the period constraint condition, and exchange data with the second rate matrix based on the second period matrix.
[0085] For the convenience of description, the above device is described in terms of functions divided into various modules. Of course, when implementing the present application, the functions of each module can be implemented in the same or multiple software and / or hardware.
[0086] The device of the above embodiment is used to implement the corresponding network switching method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.
[0087] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the network switching method described in any of the above embodiments is implemented.
[0088] Figure 6A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other through the bus 1050 in the device.
[0089] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0090] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.
[0091] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0092] The communication interface 1040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).
[0093] The bus 1050 includes a path that transmits information between the various components of the device (eg, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).
[0094] It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.
[0095] The electronic device of the above embodiment is used to implement the corresponding network switching method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.
[0096] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the network switching method described in any of the above embodiments.
[0097] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0098] The computer instructions stored in the storage medium of the above embodiments are used to enable the computer to execute the network switching method described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0099] It should be noted that the embodiments of the present application can be further described in the following manner:
[0100] A network switching method, comprising:
[0101] A first rate matrix is obtained, and a first period matrix is calculated based on the first rate matrix, wherein each row element in the first rate matrix is used to represent the signal rate input from the port indicated by the current row to the port indicated by the current column.
[0102] In response to the first period matrix not satisfying the preset period constraint, the first rate matrix is shaped to obtain a second rate matrix so that the second period matrix corresponding to the second rate matrix satisfies the period constraint, and data is exchanged with the second rate matrix based on the second period matrix.
[0103] Optionally, the period constraint includes a first constraint and a second constraint.
[0104] The first constraint condition includes: calculating the difference between any two elements in each row / column in the periodic matrix, and in response to the difference not being 1, the first periodic matrix satisfies the first constraint condition, otherwise, the first periodic matrix does not satisfy the periodic constraint condition.
[0105] The second constraint condition includes: determining whether any two elements in each row / column of the first periodic matrix are mutually prime. If the elements are not mutually prime, the first periodic matrix satisfies the second constraint condition. Otherwise, the first periodic matrix does not satisfy the periodic constraint condition.
[0106] Optionally, the period constraint condition also includes a third constraint condition.
[0107] In response to the first period matrix not satisfying a preset period constraint condition, the first rate matrix is shaped to obtain a second rate matrix, specifically including:
[0108] In response to the first periodic matrix failing to satisfy the first constraint condition and / or the second constraint condition, the first periodic matrix is preliminarily reshaped to obtain a third periodic matrix.
[0109] Arrange the elements of each row of the third periodic matrix from largest to smallest, and calculate the greatest common factor of the elements of each row.
[0110] Determine whether the greatest common divisor satisfies the third constraint.
[0111] The third constraint is expressed by the following formula: Among them, Q l,k represents the greatest common factor, and N represents the order of the third periodic matrix.
[0112] In response to the third period matrix failing to satisfy one or more of the first constraint, the second constraint and the third constraint, the third rate matrix corresponding to the third period matrix is reshaped until the third period matrix satisfies the first constraint, the second constraint and the third constraint.
[0113] In response to the third periodic matrix satisfying the first constraint condition, the second constraint condition and the third constraint condition, the third periodic matrix is used as the second periodic matrix.
[0114] Optionally, the first periodic matrix is preliminarily reshaped to obtain a third periodic matrix, specifically including:
[0115] Based on the positions of the elements in the first periodic matrix that do not satisfy the first constraint condition and / or the second constraint condition, the positions of the to-be-shaped elements of the first rate matrix that need to be shaped are found.
[0116] Reshape the rate of all elements to be shaped to the closest size The integer power of is used to determine whether the shaped element satisfies the first constraint and the second constraint.
[0117] In response to the reshaped element not satisfying the first constraint and / or the second constraint, continue to reshape the element to the size closest to it. The integer power of is raised until all elements satisfy the first constraint and the second constraint, and the third periodic matrix is obtained.
[0118] Optional, where
[0119] Reshape the rate of all elements to be shaped to the closest size Integer powers of include:
[0120] The rate of the element to be shaped is amplified, and it is determined whether the element to be shaped after the amplified rate satisfies the first constraint condition and the second constraint condition.
[0121] In response to the element to be shaped not satisfying the first constraint condition and / or the second constraint condition after the rate is enlarged, the rate of the element to be shaped is reduced.
[0122] Optionally, the rate of all elements to be shaped is shaped to the closest size Integer powers of include:
[0123] It is determined whether the period of the element to be shaped is a prime number and / or an odd number, and the elements to be shaped whose period is a prime number and / or an odd number are preferentially shaped.
[0124] Optionally, the first rate matrix is composed of the matrix R = [r(i,j)] N×N Indicates that r(i,j) represents the transmission rate from port i to port j, and N represents the order of the first rate matrix.
[0125] Reshaping the first rate matrix to obtain a second rate matrix also includes:
[0126] Set the rate constraint. The rate constraint is expressed by the following formula:
[0127] The first rate matrix is shaped based on the rate constraint.
[0128] A network switching device, comprising:
[0129] The matrix calculation module is used to obtain a first rate matrix and calculate a first period matrix based on the first rate matrix.
[0130] A matrix shaping module is used to, in response to the first periodic matrix not satisfying a preset periodic constraint condition, shape the first rate matrix to obtain a second rate matrix so that the second periodic matrix corresponding to the second rate matrix satisfies the periodic constraint condition, and exchange data with the second rate matrix based on the second periodic matrix.
[0131] An electronic device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 7 when executing the program.
[0132] A non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute the method according to any one of claims 1 to 7.
[0133] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application (including the claims) is limited to these examples. In line with the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.
[0134] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present application difficult to understand, the known power supply / ground connection with the integrated circuit (IC) chip and other components may or may not be shown in the provided drawings. In addition, the device can be shown in the form of a block diagram to avoid making the embodiments of the present application difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform to be implemented in the embodiments of the present application (that is, these details should be fully within the scope of understanding of those skilled in the art). In the case of elaborating specific details (e.g., circuits) to describe exemplary embodiments of the present application, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details or when these specific details are changed. Therefore, these descriptions should be considered to be illustrative rather than restrictive.
[0135] Although the present application has been described in conjunction with specific embodiments of the present application, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.
[0136] The embodiments of the present application are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the scope of protection of the present application.
Claims
1. A network switching method, comprising: Obtain a first rate matrix, and calculate a first period matrix based on the first rate matrix; wherein each row element in the first rate matrix is used to represent the signal rate input from the port indicated by the current row to the port indicated by the current column; In response to the first period matrix not satisfying a preset period constraint, the first rate matrix is shaped to obtain a second rate matrix so that a second period matrix corresponding to the second rate matrix satisfies the period constraint, and data is exchanged with the second rate matrix based on the second period matrix.
2. The network switching method according to claim 1, wherein: The periodic constraint condition includes a first constraint condition and a second constraint condition; The first constraint condition includes: calculating the difference between any two elements in each row / column in the periodic matrix, and in response to the difference not being 1, the first periodic matrix satisfies the first constraint condition, otherwise, the first periodic matrix does not satisfy the periodic constraint condition; The second constraint condition includes: determining whether any two elements in each row / column of the first periodic matrix are mutually prime; if the elements are not mutually prime, the first periodic matrix satisfies the second constraint condition; otherwise, the first periodic matrix does not satisfy the periodic constraint condition.
3. The network switching method according to claim 2, wherein: The periodic constraint condition also includes a third constraint condition; In response to the first period matrix not satisfying a preset period constraint condition, shaping the first rate matrix to obtain a second rate matrix specifically includes: In response to the first periodic matrix failing to satisfy the first constraint condition and / or the second constraint condition, preliminarily reshaping the first periodic matrix to obtain a third periodic matrix; Arrange the elements of each row of the third periodic matrix from large to small, and calculate the greatest common factor of the elements of each row; Determining whether the greatest common divisor satisfies the third constraint condition; The third constraint is expressed by the following formula: Among them, Q l,k represents the greatest common factor, and N represents the order of the third periodic matrix; In response to the third period matrix failing to satisfy one or more of the first constraint condition, the second constraint condition and the third constraint condition, shaping a third rate matrix corresponding to the third period matrix until the third period matrix satisfies the first constraint condition, the second constraint condition and the third constraint condition; In response to the third periodic matrix satisfying the first constraint condition, the second constraint condition and the third constraint condition, the third periodic matrix is used as the second periodic matrix.
4. The network switching method according to claim 3, wherein: The performing preliminary shaping on the first periodic matrix to obtain a third periodic matrix specifically includes: Finding positions of elements of the first rate matrix that need to be shaped based on positions of elements in the first periodic matrix that do not satisfy the first constraint condition and / or the second constraint condition; Reshape the rates of all the elements to be shaped to the closest size to the integer power of , determining whether the shaped element satisfies the first constraint condition and the second constraint condition; In response to the reshaped element not satisfying the first constraint and / or the second constraint, the element is further reshaped into a size closest to the element. The integer power of is raised until all the elements satisfy the first constraint condition and the second constraint condition, thereby obtaining a third periodic matrix.
5. The network switching method according to claim 4, wherein: The rate of all the elements to be shaped is shaped to the closest size. Integer powers of include: Amplifying the rate of the element to be shaped, and determining whether the element to be shaped after the amplified rate satisfies the first constraint condition and the second constraint condition; In response to the to-be-shaped element not satisfying the first constraint condition and / or the second constraint condition after the rate is enlarged, the rate of the to-be-shaped element is reduced.
6. The network switching method according to claim 4, wherein: The rate of all the elements to be shaped is shaped to the closest size. Integer powers of include: It is determined whether the period of the element to be shaped is a prime number and / or an odd number, and the elements to be shaped whose period is a prime number and / or an odd number are preferentially shaped.
7. The network switching method according to claim 1, wherein: The first rate matrix is composed of the matrix R = [r(i,j)] N×N represents, r(i,j) represents the transmission rate from port i to port j, and N represents the order of the first rate matrix; The step of reshaping the first rate matrix to obtain a second rate matrix further includes: Set a rate constraint condition, which is expressed by the following formula: The first rate matrix is shaped based on the rate constraint.
8. A network switching device, comprising: A matrix calculation module, used for obtaining a first rate matrix, and calculating a first period matrix based on the first rate matrix; A matrix shaping module is used to, in response to the first period matrix not satisfying a preset period constraint, shape the first rate matrix to obtain a second rate matrix so that a second period matrix corresponding to the second rate matrix satisfies the period constraint, and exchange data with the second rate matrix based on the second period matrix.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 7 when executing the program. 10 . A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute the method according to claim 1 .
Citation Information
Patent Citations
Cycle information scheduling method of train communication network based on Ethernet
CN106953886A
Channel state judgment method based on frequency hopping and time hopping pattern under self-organizing network
CN111556528A
Asynchronous terminal system scheduling optimization method based on constrained programming
CN115225587A
Optical switch delay assurance scheduling method based on iterative polling
CN118018489A
Scheduling of guaranteed-bandwidth low-jitter traffic in input-buffered switches
US20030227901A1