Intelligent spectrum allocation method based on quantum behavior mimicry algorithm

Through the intelligent spectrum allocation method based on quantum behavior mimicry algorithm, the problems of low spectrum utilization and serious resource waste under traditional static allocation are solved, and more efficient spectrum resource management and network efficiency improvement are achieved.

CN120165794APending Publication Date: 2025-06-17SHENYANG NORMAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510310380.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-17
Publication Date
2025-06-17

AI Technical Summary

Technical Problem

The traditional static spectrum resource allocation method leads to low spectrum utilization and serious resource waste, which cannot meet the increasing demand for wireless communications.

Method used

Using an intelligent spectrum allocation method based on quantum behavior mimicry algorithm, intelligent spectrum allocation is achieved by defining population size, maximum genetic algebra, spectrum availability matrix, benefit matrix and interference matrix, quantum revolving gate, elite selection, interaction force mechanism and entropy balance strategy.

Benefits of technology

It significantly improves spectrum utilization, reduces the waste of spectrum resources, can converge to the global optimal solution faster, and improves network efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120165794A_ABST
    Figure CN120165794A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent spectrum allocation method based on a quantum behavior mimicry algorithm. The method comprises the following steps: initializing parameters and a matrix; calculating the size of the quantum bit; initializing a population; measuring a population and carrying out interference constraint processing; evaluating the population, calculating a population fitness value, and recording an optimal individual in the current population; judging whether a termination condition is met or not, and if yes, mapping the optimal individual to a spectrum non-interference matrix to obtain an optimal spectrum allocation matrix; otherwise, performing evolution operation and elite selection strategy on individuals in the population, implementing an interaction force mechanism, calculating population entropy and judging a relationship between a population entropy value and a set threshold value by utilizing a quantum revolving door, if the entropy value is smaller than the threshold value, performing quantum crossover operation and quantum mutation operation, and otherwise, returning to the step of measuring the population; and the maximum genetic algebra is reached. According to the spectrum allocation method, the optimal spectrum resource allocation scheme can be found in the spectrum resources meeting the requirements, so that the overall benefit of the network is maximized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of artificial intelligence, and particularly provides an intelligent spectrum allocation method based on a quantum behavior mimicry algorithm. Background Art

[0002] In wireless communication, the spectrum is the basis for information transmission, but the spectrum is very scarce. With the explosive development of mobile terminals such as the mobile Internet, the Internet of Things, and smart cities, the demand for spectrum resources has skyrocketed. The wireless spectrum resources are becoming increasingly scarce and have become the main bottleneck restricting its further development. Traditional static spectrum resource allocation methods cannot meet the increasing wireless communication requirements due to low spectrum utilization and serious spectrum resource waste.

[0003] Currently, most countries in the world allocate wireless spectrum in a static manner. Under the static spectrum management mode, due to factors such as scarce spectrum resources, unified government configuration and management, long-term exclusivity and exclusivity of spectrum use rights, the spectrum resources are scarce and unbalanced, and a large amount of spectrum resources cannot be effectively utilized.

[0004] In summary, the traditional static allocation mode will also cause a large amount of spectrum resource waste while ensuring the normal communication of authorized users, thus reducing the spectrum utilization rate. Therefore, how to improve the spectrum utilization rate is a current research hotspot. Summary of the Invention

[0005] In view of this, the present invention provides an intelligent spectrum allocation method based on a quantum behavior mimicry algorithm to solve the problems existing in the prior art.

[0006] The technical solution provided by the present invention is: an intelligent spectrum allocation method based on a quantum behavior mimicry algorithm, comprising the following steps:

[0007] Step 1: Define the population size popsize and the maximum number of genetic generations g max , initialize the spectrum availability matrix L = {l n,m |l n,m ∈ {0, 1}} N×M , benefit matrix B = {b n,m} N×M , interference matrix C = {c n,k,m |c n,k,m ∈ {0, 1}} N×N×M , where the spectrum availability matrix L represents the availability of cognitive user n for spectrum m, the benefit matrix B represents the network benefit obtained when spectrum m is used by cognitive user n, and the interference matrix C represents the interference situation when cognitive user n and cognitive user k jointly use spectrum m;

[0008] Step 2: Calculate the size of qubit l, that is, calculate the number of 1s in the available spectrum matrix L, record the positions corresponding to each 1, and save them into matrix L1, L1 = {(n, m)|l n,m = 1}, and the data in matrix L1 is arranged in ascending order of n and m. Among them, qubit l is calculated by the following formula:

[0009]

[0010] In the formula, N represents the total number of cognitive users, M represents the total number of spectrums, and l n,m is the element value at the position (n, m) in the available spectrum matrix L. When l n,m = 1, it means that cognitive user n can use spectrum m;

[0011] Step 3: Initialize the population Q = {q1, q2,..., q popsize}, and set both probability amplitudes α and β in the individual qubit to

[0012] Step 4: Measure the population Q = {q1, q2,..., q popsize} to obtain the measurement values P = {p1, p2,..., p popsize}, and then map the measurement values P to the spectrum interference-free matrix A according to the mapping principle for interference constraint processing to ensure that one spectrum is allocated to one user;

[0013] Step 5: Evaluate the population, calculate the population fitness values F = {f1, f2,..., f popsize}, and record the best individual best_x in the current population;

[0014] Step 6: Judge whether the termination condition is reached. If so, map the best individual to the spectrum interference-free matrix A to obtain the optimal spectrum allocation matrix. Otherwise, execute Step 7;

[0015] Step 7: Use the quantum rotation gate to perform an evolution operation on the individuals in the population;

[0016] Step 8: Perform the elite selection strategy, calculate the elite selection probability, and use the roulette wheel selection method for screening. Directly retain the selected elite individuals in the next-generation population. Among them, the elite selection probability fitness1 of individual i i is calculated by the following formula:

[0017]

[0018] In the formula, α and β are elite selection factors, bestfitness takes the optimal fitness value of the current population, and fitness iDenote the fitness value of individual i in the current population;

[0019] Step 9: Implement the interaction force mechanism and calculate the potential energy E of individual i i , by reducing the mutation probability P m to increase the gravitational force between individuals, attract the individuals close to the optimal individual using the gravitational force, and by increasing the mutation probability P m to increase the repulsive force between individuals, repel and mutate the individuals far from the optimal individual using the repulsive force, and make them evolve towards the optimal individual. Among them, the potential energy E of individual i i and the mutation probability P m are calculated by the following formula:

[0020] E i = m * g * (fitness i - bestfitness);

[0021] In the formula, m represents the mass of individual i; g is a constant; fitness i represents the fitness value of individual i; bestfitness represents the optimal fitness value of the current population;

[0022]

[0023] In the formula, η is the gravitational factor and λ is the repulsive factor;

[0024] Step 10: Calculate the entropy value H(X) of the population through the probability density P e (x) of the valid data points. Among them, the probability density P e (x) of the valid data points and the population entropy value H(X) are calculated by the following formula:

[0025]

[0026] In the formula, N e represents the number of valid data points in the counting interval;

[0027] H(X) = -ΣP e (x) × log2(P e (x));

[0028] In the formula, P e (x) represents the probability density of the valid data points, and H(X) represents the entropy of the population X;

[0029] Step 11: Determine the relationship between entropy and the threshold: If the entropy H(X) is less than the threshold threshold, then execute Step 12 and Step 13 to increase population diversity; if the entropy H(X) is greater than the threshold threshold, then return to Step 4 to perform the population entropy balance strategy to make the population tend to be stable generation by generation;

[0030] Step 12: Perform quantum crossover operation, utilize quantum entanglement to increase population diversity;

[0031] Step 13: Perform quantum mutation operation, utilize individual inversion to introduce new individuals and increase population diversity. After the operation, return to Step 4 to continue execution.

[0032] Preferably, in Step 4, when cognitive user n and cognitive user k use the same spectrum m, determine the priority right to use spectrum m through the comparison result of a random number and 0.5. If the random number > 0.5, spectrum m is used by cognitive user n; if the random number < 0.5, spectrum m is used by cognitive user k.

[0033] Further preferably, in Step 5, adopt the average maximization of the total network revenue, the maximization of the minimum bandwidth, and the maximum proportional fairness metric as the population fitness function. Among them, the ultimate goal of spectrum resource allocation is to make the entire system obtain the greatest benefit.

[0034] Further preferably, in Step 8, use the following formula to determine the probability P that individual i is selected during roulette wheel selection i :

[0035]

[0036] In the formula, N represents the total number of individuals in the population, and fitness1 i represents the elitist selection probability of individual i.

[0037] Further preferably, in Step 9, first, establish a quantum potential field model according to the current best solution. Among them, the potential energy E of the optimal individual best best = 0; secondly, regard the optimal individual best as the gravitational center of the quantum potential field, generate an attractive force on the surrounding individual i, and guide the search process to move towards the region of the optimal solution; finally, on the premise of maintaining population diversity, continuously adjust the potential energy to guide the sub-optimal solution to the position of the optimal solution.

[0038] Further preferably, in Step 9, if the potential energy E of individual i i > 0, completely utilize the gravitational force to update the optimal individual best to the current individual i to make the population evolve towards the optimal solution direction. If E i < 0 and |E i | ≤ 0.5, reduce the population mutation probability P m ; if Ei < 0 and |E i | > 0.5, increase the population mutation probability P m ; If P m > 0.5, increase the repulsive force, invert each binary bit of individual i, and regenerate it to make it jump out of the current local optimal value of potential energy.

[0039] For further optimization, in step 10, first, calculate the Hamming distance matrix: For any two individuals in the population, calculate the Hamming distance between them by comparing whether each bit of their binary representations is the same. If the values of two bits are different, the Hamming distance is 1; if the values are the same, the Hamming distance is 0. Secondly, construct the Hamming distance matrix distance_matrix: Combine the Hamming distances between all individuals to form the Hamming distance matrix, expand the Hamming distance matrix into a one-dimensional vector matrix, and remove all 0 elements in the one-dimensional vector matrix to update the Hamming distance matrix distance_matrix. Then, calculate the probability density P e (x): Determine the counting interval as

[0040] [min(distance_matrix) - 0.5, max(distance_matrix) + 0.5], calculate the number of valid data points in the counting interval as N e , convert the elements in the Hamming distance matrix into the probability density P e (x); Finally, calculate the population entropy value H(X).

[0041] For further optimization, in step 12, first, use the roulette wheel selection method to distinguish excellent individuals and non-excellent individuals; then, find all non-excellent individuals and mark them as the candidate object set selected_indices for quantum crossover operation; secondly, use quantum entanglement from the candidate object set selected_indices to determine quantum entanglement pairs, that is, select the first parent parent1 and the second parent parent2. At the same time, randomly generate the quantum entanglement positions parent1_idx, parent2_idx of the offspring and the parent and the quantum crossover point position crosspoint; finally, use the characteristics of quantum entanglement to perform a crossover operation on the two parents, and add the new individuals child1 and child2 generated by the crossover operation to the population to replace the original non-excellent individuals parent1 and parent2.

[0042] For further optimization, in step 13, if the mutation probability P m is greater than 0.5, perform an inversion operation on the binary representation of the corresponding individual to achieve individual inversion and evolve non-excellent individuals into excellent individuals.

[0043] The intelligent spectrum allocation method based on the quantum-behaved bat algorithm provided by the present invention can achieve intelligent spectrum allocation. In the quantum-behaved bat algorithm, first, the proportion of excellent individuals in the population is significantly amplified to ensure that these outstanding individuals can be selected and retained in the next generation with 100% probability, strengthening the high-quality genes of the population and accelerating the evolution process to converge to the global optimal solution faster. Second, a mutual force mechanism is added to the algorithm. By constructing a quantum potential field, an attraction is generated for high-quality solutions and a repulsion for inferior solutions, making the search process tend to move towards the regions of these high-quality solutions. At the same time, the quantum tunneling ability is enhanced, allowing the algorithm to jump out of the current local minimum with a certain probability during the search process. However, due to the action of the quantum potential field, this jump often occurs towards a better solution domain. Then, an entropy balance strategy is added. By continuously monitoring the change of the entropy value of the population, the optimization strategy is dynamically adjusted. By judging the relationship between the entropy value in the population and its threshold, quantum crossover and quantum mutation operations are added to increase the diversity of the population and prevent the algorithm from falling into a local optimal solution. Through simulation experiments, the results show that with the changes of factors such as licensed users, cognitive users, the number of spectrums, and the spatial distribution of users, the quantum-behaved bat algorithm designed by the present invention has obvious advantages in three indicators of MSRM, MMR, and MPF. In summary, the intelligent spectrum allocation method based on the quantum-behaved bat algorithm designed by the present invention can better find the optimal spectrum resource allocation strategy from the spectrum resources that meet the requirements. Description of the Drawings

[0044] The following further describes the present invention in detail in conjunction with the drawings and embodiments:

[0045] Figure 1 It is a flowchart of the intelligent spectrum allocation method based on the quantum-behaved bat algorithm provided by the present invention;

[0046] Figure 2 In (a1)-(a3), when N = 5, K = 10, M = 10, it is the network benefit diagrams of six algorithms in MSRM, MMR, and MPF. In (b1)-(b3), when N = 20, K = 10, M = 10, it is the network benefit diagrams of six algorithms in MSRM, MMR, and MPF;

[0047] Figure 3 In (a1)-(a3), when N = 10, K = 10, M = 10, it is the network benefit diagrams of six algorithms in MSRM, MMR, and MPF. In (b1)-(b3), when N = 10, K = 10, M = 20, it is the network benefit diagrams of six algorithms in MSRM, MMR, and MPF;

[0048] Figure 4In (a1)-(a3), it is the network benefit diagrams of six algorithms in MSRM, MMR, and MPF when N = 10, K = 5, and M = 15. In (b1)-(b3), it is the network benefit diagrams of six algorithms in MSRM, MMR, and MPF when N = 10, K = 15, and M = 15.

[0049] Figure 5 In (a1)-(a3), it is the comparison diagram of the influence on network benefit when the available spectrum number in MSRM, MMR, and MPF changes.

[0050] Figure 6 In (a1)-(a3), it is the comparison diagram of the influence on network benefit when the number of cognitive users in MSRM, MMR, and MPF changes.

[0051] Figure 7 It is the illustration diagram of the dynamic wireless environment.

[0052] Figure 8 In (a1)-(a3), it is the network revenue diagram of dynamic spectrum resource allocation in MSRM, MMR, and MPF. Specific implementation manner

[0053] The present invention will be further explained below in combination with specific implementation schemes, but the present invention is not limited thereto.

[0054] Spectrum allocation scenario description

[0055] Assume that a wireless network has a width of X and a length of Y. Among them, there are K primary users (PU) and N secondary users (SU), and there are M available spectrums. If there is no interference among all users, the secondary users can autonomously select idle spectrums for communication. Assume that the interference among all users only depends on the distance between users. When the coverage areas of two users overlap, there is mutual interference between these two secondary users, so they cannot access this spectrum simultaneously. Assume that the spectrum sensing part has been completed, and the quantum-behaved bat algorithm only needs to allocate the sensed spectrums.

[0056] The intelligent spectrum allocation method based on the quantum-behaved bat algorithm provided by the present invention takes the maximization of network benefit as the objective function, and seeks the optimal spectrum resource allocation scheme among the spectrum resource allocation schemes that meet the conditions. Based on the graph coloring model, the quantum-behaved bat algorithm is used to solve the spectrum allocation problem. The following details the specific implementation process of spectrum allocation using the quantum-behaved bat algorithm:

[0057] 1. Encoding method

[0058] The present invention uses a quantum behavior mimicry algorithm for spectrum allocation. Each individual will be converted into a binary sequence after quantum measurement, which represents a possible result of spectrum allocation. N cognitive users, M spectrum resources, and K primary users are distributed in the same area. The cognitive users need to dynamically and intelligently utilize the currently idle spectrum to maximize their communication benefits. In the spectrum availability matrix L, if l n,m = 1, it means that this spectrum may be available to the current cognitive users. If l n,m = 0, it means that it is unavailable, which is generally because this spectrum resource is being used by a primary user or due to some other allocation restrictions. Spectrum allocation is to find the spectrum interference-free matrix A that maximizes the network benefit in the spectrum availability matrix L. If l n,m = 1, then the corresponding element a n,m in the spectrum interference-free matrix A will have the following two possibilities:

[0059]

[0060] If a n,m = 0, it indicates that this cognitive user has not obtained this spectrum; while if a n,m = 1, it represents that the cognitive user has obtained this spectrum. In this way, it is possible to clearly track the spectrum resources used by each cognitive user, thus ensuring that the entire communication process is interference-free. On the contrary, if l n,m = 0, then the corresponding a n,m in the spectrum interference-free matrix A will be set to 0, indicating that this spectrum cannot be utilized by this cognitive user.

[0061] For such complex problems, the present invention proposes a simple and effective method, that is, mapping the binary string of the individual bit by bit to the spectrum interference-free matrix A according to the "1" positions in the spectrum availability matrix L, and then encoding according to the elements a n,m corresponding to the "1" positions in the spectrum interference-free matrix A. This can reduce the complexity of the algorithm for such problems, help improve the calculation efficiency, reduce redundant information, reduce the coding dimension, improve the solution efficiency, and reduce the optimization difficulty. The number of quantum bits l of the individuals in the population is determined by the following formula.

[0062]

[0063] 2. Interference processing

[0064] The spectrum interference-free matrix A is derived from the spectrum availability matrix L and is restricted by the spectrum availability matrix L. The positions of the 0 elements in the spectrum availability matrix L are the same as those of the 0 elements in the spectrum interference-free matrix A. p i is an individual of the population. In order to evaluate its fitness, it must be mapped to the spectrum interference-free matrix A.

[0065] 3. Population Evaluation

[0066] The purpose of spectrum resource allocation is to maximize the overall network benefit. The present invention uses the maximization of the sum of average network rewards (Max-Sum-Mean-Reward, MSMR), the maximization of the minimum bandwidth (Max-Min Reward, MMR), and the maximum proportional fairness metric (Max-Proportional-Fairness, MPF) as the objective functions of the network.

[0067] U MSMR is to maximize the benefit of the cognitive radio network, U MSMR The formula is expressed as follows:

[0068]

[0069] U MMB is to maximize the spectrum utilization rate of each cognitive user, U MMB The formula is expressed as follows:

[0070]

[0071] U MPF is to maximize the fair use of the spectrum by each cognitive user, U MPF The formula is expressed as follows:

[0072]

[0073] The intelligent spectrum allocation method based on the quantum-behaved bat algorithm provided by the present invention specifically includes the following steps:

[0074] Step 1: Define the population size popsize and the maximum number of genetic generations g max , initialize the spectrum availability matrix L = {l n,m |l n,m ∈{0, 1}} N×M , the benefit matrix B = {b n,m} N×M , the interference matrix C = {c n,k,m |c n,k,m ∈{0, 1}} N×N×M , where the spectrum availability matrix L represents the availability of cognitive user n to spectrum m, the benefit matrix B represents the network benefit obtained when spectrum m is used by cognitive user n, and the interference matrix C represents the interference situation when cognitive user n and cognitive user k jointly use spectrum m;

[0075] Step 2: Calculate the size of qubit l, that is, calculate the number of 1s in the spectrum availability matrix L, record the positions corresponding to each 1, and save them into matrix L1, L1 = {(n, m)|l n,m = 1}, and the data in matrix L1 is arranged in ascending order of n and m. Among them, qubit l is calculated by the following formula:

[0076]

[0077] In the formula, N represents the total number of cognitive users, M represents the total number of spectrums, and l n,m is the element value at the (n, m) position in the spectrum availability matrix L. When l n,m = 1, it means that cognitive user n can use spectrum m;

[0078] Step 3: Initialize the population Q = {q1, q2,..., q popsize}, and set both probability amplitudes α and β in the individual qubit to

[0079] Step 4: Measure the population Q = {q1, q2,..., q popsize} to obtain the measurement values P = {p1, p2,..., p popsize}, and then map the measurement values P to the spectrum interference-free matrix A according to the mapping principle for interference constraint processing to ensure that one spectrum is allocated to one user;

[0080] Step 5: Evaluate the population, calculate the population fitness values F = {f1, f2,..., f popsize}, and record the best individual best_x in the current population;

[0081] Step 6: Judge whether the termination condition is reached. If so, map the best individual to the spectrum interference-free matrix A to obtain the optimal spectrum allocation matrix. Otherwise, execute Step 7;

[0082] Step 7: Use the quantum rotation gate to perform an evolution operation on the individuals in the population;

[0083] Step 8: Perform the elite selection strategy, calculate the elite selection probability, and use the roulette wheel selection method for screening. The selected elite individuals are directly retained in the next-generation population. Among them, the elite selection probability fitness1 of individual i i is calculated by the following formula:

[0084]

[0085] In the formula, α and β are elite selection factors, bestfitness takes the optimal fitness value of the current population, and fitness iRepresents the fitness value of individual i in the current population;

[0086] Step 9: Implement the interaction force mechanism to calculate the potential energy E of individual i i , by reducing the mutation probability P m to increase the gravitational force between individuals, attracting the individuals close to the optimal individual using the gravitational force, and by increasing the mutation probability P m to increase the repulsive force between individuals, repelling and mutating the individuals far from the optimal individual using the repulsive force to make them evolve towards the optimal individual. Among them, the potential energy E of individual i i and the mutation probability P m are calculated by the following formula:

[0087] E i = m * g * (fitness i - bestfitness);

[0088] In the formula, m represents the mass of individual i; g is a constant; fitness i represents the fitness value of individual i; bestfitness represents the optimal fitness value of the current population;

[0089]

[0090] In the formula, η is the gravitational factor and λ is the repulsive factor;

[0091] Step 10: Calculate the entropy value H(X) of the population through the probability density P e (x) of the valid data points. Among them, the probability density P e (x) of the valid data points and the population entropy value H(X) are calculated by the following formula:

[0092]

[0093] In the formula, N e represents the number of valid data points in the counting interval;

[0094] H(X) = -ΣP e (x) × log2(P e (x));

[0095] In the formula, P e (x) represents the probability density of the valid data points, and H(X) represents the entropy of the population X;

[0096] Step 11: Determine the relationship between entropy and the threshold: If the entropy H(X) is less than the threshold threshold, then execute Step 12 and Step 13 to increase population diversity; if the entropy H(X) is greater than the threshold threshold, then return to Step 4 to perform the population entropy balance strategy to make the population tend to be stable generation by generation;

[0097] Step 12: Perform quantum crossover operation. Utilize quantum entanglement to increase population diversity;

[0098] Step 13: Perform quantum mutation operation. Utilize individual inversion to introduce new individuals and increase population diversity. After the operation, return to Step 4 to continue execution.

[0099] Among them, in Step 4, when cognitive user n and cognitive user k use the same spectrum m, the priority right to use spectrum m is determined by the comparison result of a random number and 0.5. If the random number > 0.5, spectrum m is used by cognitive user n; if the random number < 0.5, spectrum m is used by cognitive user k.

[0100] Among them, in Step 5, the average maximization of the total network revenue, the maximization of the minimum bandwidth, and the maximum proportional fairness metric are adopted as the population fitness function. Among them, the ultimate goal of spectrum resource allocation is to make the entire system obtain the maximum benefit.

[0101] Among them, in Step 8, the probability P that individual i is selected during roulette wheel selection is determined using the following formula i :

[0102]

[0103] In the formula, N represents the total number of individuals in the population, and fitness1 i represents the elitist selection probability of individual i.

[0104] Among them, in Step 9, first, according to the current best solution, a quantum potential field model is established, and the potential energy is used to represent the quality of the solution. Among them, the potential energy E of the optimal individual best best = 0, and its potential energy is the lowest, so it is the most stable; secondly, regard the optimal individual best as the gravitational center of the quantum potential field, which generates an attraction to the surrounding individual i, guiding the search process to move towards the region of the optimal solution; finally, on the premise of maintaining population diversity, by continuously adjusting the potential energy, the sub-optimal solution is guided to the position of the optimal solution. Affected by gravitational repulsion, it can not only make the population tend to the optimal solution, but also avoid the danger of falling into local extrema or inferior solution domains. The mutual force mechanism enables the algorithm to continuously find new high-quality solutions and continuously improve the global optimization ability.

[0105] Among them, in Step 9, if the potential energy E of individual i i> 0, fully utilize the gravitational force to update the optimal individual best to the current individual i, enabling the population to evolve towards the optimal solution; if E i < 0 and |E i | ≤ 0.5, it indicates that individual i is near the optimal individual best. By reducing the population mutation probability P m to increase the attraction of the optimal individual best to individual i; if E i < 0 and |E i | > 0.5, it indicates that individual i is far from the optimal individual best. By increasing the population mutation probability P m to increase the repulsive force of the optimal individual best on individual i; if P m > 0.5, increase the repulsive force. Take the complement of each binary bit of individual i and regenerate it to make it jump out of the current local optimal value of potential energy. However, due to the attraction of the gravitational center, this jump often moves towards a better solution domain.

[0106] Among them, in step 10, first, calculate the Hamming distance matrix: For any two individuals in the population, calculate the Hamming distance between them by comparing whether each bit of their binary representations is the same. If the values of two bits are different, the Hamming distance is 1; if the values are the same, the Hamming distance is 0. Secondly, construct the Hamming distance matrix distance_matrix: Compose the Hamming distances between all individuals into the Hamming distance matrix, expand the Hamming distance matrix into a one-dimensional vector matrix, and remove all 0 elements in the one-dimensional vector matrix to update the Hamming distance matrix distance_matrix. Then, calculate the probability density P e (x) of valid data points: Determine the counting interval as [min(distance_matrix) - 0.5, max(distance_matrix) + 0.5], calculate the number of valid data points in the counting interval as N e , and convert the elements in the Hamming distance matrix into the probability density P e (x) of valid data points. Among them, "1" represents the total probability of the entire interval. Since the lower triangular matrix of the Hamming distance matrix distance_matrix is all 0, the entire interval can accommodate two equally probable parts, and the probability of each part is 0.5. Distribute all valid data points evenly into this probability to obtain the average probability P e (x) of each valid data point; finally, calculate the population entropy value H(X).

[0107] Among them, in step 12, first, the roulette wheel selection method is adopted to distinguish excellent individuals from non-excellent individuals; then, all non-excellent individuals are found and marked as the candidate object set selected_indices for quantum crossover operation; secondly, quantum entanglement is utilized from the candidate object set selected_indices to determine quantum entanglement pairs, that is, the first parent parent1 and the second parent parent2 are selected. At the same time, the quantum entanglement positions parent1_idx, parent2_idx of the offspring and the parent and the quantum crossover point position crosspoint are randomly generated; finally, using the characteristics of quantum entanglement, crossover operations are performed on the two parents, and the new individuals child1 and child2 generated by the crossover operation are added to the population to replace the original non-excellent individuals parent1 and parent2, so that the individuals in the population are updated and optimized, providing a better starting point for the subsequent iteration process.

[0108] Among them, in step 13, if the mutation probability P m is greater than 0.5, the binary representation of the corresponding individual is inverted to achieve individual inversion, so that non-excellent individuals evolve towards excellent individuals.

[0109] Simulation experiment

[0110] Next, using the Matlab 2024a platform, the performance evaluation of the Quantum Behavior Mimicy Algorithm (QBMA) in the cognitive radio spectrum allocation problem is realized. Through three core indicators - the maximization of the sum of the average network revenue MSRM, the maximization of the minimum bandwidth MMR, and the maximization of the proportional fairness MPF, the performance of the QBMA algorithm is systematically evaluated and comprehensively compared with the genetic algorithm GA, the particle swarm algorithm PSO, the simulated annealing genetic algorithm SAAGA, the particle swarm genetic algorithm PSOGA, and the quantum genetic algorithm QGA. To verify the superiority of the QBMA algorithm in the spectrum allocation problem, three different test scenarios (Test 1, Test 2, Test 3) are designed, and each scenario considers different network configurations and spectrum requirements.

[0111] To ensure the fairness of the comparison and the credibility of the results, all algorithms participating in the comparison are run on the same set of experimental data, including the same spectrum availability matrix L, benefit matrix B, and constraint interference matrix C. All algorithms are independently repeated 30 times, and the final results are averaged to reduce the influence of randomness on the experimental results. The parameter descriptions in this embodiment are as follows: the number of population individuals popsize = 20, the maximum number of iterations g max = 500, the crossover probability P c = 0.8, the mutation probability Pm = 0.01, learning factor c1 = 2.0, c2 = 2.0, maximum inertia weight w_max = 0.9, minimum inertia weight w_min = 0.4, Boltzmann constant Boltzmann_con = 1, decay parameter DecayScale = 0.9, initial temperature tt = 100, crossover operator distribution parameter mu = 10, mutation operator distribution parameter mum = 10, range of change of quantum rotation angle [min, max] = [0.005π, 0.1π], threshold threshold = 0.5, elite selection factors α and β, α = 1.5, β = 2, gravitational factor η = 0.8, repulsive factor λ = 1.5.

[0112] Test 1

[0113] First, the spectrum allocation performance of the quantum behavior mimic algorithm is tested. Assume that during spectrum allocation, the wireless network topology remains unchanged, that is, the states of primary users, cognitive users, and available spectra remain unchanged. Tests are carried out on cognitive users, authorized users, and available spectrum resources of different scales to ensure the universality and accuracy of the results. Three different experimental tests are used to simulate the real network environment. In each experimental test, six different algorithms are used for comparison, and the best solutions obtained by each algorithm are recorded in Table 1, Table 2, and Table 3. Additionally, Figures 2 to 4 To show the optimization performance of the six algorithms in a more direct way, the x-axis represents the number of iterations of the algorithm; the y-axis reflects the system benefits under different objectives, which more intuitively shows the optimal values of the algorithms in practical problems.

[0114] Table 1 System benefits when the number of cognitive users changes

[0115]

[0116]

[0117] Table 1 shows the benefits that the wireless network can obtain for three spectrum allocation objectives of MSRM, MMR, and MPF when the number of cognitive users changes. Figure 2 It is the result curve graph when the number of cognitive users changes.

[0118] From Table 1 and Figure 2 it can be seen that for different numbers of cognitive users, better spectrum allocation effects can be obtained by using the QBMA algorithm. In Figure 2In (a1)-(a3), for MSRM, the convergence accuracy of the QBMA algorithm is almost 30 greater than that of the QGA algorithm, and the convergence accuracy is significantly improved. For MMR, the QBMA algorithm converges to the maximum value at approximately 80 iterations of the algorithm. Compared with the other five algorithms, the QBMA algorithm has the fastest convergence speed. For MPF, the global optimal solution obtained by the QBMA algorithm is approximately 90, while the other algorithms are all trapped in the local optimum of the problem. Therefore, the QBMA algorithm has a better ability to find the global optimal solution.

[0119] Table 2 System revenue when the number of available spectra changes

[0120]

[0121]

[0122] As can be seen from Table 2, for different numbers of available spectra, the QBMA algorithm shows better spectrum allocation ability. The optimal results obtained by the QBMA algorithm at 50 generations, 200 generations, and 500 generations of iteration do not differ much, and the optimal results obtained by the QBMA algorithm are all greater than the other five algorithms. This shows that the QBMA algorithm not only has a very fast convergence speed but also a very high convergence accuracy, which also fully demonstrates the superiority of the QBMA algorithm in spectrum allocation.

[0123] From Figure 3 As can be seen from Table 2, when the number of available spectra changes, although the spectrum allocation objectives are different, the network benefits calculated by the QBMA algorithm almost always rank first. From Figure 3 In (b1)-(b3), for MSRM, the average network maximum value calculated by the QBMA algorithm is approximately 18 greater than that of the QGA algorithm, which shows that the QBMA algorithm can better guarantee the overall network benefit than the other algorithms. For MMR, the convergence curves of the QBMA algorithm and the QGA algorithm are very close, but when the QBMA algorithm iterates approximately 400 times, the calculated optimal result is slightly higher than that of the QGA algorithm. For MPF, the PSO algorithm performs the worst, and the QBMA algorithm performs the best, which shows that the QBMA algorithm has better fairness.

[0124] Table 3 System revenue when the number of primary users changes

[0125]

[0126]

[0127] As can be seen from Table 3, for different numbers of primary users, the QBMA algorithm exhibits better spectrum allocation capabilities, indicating that the QBMA algorithm has strong global search capabilities and is not prone to premature convergence, which also fully demonstrates the excellence of the QBMA algorithm in spectrum allocation.

[0128] As can be seen from Table 3 and Figure 4 it can be known that under the condition of changing the number of primary users, the spectrum allocation performance of the QBMA algorithm is better than that of the other algorithms. From Figure 4 (a1)-(a3), it can be seen that for MSRM, the PSOGA algorithm performs the worst because the evolutionary operation of this algorithm is too simple, causing the algorithm to fall into a local optimal solution. The QBMA algorithm performs the best because it has rich optimization operations, especially the interaction force operation in the algorithm, which enhances the ability of the algorithm to jump out of the local optimal solution. For MMR, the QBMA algorithm performs better than the other 5 algorithms, indicating that the QBMA algorithm can better take into account the restricted users during spectrum allocation. For MPF, the QBMA algorithm is better than the QGA algorithm, indicating that the entropy balance strategy in the QBMA algorithm enables the algorithm to effectively ensure fairness.

[0129] In summary, it can be seen that during spectrum allocation, for the three allocation metrics of MSRM, MMR, and MPF, the network benefits obtained by the QBMA algorithm are better, which fully demonstrates the effectiveness and superiority of the QBMA algorithm in solving the spectrum allocation problem.

[0130] Test 2

[0131] Next, test the effectiveness of the QBMA algorithm in solving the spectrum allocation problem. Taking MSRM, MMR, and MPF as the objective functions, with the number of primary users and cognitive users both being 10 and the number of spectrums varying between 5 and 40, the test results are as Figure 5 shown.

[0132] From Figure 5 the experimental results show that when the number of frequency bands changes, the performance of the QBMA algorithm is better than that of other methods. Under the condition that the number of cognitive users and primary users remains unchanged, the network bandwidth is proportional to the number of cognitive users. When the number of available spectrums is much smaller than the number of cognitive users, the spectrum allocation algorithm of the QBMA algorithm can still take into account the least number of users and maximize their usage rights, while other algorithms can only take into account the usage rights of the least number of users when the number of available spectrums is close to the number of cognitive users.

[0133] On this basis, analyze the performance of the algorithm when the number of primary users is 10 and the number of available spectrums is 20 and remains unchanged, and the number of cognitive users varies between 5 and 40. The results of the experimental test are as Figure 6 shown, where the x-axis represents the number of cognitive users and the y-axis represents the benefits of the wireless network.

[0134] Due to the continuous increase in the number of cognitive users, the spectrum resource allocation of the system becomes more difficult, and the competition among cognitive users is also becoming increasingly fierce. Figure 6 It can be seen that when the primary users and available spectrum are constant, with the growth of cognitive users, the values of the three network revenue functions of MSRM, MMR, and MPF all show a downward trend. However, compared with the other five algorithms, the algorithm proposed in the present invention has better effects.

[0135] Test 3

[0136] In the practical application of cognitive radio technology, the composition of the wireless network changes over time. Figure 7 It depicts that in a specific area, when an authorized user starts (stops) using the authorized frequency band or a cognitive user starts (stops) using the unlicensed frequency band, an idle spectrum will appear in the wireless environment, such as Figure 7 the blank area in (a). As Figure 7 the yellow area in (b), if a cognitive user senses the idle spectrum, it can autonomously use these idle spectrums without interfering with the primary users. As Figure 7 shown in (c), when the primary user PU1 needs to use the first segment of the spectrum, although this spectrum is being used by the cognitive user SU1, the priority of the primary user using the spectrum is higher than that of the cognitive user. Therefore, the cognitive user SU1 needs to quickly vacate this spectrum for the primary user PU1 to use, giving priority to ensuring the normal communication of the primary user PU1. Figure 7 As shown in (d), when the primary user PU2 withdraws from the use of the second segment of the spectrum, the cognitive user SU1 detects that there is not only an idle spectrum but also this spectrum is available in the second segment. Therefore, the cognitive user SU1 decides to perform autonomous access. Figure 7 As shown in (e), the cognitive user SU1 uses the second segment of the idle spectrum for communication. This process not only ensures the normal communication of the primary user but also ensures that the cognitive user reasonably uses the idle spectrum, effectively improving the utilization rate of spectrum resources and solving the problem of spectrum waste.

[0137] To further prove the superiority of the algorithm, dynamic experiments are conducted to prove that the QBMA algorithm can still maintain excellent spectrum allocation performance in a dynamic wireless network and find the optimal spectrum allocation scheme. The results of the experimental tests are as Figure 8 shown.

[0138] From Figure 8 the experimental test results show that compared with the basic quantum genetic algorithm, particle swarm genetic algorithm, simulated annealing genetic algorithm, genetic algorithm, and particle swarm algorithm, the quantum behavior mimic algorithm proposed in the present invention can not only quickly find the optimal spectrum allocation scheme but also ensure that cognitive users try to use idle spectrums as much as possible when using, thereby improving the spectrum utilization rate.

[0139] In summary, the revenue obtained by the QBMA algorithm designed in the present invention under the three network revenue functions of MSRM, MMR, and MPF is better than that of the QGA algorithm, PSOGA algorithm, SAAGA algorithm, GA algorithm, and PSO algorithm. Compared with the other six methods, this method is significantly superior to the other six methods in terms of global optimization performance and is more suitable for solving the spectrum allocation problem.

Claims

1. An intelligent spectrum allocation method based on quantum behavioral mimicry algorithm, characterized in that: The steps include: Step 1: Define the population size popsize and the maximum genetic generation number g max , initialize the spectrum available matrix L = {l n,m |l n,m ∈{0, 1}} N×M , benefit matrix B = {b n,m } N×M , interference matrix C = {c n,k,m |c n,k,m ∈{0,1}} N×N×M , where the spectrum availability matrix L represents the availability of spectrum m for cognitive user n, the benefit matrix B represents the network benefit obtained when spectrum m is used by cognitive user n, and the interference matrix C represents whether interference will occur when cognitive user n and cognitive user k use spectrum m together; Step 2: Calculate the size of the quantum bit l, that is, calculate the number of 1s in the spectrum available matrix L, and record the position corresponding to each 1, and save it in the matrix L1, L1 = {(n,m)|l n,m =1}, and the data in the matrix L1 are arranged in increasing order of n, m, where the quantum bit l is calculated by the following formula: Where N represents the total number of cognitive users, M represents the total number of spectrum, and l n,m is the element value at position (n,m) in the spectrum available matrix L. n,m =1 indicates that cognitive user n can use spectrum m; Step 3: Initialize the population Q = {q1,q2,...,q popsize }, and set the probability amplitudes of α and β in the individual qubits to Step 4: Measure the population Q = {q1,q2,...,q popsize }, and obtain the measured value P = {p1, p2, ..., p popsize }, then according to the mapping principle, the measured value P is mapped to the spectrum interference-free matrix A for interference constraint processing to ensure that one spectrum is allocated to one user; Step 5: Evaluate the population and calculate the population fitness value F = {f1,f2,...,f popsize }, and record the best individual best_x in the current population; Step 6: Determine whether the termination condition is met. If so, map the optimal individual to the spectrum interference-free matrix A to obtain the optimal spectrum allocation matrix. Otherwise, execute step 7. Step 7: Use the quantum rotating gate to perform evolution operations on individuals in the population; Step 8: Carry out elite selection strategy, calculate the elite selection probability, and use roulette selection method to screen, and directly retain the selected elite individuals to the next generation population. Among them, the elite selection probability fitness1 of individual i i Calculated by the following formula: In the formula, α and β are elite selection factors, bestfitness takes the optimal fitness value of the current population, fitness i Represents the fitness value of individual i in the current population; Step 9: Implement the interaction force mechanism and calculate the potential energy E of individual i i , by reducing the mutation probability P m To increase the gravitational force between individuals, the individuals close to the optimal individual are attracted by gravitational force, and the mutation probability P is increased. m To increase the repulsion between individuals, the individuals far away from the optimal individual are repelled and mutated by repulsion, so that they evolve towards the optimal individual. The potential energy E of individual i is i and mutation probability P m Calculated by the following formula: E i =m*g*(fitness i -bestfitness); In the formula, m represents the mass of individual i; g is a constant; fitness i represents the fitness value of individual i; Bestfitness indicates the optimal fitness value of the current population; In the formula, η is the attraction factor, λ is the repulsion factor; Step 10: Pass the probability density P of the valid data points e (x) Calculate the entropy value H(X) of the population, where the probability density P of the valid data points is e (x) and population entropy value H(X) are calculated by the following formula: Where N e Indicates the number of valid data points in the counting interval; H(X)=-ΣP e (x)×log2(P e (x)); Where P e (x) represents the probability density of valid data points, and H(X) represents the entropy of population X; Step 11: Determine the relationship between entropy and threshold: If the entropy H(X) is less than the threshold, execute steps 12 and 13 to increase population diversity; if the entropy H(X) is greater than the threshold, return to step 4 and implement the population entropy balance strategy to make the population stable from generation to generation; Step 12: Quantum crossover operation, using quantum entanglement to increase population diversity; Step 13: Quantum mutation operation, using individual reversal to introduce new individuals and increase population diversity. After the operation is completed, return to step 4 to continue.

2. The intelligent spectrum allocation method based on quantum behavior mimicry algorithm according to claim 1, characterized in that: In step 4, when cognitive user n and cognitive user k use the same spectrum m, the priority right of spectrum m is determined by comparing the random number with 0.

5. If the random number > 0.5, spectrum m is used by cognitive user n; if the random number < 0.5, spectrum m is used by cognitive user k.

3. The intelligent spectrum allocation method based on quantum behavior mimicry algorithm according to claim 1, characterized in that: In step 5, the average maximization of the total network benefits, the maximization of the minimum bandwidth and the maximum proportion fairness metric are used as the population fitness function, where the ultimate goal of spectrum resource allocation is to maximize the benefits of the entire system.

4. The intelligent spectrum allocation method based on quantum behavior mimicry algorithm according to claim 1, characterized in that: In step 8, the probability P of individual i being selected in the roulette wheel selection is determined using the following formula: i : Where N represents the total number of individuals in the population, fitness1 i represents the elite selection probability of individual i.

5. The intelligent spectrum allocation method based on quantum behavior mimicry algorithm according to claim 1, characterized in that: In step 9, first, a quantum potential field model is established based on the current best solution, where the potential energy E of the best individual best best =0; secondly, the optimal individual best is regarded as the gravitational center of the quantum potential field, which generates attraction to the surrounding individuals i and guides the search process to move to the area of ​​the optimal solution; finally, under the premise of maintaining the diversity of the group, the potential energy is continuously adjusted to guide the suboptimal solution to the optimal solution position.

6. The intelligent spectrum allocation method based on quantum behavior mimicry algorithm according to claim 1, characterized in that: In step 9, if the potential energy E of individual i i > 0, the best individual best is updated to the current individual i by fully utilizing the gravitational force, so that the population evolves towards the optimal solution. If E i <0 and |E i |≤0.5, reduce the population mutation probability P m ; if E i <0 and |E i |>0.5, increase the population mutation probability P m If P m >0.5, increase the repulsive force, invert each binary bit of individual i, and regenerate it to make it jump out of the current local optimal value of potential energy.

7. The intelligent spectrum allocation method based on quantum behavior mimicry algorithm according to claim 1, characterized in that: In step 10, first, the Hamming distance matrix is ​​calculated: for any two individuals in the population, the Hamming distance between them is calculated by comparing whether each bit of the binary representation of the two individuals is the same. If the values ​​of the two bits are different, the Hamming distance is 1; if the values ​​are the same, the Hamming distance is 0; secondly, the Hamming distance matrix dis tan ce_matrix is ​​constructed: the Hamming distances between all individuals form a Hamming distance matrix, the Hamming distance matrix is ​​expanded into a one-dimensional vector matrix, and all 0 elements in the one-dimensional vector matrix are removed, and the Hamming distance matrix dis tan ce_matrix is ​​updated; then, the probability density P of the valid data points is calculated. e (x): Determine the counting interval as [min(dis tan ce_matrix)-0.5,max(dis tan ce_matrix)+0.5], and calculate the number of valid data points in the counting interval as N e , convert the elements in the Hamming distance matrix into the probability density P of valid data points e (x); finally, calculate the population entropy value H(X).

8. The intelligent spectrum allocation method based on quantum behavior mimicry algorithm according to claim 1, characterized in that: In step 12, first, the roulette wheel selection method is used to distinguish between excellent individuals and non-excellent individuals; then, all non-excellent individuals are found and marked as the candidate set selected_indices for the quantum crossover operation; secondly, quantum entanglement is used to determine the quantum entangled pair from the candidate set selected_indices, that is, the first parent parent1 and the second parent parent2 are selected, and at the same time, the quantum entangled positions parent1_idx, parent2_idx and the quantum crossover point position crosspoint of the offspring and the parent are randomly generated; finally, the characteristics of quantum entanglement are used to perform a crossover operation on the two parents, and the new individuals child1 and child2 generated by the crossover operation are added to the population to replace the original non-excellent individuals parent1 and parent2.

9. The intelligent spectrum allocation method based on quantum behavior mimicry algorithm according to claim 1, characterized in that: In step 13, if the mutation probability P m If it is greater than 0.5, the binary representation of the corresponding individual will be inverted to achieve individual reversal, so that the inferior individuals can evolve into excellent individuals.