Research on UAV cloud control system based on ant colony algorithm

2022-09-03 08:26ZHANGLanyongandZHANGRuixuan

ZHANG Lanyong and ZHANG Ruixuan

School of Intelligent Science and Engineering,Harbin Engineering University,Harbin 150001,China

Abstract: In the cloud era,the control objects are becoming larger and the information processing is more complex,and it is difficult for traditional control systems to process massive data in a timely manner.In view of the difficulty of data processing in the cloud era,it is extremely important to perform massive data operations through cloud servers.Unmanned aeriel vehicle(UAV) control is the representative of the intelligent field.Based on the ant colony algorithm and incorporating the potential field method,an improved potential field ant colony algorithm is designed.To deal with the path planning problem of UAVs,the potential field ant colony algorithm shortens the optimal path distance by 6.7%,increases the algorithm running time by 39.3%,and increases the maximum distance by 24.1% compared with the previous improvement.The cloud server is used to process the path problem of the UAV and feedback the calculation results in real time.Simulation experiments verify the effectiveness of the new algorithm in the cloud environment.

Keywords: ant colony algorithm,potential field method,cloud server,path planning.

1.Introduction

In the 21st century,with the advancement of world science and technology,concepts such as artificial intelligence,big data,and cloud era have been deeply rooted in the hearts of the people.More artificial intelligence robots have appeared in the cloud data era,introducing the concept of cloud into the field of control,creating more intelligent equipment,replacing human beings to carry out dangerous and complex tasks,which is an inevitable requirement of the development of the times [1-3].As a representative of the field of artificial intelligence,the path planning problem of unmanned aeriel vehicle(UAV) [4,5] has received extensive attention.With the improvement of the performance of the new generation of UAVs,the data obtained by UAVs is also larger,and it is difficult to meet the requirements of real-time control of the system,which has become the bottleneck of development [6].

Cloud control is the introduction of cloud computing into the control field,which greatly improves the data processing capability of the system [7-9],deploys the UAV’s path planning algorithm to the cloud,and uses the powerful computing power of the cloud server to provide UAVs with real-time data support to ensure the safety of UAV flight routes.

Based on the ant colony algorithm and introducing the artificial potential field method,this paper deals with the path planning problem of the UAV,and improves the pheromone update strategy,potential field function and heuristic function from three aspects.The improved algorithm optimizes for the problems of the original algorithm,such as slow convergence in the early stage and unreachable algorithm objectives,which greatly improves the performance of the traditional algorithm.The simulation verifies the effectiveness of the improved algorithm.At the same time,based on the C/S structure model,the necessary operating environment,communication ports,database partition management,etc.,on the server side are designed,the completion port and the overlapping port are organically combined for data reception,and the multi-thread processing response is used to reduce communication blocking.Finally,the user interface designed in Qt shows the data processing of the cloud server,which verifies that the system works well as a whole.It realizes the use of cloud server to calculate data,and then achieves the purpose of cloud control of drones.

2.Mathematical model of ant colony algorithm

Assuming that there aremants in total,in the first iteration of the ant colony algorithm,the pheromone of the ant’s optional path is the same,and the selection is random.With the increase of the number of iterations,in thetth iteration,the antkmoves at the position of the path (i,j).The state transition probability [10] is as follows:

where α represents the heuristic factor of the ant colony pheromone concentration.The larger the value is,the stronger the attraction effect of the pheromone is.β is the expected heuristic factor or the distance heuristic factor.The larger the value of β,the greater the influence of the path distance on the ants’ decision-making.allowedkrepresents the set of all positions that the ants may choose in the next step,τijis the pheromone concentration on the path (i,j),ηijis the heuristic function,dijrepresents the distance between the two positions,the smallerdij,the larger ηij,the bigger.

Since the ant colony algorithm’s path selection is only affected by distance and pheromone,the positive feedback mechanism mentioned above will cause the pheromone on a certain path to increase too quickly.After a period of time,the pheromone on the path will increase.The effect of the heuristic function will be far greater than the effect of the heuristic function on the ants,thereby suppressing the effect of the heuristic function.In order to avoid this situation,after each iteration of the ant colony,the concentration value of pheromone at timet+1 is updated according to (3) and (4) in time.

Among them,ρ is the volatility coefficient of pheromone.The purpose is to reduce the concentration of pheromone on the path and avoid excessive accumulation of pheromone under the action of positive feedback.The value range of ρ is set to ρ ∈(0,1] . Δτi j(t) represents the change in pheromone concentration on the path (i,j),the initial time Δτi j(0)=0.

3.Potential field ant colony algorithm based on ant colony algorithm

The artificial potential field method is a virtual force method.Its working principle is to define the functions of attraction and repulsion in the artificially constructed force field,and the controlled object moves in the direction of decreasing the potential field value under the action of the resultant force to search for the optimal path [11,12],but the artificial potential field method itself has the disadvantage that it is easy to fall into the local optimum,and the ant colony algorithm has the shortcomings of long iteration time and slow convergence speed[13].Aiming at the shortcomings of the algorithm,this paper integrates its improvement measures,and finally improves the algorithm in three aspects: the update strategy of pheromone,the improvement of the heuristic function,and the improvement of the potential field function.

3.1 Improvement of pheromone update strategy

The traditional ant colony algorithm adopts the pheromone update strategy of the method shown in (3).In the initial stage of the algorithm,the pheromone content of each route to be selected is similar,which leads to great uncertainty for ants in route selection,so that the convergence of the algorithm is poor.Therefore,it is necessary to change the initial update method of pheromone,and the specific improvement plan is as follows.

The pheromone affected by the artificial potential field method is introduced as follows:

The formula of the pheromone update strategy after the improved setting is as follows:

3.2 Improvement of heuristic function

It can be seen from the heuristic function (2) that in the traditional ant colony algorithm,the heuristic information is simply related to the Euclidean distance from the current position point to the next position.The greater the distance between the two,the greater the heuristic information,but this does not take into account the influence of obstacles in the middle,and it is easy for the algorithm to fall into a local optimal situation.In order to avoid this situation,this paper introduces the potential field heuristic information ∂A(t) under the artificial potential field method,and its expression is as follows:

Whereais a constant greater than 1,F(P) is the potential field force received by the drone during the entire movement process,and θ is the angle between the direction of the resultant force and the direction of the next landing point.

In the initial stage of the algorithm,the pheromone concentration on each path is relatively low,and the ants are mainly affected by the heuristic information when they search for the optimal path in the initial stage,and the initial heuristic value is also small.Therefore,the influence of the potential field heuristic information needs to be increased in the initial stage.When the pheromone increases,the pheromone on each path gradually increases.At this time,it is necessary to avoid the effect of pheromone being too large and ignoring the role of heuristic information,so that the algorithm converges prematurely.This paper introduces the potential field heuristic information factor ψ.

The main function of the potential field heuristic information factor is to strengthen the role of the potential field heuristic information in the initial stage of the algorithm,and weaken the role of the potential field heuristic information in the later stage of the algorithm.The size of the potential field heuristic information factor is affected by the number of iterations.

whereNcis the current number of iterations,Nmaxis the threshold of the maximum number of iterations,ψ is the potential field heuristic information factor,and the value range of the heuristic factor is ψ ∈[0,1].

The improved heuristic function based on the above formulas is as follows:

It can be seen from (10) that when the resultant force received by the UAV is exactly offset,that is,when the resultant forceF(P) is zero,there is still heuristic information,which effectively overcomes the inaccessibility of the traditional artificial potential field method.At this time,the state transition probability of the antkfrom the current positioniposition to the next positionjat the timetis

3.3 Improvement of potential field function

It can be seen from (2) that the repulsion potential field function is a quadratic function of the reciprocal distance of the UAV with respect to the route obstacle.Therefore,on the one hand,when the distance is short,the repulsion potential field strength is too large.When the UAV avoids the nearby obstacles,it is easy to make the UAV fall into the local optimum,and the overall path is not the optimal solution.To this end,it is necessary to improve the repulsive potential field function,and change the quadratic function that causes the original function to change rapidly to an exponential function with a small change rate,so as to avoid the algorithm from falling into local optimum.The improved repulsion function expression is shown as

In addition,when there are many obstacles in the middle,the repulsion value of the obstacles to the UAV may be greater than the gravitational value of the target point,so that the UAV cannot reach the designated position.In response to this possibility,this paper introduces the influence factor γ of the repulsion potential field function,and defines γ=d(P,G)2,that is,the influence factor γof the repulsion function is the square of the Euclidean distance between the drone and the target point.Then the improved function expression adding the influence factor of the repulsive potential field function is shown as

The expression of the resultant force(P) in the artificial force field is shown as

It can be seen that when the UAV is at the target point position,that is,thed(P,G) distance is zero,the repulsion force received by the UAV is at least zero,which can solve the problem that the target point is unreachable.

4.UAV cloud control system server design

With the explosion of data in the era of big data,traditional UAV control methods are difficult to meet the needs of development.The powerful computing power of cloud servers makes everything possible [14-16].This chapter designs and develops the UAV cloud control system in terms of system design,data table function design,and completion port design under the communication function of the UAV cloud control system server side,and conducts functional testing of the overall cloud control system.The stable and efficient operation of each module in the system ensures user requirements and system performance,and achieves the expected design goals.

4.1 Data table structure design of cloud database

In the UAV remote control system,the cloud database is mainly used for the storage of parameter data,the query of data,the maintenance of user information,and the invocation of the path algorithm.The storage of data is the record of various operation records and related parameters,including location information,instruction information,user information,etc.Data query includes real-time data and historical data.Real-time data is helpful for users to grasp the terminal status in real time,and historical data query is helpful for operators to understand the operation status of the previous time and provide reference for future operations.

The user information table includes serial number,user name,password and authority information,which is the storage and update of the operator’s basic information.The reason for the design of the user information table data is that when the user logs into the system,the account information is matched to ensure the security of the system.After the comparison and matching are consistent,the client interface will be automatically entered,and then related operations can be performed;the realtime coordinate information table contains five fields,which are number,collection time,longitude,latitude and status;historical data information table contains number,user,time,and latitude and longitude coordinate data.Among them,the location coordinate information data table is the most important.The recorded horizontal and vertical coordinates are the operation basis of the path algorithm.The algorithm obtains the optimal route plan based on the recorded location information,sends the route information to the client for display,and updates the database content in real-time.The cloud server data is consistent with the client display data.The four data tables are shown in Figs.1-4 below.

Fig.1 User information table

Fig.2 Real-time coordinate information table

Fig.3 Historical data record

Fig.4 Position coordinate information table

4.2 Communication design

Before accessing the data of the cloud server,the client needs to bind the Internet protocol (IP) address of the server and the port number used for communication,use the transmission control protocol (TCP) network protocal to communicate with the server,and use multi-threading technology to receive and send information.

In the cloud control system,the network communication protocol is the basis of data exchange.In this paper,the TCP is used for data communication in the form of data stream.Therefore,before the data is sent,the data needs to be written into the input stream,and then forwarded through the socket.The model is oriented to both the client and the server,and the data exchange between the two parties is realized through a two-way connection.The receiving server needs to use the socket to receive information in the input stream,that is,the request will be processed by the server,and then the received data will be parsed and stored,and the processed result will be returned to the client after laborious calculation.

The data communication format between the server and the client is a 28-byte array,and the last bit is the check digit.The main data format is shown in Table 1.

Table 1 Communication data command format

The table lists the main communication data formats between the drone cloud control client and the cloud server.The start flag bit occupies two bytes,the last check bit occupies one byte,and the main transmission data is located in the middle.

4.3 Server port design

The server uses sockets to communicate with the client.Considering factors such as real-time,concurrency,and operating response speed,the server port is designed by using the completion port network model,and the completion port is used to respond to the client.The completion port places the input/output (I/O) event notification in a communication queue.After completing the I/O operation,the data packet is sent to the set completion port,and the completion port wakes up the communication thread to feed back the data result to the client.

The completion port and the overlapping port are organically combined to perform asynchronous I/O processing in the thread mechanism in the Windows environment.When using sockets for communication,this paper uses this combined model to handle network communication,and the system will notify the overlapping I/O completion event.Put it in the completion port queue,send the completion data packet to the server completion port,then wake up the communication thread,and send the received completion data packet to the UAV cloud control system client.The core steps are as follows:

Step 1Create a completion port and associate it with the terminal device to manage I/O requests;

Step 2Create a socket,which is bound to the completion port of the previous step,and listens for connection requests;

Step 3Monitor the delivery request on the socket;

Step 4After the thread obtains the data,the server processes it accordingly.

5.Experimental simulation and system testing

In this section,the improved algorithm is used to simulate the UAV trajectory planning problem.The UAV parameters of the research object are set as follows: flight control hardware Pixhawk;maximum flight wind resistance 5 m/s;battery life 100 min;8 045 slurry;lithium battery FX-303 600 mAh;maximum speed 30 km/h.The algorithm environment is Windows1 064 bit;Matlab R2014a,processor Inter(R) Core(TM) i5-5 200,computer memory 8G.

5.1 Simulation test

Assuming that the navigation environment of the UAV is a two-dimensional plane grid,use black in Fig.5 to represent dangerous areas,obstacles,etc.,and establish a 25×25 grid for simulation.

Fig.5 UAV trajectory

The simulation parameters are set in Table 2.

Table 2 Parameter settings

From the track simulation results in Fig.6,it can be seen that the improved route is smoother.With the increase of the number of iterations,the overall path length of the improved algorithm is lower than that before the improvement,and it can change faster.In terms of stability,after 50 iterations,the fluctuation of the improved algorithm is also smaller,and the system is more stable.Moreover,it can be seen in Table 3 that the optimal distance of the improved algorithm is 37.2,the maximum distance is 57.8,the number of iterations of the improved optimal route is 54,while that of the traditional ant colony algorithm is 72.It shows that the path length optimized by traditional ant colony algorithm is longer,and the improved algorithm has a certain reduction in path length and planning time,and the planned path is more in line with the actual situation,which proves the effectiveness of the improved potential field ant colony algorithm.

Fig.6 Convergence curve change trend

Table 3 Comparison of simulation experimental data

5.2 Overall system test

The improved potential field ant colony algorithm is deployed to the cloud.After the system is debugged,the user fills in the user information from the login interface shown in Fig.7,and the system will automatically jump to the main control interface as shown in Fig.8.The main control interface intuitively displays the location of the drone and some parameters of the drone,including power information,the creation time of the task submission,the overall status of the trajectory running,etc.Select a point on the map as the starting point and the ending point of the operation.The coordinates of the selected point will be displayed in the coordinate display box in the lower left corner.After clicking the submit button,the data will be uploaded to the cloud for processing.

Fig.7 System login interface

Fig.8 Control main interface

6.Conclusions

At present,the research on the cloud control system is still in its infancy.In order to cope with the computing pressure in the era of big data,this paper develops a cloud server as the data computing center of the cloud control system,and takes the path planning of the UAV as the research object.Based on the basic principles of ant colony algorithm and artificial potential field method,the algorithm is improved in three aspects: pheromone update strategy,potential field function and heuristic function,and the potential field ant colony algorithm is designed for UAV path planning.Then the cloud server is designed in terms of data table structure,and the port and overlap are innovatively completed.Then the data table structure in the cloud server is designed,and the combination of ports and overlapping ports is innovatively designed,which acts on the communication between the cloud server and the client.The improved potential field ant colony algorithm is applied to the cloud server to process the uploaded data,and finally the simulation comparison and actual test are carried out.The results show that the improved potential field ant colony algorithm has good performance in cloud processing.

This paper solves some common problems in system design,and has a good reference for further research on cloud control.