A channel allocation method and system

The channel allocation method in optical communication chips addresses inflexibility and resource demands by selecting evenly distributed opportunity points and adjusting intervals, providing flexible allocation and reduced maintenance costs.

CN115379320BActive Publication Date: 2024-12-06FIBERHOME TELECOMMUNICATION TECHNOLOGIES CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210949022.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-09
Publication Date
2024-12-06
Estimated Expiration
2042-08-09

AI Technical Summary

Technical Problem

The existing channel allocation method in optical communication chips using uniform distribution circuits is inflexible and requires additional module logic resources, increasing maintenance costs and difficulty.

Method used

A channel allocation method that selects evenly distributed and idle opportunity points from a basic bandwidth, using flag positions to adjust intervals and allocate channels without additional hardware, allowing for flexible allocation and reduced resource usage.

Benefits of technology

This method enables flexible channel allocation without additional logic resources, reducing maintenance costs and adapting to multiple channels with different bandwidths, while meeting clock beat processing requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115379320B_ABST
    Figure CN115379320B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of optical communication technology, and provides a channel allocation method and system. The method includes taking the bandwidth of the preset size in the bandwidth to be allocated as the basic bandwidth, selecting N first opportunity points that are evenly distributed and idle from all opportunity points of the basic bandwidth, taking the position of each first opportunity point as a flag bit, and finding one or more second intervals in which the number of opportunity points contained is less than the target number in the first interval corresponding to the last N-1 flag bits, taking each second interval as the target interval in turn from front to back, and shifting the flag bit corresponding to the target interval backward, so that the opportunity point located at the flag bit is an idle opportunity point, and the number of opportunity points contained in the target interval is the minimum number that can reach the target number, and the opportunity point corresponding to the flag bit is allocated to the channel. The present invention does not need to introduce an evenly distributed circuit, so that while not adding additional logic resources, it is also easier to maintain and reduces the cost of later maintenance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of optical communication technology, and in particular to a channel allocation method and system. Background Art

[0002] With the growth of communication services, optical communication chips are often required to have larger bandwidth and capacity. Large bandwidth requires a large amount of cache resources when processing across modules. Large capacity means that the number of modules and module logic resources required by optical communication chips will increase significantly. In this case, in order to reduce the power consumption of optical communication chips and make the cache resources of optical communication chips as small as possible, the method usually adopted is to evenly distribute the bandwidth of each channel, that is, channel allocation, so as to reasonably utilize cache resources.

[0003] The existing channel allocation method is to add a uniform distribution circuit between the upstream and downstream module designs, and perform channel allocation through the uniform distribution circuit to achieve the purpose of rationally utilizing cache resources. This method of channel allocation through hardware circuits is not only not flexible enough, but also requires changes to the hardware circuits during maintenance, which increases the subsequent maintenance costs and difficulty. At the same time, the use of uniform distribution circuits will also increase additional module logic resources.

[0004] In view of this, overcoming the defects of the prior art is an urgent problem to be solved in the field of this technology. Summary of the invention

[0005] The technical problem to be solved by the present invention is that the method of using a uniform distribution circuit to distribute channels in the prior art is not flexible enough and requires the addition of additional module logic resources.

[0006] The present invention adopts the following technical solution:

[0007] In a first aspect, the present invention provides a channel allocation method, comprising:

[0008] The bandwidth of the preset size in the bandwidth to be allocated is used as the basic bandwidth, and N first opportunity points that are evenly distributed and idle are selected from all opportunity points of the basic bandwidth, where N is the number of opportunity points required by the channel;

[0009] Taking the position of each first opportunity point as a flag, find one or more second intervals containing less opportunity points than the target number in the first intervals corresponding to the last N-1 flags, wherein the end position of each first interval is the corresponding flag, and the start position of each first interval is the previous flag of the corresponding flag;

[0010] From the front to the back, take each second interval as the target interval in turn, shift the flag position corresponding to the target interval backward, so that the opportunity point located at the flag position is an idle opportunity point, and the number of opportunity points contained in the target interval is the minimum number that can reach the target number, and shift the flag position corresponding to each first interval after the target interval backward, so that the number of idle opportunity points contained in each first interval after the target interval is consistent with the number of idle opportunity points contained before the shift;

[0011] Assign the opportunity point corresponding to each flag position to the channel.

[0012] Preferably, selecting N first opportunity points that are evenly distributed and idle from all opportunity points of the basic bandwidth specifically includes:

[0013] Mapping all idle opportunity points on the basic bandwidth into a continuous sequence of virtual opportunity points, and selecting evenly distributed N virtual opportunity points from all virtual opportunity points in the sequence of virtual opportunity points;

[0014] The N virtual opportunity points are inversely mapped onto the basic bandwidth to obtain N first opportunity points that are evenly distributed and idle on the basic bandwidth.

[0015] Preferably, the selecting evenly distributed N virtual opportunity points from all virtual opportunity points in the virtual opportunity point sequence specifically includes:

[0016] Each value in M×1, M×2, …, M×N is used as a reference value in turn, and the quotient obtained by dividing each reference value by N is rounded up or down to obtain the position of each virtual opportunity point to be selected in the virtual opportunity point sequence, and the virtual opportunity point of the corresponding position in the virtual opportunity point sequence is selected, where M is the number of all opportunity points in the virtual opportunity point sequence.

[0017] Preferably, when the first interval is a half-open and half-closed interval, the flag bit corresponding to the target interval is shifted backward, specifically including:

[0018] Find the i-th opportunity point after the starting position of the target interval, and if the i-th opportunity point is an idle opportunity point, translate the flag corresponding to the target interval to the position of the i-th opportunity point;

[0019] Otherwise, the flag bit corresponding to the target interval is translated to the position of the first idle opportunity point after the i-th opportunity point, where i is the target number.

[0020] Preferably, when the first interval is a half-open and half-closed interval, the flag bit corresponding to each first interval after the target interval is shifted backward, specifically including:

[0021] Find the number j of idle opportunity points added in the process of shifting the marker corresponding to the target interval backward;

[0022] The j-th idle opportunity point after the marker corresponding to each first interval is sequentially found as the corresponding designated position, and the marker corresponding to each first interval is translated backward to the corresponding designated position.

[0023] Preferably, the target number is determined by a minimum interval threshold between opportunity points of channels that can be allowed in the modules that need to be evenly distributed, specifically including:

[0024] The simulated channel allocation is performed using the minimum interval threshold as the simulated target number. If, during the flag bit shifting process in the simulated channel allocation, when the flag bit is shifted to the last idle opportunity point position on the bandwidth to be allocated, the number of opportunity points included in the target interval corresponding to the flag bit still cannot reach the target number, or the number of idle opportunity points included in the first interval corresponding to the flag bit is still less than the number of idle opportunity points included before the shifting, the simulated target number used in the last simulated channel allocation of this simulated channel allocation is used as the final target number used for channel allocation;

[0025] Otherwise, the analog target quantity used for the current analog channel allocation is increased by the preset value and used as the next analog target quantity for the next analog channel allocation.

[0026] Preferably, the method further comprises:

[0027] Select N first opportunity points that are evenly distributed and idle from all opportunity points to be allocated bandwidth, where N is the number of opportunity points required by the channel;

[0028] The position of each first opportunity point is used as a flag bit. In the third intervals corresponding to the last N-1 flag bits, if the number of opportunity points contained in each third interval is greater than or equal to the minimum interval threshold, the N first opportunity points are allocated to the channel, and channel allocation is not continued;

[0029] Otherwise, continue to allocate channels, wherein the end position of each third interval is the corresponding flag bit, and the start position of each third interval is the previous flag bit of the corresponding flag bit.

[0030] Preferably, when channel allocation is required for multiple channels, channel allocation is performed for each channel in descending order of the number of opportunity points required for the channel. When channel allocation is performed for each channel, the bandwidth of the preset size in the bandwidth to be allocated is used as the basic bandwidth, specifically including:

[0031] The value obtained by subtracting the preset redundancy value from the number of idle opportunity points in the bandwidth to be allocated is taken as the number n of idle opportunity points that should be included in the basic bandwidth, and the bandwidth to be allocated is divided into two front and rear areas, so that the number of idle opportunity points included in the front area is n, and the bandwidth corresponding to the front area is taken as the basic bandwidth.

[0032] Preferably, the number of opportunity points required for the channel is calculated based on the bandwidth required for the channel, specifically including:

[0033] The number of opportunity points required by the channel is obtained by dividing the bandwidth required by the channel by the minimum allocated bandwidth, wherein the minimum allocated bandwidth is the minimum service granular bandwidth between modules that need to be evenly allocated or the least common multiple bandwidth of each service bandwidth.

[0034] In a second aspect, the present invention provides a channel allocation system, the system comprising a selection module and an allocation module;

[0035] The selection module is used to use the bandwidth of the preset size in the bandwidth to be allocated as the basic bandwidth, select N uniformly distributed and idle first opportunity points from all opportunity points of the basic bandwidth, where N is the number of opportunity points required by the channel; use the position of each first opportunity point as a flag bit, and find one or more second intervals containing less opportunity points than the target number in the first interval corresponding to the last N-1 flag bits, where the end position of each first interval is the corresponding flag bit, and the start position of each first interval is the previous flag bit of the corresponding flag bit; use each second interval as the target interval in turn from front to back, shift the flag bit corresponding to the target interval backward, so that the opportunity point located at the flag bit is an idle opportunity point, and the number of opportunity points contained in the target interval is the minimum number that can reach the target number, and shift the flag bit corresponding to each first interval after the target interval backward, so that the number of idle opportunity points contained in each first interval after the target interval is consistent with the number of idle opportunity points contained before the shift;

[0036] The allocation module is used to allocate the opportunity point corresponding to each flag bit selected by the selection module to the channel.

[0037] In a third aspect, the present invention further provides a channel allocation device, for implementing the channel allocation method described in the first aspect, the device comprising:

[0038] At least one processor; and a memory in communication with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the processor to execute the channel allocation method described in the first aspect.

[0039] In a fourth aspect, the present invention further provides a non-volatile computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are executed by one or more processors to complete the channel allocation method described in the first aspect.

[0040] The present invention provides a method for channel allocation, which can be used to allocate channels without introducing a uniform allocation circuit, so that no additional logic resources are added, and it is easier to maintain and reduce the cost of later maintenance. At the same time, in a preferred embodiment of the present invention, it can also adapt to the allocation of multiple channels and multiple channels with different bandwidths, making the channel allocation more flexible. In addition, the present invention can meet the channel allocation requirements of various clock beat circuits by determining the number of opportunity points between opportunity points for each channel according to the clock beat processing requirements of the circuit during allocation. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0042] Figure 1 is a flow chart of a channel allocation method provided by an embodiment of the present invention;

[0043] Figure 2 is a flow chart of a channel allocation method provided by an embodiment of the present invention;

[0044] Figure 3 is a flow chart of a channel allocation method provided by an embodiment of the present invention;

[0045] Figure 4 is a flow chart of a channel allocation method provided by an embodiment of the present invention;

[0046] Figure 5 is a flow chart of a channel allocation method provided by an embodiment of the present invention;

[0047] Figure 6 is a flow chart of a channel allocation method provided by an embodiment of the present invention;

[0048] Figure 7 is a flow chart of a channel allocation method provided by an embodiment of the present invention;

[0049] Figure 8 is a flow chart of a channel allocation method provided by an embodiment of the present invention;

[0050] Fig. 9is a schematic diagram of a channel allocation method provided by an embodiment of the present invention;

[0051] Fig.10 is a schematic diagram of a channel allocation method provided by an embodiment of the present invention;

[0052] Fig.11 is a schematic diagram of the architecture of a channel allocation system provided by an embodiment of the present invention;

[0053] Fig.12 It is a schematic diagram of the architecture of a channel allocation device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0054] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0055] In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0056] Embodiment 1:

[0057] Embodiment 1 of the present invention provides a channel allocation method, such as Figure 1 As shown, including:

[0058] In step 201, a bandwidth of a preset size in the bandwidth to be allocated is used as a basic bandwidth, and N first opportunity points that are evenly distributed and idle are selected from all opportunity points of the basic bandwidth, where N is the number of opportunity points required by the channel.

[0059] The bandwidth to be allocated may be the total bandwidth in the optical communication chip or a portion of the total bandwidth, and the preset size is obtained by those skilled in the art based on the analysis of the requirements of the optical communication chip circuit design. Usually, the total bandwidth of the optical communication chip is used as the bandwidth to be allocated, and the bandwidth size displayed to the outside world by the optical communication chip is used as the preset size.

[0060] The opportunity points are inherent in the bandwidth to be allocated. The bandwidth to be allocated can be regarded as a sequence of opportunity points, some of which may be occupied by other channels, that is, they have been allocated to other channels. Such opportunity points cannot be allocated to channels again. Therefore, the opportunity points on the bandwidth to be allocated that are not occupied by channels are described as "idle" opportunity points, so as to distinguish them from the opportunity points that have been occupied by channels.

[0061] The uniform distribution does not mean that the interval between every two opportunity points or the number of opportunity points is exactly the same, but that the N opportunity points are widely distributed on the basic bandwidth without being clustered. Specifically, when the basic bandwidth is divided into multiple intervals in a certain way, the N opportunity points are scattered in multiple intervals.

[0062] The number of opportunity points required by the channel is calculated based on the bandwidth required by the channel, specifically including: dividing the bandwidth required by the channel by the minimum allocated bandwidth to obtain the number of opportunity points required by the channel, wherein the minimum allocated bandwidth is the minimum service granular bandwidth between modules that need to be evenly distributed or the least common multiple bandwidth of each service bandwidth.

[0063] In step 202, the position of each first opportunity point is used as a flag, and in the first interval corresponding to the last N-1 flags, one or more second intervals containing less than the target number of opportunity points are found, wherein the end position of each first interval is the corresponding flag, and the starting position of each first interval is the previous flag of the corresponding flag.

[0064] Among them, since the first flag does not exist with the previous flag, there is no corresponding first interval, so the number of first intervals is N-1. The first interval is one of a half-open and half-closed interval, a closed interval and an open interval. When the first interval is a half-open and half-closed interval, the number of opportunity points it contains is the number of opportunity points between the starting position and the ending position, plus an opportunity point corresponding to one of the starting position and the ending position.

[0065] The target number is obtained by technicians in this field based on experience and minimum interval threshold analysis, and the minimum interval threshold is obtained by technicians in this field based on the clock beat processing requirements of the circuit in the optical communication chip. Due to the differences in the multi-beat processing circuits in the optical communication chip, the resources that can be processed in one clock cycle are different. In some cases, when the circuit processes the data of an opportunity point, the data in this opportunity point depends on the processing result of the previous opportunity point. If the clock beat interval between this opportunity point and the previous opportunity point of this channel is too small, it may happen that when processing the data of this opportunity point, the data of the previous opportunity point has not been processed, resulting in the data of this opportunity point cannot be processed normally, and the clock beat interval between the two opportunity points is determined according to the position of the two opportunity points on the bandwidth.

[0066] According to the different properties of the first interval used, the minimum interval threshold and the target quantity to be set are different. For example, when the first interval is a closed interval, the minimum interval threshold and the target quantity used are greater than those when the first interval is a semi-closed and semi-open interval, and even greater than those when the first interval is an open interval. The target quantity needs to be greater than or equal to the minimum interval threshold. Usually, the target quantity is the value corresponding to the maximum wide distribution of the opportunity points allocated to the channel on the bandwidth to be allocated.

[0067] In the subsequent content of this embodiment, without special explanation, the first interval is a semi-closed and semi-open interval for elaboration.

[0068] In step 203, each second interval is used as the target interval in sequence from front to back, and the flag bit corresponding to the target interval is shifted backward so that the opportunity point located at the flag bit is an idle opportunity point, and the number of opportunity points included in the target interval is the minimum number that can reach the target quantity. Then, the flag bits corresponding to each first interval after the target interval are shifted backward so that the number of idle opportunity points included in each first interval after the target interval is the same as the number of idle opportunity points included before the shift.

[0069] Among them, since the end position of each first interval is the corresponding flag bit and the start position of each first interval is the previous flag bit of the corresponding flag bit, when the position of the flag bit changes, the corresponding first interval also changes. Also, because there must be a common use of flag bits between every two adjacent first intervals, that is, in the N - 1 intervals corresponding to the latter N - 1 flag bits, the flag bit used for the end position of the m-th first interval is the same as the flag bit used for the start position of the (m + 1)-th first interval (0 < m < N - 1). Therefore, when the position of the flag bit changes, it will also cause a change in the next first interval corresponding to the corresponding first interval.

[0070] Since in the bandwidth to be allocated, the opportunity points occupied by other channels and the idle opportunity points may be cross-distributed. During the process of shifting the flag bit corresponding to the target interval backward, when the number of opportunity points included in the target interval is the target quantity, the opportunity point corresponding to the flag bit may be an opportunity point occupied by other channels, and such an opportunity point cannot be allocated to the channel. Therefore, continue to shift backward until the opportunity point located at the flag bit is an idle opportunity point. At this time, the number of opportunity points included in the target interval is the minimum number that can reach the target quantity.

[0071] Each first interval after the target interval specifically refers to each first interval corresponding to the flag bits after the flag bit corresponding to the target interval before the flag bit corresponding to the target interval is shifted backward.

[0072] In the process of shifting the marker backward, the relative positions of the markers may change. For example, if there are the first marker and the second marker from the front to the back, when the first marker moves backward, the first marker may move to the position of the second marker, or the first marker may move behind the second marker. When the first marker is the previous marker of the second marker, that is, the starting position of the first interval corresponding to the second marker is the first marker, the backward shift of the first marker causes the starting position of the first interval to be after the ending position. In order to ensure the correct channel allocation, it is stipulated that when the starting position of the first interval is after the ending position or the starting position is the same as the ending position, the number of opportunity points and idle opportunity points contained in the first interval are both zero.

[0073] In step 204, the opportunity point corresponding to each flag bit is allocated to a channel.

[0074] This embodiment first selects evenly distributed opportunity points, and then shifts them backward so that the opportunity points allocated to the channel meet the requirements of the circuit's clock beat processing, thereby achieving channel allocation and making reasonable use of the cache resources of the optical communication chip. At the same time, the embodiment of the present invention does not require additional evenly distributed circuits, does not require the addition of additional logic resources, and does not require hardware changes during maintenance, thereby saving material and labor costs.

[0075] In the above step 203, one implementation method of shifting the flag bit corresponding to the target interval backward is: shifting the flag bit corresponding to the target interval backward to the position where the idle opportunity point is located in sequence, until the opportunity points included in the target interval after the shift reach i opportunity points. This implementation method requires determining the number of opportunity points included in the target interval once for each shift, which is inefficient. Therefore, there are the following preferred embodiments, which specifically include:

[0076] Find the i-th opportunity point after the starting position of the target interval. If the i-th opportunity point is an idle opportunity point, translate the flag corresponding to the target interval to the position of the i-th opportunity point. Otherwise, translate the flag corresponding to the target interval to the position of the first idle opportunity point after the i-th opportunity point, where i is the target number.

[0077] This preferred implementation method reduces the number of judgments and improves the efficiency of the backward shifting process of the marker by first finding a position where the target interval contains a target number of opportunity points, and then finding the first idle opportunity point at or after the position.

[0078] In the above step 203, one implementation method of shifting the flag bit corresponding to each first interval after the target interval backward is: record the number of idle opportunity points contained in each first interval before the flag bit of the target interval is shifted, and shift the flag bit corresponding to the first interval backward to the idle opportunity point in sequence until the number of idle opportunity points contained in the first interval is consistent with the number of idle opportunity points contained in the first interval before the flag bit of the target interval is shifted. This implementation method also requires frequent shift judgments, and there may be a situation where the number of idle opportunity points contained in multiple first intervals is different. In order to solve this situation, it is necessary to record the number of idle opportunity points contained in each first interval before the flag bit of the target interval is shifted, which consumes a lot of resources. For this situation, there are the following preferred embodiments, which specifically include:

[0079] Find the number j of idle opportunity points added in the process of shifting the marker corresponding to the target interval backward; find the jth idle opportunity point after the marker corresponding to each first interval in turn as the corresponding designated position, and shift the marker corresponding to each first interval backward to the corresponding designated position.

[0080] Among them, the first interval includes the second interval. When the j-th idle opportunity point is found in sequence, the opportunity point occupied by the channel is not included in the search. For example, when j is equal to 2 and there are 3 opportunity points after the flag bit corresponding to a first interval, when the second opportunity point is occupied by other channels, the second idle opportunity point obtained is the third opportunity point after the flag bit.

[0081] This preferred implementation method performs the shifting by calculating the difference between the idle opportunity points included in the flag bit of the target interval before and after the backward shift, and then using it as the flag bit of the first interval. During the backward shift, the change in the idle opportunity points in each first interval is determined by the backward shift process of the previous first interval, and the target interval is the first first interval in the backward shift process. Therefore, the change in the idle opportunity points in the target interval is the change required for each first interval after the target interval. The shifting is performed based on this change, thereby improving the efficiency of the shifting and reducing resource usage.

[0082] In the above embodiment, there are multiple implementation methods for selecting N first opportunity points that are evenly distributed and idle from all opportunity points in the basic bandwidth. One implementation method is: when all opportunity points in the basic bandwidth are idle, the selection of N first opportunity points that are evenly distributed and idle from all opportunity points in the basic bandwidth can be obtained by directly traversing and selecting on the basic bandwidth.

[0083] However, in actual situations, some opportunity points on the basic bandwidth may be occupied by other channels. In this case, simply selecting through traversal may select opportunity points that are already occupied by other channels, that is, the idle condition is not met. In order to meet the conditions of uniform distribution and opportunity point idleness at the same time, an optimal implementation method is proposed, such as Figure 2 As shown, specifically including:

[0084] In step 301, all idle opportunity points on the basic bandwidth are mapped into a continuous virtual opportunity point sequence, and N evenly distributed virtual opportunity points are selected from all virtual opportunity points in the virtual opportunity point sequence.

[0085] In step 302, the N virtual opportunity points are inversely mapped onto the basic bandwidth to obtain N first opportunity points that are evenly distributed and idle on the basic bandwidth.

[0086] The mapping and de-mapping may be achieved by additionally storing the correspondence between the virtual opportunity points in the virtual opportunity point sequence and the opportunity points on the basic bandwidth during mapping, or by directly defining the virtual opportunity points as the positions of the corresponding opportunity points in the bandwidth to be allocated. For example, if there are five opportunity points on the basic bandwidth, and the first, third, and fifth opportunity points are idle, the virtual opportunity points in the obtained virtual opportunity point sequence are 1, 3, and 5, respectively. During de-mapping, the corresponding opportunity points in the basic bandwidth may be directly found through the virtual opportunity points.

[0087] This preferred implementation method can select a first opportunity point that is evenly distributed and idle when there are opportunity points in the basic bandwidth that are already occupied by other channels.

[0088] Usually, a method that can be adopted to select several evenly distributed target objects on an object sequence is to divide the total number of objects on the object sequence by the number of target objects to be selected, and obtain the number of objects n between each two target objects; select the first object on the object sequence as the first target object, and successively use the most recently selected target object as the starting point, and select the nth object after the starting point as the target object, until the number of selected target objects reaches the required number. In this way, the method of selecting evenly distributed N virtual opportunity points from all virtual opportunity points in the virtual opportunity point sequence is simple and easy to implement, but when the number of virtual opportunity points in the virtual opportunity point sequence cannot be divided by N, it is usually necessary to perform an approximate operation on the quotient to obtain n. When an approximate operation of rounding up is used, n may be too large, resulting in the inability to select N virtual opportunity points when selecting according to n, and when rounding down is used, n may be too small, resulting in the selected virtual opportunity points not being widely distributed. For this reason, the following preferred implementation methods are proposed, specifically including:

[0089] Each value in M×1, M×2, …, M×N is used as a reference value in turn, and the quotient obtained by dividing each reference value by N is rounded up or down to obtain the position of each virtual opportunity point to be selected in the virtual opportunity point sequence, and the virtual opportunity point of the corresponding position in the virtual opportunity point sequence is selected, where M is the number of all opportunity points in the virtual opportunity point sequence.

[0090] Among them, when calculating, one of rounding up or rounding down can be used uniformly to calculate all the rankings, or the quotient obtained by dividing each benchmark value by N is rounded up and rounded down respectively to obtain the two values, and the one closer to the benchmark value is selected as the corresponding ranking.

[0091] When rounding up is selected for calculation, this implementation method uses the formula to express the result as follows:

[0092]

[0093] Wherein, L is the position of the virtual opportunity point to be selected in the virtual opportunity point sequence, M is the number of all opportunity points in the virtual opportunity point sequence, N is the number of virtual opportunity points to be selected, and K is an integer in the range greater than 0 and less than or equal to N. Any calculation method obtained by modifying this formula without violating the principle of this formula shall be included in the protection scope of the present invention.

[0094] This implementation can eliminate the influence of the number of virtual opportunity points in the virtual opportunity point sequence, so that the selected virtual opportunity points can definitely reach N and can be distributed as widely as possible in the virtual opportunity point sequence.

[0095] According to the principle of the above formula, one of the calculation methods obtained by performing a variation thereof is as follows: Figure 3 As shown, specifically including:

[0096] In step 401, virtual opportunity points on the virtual opportunity point sequence are visited in sequence.

[0097] In step 402, each time a virtual opportunity point is visited, a score corresponding to each virtual opportunity point is calculated as a first value minus a second value, wherein the first value is N multiplied by the rank of the virtual opportunity point, and the second value is the number of selected virtual opportunity points plus 1 multiplied by M. If the score is greater than or equal to zero, the virtual opportunity point at the rank is selected, and the next virtual opportunity point after the virtual opportunity point is visited.

[0098] The second value is the number of virtual opportunity points that have been selected plus 1 and then multiplied by M. That is, the second value obtained means the number of opportunity points to be selected, that is, K in the formula before the variation. Therefore, the calculation formula of the score in this implementation is:

[0099] l×NM×K

[0100] Among them, M and N have the same meaning as in the formula before the variation, l is the corresponding position when visiting each virtual opportunity point, and K is an integer in the interval greater than 0 and less than or equal to N.

[0101] When the score is greater than or equal to 0, the obtained value of l is considered to be the position L of the virtual opportunity point required to be selected in the formula before the mutation in the virtual opportunity point sequence. This calculation method selects the virtual opportunity point at this position by sequentially visiting the virtual opportunity points that meet the formula before the mutation as L. This calculation method is more suitable for mechanical calculation than the formula before the mutation.

[0102] Based on the above modified calculation method, the calculation method is further optimized as follows: Figure 4 As shown, specifically including:

[0103] In step 501, virtual opportunity points on the virtual opportunity point sequence are visited in sequence.

[0104] In step 502, each time a virtual opportunity point is visited, the score Q is added to N to obtain the variable M 1 , if M 1 is greater than or equal to M, then M 1 Subtract the value obtained from M as Q, select the virtual opportunity point, and continue to visit the next virtual opportunity point of the virtual opportunity point; otherwise, set M equal to M 1 , continue to visit the next virtual opportunity point of the virtual opportunity point, where the initial value of the score Q is 0.

[0105] The principle used in this calculation method is consistent with the principle used in the above-mentioned variant calculation method, but it makes better use of the advantage of mechanical operations that can perform iterative calculations. By using the addition and subtraction operations in each iteration, it replaces the multiplication operations frequently performed in the variant calculation method, thereby improving the calculation efficiency. In addition, when M or N is extremely large, the value obtained after the subtraction operation is smaller in magnitude than the value obtained by the multiplication operation in the variant calculation method, and the space reserved for the variable storing the value can be smaller, thereby reducing resource usage.

[0106] When using this calculation method, it is necessary to sequentially access the virtual opportunity points on the virtual opportunity point sequence. In step 203 of the above embodiment, the corresponding translation can also be achieved by sequentially accessing the virtual opportunity points on the virtual opportunity point sequence. In order to improve the efficiency of the calculation, these two processes can be interspersed to reduce the number of sequential accesses. Therefore, there is also a preferred channel allocation method, such as Figure 5 As shown, specifically including:

[0107] In step 601, all idle opportunity points on the bandwidth to be allocated are mapped into a continuous sequence of virtual opportunity points.

[0108] In step 602, virtual opportunity points on the virtual opportunity point sequence are visited in sequence.

[0109] In step 603, each time a virtual opportunity point is visited, the score Q is added to N to obtain the variable M 1 , where the initial value of the score Q is 0. If M 1 is less than M, then let M equal to M 1 , continue to visit the next virtual opportunity point of the virtual opportunity point, where M is the number of idle opportunity points on the bandwidth of the previous preset size in the bandwidth to be allocated.

[0110] In step 604, if M 1 is greater than or equal to M, then M 1 The value obtained by subtracting M is taken as Q. If the visited virtual opportunity point meets the target number requirement, the virtual opportunity point is selected and the next virtual opportunity point of the virtual opportunity point is visited. Otherwise, the first virtual opportunity point that meets the target number requirement after the visited virtual opportunity point is found, the first virtual opportunity point is selected, and the next virtual opportunity point of the first virtual opportunity point is visited, wherein meeting the target number requirement means that the number of opportunity points between a virtual opportunity point and the opportunity points corresponding to the last selected virtual opportunity point is greater than or equal to the target number.

[0111] In step 605, the N virtual opportunity points are inversely mapped to the bandwidth to be allocated to obtain N first opportunity points on the bandwidth to be allocated, and the N first opportunity points are allocated to the channel.

[0112] In the subsequent content of this embodiment, the requirement of meeting the target number will be directly used to refer to that the number of opportunity points between a virtual opportunity point and the opportunity points corresponding to the last selected virtual opportunity point is greater than or equal to the target number, or to refer to that the number of opportunity points between an opportunity point and the last selected opportunity point is greater than or equal to the target number, and the requirement of meeting the minimum interval threshold will be directly used to refer to that the number of opportunity points between an opportunity point and the last selected opportunity point is greater than or equal to the minimum interval threshold.

[0113] This preferred embodiment directly uses the bandwidth to be allocated for mapping, and while selecting evenly distributed virtual opportunity points, it replaces the backward translation of the flag by selecting the point backward. The effects achieved by the two are consistent. Then the next virtual opportunity point is selected according to the opportunity point selected by the backward movement, so that when the virtual opportunity points are traversed only once, the opportunity point that meets the even distribution and the target number requirements is directly selected, which meets the channel allocation requirements and improves the efficiency.

[0114] In the above embodiment, according to the size of the target number and the number of opportunity points required for the channel, the opportunity points allocated to the channel are distributed to different degrees on the bandwidth to be allocated. In order to ensure that the obtained opportunity points are not affected by the number of opportunity points required for the channel and can always be distributed as widely as possible, there are the following preferred embodiments, which specifically include:

[0115] The minimum interval threshold is used as the simulated target number for simulated channel allocation. If in the process of flag bit shifting in the simulated channel allocation, when the flag bit is shifted to the last idle opportunity point position on the bandwidth to be allocated, the number of opportunity points contained in the target interval corresponding to the flag bit still cannot reach the target number, or the number of idle opportunity points contained in the first interval corresponding to the flag bit is still less than the number of idle opportunity points contained before the shift, then the simulated target number used in the last simulated channel allocation of this simulated channel allocation is used as the final target number used for channel allocation.

[0116] Otherwise, the analog target quantity used for the current analog channel allocation is increased by the preset value and used as the next analog target quantity for the next analog channel allocation.

[0117] The method of analog channel allocation is similar to the method of channel allocation, the only difference between the two is that the channel allocation uses the target number and allocates the opportunity points corresponding to the channel allocation flag, while the analog channel allocation uses the simulated target number, and the opportunity points corresponding to the obtained flag are not allocated to the channel. The purpose of analog channel allocation is only to obtain the maximum target number that can meet the channel allocation requirements. The preset increment is obtained by those skilled in the art based on empirical analysis and is usually set to 1.

[0118] Since the flag bit shift cannot meet the demand for the number of simulated targets during the last simulated channel allocation, the number of simulated targets used in the penultimate simulated channel allocation is selected as the final number of targets used, so that the number of opportunity points spaced between the selected opportunity points is the largest, that is, the opportunity points with the widest distribution on the bandwidth to be allocated are selected.

[0119] This embodiment simulates channel allocation by using different simulated target quantities to obtain the maximum target quantity value that can meet the allocation requirements, so that when performing actual channel allocation, the opportunity points allocated to the channels are distributed as widely as possible on the bandwidth to be allocated.

[0120] In actual situations, different values ​​of the selected basic bandwidth and the minimum interval threshold may result in different numbers of analog channel allocations. When the basic bandwidth is too small, the minimum interval threshold is too small, or the bandwidth to be allocated is too large, the number of analog channel allocations may increase, resulting in a longer time consumed in the channel allocation process. In order to solve this problem, there are the following preferred embodiments, such as Figure 6 As shown, that is, before the method, it specifically includes:

[0121] In step 701, N first opportunity points that are evenly distributed and idle are selected from all opportunity points to be allocated bandwidth, where N is the number of opportunity points required by the channel.

[0122] In step 702, the position of each first opportunity point is used as a flag bit. In the third interval corresponding to the last N-1 flag bits, if the number of opportunity points contained in each third interval is greater than or equal to the minimum interval threshold, the N first opportunity points are allocated to the channel and channel allocation is not continued.

[0123] In step 703, otherwise, continue to allocate channels, wherein the end position of each third interval is the corresponding flag bit, and the start position of each third interval is the previous flag bit of the corresponding flag bit.

[0124] This preferred embodiment attempts to use the bandwidth to be allocated for allocation before allocating channels through the basic bandwidth. If the selected opportunity point meets the requirement of the minimum interval threshold, the opportunity point is allocated to the channel. Otherwise, the channel is allocated through the basic bandwidth. When the channel to be allocated is long enough, it is possible to find the opportunity points with the widest distribution without multiple simulations of channel allocation, thereby improving the efficiency of channel allocation.

[0125] In actual situations, it may be necessary to allocate opportunity points to multiple channels. Since the number of opportunity points required for each channel is different, the order of channel allocation for each channel may affect the result of the opportunity points finally allocated to each channel. If the number of opportunity points required for the channel is not distinguished, and channel allocation is performed directly for multiple channels, it may happen that after channel allocation is performed for channels with a small number of required opportunity points first, the distribution of idle opportunity points in the bandwidth to be allocated is dense, and when channel allocation is performed for channels with a large number of required opportunity points, the selected opportunity points cannot meet the requirement of the target number of opportunity points between every two opportunity points. When channel allocation is performed for multiple channels, there are the following preferred embodiments, which specifically include:

[0126] When channel allocation is required for multiple channels, channel allocation is performed for each channel in order from largest to smallest in terms of the number of opportunity points required for the channel.

[0127] Among them, when channel allocation is performed for a channel with a large number of required opportunity points, the idle opportunity points in the allocated bandwidth are spaced apart by the opportunity points allocated to the channel to form multiple small clustering areas. When channel allocation is performed for a channel with a small number of required opportunity points, the selected opportunity points can be in multiple different clustering areas, that is, they are spaced apart by the opportunity points allocated to the channel, so that the target number of opportunity points can be separated between every two opportunity points.

[0128] Based on this preferred embodiment, when channel allocation is performed for multiple channels, due to the backward translation of the flag bit in the channel allocation process, that is, the opportunity point finally allocated to the channel may be outside the basic bandwidth. When all the opportunity points outside the basic bandwidth are allocated to the channel, when channel allocation is performed for other channels subsequently, there must be a flag bit that moves out of the basic bandwidth, and no idle opportunity point can be found, resulting in channel allocation failure. For this problem, there is also a preferred implementation method, that is, when channel allocation is performed for each channel, the bandwidth of the preset size in the bandwidth to be allocated is used as the basic bandwidth, specifically including:

[0129] The value obtained by subtracting the preset redundancy value from the number of idle opportunity points in the bandwidth to be allocated is taken as the number n of idle opportunity points that should be included in the basic bandwidth, and the bandwidth to be allocated is divided into two front and rear areas, so that the number of idle opportunity points included in the front area is n, and the bandwidth corresponding to the front area is taken as the basic bandwidth.

[0130] The preset redundancy value is obtained by those skilled in the art based on experience and analysis of channel allocation requirements.

[0131] This preferred implementation ensures that there are always idle opportunity points with preset redundancy values ​​outside the basic bandwidth, thereby ensuring that channel allocation can be carried out normally when allocation is required for multiple channels.

[0132] The "first", "second" and "third" in this embodiment do not have any special limiting meanings. They are used for description only to facilitate the description of different individuals in a category of objects and should not be interpreted as having special limiting meanings in order or other aspects.

[0133] Embodiment 2:

[0134] The present invention is based on the method described in Example 1, combined with specific application scenarios, and uses technical descriptions in related scenarios to illustrate the implementation process of the present invention in characteristic scenarios.

[0135] The total bandwidth of the optical communication chip used in this embodiment is 432G, of which the minimum service granular bandwidth between modules is 250M, so the number of opportunity points corresponding to the total bandwidth is 1650. The bandwidth size displayed to the outside world by the optical communication chip is 400G, that is, the system bandwidth is 400G, and the redundant bandwidth is 432G-400G=32G. In this embodiment, the 1G=1000M commonly used in the hardware development process is used as the standard for calculation. The number of opportunity points corresponding to the system bandwidth is 1600, and the number of opportunity points corresponding to the redundant bandwidth is 50. According to the clock beat processing requirements of the circuit of the optical communication chip used, the minimum interval threshold set by those skilled in the art is 4.

[0136] If the total bandwidth is taken as the bandwidth to be allocated and opportunity points are allocated to 6 channels, the bandwidths required by these 6 channels are 18750M, 97500M, 52500M, 95000M, 6250M and 80000M respectively. The calculated numbers of opportunity points required by these 6 channels are 75, 390, 210, 380, 25 and 320 respectively.

[0137] Sort the six channels in descending order according to the number of required opportunity points to obtain a sequence CH storing the six channels, where CH[0] requires 390 opportunity points, CH[1] requires 380 opportunity points, CH[2] requires 320 opportunity points, CH[3] requires 210 opportunity points, CH[4] requires 75 opportunity points, and CH[5] requires 25 opportunity points. Channel allocation is performed for CH[0], CH[1], CH[2], CH[3], CH[4], and CH[5] in turn. The specific steps for channel allocation for CH[i] (i≥0 and i≤5) are as follows: Figure 7 As shown, specifically including:

[0138] In step 801, all idle opportunity points on the bandwidth to be allocated are mapped to a continuous sequence of virtual opportunity points W, where the virtual opportunity point is the rank of the corresponding idle opportunity point in the bandwidth to be allocated, the number of virtual opportunity points in W is recorded as M, the number of opportunity points required for CH[i] is recorded as N, the preset minimum threshold is recorded as Gap, Q=0, j=0, z=-Gap, and an array newArry is preset. Mapping all idle opportunity points in the bandwidth to be allocated to a continuous sequence of opportunity points W is to facilitate direct access without having to determine whether the accessed opportunity point is an idle opportunity point or an opportunity point occupied by a channel each time the access is made. Q is used to record the score corresponding to the accessed virtual opportunity point, j is a count value used to access the opportunity point on W, z is used to record the virtual opportunity point selected last time, and newArry is used to store the found opportunity points. Before channel allocation is performed for each channel, these sequences, values, and arrays are initialized before entering step 802.

[0139] In step 802 , Q=Q+N is set, that is, the score of the virtual opportunity point being visited is calculated, and the process proceeds to step 803 .

[0140] In step 803 , determine whether Q is greater than or equal to M. If Q is greater than or equal to M, proceed to step 804 ; otherwise, proceed to step 808 .

[0141] In step 804, it is determined whether W[j]-z is greater than or equal to Gap. If W[j]-z is greater than or equal to Gap, it means that the visited virtual opportunity point can meet the target number requirement, and the process proceeds to step 805. When the first virtual opportunity point is visited, the previous virtual opportunity point has not been selected. Since the initial value of z is -Gap, the first virtual opportunity point found must satisfy W[j]-z is greater than or equal to Gap. Otherwise, it means that the visited virtual opportunity point cannot meet the target number requirement, that is, when the bandwidth to be allocated is used to find the most widely distributed opportunity point, the selected virtual opportunity point cannot meet the target number requirement, and the allocation is interrupted. The process proceeds to step 810 to perform channel allocation using the basic bandwidth.

[0142] In step 805 , W[j] is recorded at the end of newArry, and z=W[j], Q=QM is set, that is, the virtual opportunity point being visited is selected, and the process proceeds to step 806 .

[0143] In step 806, it is determined whether the number of virtual opportunity points recorded in newArry has reached N. If the number of virtual opportunity points recorded in newArry has reached N, it means that when using the bandwidth to be allocated to find the most widely distributed opportunity points, the selected virtual opportunity points can meet the target number requirements, and the process proceeds to step 807 to allocate the opportunity points corresponding to the virtual opportunity points to the channels. Otherwise, the process proceeds to step 808.

[0144] In step 807, the opportunity points corresponding to the N virtual opportunity points recorded in newArry are allocated to CH[i], and the channel allocation for CH[i] is completed. If there is still a channel to be allocated after CH[i], i=i+1 is set to allocate the next channel.

[0145] In step 808 , let j=j+1 and proceed to step 809 .

[0146] In step 809, it is determined whether j is greater than or equal to the length of W. If j is greater than or equal to the length of W, it means that the number of opportunity points required by the channel is greater than the number of idle opportunity points in the bandwidth to be allocated. In this case, channel allocation cannot be performed and a channel allocation error is made. The channel allocation error is recorded to facilitate subsequent tracking and processing by technicians in this field. The channel allocation for CH[i] is terminated and the next channel is allocated. Otherwise, the process goes to step 802 to continue accessing the next opportunity point and calculate the score Q.

[0147] In step 810, channel allocation is performed using the basic bandwidth, and after channel allocation for CH[i] is completed, channel allocation for the next channel is performed.

[0148] In the above step 810, channel allocation is performed based on the basic bandwidth. Figure 8 As shown, specifically including:

[0149] In step 901, all idle opportunity points on the bandwidth to be allocated are mapped to a continuous sequence of virtual opportunity points W, where the virtual opportunity point is the position of the corresponding idle opportunity point in the bandwidth to be allocated. The simulation target number Gap is set to be equal to the minimum interval threshold, and the number of idle opportunity points on the bandwidth of the previous preset size in the bandwidth to be allocated is selected as M. The arrays oldArry and newArry are preset, where W and newArry have the same meanings as those in the above step 801. In this step, W in the above step 810 can also be used and newArry can be cleared before use. Only M needs to be calculated without re-mapping the sequence and creating a newArry array and other variables. Wherein, newArry is used to store the virtual opportunity points obtained by the latest round of simulated channel allocation, and oldArry is used to store the opportunity points obtained by the previous round of simulated channel allocation, and then the process proceeds to step 902.

[0150] In step 902, let Q = 0, j = 0, z = -Gap, Q is used to record the score corresponding to the visited virtual opportunity point, j is the count value used to visit the virtual opportunity points on W, and z is used to record the last selected virtual opportunity point. These values ​​are initialized for each round of simulated channel allocation, and the process proceeds to step 903.

[0151] In step 903 , Q=Q+N is set, that is, the score of the virtual opportunity point being visited is calculated, and the process proceeds to step 904 .

[0152] In step 904 , determine whether Q is greater than or equal to M. If Q is greater than or equal to M, proceed to step 905 ; otherwise, proceed to step 912 .

[0153] In step 905, determine whether W[j]-z is greater than or equal to Gap. If W[j]-z is greater than or equal to Gap, it means that the visited virtual opportunity point can meet the requirement of the simulation target number, and go to step 906. Otherwise, it means that the visited virtual opportunity point cannot meet the requirement of the simulation target number, and go to step 910 to find the first virtual opportunity point after W[j] that meets the requirement of the simulation target number.

[0154] In step 906 , W[j] is recorded at the end of newArry, and z=W[j], Q=QM is set, that is, the virtual opportunity point being visited is selected, and the process proceeds to step 907 .

[0155] In step 907, it is determined whether the number of virtual opportunity points recorded in newArry has reached N. If the number of virtual opportunity points recorded in newArry has reached N, it means that this round of simulated channel allocation can select the required number of opportunity points for the channel, but it is impossible to determine whether the number of simulated targets used in this round is the maximum number of targets that can be used. In order to find the maximum number of targets so that the opportunity points allocated to the channel are distributed as widely as possible on the bandwidth to be allocated, the process proceeds to step 908 for the next round of simulated channel allocation. Otherwise, the process proceeds to step 912.

[0156] In step 908, oldArry=newArry is set, and the opportunity points recorded in newArry are cleared, that is, before entering the next round of simulation channel allocation, the result of this round of simulation channel allocation is recorded, and the process goes to step 909;

[0157] In step 909 , Gap=Gap+preset increment, and the simulation target quantity of this round is increased by the preset increment as the simulation target quantity of the next round, and the process proceeds to step 910 .

[0158] In step 910 , let j=j+1 and proceed to step 911 .

[0159] In step 911, determine whether j is greater than or equal to the length of W. If j is greater than or equal to the length of W, it means that in this round of simulated channel allocation, the required number of opportunity points for the channel cannot be selected, which means that the number of simulated targets used in this round of simulated channel allocation is too large. The number of simulated targets used in the previous round of simulated channel allocation is the target number that makes the opportunity points allocated to the channel as widely distributed as possible on the bandwidth to be allocated. Go to step 914 to allocate the opportunity points corresponding to the virtual opportunity points selected in the previous round to the channels. Otherwise, go to step 905 to make a target number judgment to find virtual opportunity points that meet the target number requirements.

[0160] In step 912 , let j=j+1 and proceed to step 913 .

[0161] In step 913, it is determined whether j is greater than or equal to the length of W. If j is greater than or equal to the length of W, it means that the required number of opportunity points for the channel cannot be selected in this round of simulated channel allocation, which means that the number of simulated targets used in this round of simulated channel allocation is too large. The number of simulated targets used in the previous round of simulated channel allocation is the target number that makes the opportunity points allocated to the channel as widely distributed as possible on the bandwidth to be allocated. Then, step 914 is performed to allocate the opportunity points corresponding to the virtual opportunity points selected in the previous round to the channel. Otherwise, step 903 is performed to access the next virtual opportunity point and calculate the score Q.

[0162] In step 914, the opportunity points corresponding to the N virtual opportunity points recorded in oldArry are allocated to CH[i]. After the channel allocation for CH[i] is completed, the channel allocation for the next channel is performed. When oldArry is empty, it indicates that the channel allocation is wrong. The channel allocation error is recorded to facilitate subsequent tracking and processing by technical personnel in the field.

[0163] The following will explain the process of some key steps in the above steps 801 to 810 and steps 901 to 914 through actual application scenarios. Taking the total bandwidth as the bandwidth to be allocated, the minimum interval threshold is 4, the number of opportunity points on the redundant bandwidth as the preset redundancy value, that is, the preset redundancy value is 50, and 1 as the preset increment, in the process of allocating 380 opportunity points to channel CH[0], firstly, the score Q is obtained by accumulation and subtraction, and the virtual opportunity point is selected by the score Q, that is, the above steps 801 to 809 are executed. In step 801, since the opportunity points in the bandwidth to be allocated are not occupied by any channel, the mapped W is the sequence of the positions corresponding to all opportunity points in the total bandwidth; when the total bandwidth is accessed, When the fifth opportunity point is selected, that is, j=4, the Q value calculated in step 802 is 1950, which is greater than or equal to M, and in step 804, W[j]-z=4-(-4)=8 is greater than or equal to Gap, so in step 805, W[j] is recorded at the end of newArry. In the process of selecting virtual opportunity points, the interval between the selected opportunity point and the opportunity point corresponding to the last selected virtual opportunity point is greater than or equal to Gap. After recording 390 opportunity points, step 807 is entered, and the opportunity points allocated to channel CH[0] are as follows: Fig. 9 As shown in FIG. 1 , the 5th, 9th, 13th, …, 1600th, 1604th, …, 1650th, 390 opportunity points in the total bandwidth are allocated to CH[0]. Since the total bandwidth is usually counted from 0 during the algorithm implementation process, Fig. 9 As shown, 390 opportunity points with serial numbers of 4, 8, 12, ..., 1599, 1603, ..., 1649 are allocated to CH[0]. Since the selected opportunity points have met the requirement of the minimum interval threshold, there is no need to execute step 810.

[0164] In the process of allocating 380 opportunity points to channel CH[1], we first obtain the score Q by accumulation and subtraction, and select the virtual opportunity points based on the score Q. Since some opportunity points in the total bandwidth are occupied by channel CH[0], the number of idle opportunity points in the total bandwidth is 1260 at this time. The resulting virtual opportunity point sequence W is as follows: Fig.10As shown, the idle opportunity points corresponding to the basic bandwidth are the opportunity points corresponding to the first M virtual opportunity points on the virtual opportunity point sequence W. When the sequence W

[13] =17 is accessed, that is, the 18th opportunity point of the total bandwidth is accessed, the Q value calculated in step 802 is greater than or equal to M and the interval between the opportunity point and the opportunity point corresponding to the previous virtual opportunity point is greater than or equal to Gap, and the opportunity point is recorded in newArry. When the sequence W

[16] =20 is accessed, that is, the 21st opportunity point in the total bandwidth is accessed, z=W

[13] =17, W

[16] -z=3 is less than Gap, and the minimum threshold requirement is not met, so the allocation is interrupted and the process goes to step 810 to perform analog channel allocation through the basic bandwidth.

[0165] When simulating channel allocation for channel CH[1] through basic bandwidth, the number of idle opportunity points in the basic bandwidth is calculated to be M=1260-50=1210. When the number of simulated targets Gap used is 4, 380 virtual opportunity points can be recorded. The number of simulated targets is increased by 1, that is, Gap=5 is used to search for opportunity points. At this time, the number of recorded virtual opportunity points cannot reach 380. Therefore, 4 is selected as the final target number used. The opportunity points corresponding to the virtual opportunity points recorded when simulating channel allocation using 4 are allocated to channel CH[1]. The opportunity points allocated to CH[1] are as follows: Fig.10 shown.

[0166] The "first", "second" and "third" in this embodiment do not have any special limiting meanings. They are used for description only to facilitate the description of different individuals in a category of objects and should not be interpreted as having special limiting meanings in order or other aspects.

[0167] Embodiment 3:

[0168] Based on Example 1 and Example 2, this embodiment also provides a channel allocation system, such as Fig.11 As shown, the system includes a selection module and an allocation module.

[0169] The selection module is used to use the bandwidth of the preset size in the bandwidth to be allocated as the basic bandwidth, select N uniformly distributed and idle first opportunity points from all opportunity points of the basic bandwidth, where N is the number of opportunity points required by the channel; use the position of each first opportunity point as a flag bit, and find one or more second intervals containing less opportunity points than the target number in the first interval corresponding to the last N-1 flag bits, where the end position of each first interval is the corresponding flag bit, and the starting position of each first interval is the previous flag bit of the corresponding flag bit; use each second interval as the target interval from front to back, shift the flag bit corresponding to the target interval backward, so that the opportunity point located at the flag bit is an idle opportunity point, and the number of opportunity points contained in the target interval is the minimum number that can reach the target number, and shift the flag bit corresponding to each first interval after the target interval backward, so that the number of idle opportunity points contained in each first interval after the target interval is consistent with the number of idle opportunity points contained before the shift.

[0170] The allocation module is used to allocate the opportunity point corresponding to each flag bit selected by the selection module to the channel.

[0171] Embodiment 4:

[0172] like Fig.12 , which is a schematic diagram of the architecture of a channel allocation device according to an embodiment of the present invention. The channel allocation device according to this embodiment includes one or more processors 21 and a memory 22. Fig.12 A processor 21 is taken as an example.

[0173] The processor 21 and the memory 22 may be connected via a bus or other means. Fig.12 The example of connecting through bus is taken in the following.

[0174] The memory 22 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs and non-volatile computer executable programs, such as the channel allocation method in Example 1. The processor 21 executes the channel allocation method by running the non-volatile software programs and instructions stored in the memory 22.

[0175] The memory 22 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some embodiments, the memory 22 may optionally include a memory remotely arranged relative to the processor 21, and these remote memories may be connected to the processor 21 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0176] The program instructions / modules are stored in the memory 22, and when executed by the one or more processors 21, the channel allocation methods in the above-mentioned embodiments 1 and 2 are executed, for example, the channel allocation methods described above are executed. Figures 1 to 8 The steps shown.

[0177] It is worth noting that the information interaction, execution process, etc. between the modules and units within the above-mentioned devices and systems are based on the same concept as the processing method embodiment of the present invention. The specific contents can be found in the description of the method embodiment of the present invention and will not be repeated here.

[0178] A person skilled in the art may understand that all or part of the steps in the various methods of the embodiments may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0179] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A channel allocation method, characterized in that: include: The bandwidth of the preset size in the bandwidth to be allocated is used as the basic bandwidth, and N first opportunity points that are evenly distributed and idle are selected from all opportunity points of the basic bandwidth, where N is the number of opportunity points required by the channel; Taking the position of each first opportunity point as a flag, find one or more second intervals containing less opportunity points than the target number in the first intervals corresponding to the last N-1 flags, wherein the end position of each first interval is the corresponding flag, and the start position of each first interval is the previous flag of the corresponding flag; From the front to the back, take each second interval as the target interval in turn, shift the flag position corresponding to the target interval backward, so that the opportunity point located at the flag position is an idle opportunity point, and the number of opportunity points contained in the target interval is the minimum number that can reach the target number, and shift the flag position corresponding to each first interval after the target interval backward, so that the number of idle opportunity points contained in each first interval after the target interval is consistent with the number of idle opportunity points contained before the shift; Assign the opportunity point corresponding to each flag position to the channel.

2. The channel allocation method according to claim 1, characterized in that: The selecting of N first opportunity points that are evenly distributed and idle from all opportunity points of the basic bandwidth specifically includes: Mapping all idle opportunity points on the basic bandwidth into a continuous sequence of virtual opportunity points, and selecting evenly distributed N virtual opportunity points from all virtual opportunity points in the sequence of virtual opportunity points; The N virtual opportunity points are inversely mapped onto the basic bandwidth to obtain N first opportunity points that are evenly distributed and idle on the basic bandwidth.

3. The channel allocation method according to claim 2, characterized in that: The selecting N evenly distributed virtual opportunity points from all virtual opportunity points in the virtual opportunity point sequence specifically includes: Each value in M×1, M×2, …, M×N is used as a reference value in turn, and the quotient obtained by dividing each reference value by N is rounded up or down to obtain the position of each virtual opportunity point to be selected in the virtual opportunity point sequence, and the virtual opportunity point of the corresponding position in the virtual opportunity point sequence is selected, where M is the number of all opportunity points in the virtual opportunity point sequence.

4. The channel allocation method according to claim 1, when the first interval is a half-open and half-closed interval, is characterized in that: Shift the flag corresponding to the target interval backward, including: Find the i-th opportunity point after the starting position of the target interval, and if the i-th opportunity point is an idle opportunity point, translate the flag corresponding to the target interval to the position of the i-th opportunity point; Otherwise, the flag bit corresponding to the target interval is translated to the position of the first idle opportunity point after the i-th opportunity point, where i is the target number.

5. The channel allocation method according to claim 1, when the first interval is a half-open and half-closed interval, is characterized in that: The step of shifting the flag bit corresponding to each first interval after the target interval backward specifically includes: Find the number j of idle opportunity points added in the process of shifting the marker corresponding to the target interval backward; The j-th idle opportunity point after the marker corresponding to each first interval is sequentially found as the corresponding designated position, and the marker corresponding to each first interval is translated backward to the corresponding designated position.

6. The channel allocation method according to claim 1, characterized in that: The target number is determined by the minimum interval threshold between the opportunity points of the channels allowed in the modules that need to be evenly distributed, specifically including: The simulated channel allocation is performed using the minimum interval threshold as the simulated target number. If, during the flag bit shifting process in the simulated channel allocation, when the flag bit is shifted to the last idle opportunity point position on the bandwidth to be allocated, the number of opportunity points included in the target interval corresponding to the flag bit still cannot reach the target number, or the number of idle opportunity points included in the first interval corresponding to the flag bit is still less than the number of idle opportunity points included before the shifting, the simulated target number used in the last simulated channel allocation of this simulated channel allocation is used as the final target number used for channel allocation; Otherwise, the analog target quantity used for the current analog channel allocation is increased by the preset value and used as the next analog target quantity for the next analog channel allocation.

7. The channel allocation method according to claim 1, characterized in that: The method also includes: Select N first opportunity points that are evenly distributed and idle from all opportunity points to be allocated bandwidth, where N is the number of opportunity points required by the channel; The position of each first opportunity point is used as a flag bit. In the third intervals corresponding to the last N-1 flag bits, if the number of opportunity points contained in each third interval is greater than or equal to the minimum interval threshold, the N first opportunity points are allocated to the channel, and channel allocation is not continued; Otherwise, continue to allocate channels, wherein the end position of each third interval is the corresponding flag bit, and the start position of each third interval is the previous flag bit of the corresponding flag bit.

8. The channel allocation method according to claim 1, characterized in that: When multiple channels need to be allocated, each channel is allocated in turn in the order of the number of opportunity points required by the channel from large to small. When allocating channels for each channel, the bandwidth of the preset size in the bandwidth to be allocated is used as the basic bandwidth, specifically including: The value obtained by subtracting the preset redundancy value from the number of idle opportunity points in the bandwidth to be allocated is taken as the number n of idle opportunity points that should be included in the basic bandwidth, and the bandwidth to be allocated is divided into two front and rear areas, so that the number of idle opportunity points included in the front area is n, and the bandwidth corresponding to the front area is taken as the basic bandwidth.

9. The channel allocation method according to any one of claims 1 to 8, characterized in that: The number of opportunity points required for the channel is calculated based on the bandwidth required for the channel, specifically including: The number of opportunity points required by the channel is obtained by dividing the bandwidth required by the channel by the minimum allocated bandwidth, wherein the minimum allocated bandwidth is the minimum service granular bandwidth between modules that need to be evenly allocated or the least common multiple bandwidth of each service bandwidth.

10. A channel allocation system, characterized in that: The system includes a selection module and an allocation module; The selection module is used to use the bandwidth of the preset size in the bandwidth to be allocated as the basic bandwidth, select N uniformly distributed and idle first opportunity points from all opportunity points of the basic bandwidth, where N is the number of opportunity points required by the channel; use the position of each first opportunity point as a flag bit, and find one or more second intervals containing less opportunity points than the target number in the first interval corresponding to the last N-1 flag bits, where the end position of each first interval is the corresponding flag bit, and the start position of each first interval is the previous flag bit of the corresponding flag bit; use each second interval as the target interval in turn from front to back, shift the flag bit corresponding to the target interval backward, so that the opportunity point located at the flag bit is an idle opportunity point, and the number of opportunity points contained in the target interval is the minimum number that can reach the target number, and shift the flag bit corresponding to each first interval after the target interval backward, so that the number of idle opportunity points contained in each first interval after the target interval is consistent with the number of idle opportunity points contained before the shift; The allocation module is used to allocate the opportunity point corresponding to each flag bit selected by the selection module to the channel.

Citation Information

Patent Citations

  • Dynamic bandwidth allocation method, device and equipment and computer readable storage medium

    CN112333822A

  • KR20210067051A