A spectrum allocation method for cognitive radio networks based on binary dragonfly optimization algorithm
By applying a binary dragonfly optimization algorithm in spectrum allocation, the problem of difficulty in achieving rapid convergence and high precision in spectrum allocation in the prior art is solved, and efficient utilization of spectrum resources is achieved.
Patent Information
- Application Number
- CN202210290853.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-23
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2042-03-23
Smart Images

Figure CN114641006B_ABST
Abstract
Description
Technical Field
[0001] The present technology relates to a spectrum allocation method for a cognitive radio network based on a binary dragonfly optimization algorithm, and belongs to the field of cognitive radio. Background Art
[0002] With the development of communication technology, we are experiencing a new era of science and technology from the Internet of Everything to the Intelligent Internet of Everything. The surge in new services has led to a sharp increase in the demand for spectrum resources. The traditional spectrum allocation method is static, that is, channels are fixedly allocated to users. Regardless of whether the user uses it or not, the allocated spectrum can only be used by the user and others cannot use it. Therefore, idle frequency resources in the air, time and frequency domains for current communications will cause a huge waste of spectrum, leading to the current situation of very scarce spectrum resources.
[0003] Spectrum resources are a scarce and non-traditional natural resource. Unlike commercial allocation methods such as auctions in foreign countries, spectrum resources in my country are uniformly planned by the government. After operators obtain the spectrum segments they are allowed to use, how to use limited spectrum resources to provide more users is the focus of research. In order to avoid the waste of idle spectrum, the concept of cognitive radio (CR) was proposed. The communication network under this concept is called cognitive wireless network. The idea is that users can capture or perceive information from wireless networks. On the basis of not affecting the normal communication of users in the authorized frequency band, cognitive users can access the authorized frequency band in accordance with certain criteria, dynamically use the spectrum, and realize resource sharing. In order to realize the cognitive ability of radio and dynamically use the spectrum, the spectrum allocation algorithm is the core technology.
[0004] To allocate spectrum, we first need to mathematically model the spectrum allocation problem for users in the network. Common models include: graph coloring model, bidding auction model, game theory model, interference temperature model, etc. Among them, the graph coloring model considers both network benefits and user fairness, is closer to the actual situation, and is widely used.
[0005] Based on the allocation model, an optimized objective function is established according to the network benefit or fairness allocation criteria, and the model is solved to obtain the optimal allocation plan, which allocates idle spectrum to cognitive users who currently need bandwidth, realizes spectrum reuse, and improves network benefits and spectrum utilization. However, solving the allocation model is a typical NP-hard problem under binary conditions, that is, it is impossible to find a polynomial time algorithm solution, and the time overhead of the greedy algorithm increases nonlinearly with the number of users and the number of spectrum. The metaheuristic algorithm was proposed in the 1960s. It is a method of optimizing the objective function by using the principles of bionics to simulate the behavioral mechanism of group movement and positioning in biological or natural phenomena. It has the advantages of high optimization efficiency, self-regulation, and no requirement for continuous differentiability of the objective function. It has been widely used in solving NP-hard problems and combinatorial optimization problems. The metaheuristic algorithm has also been widely used in solving spectrum allocation models and has achieved good results. The solution of the model is an allocation plan, and allocation is a discrete mathematical problem. The model uses two values 1 and 0 to indicate whether it is allocated. Therefore, the common metaheuristic optimization method in the continuous domain cannot be directly used in the spectrum allocation problem and needs to be binarized.
[0006] The convergence speed and calculation accuracy of the meta-heuristic optimization algorithm are also two important factors to be considered in implementing the spectrum allocation method. The improvement of these two factors is often complementary, and both require improving the search ability of individuals in the optimization algorithm for the optimal solution. Summary of the invention
[0007] In view of the shortcomings of the prior art, the present invention provides a spectrum allocation method for a cognitive radio network based on a binary dragonfly optimization algorithm. Under a cognitive radio spectrum model constructed by a graph theory coloring model, an allocation scheme optimization process with fast convergence and high precision is performed to obtain a spectrum allocation method that maximizes network benefits.
[0008] Terminology explanation:
[0009] 1. Halton sequence: Halton sequence is a random sequence that is used to generate uniformly distributed random numbers. The principle of random number generation is to select a prime number as the base number, and then continuously divide it to form some non-repeating and uniform points, and the coordinates of each point are between 0 and 1. For example, to use the Halton sequence to generate random numbers in the two-dimensional space [0,1]╳[0,1], you can pair the Halton sequences generated with prime number 2 as the base number in the X dimension and prime number 3 as the base number in the Y dimension. The interval [0,1] on the X-axis is continuously divided into two equal parts, and the dividing points form a sequence: The interval [0,1] on the Y axis is continuously divided into three equal parts, and the dividing points form a sequence: Then the random numbers in two-dimensional space are
[0010] 2. Graph coloring model: The graph coloring model is a model that transforms the spectrum allocation problem into a vertex coloring problem in graph theory. Specifically, the network topology of cognitive users distributed within a certain range is abstracted into a graph. Each vertex represents a cognitive user. One color represents an available spectrum. The available spectrum refers to the idle spectrum that is not used by authorized users and can be used by cognitive users at the current time and space, and it is assumed that these spectrums satisfy an orthogonal relationship. Each vertex has a set of available spectrum, namely the spectrum pool, according to its geographical location. If there is a connecting edge between vertices, it means that there is interference between the pair of users, and the two vertices cannot use the same spectrum, that is, they cannot be colored with the same color. Therefore, the spectrum allocation problem is transformed into a vertex coloring problem under the interference constraint.
[0011] The technical solution of the present invention is:
[0012] A spectrum allocation method for a cognitive radio network based on a binary dragonfly optimization algorithm, specifically comprising:
[0013] (1) Initialize the graph theory coloring model of spectrum allocation, and then calculate the available channel matrix L, the benefit matrix B, and the interference constraint matrix C according to the initialization settings. The allocation matrix A is the optimization object to be calculated.
[0014] (2) Initialize the dragonfly algorithm and obtain the initialization dragonfly population position matrix S, where each dragonfly individual position represents a candidate solution vector;
[0015] (3) Binarize the candidate solution vector;
[0016] (4) According to the candidate solution coding rule, the candidate solution vector X i Mapped to the allocation matrix A;
[0017] (5) Determine and remove interference in the allocation matrix A;
[0018] (6) Calculate the objective function value of each dragonfly individual position, then sort the objective function values from small to large, save the candidate solution vectors corresponding to the maximum and minimum values of the objective function, and update them as the location of the food source and the location of the natural enemy respectively;
[0019] (7) Use the improved dragonfly algorithm to iteratively update the population position;
[0020] (8) Determine whether the iteration termination condition is met. If the termination condition is not met, repeat steps (3) to (7). If the termination condition is met, output the allocation matrix A corresponding to the optimal solution vector to obtain the spectrum allocation scheme of the cognitive radio network.
[0021] Preferably, in step (1), the parameters of the graph theory coloring model for spectrum allocation are initialized and set, and the parameters of the graph theory coloring model include: the spectrum allocation space range, the number and position coordinates of authorized users, the protection radius of the authorized users for the spectrum, the number and position coordinates of cognitive users, and the transmission range of cognitive users under each spectrum, and the position coordinates of the authorized users and the position coordinates of the cognitive users are all randomly generated;
[0022] Then, the available channel matrix L, the benefit matrix B, and the interference constraint matrix C are calculated according to the initialization settings. The specific process is:
[0023] 1-1, the available spectrum matrix L = {l n,m l n,m ∈{0,1}} N×M , subscript n = 1, 2, ..., N, represents the number of cognitive users; m = 1, 2, ..., M represents the number of available spectrum; the element l in the matrix n,m =1, it means that the nth cognitive user can use the mth spectrum resource, l n,m = 0 means that the nth cognitive user cannot use the mth spectrum resource; the calculation process is: if the location coordinates of each user are known, the protection radius of the authorized user x for the frequency band m is d p (x,m), the subscript p indicates protection; the transmission range of cognitive user n in frequency band m is d s (n,m)∈[d min ,d max ], the subscript s represents the distance; the distance from the nth cognitive user to the authorized user x is calculated as Dist(n,x); then, if the condition d that the cognitive user n and the authorized user x use the m frequency band at the same time is satisfied s (n,m)≤Dist(n,x)-d p (x,m), then the available spectrum matrix L(n,m)=1, otherwise L(n,m)=0;
[0024] 1-2, benefit matrix B = {b n,m} N×M , b n,m represents the benefit weight brought by the nth cognitive user using the mth spectrum resource, b n,m is a real number; for example, spectrum utilization, network bandwidth, etc.;
[0025] 1-3, interference constraint matrix C = {c n,l,m |c n,l,m ∈{0,1}} N×L×M is a three-dimensional 0-1 matrix, c n,l,m Indicates whether the nth and lth cognitive users using spectrum m at the same time will cause interference, l = 1, 2, ..., N; if cn,l,m =1, then the nth and lth cognitive users using spectrum m at the same time will cause interference; if c n,l,m = 0, the nth and lth cognitive users using spectrum m simultaneously will not cause interference;
[0026] The calculation of the interference matrix is only related to the available spectrum matrix L. Obviously, for the same spectrum, C(:,:,m) is a symmetric matrix, and the diagonal elements c n,l,m =1-l n,m ;
[0027] In step (1), the allocation matrix A = {a n,m |a n,m ∈{0,1}} N×M represents the allocation of spectrum among all cognitive users; if a n,m =1, the mth available spectrum is allocated to the nth cognitive user, and l n,m =1; and for any n<N, l<N, m<M, if c n,l,m =1, then a n,m ·a l,m =0, that is, the allocation modes represented by the allocation matrix A do not interfere with each other;
[0028] This allocation is valid only if the availability condition is met, i.e. n,m = 1; on the other hand, considering the interference constraint, when there is interference between two cognitive users, c n,l,m =1, they cannot use frequency band m at the same time, so a in the non-interference allocation matrix n,m and a l,m cannot be 1 at the same time, that is, the following non-interference condition is satisfied: for any n<N, l<N, m<M, if c n,l,m =1, then a n,m ·a l,m =0.
[0029] The spectrum allocation matrix A is the optimization object to be sought. The spectrum allocation matrix A is a binary allocation matrix that satisfies the maximum network benefit or the maximum fairness, under the constraints of the available spectrum matrix L and the interference constraint matrix C, combined with the benefit matrix B.
[0030] According to the preferred embodiment of the present invention, in step (2), the dragonfly algorithm is initialized, that is, the population size Num, the maximum number of iterations t max , the value range of nonlinear inertia weight [ω min ,ω max ],ω min represents the minimum value of the nonlinear inertia weight, ω max Indicates the maximum value of the nonlinear inertia weight;
[0031] The candidate solution vector X is initialized using the Halton sequence to generate a Halton sequence of dimension D, and then Num of them are selected to obtain the initialized dragonfly population position matrix S = {X1; X2; ...; X Num}∈R Num×D , X i , i=1,2,…,Num, represents the individual position of the dragonfly, each individual position of the dragonfly represents a candidate solution vector; D is the dimension of the candidate solution vector, and D is equal to the number of 1s in the available channel matrix L.
[0032] The Halton sequence is used to generate uniformly distributed random numbers. The principle is to select a prime number as the base number and then continuously divide it within [0,1] to form some non-repeating and uniform points, that is, to obtain the initial position of the population of the dragonfly algorithm.
[0033] According to the preferred embodiment of the present invention, in step (3), the candidate solution vector is binarized, and the specific process is as follows:
[0034] The update speed of the candidate solution vector ΔX t+1 As the independent variable, use the V-type function to convert ΔX t+1 Every dimension All are mapped to the range [0,1], as shown in formula (I):
[0035]
[0036] In formula (I), Indicates update speed The conversion probability in the i-th dimension;
[0037] Then, according to the comparison result between the transformation probability and the random number rand in [0,1], the binary value of the candidate solution vector on the i-th dimension is determined, as shown in formula (II):
[0038]
[0039] The advantage of using a V-type function instead of an S-type function for conversion probability mapping is that the V-type function is symmetrical and has the same processing when the update speed has the same change in the positive direction or the reverse direction.
[0040] According to the preferred embodiment of the present invention, in step (4), in the optimization target matrix A, allocation is allowed only when a cognitive user can use a certain channel. Therefore, in order to reduce the spatial dimension of optimization and speed up the calculation, the candidate solution individuals are first coded for available channels before iteration. The candidate solution coding rule is as follows: the allocation matrix A is initialized as an all-zero matrix, and then the positions of element 1 in the available channel matrix L from the first row to the Nth row are set to candidate solution vectors X from left to right. i The values in the matrix are the distribution matrix A. For example, Candidate solution vector X i =[0110010] is the length of the number of 1s in L. Find the position of element 1 from the first row to the fourth row in matrix L in matrix A, and map them to the values of the candidate solution vector from left to right, that is, 0110010. Set the other elements in matrix A to 0, and then get the allocation matrix
[0041] Preferably, according to the present invention, based on the non-zero value of the interference constraint matrix C, in step (5), the interference existing in the allocation matrix A is judged and removed. The specific process is:
[0042] Determine whether there is an interfering allocation in the allocation matrix A. If there is an interfering allocation, the interfering allocation pair a n,m and a l,m One of the two random zeros is set to remove interference. Interference allocation refers to allocating a spectrum resource to two cognitive users at the same time. l,m and cognitive user a n,m .
[0043] Preferably, in step (6), the optimization goal is to maximize the benefits of the entire network, and the candidate solution vector represented by each dragonfly individual position is mapped into an allocation matrix A, corresponding to an allocation scheme, and the calculation formula of the objective function value of each dragonfly individual position is as follows:
[0044]
[0045] In formula (X), U MNE is the overall network benefit, which is obtained by summing the benefits of N cognitive users, r n =a n,m b n,m , r n represents the network benefit of the nth cognitive user; a n,m It means that the mth available spectrum is allocated to the nth cognitive user.
[0046] Sort the objective function value of each candidate solution vector from small to large, take the candidate solution vector corresponding to the maximum objective function value as the current optimal solution vector, and update it to the location of the food source; take the candidate solution vector corresponding to the minimum objective function value, and update it to the location of the natural enemy.
[0047] According to the preferred embodiment of the present invention, in step (7), the population position is iteratively updated using the improved dragonfly algorithm, and the specific process is as follows:
[0048] Calculate the five group behaviors of the current dragonfly individual, including the separation behavior S i , Alignment Behavior A i , Aggregation Behavior C i , foraging behavior i and avoidance behavior i , as shown in formula (III):
[0049]
[0050] In formula (III), X represents the current position of the dragonfly individual, X j represents the position of the jth neighbor of the current dragonfly, j = 0, 1, ..., N D , N D represents the number of dragonfly neighbors, V j represents the speed of the jth neighbor of the current dragonfly, X + represents the location of the food source, corresponding to the optimal solution of each iteration, X - represents the position of the natural enemy, corresponding to the worst solution of each iteration; the nearest neighbor of X is centered on X, R N It is composed of dragonflies within the radius, generally R N One tenth of the length or width of the space is allocated for the spectrum.
[0051] In the tth iteration, the position X of the dragonfly is updated t+1 The position vector X of the current dragonfly individual t and the step vector ΔX t+1 Determine, as shown in formula (IV):
[0052] X t+1 =X t +ΔX t+1 (IV),
[0053] In formula (IV), the step vector ΔX t+1 Represents the flight direction and step length of the dragonfly, the step length vector ΔX t+1 It is determined by the five behaviors of the dragonfly, S, A, C, F and E, as shown in formula (V):
[0054] ΔX t+1 =(sS i+aA i +cC i +fF i +eE i )+ω * ΔX t (V),
[0055] In formula (V), s represents the separation weight, a represents the alignment weight, c represents the alliance weight, f represents the food weight, e represents the natural enemy weight, t represents the current iteration number, ω * is the nonlinear inertia weight, and a new weight is constructed using a decreasing exponential function, as shown in formula (VII):
[0056] ω * =ω min +|ω max -ω min |exp(-2t / t max )(VII)
[0057] In formula (VII), ω min Indicates the lower limit of the inertia weight, ω max represents the upper limit of the inertia weight, t represents the current number of iterations, and t max Indicates the maximum number of iterations set;
[0058] When there is no nearest neighbor solution near the same individual, the randomness of the dragonfly exploration is increased by using the Levy flight mechanism to fly around the search space. At this time, the position of the dragonfly individual is updated as follows:
[0059]
[0060] In formula (VIII), D represents the dimension of the solution vector, Represents point product, Levy function is as shown in formula (IX):
[0061]
[0062] In formula (IX), r1(D) and r2(D) both represent D-dimensional random number vectors with a value range of [0,1], β = 1.5, Γ(x)=(x-1)! .
[0063] According to the preferred embodiment of the present invention, before performing step (7), it is necessary to map the interference-eliminating allocation matrix A back to the candidate solution vector X according to the candidate decoding rule. i The candidate solution decoding rule is: find the position where the element is 1 in the matrix L, and then select the value of the position corresponding to the position of element 1 in the matrix A from the first row to the Nth row, and then encode it into a vector, that is, the candidate solution vector X is obtained.i .For example, Find the position where the element is 1 in matrix L, and then select the values of the position corresponding to the position of element 1 in matrix A from the first row to the fourth row and from left to right, that is, the selected value is 0110010, thus obtaining X i =[0110010]. The population position matrix S contains Num individuals, each individual X i After candidate decoding, its dimension D can be reduced from M×N before encoding to the number of 1s in the L matrix, which greatly reduces the amount of calculation.
[0064] Preferably, according to the present invention, in step (8), if the termination condition is met, the solution corresponding to the maximum benefit of the entire network is selected as the optimal solution vector. The position of the dragonfly individual represented by the optimal solution vector is also the position of the food source, indicating that the dragonfly has found food. At this time, the allocation scheme represented by the allocation matrix A corresponding to the optimal solution is the spectrum allocation scheme of the optimal cognitive radio network.
[0065] The beneficial effects of the present invention are:
[0066] 1. The spectrum allocation method of a cognitive radio network based on a binary dragonfly optimization algorithm of the present invention takes maximizing network benefits as the optimization goal, takes a graph theory coloring model as the spectrum allocation model, and designs a spectrum allocation scheme with fast convergence and higher precision based on an improved binary dragonfly algorithm; Halton sequences are used in the dragonfly algorithm instead of random initialization to construct a more uniform initial distribution of the population, enhance the diversity of the population, and accelerate the convergence speed; the introduction of nonlinear inertia weights helps to dynamically adjust the search step size during iterations, thereby improving the global search capability and convergence precision of the algorithm; and the dragonfly algorithm is extended to the field of binary allocation problems using a V-type binary code conversion formula.
[0067] 2. The spectrum allocation scheme of the present invention has fast convergence and high precision, which greatly improves the utilization efficiency of spectrum resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] Figure 1 A flowchart of spectrum allocation for cognitive radio networks based on the binary dragonfly algorithm proposed by the present invention;
[0069] Figure 2 Schematic diagram of the initial distribution comparison of 20 candidate solutions initialized by random and Halton sequence;
[0070] Figure 3 When the number of authorized users K=10, the number of available channels M=10, and the number of cognitive users N=10, the iterative curve comparison diagram of the algorithm of the present invention, the original dragonfly algorithm, and the particle swarm algorithm;
[0071] Figure 4 Schematic diagram of the comparison of average network benefits when the number of authorized users K = 10, the number of available channels M = 10, and the number of cognitive users N∈{2,4,6,8,10,12} increases successively. DETAILED DESCRIPTION
[0072] The present invention will be further described below in conjunction with the embodiments and the accompanying drawings, but is not limited thereto.
[0073] Example 1
[0074] A spectrum allocation method for cognitive radio networks based on binary dragonfly optimization algorithm, such as Figure 1 As shown, specifically including:
[0075] (1) Initializing and setting the parameters of the graph theory coloring model for spectrum allocation. The parameters of the graph theory coloring model include: the spectrum allocation space range, the number and location coordinates of authorized users, the protection radius of the spectrum by authorized users, the number and location coordinates of cognitive users, and the transmission range of cognitive users in each spectrum. The location coordinates of authorized users and cognitive users are all randomly generated.
[0076] Then, the available channel matrix L, the benefit matrix B, and the interference constraint matrix C are calculated according to the initialization settings. The specific process is:
[0077] 1-1, the available spectrum matrix L = {l n,m l n,m ∈{0,1}} N×M , subscript n = 1, 2, ..., N, represents the number of cognitive users; m = 1, 2, ..., M represents the number of available spectrum; the element l in the matrix n,m =1, it means that the nth cognitive user can use the mth spectrum resource, l n,m = 0 means that the nth cognitive user cannot use the mth spectrum resource; the calculation process is: if the location coordinates of each user are known, the protection radius of the authorized user x for the frequency band m is d p (x,m), the subscript p indicates protection; the transmission range of cognitive user n in frequency band m is d s (n,m)∈[d min ,d max ], the subscript s represents the distance; the distance from the nth cognitive user to the authorized user x is calculated as Dist(n,x); then, if the condition d that the cognitive user n and the authorized user x use the m frequency band at the same time is satisfied s (n,m)≤Dist(n,x)-d p (x,m), then the available spectrum matrix L(n,m)=1, otherwise L(n,m)=0;
[0078] 1-2, benefit matrix B = {b n,m} N×M , b n,m represents the benefit weight brought by the nth cognitive user using the mth spectrum resource, b n,m is a real number; for example, spectrum utilization, network bandwidth, etc.;
[0079] 1-3, interference constraint matrix C = {c n,l,m |c n,l,m ∈{0,1}} N×L×M is a three-dimensional 0-1 matrix, c n,l,m Indicates whether the nth and lth cognitive users using spectrum m at the same time will cause interference, l = 1, 2, ..., N; if c n,l,m =1, then the nth and lth cognitive users using spectrum m at the same time will cause interference; if c n,l,m = 0, the nth and lth cognitive users using spectrum m simultaneously will not cause interference;
[0080] The calculation of the interference matrix is only related to the available spectrum matrix L. Obviously, for the same spectrum, C(:,:,m) is a symmetric matrix, and the diagonal elements c n,l,m =1-l n,m ;
[0081] In step (1), the optimization object allocation matrix A is n,m |a n,m ∈{0,1}} N×M represents the allocation of spectrum among all cognitive users; if a n,m =1, the mth available spectrum is allocated to the nth cognitive user, and l n,m =1; and The allocation matrix A represents an allocation method that does not interfere with each other;
[0082] This allocation is valid only if the availability condition is met, i.e. n,m = 1; on the other hand, considering the interference constraint, when there is interference between two cognitive users, c n,l,m =1, they cannot use frequency band m at the same time, so a in the non-interference allocation matrix n,m and a l,m They cannot be 1 at the same time, that is, they meet the following non-interference conditions:
[0083] The spectrum allocation matrix A is the optimization object to be sought. The spectrum allocation matrix A is a binary allocation matrix that satisfies the maximum network benefit or the maximum fairness, under the constraints of the available spectrum matrix L and the interference constraint matrix C, combined with the benefit matrix B.
[0084] (2) Initialize the dragonfly algorithm, set the population size Num, and the maximum number of iterations t max , the initial weight in the velocity update formula, that is, the value range of the nonlinear inertia weight [ω min ,ω max ];ω min represents the minimum value of the nonlinear inertia weight, ω max Indicates the maximum value of the nonlinear inertia weight;
[0085] The solution vector X is initialized using the Halton sequence to generate a Halton sequence of dimension D, and then Num of them are selected to obtain the initial position matrix S = {X1; X2; ...; X Num}∈R Num×D .X i , i=1,2,…,Num, represents the individual position of the dragonfly, each individual position of the dragonfly represents a candidate solution vector; D is the dimension of the candidate solution vector, and D is equal to the number of 1s in the available channel matrix L.
[0086] Compared with random initialization, the candidate solutions obtained by Halton sequence initialization are more evenly distributed, and there will be no phenomenon of candidate solutions being too close or clustered, which helps to enhance population diversity and speed up the optimization process.
[0087] To illustrate the distribution of random initialization and Halton sequence initialization, a visual comparison is made. Taking two-dimensional space as an example, the distribution of 20 candidate solutions initialized by random initialization and Halton sequence initialization in the range of ([0,1],[0,1]) is shown as follows: Figure 2 As shown, the left figure is the distribution obtained by random initialization, and the right figure is the distribution obtained by Halton sequence initialization.
[0088] like Figure 2 As shown in the figure, the candidate solutions generated by random initialization are unevenly distributed, showing three clustered distributions in the upper right, upper left and lower middle, and there are even no candidate solutions in some areas. If the 25 squares divided by the coordinate axis 0.2 are used as a reference, there are 12 squares in the left figure without candidate solutions, and most of these squares are in a neighbor relationship. The right figure shows that the candidate solutions generated by the Halton sequence are distributed relatively evenly in space, and there is no phenomenon of candidate solution aggregation. There are no candidate solutions in 9 of the 25 squares, and the distribution positions are discrete. Therefore, the Halton sequence is a more evenly distributed random number.
[0089] (3) Binarize the candidate solution vector; the specific process is as follows:
[0090] The update speed ΔX of the candidate solution vector represented by the dragonfly individual position t+1As the independent variable, use the V-type function to convert ΔX t+1 Every dimension All are mapped to the range [0,1], as shown in formula (I):
[0091]
[0092] In formula (I), Indicates update speed The conversion probability in the i-th dimension;
[0093] Then, according to the comparison result between the transformation probability and the random number rand in [0,1], the random number rand can be obtained by the rand function of MATLAB, and the binary value of the candidate solution vector on the i-th dimension is determined, as shown in formula (II):
[0094]
[0095] The advantage of using a V-type function instead of an S-type function for conversion probability mapping is that the V-type function is symmetrical and has the same processing when the update speed has the same change in the positive direction or the reverse direction.
[0096] (4) According to the candidate solution coding rule, the candidate solution vector X i Mapped to the allocation matrix A;
[0097] In step (4), the candidate decoding rule is specifically as follows: set the position of element 1 in the available channel matrix L from the first row to the Nth row as the candidate solution vector X from left to right i The values in , and all other values in the matrix are set to 0, that is, the distribution matrix A is obtained. For example, X i =[0110010], change the position of element 1 from the first row to the fourth row in the matrix L to 0110010 from left to right, and set other elements in the matrix to 0, then the allocation matrix is obtained
[0098] (5) Determine and remove interference in the allocation matrix A;
[0099] According to the non-zero value of the interference constraint matrix C, in step (5), the interference in the allocation matrix A is determined and removed; the specific process is:
[0100] Determine whether there is an interfering allocation in the allocation matrix A. If there is an interfering allocation, the interfering allocation pair a n,m and a l,m One of the two random zeros is set to remove interference. Interference allocation refers to allocating a spectrum resource to two cognitive users at the same time. l,m and cognitive user an,m .
[0101] (6) Calculate the objective function value of each dragonfly individual position, then sort the objective function values from small to large, save the candidate solution vectors corresponding to the maximum and minimum values of the objective function, and update them as the location of the food source and the location of the natural enemy respectively;
[0102] Step (6) takes maximizing the overall benefit of the network as the optimization goal. The candidate solution vector represented by each dragonfly individual position is mapped into an allocation matrix A, corresponding to an allocation scheme. The calculation formula of the objective function value of each dragonfly individual position is as follows:
[0103]
[0104] In formula (X), U MNE is the overall network benefit, which is obtained by summing the benefits of N cognitive users, r n =a n,m b n,m , r n represents the network benefit of the nth cognitive user; a n,m It means that the mth available spectrum is allocated to the nth cognitive user.
[0105] Sort the objective function value of each candidate solution vector from small to large, take the candidate solution vector corresponding to the maximum objective function value as the current optimal solution vector, and update it to the location of the food source; take the candidate solution vector corresponding to the minimum objective function value, and update it to the location of the natural enemy.
[0106] (7) The improved dragonfly algorithm is used to iteratively update the population position. The specific process is as follows:
[0107] Calculate the five group behaviors of the current dragonfly individual, including the separation behavior S i , Alignment Behavior A i , Aggregation Behavior C i , foraging behavior i and avoidance behavior i , as shown in formula (III):
[0108]
[0109] In formula (III), X represents the current position of the dragonfly individual, X j represents the position of the jth neighbor of the current dragonfly, j = 0, 1, ..., N D , N D represents the number of dragonfly neighbors, V j represents the speed of the jth neighbor of the current dragonfly, X + represents the location of the food source, corresponding to the optimal solution of each iteration, X -represents the position of the natural enemy, corresponding to the worst solution of each iteration; the nearest neighbor of X is centered on X, R N It is composed of dragonflies within the radius, generally R N One tenth of the length or width of the space is allocated for the spectrum.
[0110] In the tth iteration, the position X of the dragonfly is updated t+1 The position vector X of the current dragonfly individual t and the step vector ΔX t+1 Determine, as shown in formula (IV):
[0111] X t+1 =X t +ΔX t+1 (IV),
[0112] In formula (IV), the step vector ΔX t+1 Represents the flight direction and step length of the dragonfly, the step length vector ΔX t+1 It is determined by the five behaviors of the dragonfly, S, A, C, F and E, as shown in formula (V):
[0113] ΔX t+1 =(sS i +aA i +cC i +fF i +eE i )+ω * ΔX t (V),
[0114] In formula (V), s represents the separation weight, a represents the alignment weight, c represents the alliance weight, f represents the food weight, e represents the natural enemy weight, t represents the current iteration number, ω * is the nonlinear inertia weight;
[0115] The original dragonfly step size update algorithm uses a linearly decreasing inertia weight ω, as shown in the following formula (VI):
[0116] ω=0.9-t(0.5 / t max )(VI)
[0117] In formula (VI), t is the number of iterations, t maxis the maximum number of iterations set; the inertia weight ω is a linear decreasing curve, starting from the initial 0.9 and dropping to 0.4 in the last iteration. In the iterative process of the dragonfly algorithm, the inertia weight specifies the difference between each iteration and the previous iteration. According to the optimization process, the step size change in the early stage is larger in order to quickly approach the optimal solution, and the step size needs to be updated in the later stage to find the optimal solution. The convergence speed of the iteration is related to the step size update of the optimization. The objective function often converges quickly in the early stage, and the optimization in the later stage is more refined, so the convergence slows down. This process is not linear. Therefore, the change of the step size also needs to be close to the changing trend of the objective function to speed up the convergence speed of the entire algorithm. For this reason, in the present invention, ω * is the nonlinear inertia weight, and a new weight is constructed using a decreasing exponential function, as shown in formula (VII):
[0118] ω * =ω min +|ω max -ω min |exp(-2t / t max )(VII)
[0119] In formula (VII), ω min Indicates the lower limit of the inertia weight, ω max represents the upper limit of the inertia weight, t represents the current number of iterations, and t max Indicates the maximum number of iterations set; in this algorithm, the value range of the inertia weight is kept consistent with the original dragonfly algorithm, that is, ω min =0.4,ω max =0.9.
[0120] When there is no nearest neighbor solution near the same individual, the randomness of the dragonfly exploration is increased by using the Levy flight mechanism to fly around the search space. At this time, the position of the dragonfly individual is updated as follows:
[0121]
[0122] In formula (VIII), D represents the dimension of the solution vector, Represents point product, Levy function is as shown in formula (IX):
[0123]
[0124] In formula (IX), r1(D) and r2(D) both represent D-dimensional random number vectors with a value range of [0,1], β = 1.5, Γ(x)=(x-1)! .
[0125] In addition, before performing step (7), the allocation matrix A needs to be mapped back to the candidate solution vector X according to the candidate decoding rule. i In the optimization target matrix A, allocation is allowed only when a cognitive user can use a certain channel. Therefore, in order to reduce the spatial dimension of optimization and speed up the calculation, the candidate solution individuals are first coded for available channels before iteration; the candidate solution decoding rule is: find the position where the element in the matrix L is 1, and then select the values of the position corresponding to the position of element 1 in the matrix A from the first row to the Nth row, and then encode it into a vector, that is, the candidate solution vector X is obtained. i ;For example, Find the position where the element is 1 in matrix L, and then select the value of the position corresponding to the position of element 1 in matrix A, that is, the selected value is 0110010, so as to obtain X i =[0110010]. The population position matrix S contains Num individuals, each individual X i After candidate decoding, its dimension D can be reduced from M×N before encoding to the number of 1s in the L matrix, which greatly reduces the amount of calculation.
[0126] (8) Determine whether the iteration termination condition is met. If the termination condition is not met, repeat steps (3)-(7);
[0127] If the termination condition is met, the solution corresponding to the maximum benefit of the entire network is selected as the optimal solution vector. The position of the dragonfly individual represented by the optimal solution vector is also the position of the food source, indicating that the dragonfly has found food; at this time, the allocation scheme represented by the allocation matrix A corresponding to the optimal solution is the spectrum allocation scheme of the optimal cognitive radio network.
[0128] The effect of spectrum allocation of the present invention is illustrated by the following simulation experiment.
[0129] The simulation experiment is carried out in a 30×30 area. The number of authorized users K, the number of available channels M, and the number of cognitive users N are set to different values according to different experimental purposes; the protection radius d of the authorized user p =2, the communication range of the cognitive user is [1,4], and the population number Num of the dragonfly algorithm is 20. The maximum number of iterations t max =200. The original dragonfly algorithm and particle swarm algorithm are selected for comparison. The population size and maximum number of iterations are set the same. The particle swarm algorithm uses a crossover probability of 0.8 and a mutation probability of 0.01. The initialization of these two algorithms is a random sequence, and the experimental results are the average of 20 repetitions. To ensure the effectiveness of the comparison, in all algorithms, the locations of authorized users and cognitive users are the same set of random locations within the defined area.
[0130] Figure 3When the number of authorized users K=10, the number of available channels M=10, and the number of cognitive users N=10, the iteration curves of the algorithm of the present invention, the original dragonfly algorithm, and the particle swarm algorithm, after Halton initialization, the network benefit value of the algorithm of the present invention is significantly higher than that of the original dragonfly algorithm in the early stage of iteration, indicating that uniform initialization increases the population diversity and is conducive to algorithm convergence. The nonlinear inertia weight makes the search step size change nonlinearly, which is conducive to rapid convergence in the early stage and fine optimization in the later stage. Therefore, the final optimization accuracy is higher than that of the original dragonfly algorithm.
[0131] Figure 4 The comparison of average network benefits when the number of authorized users K = 10, the number of available channels M = 10, and the number of cognitive users N∈{2,4,6,8,10,12} increase successively. The average network benefit decreases with the increase of the number of cognitive users. This is because the more cognitive users there are, the greater the density, the greater the mutual interference, and the more intense the competition for channels. It can be seen that the allocation method provided by the present invention can improve the average network benefit under various numbers of cognitive users, and is a cognitive radio spectrum allocation method with excellent performance.
Claims
1. A spectrum allocation method for cognitive radio networks based on binary dragonfly optimization algorithm, characterized in that: Specifically include: (1) Initialize the graph theory coloring model of spectrum allocation, and then calculate the available channel matrix L, the benefit matrix B, and the interference constraint matrix C according to the initialization settings. The allocation matrix A is the optimization object to be calculated. (2) Initialize the dragonfly algorithm and obtain the initialization dragonfly population position matrix S, where each dragonfly individual position represents a candidate solution vector; (3) Binarize the candidate solution vector; (4) According to the candidate solution coding rule, the candidate solution vector X i Mapped to the allocation matrix A; (5) Determine and remove interference in the allocation matrix A; (6) Calculate the objective function value of each dragonfly individual position, then sort the objective function values from small to large, save the candidate solution vectors corresponding to the maximum and minimum values of the objective function, and update them as the location of the food source and the location of the natural enemy respectively; (7) Use the improved dragonfly algorithm to iteratively update the population position; (8) Determine whether the iteration termination condition is met. If the termination condition is not met, repeat steps (3) to (7). If the termination condition is met, output the allocation matrix A corresponding to the optimal solution vector to obtain the spectrum allocation scheme of the cognitive radio network.
2. The spectrum allocation method of a cognitive radio network based on a binary dragonfly optimization algorithm according to claim 1 is characterized in that: In step (1), the parameters of the graph theory coloring model of spectrum allocation are initialized and set. The parameters of the graph theory coloring model include: the spectrum allocation space range, the number and position coordinates of authorized users, the protection radius of the authorized users for the spectrum, the number and position coordinates of cognitive users, and the transmission range of cognitive users under each spectrum. The position coordinates of authorized users and cognitive users are all randomly generated. Then, the available channel matrix L, the benefit matrix B, and the interference constraint matrix C are calculated according to the initialization settings. The specific process is: 1-1, the available spectrum matrix L = {l n,m l n,m ∈{0,1}} N×M , subscript n = 1, 2, ..., N, represents the number of cognitive users; m = 1, 2, ..., M represents the number of available spectrum; the element l in the matrix n,m =1, it means that the nth cognitive user can use the mth spectrum resource, l n,m = 0 means that the nth cognitive user cannot use the mth spectrum resource; the calculation process is: if the location coordinates of each user are known, the protection radius of the authorized user x for the frequency band m is d p (x,m), the subscript p indicates protection; the transmission range of cognitive user n in frequency band m is d s (n,m)∈[d min ,d max ], the subscript s represents the distance; the distance from the nth cognitive user to the authorized user x is calculated as Dist(n,x); then, if the condition d that the cognitive user n and the authorized user x use the m frequency band at the same time is satisfied s (n,m)≤Dist(n,x)-d p (x,m), then the available spectrum matrix L(n,m)=1, otherwise L(n,m)=0; 1-2, benefit matrix B = {b n,m } N×M , b n,m represents the benefit weight brought by the nth cognitive user using the mth spectrum resource, b n,m is a real number; 1-3, interference constraint matrix C = {c n,l,m |c n,l,m ∈{0,1}} N×L×M is a three-dimensional 0-1 matrix, c n,l,m Indicates whether the nth and lth cognitive users using spectrum m at the same time will cause interference, l = 1, 2, ..., N; if c n,l,m =1, then the nth and lth cognitive users using spectrum m at the same time will cause interference; if c n,l,m = 0, the nth and lth cognitive users using spectrum m simultaneously will not cause interference; In step (1), the allocation matrix A = {a n,m |a n,m ∈{0,1}} N×M represents the allocation of spectrum among all cognitive users; if a n,m =1, the mth available spectrum is allocated to the nth cognitive user, and l n,m =1; and for any n<N, l<N, m<M, if c n,l,m =1, then a n,m ·a l,m =0, that is, there is no mutual interference in the allocation mode represented by the allocation matrix A.
3. The spectrum allocation method for cognitive radio network based on binary dragonfly optimization algorithm according to claim 1 is characterized in that: In step (2), the dragonfly algorithm is initialized, that is, the population size Num and the maximum number of iterations t are set. max , the value range of nonlinear inertia weight [ω min ,ω max ],ω min represents the minimum value of the nonlinear inertia weight, ω max Indicates the maximum value of the nonlinear inertia weight; The candidate solution vector X is initialized using the Halton sequence to generate a Halton sequence of dimension D, and then Num of them are selected to obtain the initialized dragonfly population position matrix S = {X1; X2; ...; X Num }∈R Num×D , X i , i=1,2,…,Num, represents the individual position of the dragonfly, each individual position of the dragonfly represents a candidate solution vector; D is the dimension of the candidate solution vector, and D is equal to the number of 1s in the available channel matrix L.
4. The spectrum allocation method for cognitive radio network based on binary dragonfly optimization algorithm according to claim 1 is characterized in that: In step (3), the candidate solution vector is converted into a binary form. The specific process is as follows: The update speed of the candidate solution vector ΔX t+1 As the independent variable, use the V-type function to convert ΔX t+1 Every dimension i=0,1,...,D, are all mapped to the range [0,1], as shown in formula (I): In formula (I), Indicates update speed The conversion probability in the i-th dimension; Then, according to the comparison result between the conversion probability and the random number rand in [0, 1], the binary value of the candidate solution vector on the i-th dimension is determined, as shown in formula (II):
5. The spectrum allocation method for cognitive radio network based on binary dragonfly optimization algorithm according to claim 1 is characterized in that: In step (4), the candidate decoding rule is as follows: the allocation matrix A is initialized as an all-zero matrix, and then the positions of element 1 in the available channel matrix L from the first row to the Nth row are set as candidate solution vectors X from left to right. i The values in , we get the allocation matrix A.
6. The spectrum allocation method of cognitive radio network based on binary dragonfly optimization algorithm according to claim 1 is characterized in that: In step (5), the interference in the allocation matrix A is determined and removed. The specific process is as follows: It is determined whether there is an interfering allocation in the allocation matrix A. If there is an interfering allocation, one of the interfering allocation pairs is randomly set to zero to remove the interference.
7. The spectrum allocation method of cognitive radio network based on binary dragonfly optimization algorithm according to claim 2 is characterized in that: In step (6), the optimization goal is to maximize the benefits of the entire network. The candidate solution vector represented by each dragonfly individual position is mapped into an allocation matrix A, corresponding to an allocation scheme. The calculation formula for the objective function value of each dragonfly individual position is as follows: In formula (X), U MNE is the overall network benefit, which is obtained by summing the benefits of N cognitive users, r n =a n,m b n,m , r n represents the network benefit of the nth cognitive user; a n,m It means that the mth available spectrum is allocated to the nth cognitive user; Sort the objective function values of each candidate solution vector from small to large, take the candidate solution vector corresponding to the maximum objective function value as the current optimal solution vector, and update it to the location of the food source; The candidate solution vector corresponding to the minimum objective function value is updated to the position of the natural enemy.
8. The spectrum allocation method for cognitive radio network based on binary dragonfly optimization algorithm according to claim 7 is characterized in that: In step (7), the improved dragonfly algorithm is used to iteratively update the population position. The specific process is as follows: Calculate the five group behaviors of the current dragonfly individual, including the separation behavior S i , Alignment Behavior A i , Aggregation Behavior C i , foraging behavior i and avoidance behavior i , as shown in formula (III): In formula (III), X represents the current position of the dragonfly individual, X j represents the position of the jth neighbor of the current dragonfly, j = 0, 1, ..., N D , N D represents the number of dragonfly neighbors, V j represents the speed of the jth neighbor of the current dragonfly, X + represents the location of the food source, corresponding to the optimal solution of each iteration, X - represents the position of the natural enemy, corresponding to the worst solution of each iteration; the nearest neighbor of X is centered on X, R N is the dragonfly within the radius, R N Allocate one-tenth the length or width of the space for the spectrum; In the tth iteration, the position X of the dragonfly is updated t+1 The position vector X of the current dragonfly individual t and the step vector ΔX t+1 Determine, specifically as shown in formula (IV): X t+1 =X t +ΔX t+1 (IV), In formula (IV), the step vector ΔX t+1 Represents the flight direction and step length of the dragonfly, the step length vector ΔX t+1 As shown in formula (V): ΔX t+1 =(sS i +aA i +cC i +fF i +eE i )+ω * ΔX t (V) In formula (V), s represents the separation weight, a represents the alignment weight, c represents the alliance weight, f represents the food weight, e represents the natural enemy weight, t represents the current number of iterations, ω* is the nonlinear inertia weight, and a decreasing exponential function is used to construct a new weight, as shown in formula (VII): oh * =ω min +|ω max -oh min |exp(-2t / t max ) (VII) In formula (VII), ω min Indicates the lower limit of the inertia weight, ω max represents the upper limit of the inertia weight, t represents the current number of iterations, and t max Indicates the maximum number of iterations set; When there is no nearest neighbor solution near the same individual, the randomness of the dragonfly exploration is increased by using the Levy flight mechanism to fly around the search space. At this time, the position of the dragonfly individual is updated as follows: In formula (VIII), D represents the dimension of the solution vector, Represents point product, Levy function is as shown in formula (IX): In formula (IX), r1(D) and r2(D) both represent D-dimensional random number vectors with a value range of [0, 1], β = 1.5, Γ(x)=(x-1)! .
9. The spectrum allocation method of cognitive radio network based on binary dragonfly optimization algorithm according to claim 8, characterized in that: Before performing step (7), it is necessary to map the interference-eliminating allocation matrix A back to the candidate solution vector X according to the candidate decoding rule. i The candidate solution decoding rule is: find the position where the element is 1 in the matrix L, and then select the value of the position corresponding to the position of element 1 in the matrix A from the first row to the Nth row, and then encode it into a vector, that is, the candidate solution vector X is obtained. i .
10. A spectrum allocation method for cognitive radio network based on binary dragonfly optimization algorithm according to any one of claims 1 to 9, characterized in that: In step (8), if the termination condition is met, the solution corresponding to the maximum benefit of the entire network is selected as the optimal solution vector. The position of the dragonfly individual represented by the optimal solution vector is also the position of the food source, indicating that the dragonfly has found food. At this time, the allocation scheme represented by the allocation matrix A corresponding to the optimal solution is the spectrum allocation scheme of the optimal cognitive radio network.
Citation Information
Patent Citations
Multi-target spectrum allocation method based on undisposal order preference quantum goose group algorithm
CN102316464A
Wireless spectrum distributing method based on chaos search quantum genetic algorithm
CN104768161A