Disclosure of Invention
In order to solve part or all of the technical problems in the prior art, the invention provides an unmanned aerial vehicle cluster pilot selection method based on a distributed consensus mechanism.
The technical scheme of the invention is as follows:
the invention provides a method for selecting unmanned aerial vehicle cluster pilots based on a distributed consensus mechanism, which comprises the following steps:
s1, a pilot of an unmanned aerial vehicle cluster sends heartbeat signals to followers of the unmanned aerial vehicle cluster at preset time intervals;
s2, when the heartbeat signal of the pilot is not received in a set time, each follower calculates a self-qualification value according to the self-characteristics and the current unmanned aerial vehicle cluster state, and sends a voting request comprising the self-qualification value to other followers;
s3, each follower compares the self qualification value with all qualification values received in the preset receiving time, if the self qualification value is not smaller than other qualification values, the follower is voted for, if the other qualification values are larger than the self qualification value, the follower with the highest qualification value is voted for and the voting information is replied, wherein if the follower with the highest qualification value comprises a plurality of followers, one of the followers is selected in sequence to vote according to the receiving time of the voting request;
s4, counting the obtained votes in real time by each follower, if more than half of the votes of the followers are obtained, sending pilot confirmation state information to other followers, sending heartbeat signals to other followers at preset time intervals, if more than half of the votes of the followers are not obtained, and the pilot confirmation state information is not received within preset voting time, calculating voting request retransmission time according to self qualification values, and carrying out step S5;
and S5, immediately voting the follower corresponding to the voting request if the voting request of other followers is received before the voting request is sent again, replying voting information, and repeating the step S4, and sending the voting request to the other followers if the voting request of the other followers is not received, voting the follower, and repeating the step S4.
In some possible implementations, the follower calculates the self qualification value according to the self characteristics and the current unmanned aerial vehicle cluster state by using the following formula;
wherein Q isself Representing self qualification value of the current follower, exp (·) representing an exponential function, θ representing a characteristic weight parameter vector, θT And (3) expressing the transpose of the characteristic weight parameter vector, wherein x is the numerical characteristic vector of the unmanned aerial vehicle after normalized dimensionless pretreatment, and sigma is the standard deviation of the distance set between the current follower and other followers.
In some possible implementations, the unmanned aerial vehicle self-features include: at least one of a remaining amount of energy, a distance from a task target, a total number of sensor load categories, and a total number of task related load categories.
In some possible implementations, the standard deviation of the follower from the other follower distance sets is calculated using the following formula;
wherein di Represents the distance, d, of the current follower from the ith follower of the other followersavg Representing the average distance of the current follower from the other followers, n representing the total number of followers in the unmanned cluster.
In some possible implementations, in step S3, when the follower with the highest qualification value includes a plurality of followers, the current follower selects a follower corresponding to the voting request received first in the plurality of followers with the highest qualification value to vote.
In some possible implementations, the follower calculates the voting request retransmission time according to its own qualification value using the following formula;
wherein T isself Indicating the retransmission time of the voting request corresponding to the current follower.
In some possible implementations, if the failed navigator resumes state, the follower is rejoined.
The technical scheme of the invention has the main advantages that:
according to the unmanned aerial vehicle cluster pilot selection method based on the distributed consensus mechanism, the qualification value of each follower serving as a pilot is calculated according to the characteristics of the unmanned aerial vehicle and the current unmanned aerial vehicle cluster state, the consensus election is completed according to the numerical comparison, and meanwhile, a voting request is sent for voting again according to the possible election flat voting phenomenon and election voting dividing phenomenon according to the qualification value delay, so that the influence of the unmanned aerial vehicle cluster state, the real objective environment and the actual execution task can be fully considered, the consensus election is completed in a short time, and the stability and the robustness of the unmanned aerial vehicle cluster are ensured.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to specific embodiments of the present invention and corresponding drawings. It will be apparent that the described embodiments are only some, but not all, embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The following describes in detail the technical scheme provided by the embodiment of the invention with reference to the accompanying drawings.
Referring to fig. 1, an embodiment of the present invention provides a method for selecting a pilot for a cluster of unmanned aerial vehicles based on a distributed consensus mechanism, the method comprising the following steps:
s1, a pilot of an unmanned aerial vehicle cluster sends heartbeat signals to followers of the unmanned aerial vehicle cluster at preset time intervals;
s2, when the heartbeat signal of the pilot is not received in a set time, each follower calculates a self-qualification value according to the self-characteristics and the current unmanned aerial vehicle cluster state, and sends a voting request comprising the self-qualification value to other followers;
s3, each follower compares the self qualification value with all qualification values received in the preset receiving time, if the self qualification value is not smaller than other qualification values, the follower is voted for, if the other qualification values are larger than the self qualification value, the follower with the highest qualification value is voted for and the voting information is replied, wherein if the follower with the highest qualification value comprises a plurality of followers, one of the followers is selected in sequence to vote according to the receiving time of the voting request;
s4, counting the obtained votes in real time by each follower, if more than half of the votes of the followers are obtained, sending pilot confirmation state information to other followers, sending heartbeat signals to other followers at preset time intervals, if more than half of the votes of the followers are not obtained, and the pilot confirmation state information is not received within preset voting time, calculating voting request retransmission time according to self qualification values, and carrying out step S5;
and S5, immediately voting the follower corresponding to the voting request if the voting request of other followers is received before the voting request is sent again, replying voting information, and repeating the step S4, and sending the voting request to the other followers if the voting request of the other followers is not received, voting the follower, and repeating the step S4.
According to the unmanned aerial vehicle cluster pilot selection method based on the distributed consensus mechanism, which is provided by the embodiment of the invention, the qualification value of each follower serving as a pilot is calculated according to the characteristics of the unmanned aerial vehicle and the current unmanned aerial vehicle cluster state, the consensus election is completed according to the numerical comparison, and meanwhile, the voting request is sent for voting again according to the possible election flat voting phenomenon and election voting dividing phenomenon according to the qualification value delay, so that the influence of the unmanned aerial vehicle cluster state, the real objective environment and the actual execution task can be fully considered, the consensus election can be completed in a short time, and the stability and the robustness of the unmanned aerial vehicle cluster are ensured.
The following specifically describes each step and principle of the unmanned aerial vehicle cluster pilot selection method based on the distributed consensus mechanism provided by an embodiment of the present invention.
Step S1, a pilot of the unmanned aerial vehicle cluster sends heartbeat signals to followers of the unmanned aerial vehicle cluster at preset time intervals.
One unmanned aerial vehicle in the unmanned aerial vehicle cluster for performing motion control by using a pilot following method is used as a pilot, and other unmanned aerial vehicles are used as followers. When the unmanned aerial vehicle cluster is in a stable working state, the pilot sends a control instruction to the follower, the follower receives the control instruction of the pilot and executes corresponding actions, and meanwhile, the pilot exchanges heartbeat signals with the follower at preset time intervals so as to keep the normal working state.
The preset time interval can be set according to the position state and the communication state of the unmanned aerial vehicle cluster, the actual task executed and the environment.
And S2, when the heartbeat signal of the pilot is not received in the set time, each follower calculates the self-qualification value according to the self-characteristics and the current unmanned aerial vehicle cluster state, and sends a voting request comprising the self-qualification value to other followers.
When the follower does not receive the heartbeat signal of the navigator beyond the set time, the current navigator may suffer from faults or some rejection factors to fail, and the navigator needs to be reselected in order to ensure that the unmanned aerial vehicle cluster can stably run to execute tasks.
And if the failed navigator recovers the state, the follower is added again.
In an embodiment of the invention, after the heartbeat signal of the pilot is not received in excess of the set time, each follower calculates the self qualification value according to the self characteristics and the current unmanned aerial vehicle cluster state by using the following formula;
wherein Q isself Representing self qualification value of the current follower, exp (·) representing an exponential function, θ representing a characteristic weight parameter vector, θT And (3) expressing the transpose of the characteristic weight parameter vector, wherein x is the numerical characteristic vector of the unmanned aerial vehicle after normalized dimensionless pretreatment, and sigma is the standard deviation of the distance set between the current follower and other followers.
In an embodiment of the present invention, the unmanned aerial vehicle self-features include: at least one of a remaining amount of energy, a distance from a task target, a total number of sensor load categories, and a total number of task related load categories.
Optionally, the unmanned aerial vehicle self-characteristics include: energy residuals, distance to task targets, total number of sensor load categories, and total number of task related load categories. Thus, the reliability of the pilot obtained by the final election can be ensured.
In one embodiment of the invention, the transpose θ of the feature weight parameter vectorT Can be set as by heuristic methodm is the total number of the self-characteristics of the unmanned aerial vehicle.
In an embodiment of the present invention, the standard deviation of the distance set between the follower and other followers can be calculated by using the following formula;
wherein di Represents the distance, d, of the current follower from the ith follower of the other followersavg Representing the average distance of the current follower from the other followers, n representing the total number of followers in the unmanned cluster.
By using the formula to calculate the qualification value of each follower serving as a pilot, the influence of each factor of the unmanned aerial vehicle cluster state, the real objective environment and the actual execution task can be fully considered, so that the recombined unmanned aerial vehicle cluster can cope with complex and changeable environments and various different tasks.
The set time can be set according to the position state and the communication state of the unmanned aerial vehicle cluster, the actual task executed and the environment.
And S3, each follower compares the self qualification value with all qualification values received in the preset receiving time, if the self qualification value is not smaller than other qualification values, the follower is voted for, if the other qualification values are larger than the self qualification value, the follower with the highest qualification value is voted for and the voting information is replied, wherein if the follower with the highest qualification value comprises a plurality of followers, one of the followers is selected in sequence to vote according to the receiving time of the voting request.
In an embodiment of the invention, voting is performed by comparing the values of the qualification, and a follower with the highest qualification is selected as a pilot, so that the consistency of cluster consensus can be completed, and the stability and the robustness of the recombined unmanned aerial vehicle cluster can be improved.
The preset receiving time can be set according to the position state and the communication state of the unmanned aerial vehicle cluster.
In an embodiment of the present invention, when the follower with the highest qualification value includes a plurality of followers, the current follower selects the follower corresponding to the first received voting request from the plurality of followers with the highest qualification value to vote, that is, selects the follower corresponding to the previous receiving time of the voting request to vote.
Step S4, each follower counts the obtained votes in real time, if more than half of the votes of the followers are obtained, the pilot confirmation state information is sent to other followers, heartbeat signals are sent to other followers at preset time intervals, if more than half of the votes of the followers are not obtained, the pilot confirmation state information is not received within preset voting time, the voting request retransmission time is calculated according to the self qualification value, and step S5 is carried out;
specifically, when a certain follower obtains votes of more than half of the followers, the follower is elected as a pilot, at this time, the pilot sends pilot confirmation state information to other followers, and sends heartbeat signals to other followers at preset time intervals, so that the normal working state of the unmanned aerial vehicle cluster is maintained, and the pilot selection process is completed.
When the followers do not obtain more than half of the votes of the followers and the pilot confirmation state information is not received within the preset voting time, the phenomenon of flat voting or the phenomenon of dividing the votes appears in the voting process, and at the moment, each follower calculates the retransmission time of the voting request according to the self qualification value so as to reselect.
The preset voting time can be set according to the position state and the communication state of the unmanned aerial vehicle cluster.
In an embodiment of the present invention, the follower may calculate the retransmission time of the voting request according to the self-qualification value by using the following formula;
wherein T isself Indicating the retransmission time of the voting request corresponding to the current follower.
By calculating the retransmission time of the voting request corresponding to each follower by using the formula, the follower with the highest qualification value can have the minimum retransmission time of the voting request, so that the follower with the highest qualification value firstly sends out the voting request. And because the qualification value is highest, other followers receiving the voting request immediately vote after receiving the voting request, and the concussion and instability of multiple rounds of voting can be avoided.
And step S5, if each follower receives the voting request of other followers before the voting request is sent again, immediately voting the follower corresponding to the voting request, replying the voting information, and repeating step S4, and if the voting request of other followers is not received, sending the voting request to other followers, voting the follower, and repeating step S4.
Specifically, as the retransmission time of the voting request is calculated according to the qualification value, the higher the qualification value is, the smaller the retransmission time of the corresponding voting request is, if the follower receives the voting requests of other followers before the retransmission time of the voting request, the qualification value contained in the received voting request is necessarily larger than the self qualification value, and at the moment, the corresponding follower of the voting request is immediately voted and the voting information is replied; if the follower does not receive the voting requests of other followers before the voting request re-sending time, the follower indicates that the self qualification value is highest, and at the moment, the follower sends the voting requests to other followers and votes the follower; meanwhile, after voting, the follower counts the obtained votes in real time and performs corresponding actions according to the statistical result until the pilot is selected.
It should be noted that in this document, relational terms such as "first" and "second" and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. In this context, "front", "rear", "left", "right", "upper" and "lower" are referred to with respect to the placement state shown in the drawings.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting thereof; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.