Channel allocation method, device and storage medium based on cognitive radio networkTechnical Field
The present application relates to the field of communications technologies, and in particular, to a channel allocation method, device, and storage medium based on a cognitive radio network.
Background
Modern electronic communication technology is continuously developed, and offshore data interaction is more frequent, such as data interaction between ship electronic devices, data interaction between a ship and an information center and the like, wherein the data interaction is performed through ocean radio, and the performance of the data interaction directly influences the data communication quality.
When the fishery communication frequency band is divided, the fishery ultrashort wave communication frequency band is divided into a plurality of independent channels, except for special communication guarantee tasks such as emergency and weather, other channels are indiscriminately used by fishery related users, signal congestion in part of channels is caused due to single channel division and distribution mode, communication quality is reduced, part of channels are idle, and precious communication resources are wasted.
Disclosure of Invention
The present application aims to provide a channel allocation method, device and storage medium based on a cognitive radio network, so as to solve the technical problem that precious communication resources are wasted due to the deficiency of the prior art.
In a first aspect, an embodiment of the present application provides a channel allocation method based on a cognitive radio network, including:
1.1) determining the coding mode and generating an initial group
Establishing a user connection diagram based on a graph theory principle, wherein the user is a cognitive user in a cognitive wireless network;
establishing a link constraint graph according to the link constraint relation in the user connection graph; there are two links of the connecting line in the link constraint graph, when one of them is communicating, the other link can't communicate;
obtaining a maximal independent set of the link constraint graph, wherein the maximal independent set comprises at least one user with priority communication; selecting the maximum independent set with the least neighbor nodes as a link set for preferentially distributing channels;
randomly allocating channels to the link set, namely generating s + x (x < s) channel allocation schemes, namely generating s + x chromosomes, wherein the s + x chromosomes form an initial population;
1.2) determining a fitness function and calculating the fitness value of each individual in the population
Taking the utility function of the network throughput as the fitness function fi;
Calculating fitness values of all chromosomes;
1.3) calculating the average fitness and the maximum fitness of the groups, sorting the groups according to the fitness value and dividing the groups into two groups
Sorting all chromosomes according to the size of the fitness value and dividing the chromosomes into two groups; wherein the group of chromosomes with higher fitness values is classified as a first group and the group of chromosomes with lower fitness values is classified as a second group;
1.4) population crossing
Selecting a chromosome to be subjected to crossover operation from each of the first and second sets of chromosomes;
when the two selected chromosomes are subjected to cross operation, judging the algebra of the population, and if the algebra is smaller than n, executing fixed cross probability; if the cross probability is larger than or equal to n, executing self-adaptive cross probability; wherein n is an algebra for performing fixed-parameter genetic operations;
two new chromosomes obtained by the crossover operation replace two old chromosomes selected to be crossed in the population, and then the crossover operation is completed;
1.5) population variation
Judging the algebra of the group after the cross operation, and if the algebra is less than n, randomly selecting chromosomes according to a fixed mutation probability to perform mutation operation; if the algebra is more than or equal to n, randomly selecting chromosomes according to the self-adaptive mutation probability to perform mutation operation;
1.6) population update
Calculating the fitness value of a new chromosome generated by cross operation and mutation operation to form a new generation population;
1.7) determination of the iteration termination condition
The step 1.4) to the step 1.6) are iterative processes;
judging whether the current evolution algebra is equal to a preset evolution algebra, if so, terminating iteration; otherwise, the step 1.4) is carried out continuously until the current evolution algebra is equal to the preset evolution algebra, and the iteration is terminated;
after the iteration is terminated, the chromosome with the maximum fitness value is selected, namely the channel optimal allocation scheme.
In one possible implementation, the adaptive cross probability PcThe following were used:
wherein f iscThe greater fitness value in the two chromosomes to be crossed; f. ofavgIs the mean fitness value of the population; f. ofmaxIs the maximum fitness value of the population; k is a radical of1、k2Is a preset constant.
In one possible implementation, the adaptive mutation probability PmThe following were used:
wherein f ismFitness value of chromosome for mutation operation; k is a radical of3、k4Is a preset constant.
Further, the technical scheme provided by the embodiment of the application comprises:
the population initialized by the step 1.1) is an initial parent population, and the population operated by the step 1.4) and the step 1.5) is a child population of the initial parent population;
performing the operations of the step 1.4) and the step 1.5) on the initial parent population to generate a child population of the initial parent population, merging the initial parent population and the child population, and performing the operation of the step 1.6), wherein the process of generating a new population is a first iteration process;
taking the new population generated in the first iteration process as a parent population, performing the operations of the step 1.4) and the step 1.5) to generate a child population of the parent population, merging the parent population and the child population, and performing the operation of the step 1.6), wherein the process of generating the new population is a second iteration process;
subsequent iterations are similar.
In a second aspect, an embodiment of the present application provides an electronic device, including: a memory and a processor;
the memory for storing a computer program;
wherein the processor executes the computer program in the memory to implement the method of the first aspect.
In a third aspect, the present application provides a computer-readable storage medium, in which a computer program is stored, and the computer program is used for implementing the method described in the first aspect when being executed by a processor.
Compared with the prior art, the channel allocation method, the device and the storage medium based on the cognitive radio network, which are provided by the application, are characterized in that a channel allocation model with maximized network throughput is built based on the cognitive radio network, and a method for solving the channel allocation problem by using an adaptive genetic algorithm is provided.
Drawings
Fig. 1 is a schematic overall implementation flow diagram of a channel allocation method based on a cognitive radio network according to an embodiment of the present application;
fig. 2 is a user connection diagram according to an embodiment of the present application;
FIG. 3 is a link constraint graph according to an embodiment of the present application;
fig. 4 is a user connection diagram of a simulation experiment provided in the second embodiment of the present application;
FIG. 5 is a diagram illustrating a relationship between network throughput and genetic algebra according to a second embodiment of the present application;
fig. 6 is a schematic diagram illustrating a variation trend of network throughput and channel number according to a second embodiment of the present application;
fig. 7 is a schematic diagram illustrating a variation trend of network throughput and the number of users according to a second embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device according to a third embodiment of the present application.
Detailed Description
The following detailed description of embodiments of the present application is provided in conjunction with the accompanying drawings, but it should be understood that the scope of the present application is not limited to the specific embodiments.
Throughout the specification and claims, unless explicitly stated otherwise, the word "comprise", or variations such as "comprises" or "comprising", will be understood to imply the inclusion of a stated element or component but not the exclusion of any other element or component.
Firstly, a channel allocation model constructed based on a cognitive radio network is introduced.
For a multi-channel wireless network composed of Y + Z nodes, distributed in a certain unit area, including Y authorized users, each authorized user occupies one channel, and the coverage radius of the occupied channel is rPUOther Z cognitive users are cluster member nodes, an idle channel is searched for in an opportunistic manner, and the interference radius is rinter. In the cognitive wireless network system, an available frequency spectrum range forms a frequency spectrum area which is divided into non-overlapped orthogonal sub-channels, the sub-channels are free of interference, a cognitive user cannot use the occupied channel within the coverage range of an authorized user, and when the distance between the cognitive users is less than rinnerWhen time comes, the channels used by two users will collide.
Channel allocation will be based on the principle of graph theoryThe user connection relationship is described as G ═ (V, E), and the node V ═ V in graph theory
iI | -1, 2, …, Z } represents a set of cognitive user nodes, and an edge set is used for connection relations between cognitive users
When in use
Time of day, cognitive user v
iAnd v
jWithin communication range of each other, a link is formed, whereas communication is impossible. Further, the link constraint graph G '═ (V', E ') is described using the graph theory principle, and the node V' ═ V in the link constraint graph
y,z| y ∈ {1,2, …, N }, z ∈ {1,2, …, N } } represents the set of communication links, the set of edges
Representing a constrained relationship between communication links when
When, v
y,zAnd v
i,jWith a constraint relationship, the two links cannot communicate, and the links are in no constraint relationship and can communicate.
In the allocated channels, a channel idle matrix L for recognizing the channel availability of the user is { L ═ Ln,m|ln,m∈(0,1)}N*MAnd (4) showing. If and only if the cognitive user n senses that no authorized user works on the sub-channel m through the frequency spectrumn,m1, indicating that a subchannel m is available to a cognitive user n; when the cognitive user n senses that the authorized user on the sub-channel calendar is working,ln,m0, indicates that subchannel m is not available to cognitive user n.
To represent the interference between cognitive users, an interference matrix C ═ C is constructedi,j|ci,j∈(0,1)}N*N. C, if the cognitive user i and the cognitive user j use the same channel at the same time and interfere with each otheri,j1, otherwiseci,j0. Whether interference exists between cognitive users depends on the distance between the cognitive users and the adopted transmission modeAnd signal power. The corresponding non-interference sub-channel distribution matrix A ═ an,m|an,m∈(0,1)}N*M. If an,mWhen the frequency band m is 1, the frequency band m is allocated to the cognitive user n for use, otherwise, an,m0. The constraint that the subchannel allocation matrix a must satisfy the interference matrix is as follows:
the sub-channel distribution matrixes A satisfying the above formula are many and use lambadaN,MRepresenting the set of all non-interfering sub-channel allocation matrices a that satisfy the above-mentioned condition.
Based on the above concept, the utility matrix B ═ B is utilizedn,m|bn,m≥0}N*MRepresenting the utility of a cognitive user to obtain a certain spectrum, i.e. bn,mThe utility of the cognitive user n which is allocated to use the sub-channel m is shown, the utility can be throughput, or channel utilization rate and the like, the throughput is used for showing the utility in consideration of the communication requirement of the marine fishing vessel, and ifln,m0, i.e. subchannel m is not available to cognitive user n, then bn,m=0。
The goal of dynamic channel allocation is to maximize the utility of the system without interference, which can be expressed as follows:
under this model, maximizing the system utility can be described by utility function u (a), the spectrum allocation problem is defined by the following optimization function.
When the utility matrix B represents the throughput of the cognitive user, the utility function describes the throughput of the cognitive wireless network system, namely the dynamic channel allocation aims at maximizing the throughput of the system;
after logarithms are taken for the throughput of the cognitive users, the fairness of the cognitive wireless network system is described by the maximized utility function, namely proportional fairness, which is expressed by the following formula:
after the channel allocation model of the marine fishing vessel is constructed, the channel allocation problem is converted into an optimization solving problem which aims at maximizing network throughput. The method applies the self-adaptive genetic algorithm to the channel allocation optimization of the marine fishing vessel and is used for solving the optimal channel allocation scheme.
Example one
The embodiment takes the flow of the adaptive genetic algorithm as a basic frame, and the problems of prematurity and local convergence easily occur in the optimization process due to the self limitation of the existing genetic algorithm, so that the problem of channel allocation of the existing genetic algorithm on a marine fishing vessel is solved, the realization parameter variability of the genetic algorithm is improved, the cross rate and the variation rate are adaptively changed along with the fitness of a group, the optimal cross rate and the variation rate relative to a certain solution are provided, the global search capability of the algorithm is enhanced, the algorithm is prevented from falling into local optimization, and the search efficiency is improved. The specific steps of the channel allocation method based on the cognitive radio network described in this embodiment include:
1) determining a coding mode and generating an initial population
A user connection diagram is established based on the graph theory principle, as shown in fig. 2, a to I represent users, and the users are cognitive users in a cognitive wireless network.
Establishing a link constraint graph according to the link constraint relationship in the user connection graph, as shown in fig. 3; there are two links of the connection line in the link constraint graph, and when one of the links is communicating, the other link cannot communicate no matter how the channel is switched.
And solving a maximum independent set of the link constraint graph, wherein the maximum independent set needs to contain at least one user with priority for communication transmission, and preferentially selecting the maximum independent set with the least neighbor nodes, so as to obtain a link set needing to be allocated with channels firstly.
The channels are randomly allocated to the link sets, and s + x (x < s) channel allocation schemes are generated according to different allocation methods, namely s + x chromosomes are generated, and the s + x chromosomes form an initial population.
2) Determining fitness function, and calculating fitness value of each individual in the population
Using the utility function U (A) of the network throughput as a fitness function fi;
Fitness values for all chromosomes are calculated.
3) Calculating the average fitness and the maximum fitness of the population, sorting the population according to the fitness value and dividing the population into two groups
Sorting all chromosomes according to the size of the fitness value and dividing the chromosomes into two groups; wherein the group of chromosomes with higher fitness values is classified as a first group and the group of chromosomes with lower fitness values is classified as a second group; the ordering and grouping of the fitness values may prevent a locally optimal situation.
4) Group crossing
And selecting one chromosome to be subjected to cross operation from the first group of chromosomes and the second group of chromosomes respectively, and performing cross operation from the two groups of chromosomes respectively in a random mode before the cross operation is performed, so that the simultaneous existence of the optimum and the worst can be ensured, the possibility of chromosome variation is increased, and the genetic algorithm is prevented from falling into local optimum.
When the two selected chromosomes are subjected to cross operation, judging the evolution algebra of the population, and if the evolution algebra is less than n, executing fixed cross probability; if the cross probability is larger than or equal to n, executing self-adaptive cross probability; where n is the number of generations performing a fixed parameter genetic operation, optionally the adaptive cross-probability PcThe following were used:
wherein f iscThe greater fitness value in the two chromosomes to be crossed; f. ofavgIs the mean fitness value of the population; f. ofmaxIs the maximum fitness value of the population; k is a radical of1、k2Is a preset constant;
and replacing two old chromosomes which are selected to be crossed in the population by the two new chromosomes obtained by the crossing operation, and finishing the crossing operation.
5) Group variation
Judging the evolution algebra of the population after the cross operation, and if the algebra is less than n, randomly selecting chromosomes according to a fixed mutation probability to perform mutation operation; if the algebra is greater than or equal to n, then according to the adaptive mutation probability PmRandomly selecting chromosomes to carry out mutation operation; optionally, the adaptive mutation probability PmThe following were used:
wherein f ismFitness value of chromosome for mutation operation; k is a radical of3、k4Is a preset constant;
6) group update
Calculating the fitness value of a new chromosome generated by cross operation and mutation operation to form a new generation population;
7) iteration end condition determination
The steps 4) to 6) are iterative processes;
judging whether the current evolution algebra is equal to a preset evolution algebra, if so, terminating iteration; otherwise, the step 4) is carried out continuously until the current evolution algebra is equal to the preset evolution algebra, and the iteration is terminated.
After the iteration is terminated, the chromosome with the maximum fitness value is selected, namely the channel optimal allocation scheme.
It is worth mentioning that the population initialized in the step 1) is an initial parent population, and the population operated in the steps 4) and 5) is a child population of the initial parent population;
and (3) carrying out the operations of the step 4) and the step 5) on the initial parent population to generate a child population of the initial parent population, merging the initial parent population and the child population, carrying out the operation of the step 6), and taking the process of generating a new population as a first iteration process.
And (3) taking the new population generated in the first iteration process as a parent population, carrying out the operations of the step 4) and the step 5) to generate a child population of the parent population, merging the parent population and the child population, carrying out the operation of the step 6), and taking the process of generating the new population as a second iteration process.
Subsequent iterations are similar.
The channel allocation method based on the cognitive radio network provided by the embodiment includes the steps of firstly, building a network model for channel allocation by using a graph theory principle, giving an expression mode of an idle matrix and an interference matrix, then, taking network throughput as a utility function, converting a channel allocation problem into an optimization problem, and solving by using an adaptive genetic algorithm aiming at a problem that local convergence may occur in an optimization process to obtain a channel allocation result with maximized network throughput.
Example two
The effect of the present application will be further explained with the simulation experiment.
In order to verify the effect and the function of the adaptive genetic algorithm in channel allocation of the marine fishing vessel, the application designs a simulation experiment to explore the improvement of the improved algorithm on the performances of throughput, channel conflict and the like in channel allocation. Assuming that all users at sea are randomly distributed in a 1000m by 1000m area in a distributed network manner, and assuming that 40 users including 2 authorized users and 38 cognitive users are randomly produced in the area, as shown in fig. 4, the coverage area of the authorized users is rPU400m, the communication distance of the cognitive user is rcom250m, the interference range of the cognitive user is rinter=2.2×rcom。
Based on the setting of the simulation environment, the average value of the experiment results repeated 100 times is used as the reference for comparing the algorithm results, the marine fishing vessel channel allocation method of the adaptive genetic algorithm provided by the application is compared with the result of channel random allocation, and the quality of the algorithm is verified.
The evolution times and convergence conditions in the genetic algorithm are important parameters for measuring the optimizing result, so that the performance of the adaptive genetic algorithm in the channel allocation of the marine fishing vessel is firstly analyzed from the aspect of algorithm parameter configuration. The initial population size is set to 100, x is 20, the crossover probability is 0.8, the variation probability is 0.1, the number of channels is set to 6, the number of generations varies from 0 to 200, and the variation of the network throughput is shown in fig. 5.
As can be seen from fig. 5, as the genetic algebra increases, the network throughput continuously increases, which shows that the result tends to be optimal more and more as the genetic algebra increases, until the genetic algebra reaches 100, the increase of the network throughput gradually tends to be stable, and as can be seen from the trend of the curve in fig. 5, the adaptive genetic algorithm has good convergence in channel allocation.
In order to verify the result and performance of the adaptive genetic algorithm, the present application compares the adaptive genetic algorithm with the random allocation algorithm in terms of both the number of channels and the number of users, as shown in fig. 6 and 7, respectively.
Fig. 6 shows the variation of the network throughput when the number of channels increases from 4 to 12, and when the number of channels is 4, because the communication congestion condition occurs due to the smaller number of channels, the network throughput at this time is relatively unstable, when the number of channels is increased, the network throughput of the self-adaptive genetic algorithm presents a steady trend, the randomly distributed network throughput presents a slowly rising trend, the reason is that the adaptive genetic algorithm can solve the reasonable distribution when the number of the channels is insufficient, fully utilize the idle channels, exert the maximum utilization rate of the channels, and the random distribution causes network congestion because of no prearrangement and reasonable plan, therefore, the network throughput is reduced, and when the number of channels is increased, the network has more margin for channel allocation, so that the network throughput tends to increase along with the increase of the channels. The self-adaptive genetic algorithm provided by the application aims at the maximum throughput, the throughput is doubled compared with a random distribution method, the self-adaptive genetic algorithm is not limited by the number of channels, and the self-adaptive genetic algorithm provided by the application has great advantages when the offshore channel is distributed with scarce resources and frequent communication.
Fig. 7 shows a relationship between network throughput and user number, where the user number is increased from 10 to 50, both the adaptive genetic algorithm and the random allocation method exhibit a trend of increasing steadily, but an increase rate of the adaptive genetic algorithm is slightly greater than an increase rate of the random allocation, congestion is more likely to occur as users increase, and although the network throughput is improved more steadily, the adaptive genetic algorithm can better solve the problem of channel congestion, allocate channels reasonably, and improve the utilization rate of the channels, but when the number of users is too high, the channels exhibit a saturated state, and both allocation manners do not increase greatly. As can be seen from the figure, the adaptive genetic algorithm performs better in the case of insufficient number of offshore channel allocations.
EXAMPLE III
Fig. 8 is a schematic structural diagram of an electronic device according to a third embodiment of the present application, and as shown in fig. 8, the electronic device includes: amemory 801 and aprocessor 802;
amemory 801 for storing a computer program;
wherein theprocessor 802 executes the computer program in thememory 801 to implement the methods provided by the method embodiments described above.
In this embodiment, the processor may be a Central Processing Unit (CPU) or other form of processing unit having data processing capabilities and/or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.
The memory may include one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. Volatile memory can include, for example, Random Access Memory (RAM), cache memory (or the like). The non-volatile memory may include, for example, Read Only Memory (ROM), a hard disk, flash memory, and the like. One or more computer program instructions may be stored on a computer-readable storage medium and executed by a processor to implement the methods of the various embodiments of the present application above and/or other desired functions. Various contents such as an input signal, a signal component, a noise component, etc. may also be stored in the computer-readable storage medium.
Example four
An embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored, and the computer program is used for implementing the methods provided by the method embodiments described above when being executed by a processor.
In practice, the computer program in this embodiment may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + +, python, etc., and conventional procedural programming languages, such as the "C" programming language or similar programming languages, for performing the operations of embodiments of the present invention. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server.
In practice, the computer-readable storage medium may take any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may include, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The foregoing descriptions of specific exemplary embodiments of the present application have been presented for purposes of illustration and description. It is not intended to limit the application to the precise form disclosed, and obviously many modifications and variations are possible in light of the above teaching. The exemplary embodiments were chosen and described in order to explain certain principles of the present application and its practical application to enable one skilled in the art to make and use various exemplary embodiments of the present application and various alternatives and modifications thereof. It is intended that the scope of the application be defined by the claims and their equivalents.