Method and system for generating unmanned aerial vehicle tower fault emergency inspection route
Genetic algorithms generate drone inspection routes and inspection solutions, which solves the problem of low patrol efficiency in power systems, and realizes efficient scheduling and fault location of drones in pole tower inspection tasks.
Patent Information
- Application Number
- CN202411324315.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2025-02-07
AI Technical Summary
The lack of effective drone scheduling methods in the prior art has resulted in low patrol efficiency in power systems and it is difficult to quickly locate and repair faults on poles.
Genetic algorithms are used to generate the patrol routes of drones in poles and towers, and combine the exit, entrance, relative position relationship and number of drones to generate a patrol plan for drones to patrol all poles and towers.
It improves the scheduling efficiency of the drone when facing the tower patrol inspection tasks, so that the drone can adapt to the special working conditions of the tower, cover all potential fault points, and achieve fast and accurate patrols.
Smart Images

Figure CN119398290A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of unmanned aerial vehicle (UAV) dispatching, and in particular to a method and system for generating an emergency inspection route for a UAV pole tower failure. Background Art
[0002] In recent years, driven by national policies, my country's power grid infrastructure construction has achieved rapid development. With the expansion of the distribution range of transmission lines and the increase in distribution density, line equipment has been exposed to the field for a long time, causing natural disasters, animal and plant invasions, and man-made external forces to cause different degrees of damage to it, resulting in power accidents from time to time, which has a serious impact on people's production and life and social operation.
[0003] In the event of an emergency when a power system fails, in order to quickly locate and repair the fault, the power grid company relies heavily on drone inspection technology to efficiently inspect key components on the towers, as traditional manual inspections have high personal safety risks, low inspection efficiency, and high costs. The goal is to optimize inspection routes through intelligent means to ensure that drones can quickly and accurately cover all potential fault points. Drone swarms need to be deployed quickly, using advanced algorithms to automatically generate the optimal inspection route, and conduct detailed inspections of key components on the towers that may occur in the shortest possible time.
[0004] However, the existing technology lacks an efficient dispatching method for drones for this type of towers, which restricts the further application of drones in power systems. Summary of the invention
[0005] The purpose of the embodiments of the present invention is to provide a method and system for generating an emergency inspection route for a tower failure of an unmanned aerial vehicle, which can improve the scheduling efficiency of the unmanned aerial vehicle in the face of tower inspection tasks.
[0006] In order to achieve the above object, an embodiment of the present invention provides a method for generating an emergency inspection route for a drone tower failure, comprising:
[0007] Obtain the towers of the route to be generated;
[0008] Traversing each of the pole towers, and using a preset first genetic method to generate an inspection route for the drone within each of the pole towers;
[0009] Determine the exit, entrance, relative position relationship of each of the towers and the number of drones used for inspection;
[0010] According to the exits, entrances, relative position relationships and the number of drones, a preset second genetic method is used to generate an inspection plan for drone inspections of all towers.
[0011] Optionally, a preset first genetic method is used to generate an inspection route of the drone within each of the towers, including:
[0012] Determine the inspection point, exit and entrance of the drone in the tower;
[0013] Encoding the inspection point, the exit and the entrance to obtain a first chromosome representing the inspection route as a first parent population;
[0014] Calculating a first fitness of each of the first chromosomes of the first parent population;
[0015] Selecting the first chromosome from the first parent population using a roulette wheel method according to the first fitness to form a first child population;
[0016] Performing a first crossover operation, a first mutation operation, a first local optimization operation, and a first population reinsertion operation according to the first offspring population;
[0017] Selecting the first chromosome from the first parent population and the first offspring population to obtain a new first parent population;
[0018] Determine whether the current first iteration number is greater than or equal to a first preset value;
[0019] When it is determined that the first iteration number is greater than or equal to the first preset value, selecting the best individual in the first parent population as the final inspection route;
[0020] When it is determined that the first iteration number is less than the first preset value, the step of calculating the first fitness of each of the first chromosomes of the first parent population is returned to be executed.
[0021] Optionally, the inspection point, the exit and the entrance are encoded to obtain a first chromosome representing the inspection route as a first parent population, including:
[0022] Select two points on the top of each tower as the exit and entrance respectively;
[0023] An integer 0 or an integer 1 is used as the code of the exit or the entrance;
[0024] Integer encoding the inspection points;
[0025] The codes of the entrance, the inspection point and the exit are combined to obtain the first chromosome.
[0026] Optionally, calculating the first fitness of each of the first chromosomes of the first parent population includes:
[0027] The first total time is calculated according to formula (1) to formula (5),
[0028]
[0029] Among them, aimFunc is the first total time, x i+1 is the x-axis coordinate of the i+1th inspection point, x i is the x-axis coordinate of the ith inspection point, y i+1 is the y-axis coordinate of the i+1th inspection point, y i is the y-axis coordinate of the i-th inspection point, z i+1 is the z-axis coordinate of the i+1th inspection point, z i is the z-axis coordinate of the ith inspection point, x2 is the x-axis coordinate of the first inspection point, y2 is the y-axis coordinate of the first inspection point, z2 is the z-axis coordinate of the first inspection point, x0 is the x-axis coordinate of the entrance, y0 is the y-axis coordinate of the entrance, z0 is the z-axis coordinate of the entrance, x n+1 is the x-axis coordinate of the last inspection point, y n+1 is the y-axis coordinate of the last inspection point, z n+1 is the z-axis coordinate of the last inspection point, x1 is the x-axis coordinate of the exit, y1 is the y-axis coordinate of the exit, z1 is the z-axis coordinate of the exit, n is the number of inspection points, times_r is the time the drone stays at the inspection point, and times_f is the time the drone stays at the auxiliary position of the inspection point;
[0030] The first fitness is determined according to the first total time using the ea.sacling function.
[0031] Optionally, selecting the first chromosome from the first parent population using a roulette wheel method according to the first fitness to form a first child population includes:
[0032] performing a linear transformation operation on the first chromosome according to the first fitness to map the first chromosome to a continuous segment;
[0033] The first chromosome is selected according to the principle of the first fitness from large to small to obtain the first offspring population.
[0034] Optionally, the first crossover operation includes:
[0035] Randomly selecting two of the first chromosomes;
[0036] Randomly selecting two identical positions on the two selected first chromosomes as the starting position and the ending position respectively;
[0037] respectively intercepting the codes between the starting position and the ending position on the two first chromosomes;
[0038] exchanging the truncated coding on the two first chromosomes;
[0039] Constructing a mapping relationship of exchange intercepted encodings;
[0040] Respectively detecting the repeated codes on the two first chromosomes;
[0041] Adjusting repeated coding outside the intercepted area according to the mapping relationship;
[0042] The first mutation operation includes:
[0043] Randomly select one of the first chromosomes;
[0044] Randomly select two positions on the selected first chromosome as a starting position and an ending position;
[0045] Reversing the codes of the starting position and the ending position;
[0046] The first local optimization operation includes:
[0047] Calculating the distance matrix of each of the first chromosomes respectively;
[0048] Using the solve_tsp function to perform the local optimization operation on the first chromosome according to the distance matrix;
[0049] The first population reinsertion operation comprises:
[0050] Selecting a plurality of first chromosomes from the first parent population in ascending order of the first fitness, and extracting a first chromosome index from the first chromosomes as the first chromosome index to be deleted;
[0051] Selecting a plurality of first chromosomes from the first offspring population in descending order of the first fitness, and extracting a first chromosome index from the first chromosomes as the first chromosome index to be inserted;
[0052] The first chromosome index to be inserted is used to replace the first chromosome index to be deleted.
[0053] Optionally, a preset second genetic method is used to generate an inspection plan for inspecting all towers by drones according to the exit, the entrance, the relative position relationship and the number of drones, including:
[0054] Encoding the exit, entrance, drone number, and tower number to obtain a second chromosome representing the inspection plan as a second parent population;
[0055] Calculating a second fitness of each of the second chromosomes of the second parent population;
[0056] selecting the second chromosome from the second parent population using a roulette wheel method according to the second fitness to form a second offspring population;
[0057] Performing a second crossover operation, a second mutation operation, a second local optimization operation, and a second population reinsertion operation according to the second offspring population;
[0058] Selecting a second chromosome from the second parent population and the second offspring population to obtain a new second parent population;
[0059] Determine whether the current second iteration number is greater than or equal to a second preset value;
[0060] When it is determined that the second iteration number is greater than or equal to the second preset value, selecting the best individual in the second parent population as the final inspection plan;
[0061] When it is determined that the second iteration number is less than the second preset value, the step of calculating the second fitness of each second chromosome of the second parent population is returned to be executed.
[0062] Optionally, the exit, the entrance, the drone number, and the tower number are encoded to obtain a second chromosome representing the inspection plan as a second parent population, including:
[0063] The tower number is used as the first layer code, the drone number is used as the second layer code, and the entrance is used as the third layer code;
[0064] Combining the first layer of code, the second layer of code and the third layer of code to obtain the second chromosome;
[0065] Calculating the second fitness of each of the second chromosomes of the second parent population includes:
[0066] Calculate the inspection time of each drone in the second chromosome respectively;
[0067] Using the ea.sacling function to determine the second fitness according to the maximum value of the inspection time;
[0068] The method further comprises: selecting the second chromosome from the second parent population using a roulette wheel method according to the second fitness to form a second offspring population, comprising:
[0069] performing a linear transformation operation on the second chromosome according to the second fitness to map the second chromosome to a continuous segment;
[0070] The second chromosomes are selected according to the principle of the second fitness from large to small to obtain the second offspring population.
[0071] Optionally, the second crossover operation includes:
[0072] Randomly selecting two of the second chromosomes;
[0073] For the first layer encoding of the second chromosome, two identical positions are randomly selected on the two selected second chromosomes as the starting position and the ending position respectively;
[0074] respectively intercepting the codes between the starting position and the ending position on the two second chromosomes;
[0075] exchanging the truncated coding on the two second chromosomes;
[0076] Constructing a mapping relationship of exchange intercepted encodings;
[0077] Respectively detecting the repeated codes on the two second chromosomes;
[0078] Adjusting the repeated coding outside the intercepted area according to the mapping relationship; and / or
[0079] For the second level code and the third level code of the second chromosome, randomly select two identical positions on the two selected second chromosomes as the starting position and the ending position respectively;
[0080] respectively intercepting the codes between the starting position and the ending position on the two second chromosomes;
[0081] exchanging the truncated coding on the two second chromosomes;
[0082] The second mutation operation includes:
[0083] Randomly selecting one of the second chromosomes;
[0084] Randomly selecting two positions on the selected second chromosome as a starting position and an ending position;
[0085] Reversing the codes of the starting position and the ending position;
[0086] The second local optimization operation includes:
[0087] Calculate the distance matrix of each second chromosome respectively;
[0088] Using the solve_tsp function to perform the local optimization operation on the second chromosome according to the distance matrix;
[0089] The second population reinsertion operation comprises:
[0090] Selecting a plurality of second chromosomes from the second parent population in ascending order of the second fitness, and extracting a second chromosome index from the second chromosome as the second chromosome index to be deleted;
[0091] Selecting a plurality of second chromosomes from the second offspring population in descending order of the second fitness, and extracting a second chromosome index from the second chromosome as the second chromosome index to be inserted;
[0092] The second chromosome index to be inserted is used to replace the second chromosome index to be deleted.
[0093] On the other hand, the present invention also provides a drone tower failure emergency inspection route generation system, the system comprising a processor, and the processor is configured to execute any of the methods described above.
[0094] Through the above technical solution, the embodiment of the present invention provides a method and system for generating a route for emergency inspection of a pole tower failure by a drone. The method and system generate routes for the working conditions inside and outside the pole tower respectively, thereby obtaining a complete and efficient inspection plan. Compared with the prior art, the method and system provided by the present invention generate routes based on the distribution of the pole tower, so that the drone can adapt to the special working conditions of the pole tower, thereby improving the application scope of the drone and the scheduling efficiency when facing the pole tower inspection task.
[0095] Other features and advantages of the embodiments of the present invention will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0096] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present invention, but do not constitute a limitation on the embodiments of the present invention. In the accompanying drawings:
[0097] Figure 1 is a flow chart of a method for generating a drone pole tower failure emergency inspection route according to an embodiment of the present invention;
[0098] Figure 2 is a flow chart of a first genetic method according to one embodiment of the present invention;
[0099] Figure 3 is an example diagram of a first chromosome according to an example of the present invention;
[0100] Figure 4 is a flowchart of a method of a first crossover operation according to one embodiment of the present invention;
[0101] Figure 5 is one of the example graphs of two first chromosomes according to a first crossover operation according to one embodiment of the present invention;
[0102] Figure 6 is a second example diagram of two first chromosomes of a first crossover operation according to one embodiment of the present invention;
[0103] Figure 7 is a third example diagram of two first chromosomes of a first crossover operation according to an embodiment of the present invention;
[0104] Figure 8 is a fourth example diagram of two first chromosomes of a first crossover operation according to an embodiment of the present invention;
[0105] Fig. 9 is an example diagram of a first mutation operation according to one embodiment of the present invention;
[0106] Fig.10 is a flow chart of a second genetic method according to one embodiment of the present invention;
[0107] Fig.11 is an example diagram of an encoded second chromosome according to an example of one embodiment of the present invention;
[0108] Fig.12 is one of the flowcharts of a method for a second crossover operation according to one embodiment of the present invention;
[0109] Fig.13 This is a second flowchart of a method for a second crossover operation according to an embodiment of the present invention. DETAILED DESCRIPTION
[0110] The specific implementation of the embodiment of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the embodiment of the present invention, and is not used to limit the embodiment of the present invention.
[0111] like Figure 1 The figure is a flow chart of a method for generating a route for emergency inspection of a tower failure by a drone according to an embodiment of the present invention. Figure 1 In the method, the method may include the following steps:
[0112] In step S10, the towers of the route to be generated are obtained;
[0113] In step S11, each pole tower is traversed, and a preset first genetic method is used to generate an inspection route of the drone in each pole tower;
[0114] In step S12, the exit, entrance, relative position relationship of each tower and the number of drones used for inspection are determined;
[0115] In step S13, a preset second genetic method is used to generate an inspection plan for all towers by using drones according to the exits, entrances, relative position relationships and the number of drones.
[0116] In this Figure 1 In the method shown, step S10 can be used to obtain the pole towers of the route to be generated. In this embodiment, the distribution of the pole towers can be irregular, and each pole tower includes an exit, an entrance, and multiple inspection points. The drone flies into the pole tower from the entrance, traverses and inspects each inspection point, and finally flies out from the exit.
[0117] Step S11 can be used to traverse each pole tower and use a preset first genetic method to generate a patrol route for the drone in each pole tower. In this embodiment, the first genetic method can be in various forms known to those skilled in the art. In one example of the present invention, the first genetic method can include: Figure 2 In the steps shown in Figure 2 In the first genetic method, the first genetic method may include the following steps:
[0118] In step S20, the inspection point, exit and entrance of the drone are determined in the tower;
[0119] In step S21, the inspection point, the exit and the entrance are encoded to obtain a first chromosome representing the inspection route as the first parent population;
[0120] In step S22, the first fitness of each first chromosome of the first parent population is calculated;
[0121] In step S23, a first chromosome is selected from the first parent population using a roulette wheel method according to the first fitness to form a first child population;
[0122] In step S24, a first crossover operation, a first mutation operation, a first local optimization operation, and a first population reinsertion operation are performed according to the first offspring population;
[0123] In step S25, the first chromosome is selected from the first parent population and the first child population to obtain a new first parent population;
[0124] In step S26, it is determined whether the current first iteration number is greater than or equal to a first preset value;
[0125] In step S27, when it is determined that the first iteration number is greater than or equal to the first preset value, the best individual is selected from the first parent population as the final inspection route.
[0126] When it is determined that the first iteration number is less than the first preset value, the process returns to the step of calculating the first fitness of each first chromosome of the first parent population, that is, returns to step S22.
[0127] In this Figure 2 In the method shown, step S21 is used to encode the inspection points, exits and entrances to obtain a first chromosome representing the inspection route as the first parent population. The first parent population includes multiple first chromosomes, and each first chromosome is used to represent a complete inspection route. As for the specific steps of encoding the first chromosome, in this example, it can be to first select two points at the top of each tower as the exit and entrance, and then use integers 0 and 1 as the encoding of the exit or entrance. For the inspection points, considering the large number of inspection points, integer encoding can be used in this example. Finally, the encoding of the entrance, inspection point and exit is combined to obtain a first chromosome. An example of the first chromosome can be as follows Figure 3 shown.
[0128] Step S22 is used to calculate the first fitness of each first chromosome of the first parent population. In this example, considering that the method provided by the present invention is intended to improve the scheduling efficiency of the drone, the first fitness can be determined by the total time of the drone inspection. Specifically, the first fitness can be first calculated using the following formulas (1) to (5):
[0129]
[0130] Among them, aimFunc is the first total time, x i+1 is the x-axis coordinate of the i+1th inspection point, x i is the x-axis coordinate of the ith inspection point, y i+1 is the y-axis coordinate of the i+1th inspection point, y i is the y-axis coordinate of the i-th inspection point, z i+1 is the z-axis coordinate of the i+1th inspection point, z i is the z-axis coordinate of the ith inspection point, x2 is the x-axis coordinate of the first inspection point, y2 is the y-axis coordinate of the first inspection point, z2 is the z-axis coordinate of the first inspection point, x0 is the x-axis coordinate of the entrance, y0 is the y-axis coordinate of the entrance, z0 is the z-axis coordinate of the entrance, x n+1 is the x-axis coordinate of the last inspection point, y n+1 is the y-axis coordinate of the last inspection point, z n+1is the z-axis coordinate of the last inspection point, x1 is the x-axis coordinate of the exit, y1 is the y-axis coordinate of the exit, z1 is the z-axis coordinate of the exit, n is the number of inspection points, times_r is the time the drone stays at the inspection point, and times_f is the time the drone stays at the auxiliary position of the inspection point. Then the ea.sacling function is used to determine the first fitness according to the first total time.
[0131] Step S23 is used to select the first chromosome in the first parent population using the roulette method according to the first fitness to form the first child population. In this example, considering that the larger the value of the first fitness is, the better the first chromosome is, so the roulette method can be firstly to perform a linear transformation operation on the first chromosome according to the first fitness to map the first chromosome to a continuous segment, and then select the first chromosome according to the principle of the first fitness from large to small to obtain the first child population.
[0132] Step S24 is used to perform a first crossover operation, a first mutation operation, a first local optimization operation, and a first population reinsertion operation according to the first offspring population. Specifically, in this example, the first crossover operation may include: Figure 4 In the steps shown in Figure 4 In the first crossover operation, the first crossover operation may include the following steps:
[0133] In step S30, two first chromosomes are randomly selected;
[0134] In step S31, two identical positions are randomly selected on the two selected first chromosomes as the starting position and the ending position respectively;
[0135] In step S32, the codes between the start position and the end position are respectively intercepted on the two first chromosomes;
[0136] In step S33, the truncated codes are exchanged on the two first chromosomes;
[0137] In step S34, a mapping relationship of the exchange intercepted codes is constructed;
[0138] In step S35, the repeated codes on the two first chromosomes are detected respectively;
[0139] In step S36, the repeated coding outside the cut-off area is adjusted according to the mapping relationship.
[0140] Combination Figure 4 The method in Figure 5 Taking the first chromosomes ParentA and ParentB shown in FIG. 1 as an example, the chromosomes after the exchange from step S31 to step S33 are as follows: Figure 6Considering that the exchanged segments may cause coding conflicts with the remaining segments, in this example, repeated coding is further detected and adjusted through steps S34 to S36. Specifically, the mapping relationship established in step S34 is as follows: Figure 7 As shown, the result after step 36 adjustment is as follows Figure 8 shown.
[0141] In this example, the first mutation operation can be in various forms known to those skilled in the art. In this example, considering the diversity of mutations, the first mutation operation can be to first randomly select a first chromosome, then randomly select two positions on the selected first chromosome as the starting position and the ending position, and finally flip the codes of the starting position and the ending position. The specific example is shown in the figure below. Fig. 9 shown.
[0142] The first local optimization operation may be to first calculate the distance matrix of each first chromosome respectively, and then use the solve_tsp function to perform local optimization operations on the first chromosome according to the distance matrix. The first population reinsertion operation may be to select multiple first chromosomes from the first parent population in the order of the first fitness from small to large, and extract the first chromosome index in the first chromosome as the first chromosome index to be deleted, and then select multiple first chromosomes from the first child population in the order of the first fitness from large to small, and extract the first chromosome index in the first chromosome as the first chromosome index to be inserted, and finally use the first chromosome index to be inserted to replace the first chromosome index to be deleted.
[0143] Step S13 can be used to generate a drone inspection plan for all towers using a preset second genetic method based on the exit, entrance, relative position relationship, and number of drones. In this embodiment, the second genetic method can be in various forms known to those skilled in the art. In one example of the present invention, the second genetic method may include: Fig.10 In the steps shown in Figure 2 In the second genetic method, the second genetic method may include the following steps:
[0144] In step S40, the exit, the entrance, the drone number, and the tower number are encoded to obtain a second chromosome representing the inspection plan as the second parent population;
[0145] In step S41, the second fitness of each second chromosome of the second parent population is calculated;
[0146] In step S42, a second chromosome is selected from the second parent population using a roulette wheel method according to the second fitness to form a second child population;
[0147] In step S43, a second crossover operation, a second mutation operation, a second local optimization operation, and a second population reinsertion operation are performed according to the second offspring population;
[0148] In step S44, the second chromosome is selected from the second parent population and the second child population to obtain a new second parent population;
[0149] In step S45, it is determined whether the current second iteration number is greater than or equal to a second preset value;
[0150] In step S46, when it is determined that the second iteration number is greater than or equal to the second preset value, the best individual is selected from the second parent population as the final inspection plan;
[0151] When it is determined that the second iteration number is less than the second preset value, the process returns to the step of calculating the second fitness of each second chromosome of the second parent population, that is, returns to step S41.
[0152] In this Fig.10 In the method shown, step S40 is used to encode the exit, entrance, drone number, and tower number to obtain a second chromosome representing the inspection plan as the second parent population. The specific method for encoding the second chromosome can be in a variety of forms known to those skilled in the art. Taking into account the different content form of the first chromosome encoding, in one example of the present invention, the method for encoding the second chromosome can be to use the tower number as the first layer of encoding, the drone number as the second layer of encoding, and the entrance as the third layer of encoding, and combine the first layer of encoding, the second layer of encoding, and the third layer of encoding to obtain the second chromosome. An example of the encoded second chromosome can be as follows: Fig.11 shown.
[0153] In this Fig.10 In the method shown, step S40 can be used to encode the exit, entrance, drone number, and tower number to obtain a second chromosome representing the inspection plan as the second parent population. The specific method for encoding the second chromosome can be in various forms known to those skilled in the art. Considering that the inspection plan includes multiple drones for performing inspection tasks, multiple towers to be inspected, and exits and entrances in each tower, in this example, the method for encoding the second chromosome can be to use the tower number as the first layer of coding, the drone number as the second layer of coding, and the entrance as the third layer of coding, and then combine the first layer of coding, the second layer of coding, and the third layer of coding to obtain a second chromosome. An example diagram of the second chromosome can be as follows: Fig.11 shown.
[0154] Step S41 can be used to calculate the second fitness of each second chromosome of the second parent population. The second fitness can be in a variety of forms known to those skilled in the art. Considering the composition of the inspection scheme, the maximum value of the inspection time for the drone to complete the inspection task can be used as a reference for the second fitness. Therefore, in one example of the present invention, the method for calculating the second fitness can be to first calculate the inspection time of each drone in the second chromosome separately, and then use the ea.sacling function to determine the second fitness according to the maximum value of the inspection time.
[0155] Step S42 is used to select the second chromosome in the second parent population using the roulette wheel method according to the second fitness to form a second offspring population. Specifically, in this example, step S42 may be to first perform a linear transformation operation on the second chromosome according to the second fitness to map the second chromosome to a continuous segment, and then select the second chromosome according to the principle of the second fitness from large to small to obtain the second offspring population.
[0156] Step S43 is used to perform a second crossover operation, a second mutation operation, a second local optimization operation, and a second population reinsertion operation according to the second offspring population. In this example, considering the three-layer encoding structure of the second chromosome, the second crossover operation may include: Fig.12 and / or Fig.13 The method shown. Fig.12 In the embodiment, the second crossover operation may include the following steps:
[0157] In step S50, two second chromosomes are randomly selected;
[0158] In step S51, for the first layer encoding of the second chromosome, two identical positions are randomly selected on the two selected second chromosomes as the starting position and the ending position respectively;
[0159] In step S52, the codes between the start position and the end position are respectively intercepted on the two second chromosomes;
[0160] In step S53, the truncated codes are exchanged on the two second chromosomes;
[0161] In step S54, a mapping relationship of the exchange intercepted codes is constructed;
[0162] In step S55, the repeated codes on the two second chromosomes are detected respectively;
[0163] In step S56, the repeated coding outside the cut-off area is adjusted according to the mapping relationship.
[0164] In this Fig.13 In the embodiment, the second crossover operation may include the following steps:
[0165] In step S60, two second chromosomes are randomly selected;
[0166] In step S61, two identical positions are randomly selected on the two selected second chromosomes as the starting position and the ending position respectively;
[0167] In step S62, the codes between the start position and the end position are respectively intercepted on the two second chromosomes;
[0168] In step S63, the truncated codes are exchanged on the two second chromosomes.
[0169] In this example, the second mutation operation may be in various forms known to those skilled in the art. In this example, considering the diversity of mutations, the second mutation operation may be to first randomly select two first chromosomes, then randomly select two positions on the selected second chromosomes as the starting position and the ending position, and finally flip the codes of the starting position and the ending position.
[0170] As for the second local optimization operation, in this example, the distance matrix of each second chromosome is calculated respectively, and then the solve_tsp function is used to perform local optimization operation on the second chromosome according to the distance matrix. The second population reinsertion operation can be to select multiple first chromosomes from the second parent population in the order of the second fitness from small to large, and extract the second chromosome index in the second chromosome as the second chromosome index to be deleted, and then select multiple second chromosomes from the second child population in the order of the second fitness from large to small, and extract the second chromosome index in the second chromosome as the second chromosome index to be inserted, and finally use the second chromosome index to be inserted to replace the second chromosome index to be deleted.
[0171] On the other hand, the present invention also provides a drone tower failure emergency inspection route generation system, the system comprising a processor, and the processor is configured to execute any of the methods described above.
[0172] Through the above technical solution, the embodiment of the present invention provides a method and system for generating a route for emergency inspection of a pole tower failure by a drone. The method and system generate routes for the working conditions inside and outside the pole tower respectively, thereby obtaining a complete and efficient inspection plan. Compared with the prior art, the method and system provided by the present invention generate routes based on the distribution of the pole tower, so that the drone can adapt to the special working conditions of the pole tower, thereby improving the application scope of the drone and the scheduling efficiency when facing the pole tower inspection task.
[0173] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0174] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0175] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0176] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0177] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0178] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0179] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0180] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0181] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A method for generating an emergency inspection route for a drone tower failure, characterized in that: The method comprises: Obtain the towers of the route to be generated; Traversing each of the pole towers, and using a preset first genetic method to generate an inspection route for the drone within each of the pole towers; Determine the exit, entrance, relative position relationship of each of the towers and the number of drones used for inspection; According to the exits, entrances, relative position relationships and the number of drones, a preset second genetic method is used to generate an inspection plan for drone inspections of all towers.
2. The generation method according to claim 1, characterized in that: The inspection route of the UAV in each of the towers is generated by using a preset first genetic method, including: Determine the inspection point, exit and entrance of the drone in the tower; Encoding the inspection point, the exit and the entrance to obtain a first chromosome representing the inspection route as a first parent population; Calculating a first fitness of each of the first chromosomes of the first parent population; Selecting the first chromosome from the first parent population using a roulette wheel method according to the first fitness to form a first child population; Performing a first crossover operation, a first mutation operation, a first local optimization operation, and a first population reinsertion operation according to the first offspring population; Selecting the first chromosome from the first parent population and the first offspring population to obtain a new first parent population; Determine whether the current first iteration number is greater than or equal to a first preset value; When it is determined that the first iteration number is greater than or equal to the first preset value, selecting the best individual in the first parent population as the final inspection route; When it is determined that the first iteration number is less than the first preset value, the step of calculating the first fitness of each of the first chromosomes of the first parent population is returned to be executed.
3. The method according to claim 2, characterized in that The inspection point, the exit and the entrance are encoded to obtain a first chromosome representing the inspection route as the first parent population, including: Select two points on the top of each tower as the exit and entrance respectively; An integer 0 or an integer 1 is used as the code of the exit or the entrance; Integer encoding the inspection points; The codes of the entrance, the inspection point and the exit are combined to obtain the first chromosome.
4. The method according to claim 2, characterized in that: Calculating a first fitness of each of the first chromosomes of the first parent population includes: The first total time is calculated according to formula (1) to formula (5), Among them, aimFunc is the first total time, x i+1 is the x-axis coordinate of the i+1th inspection point, x i is the x-axis coordinate of the ith inspection point, y i+1 is the y-axis coordinate of the i+1th inspection point, y i is the y-axis coordinate of the i-th inspection point, z i+1 is the z-axis coordinate of the i+1th inspection point, z i is the z-axis coordinate of the ith inspection point, x2 is the x-axis coordinate of the first inspection point, y2 is the y-axis coordinate of the first inspection point, z2 is the z-axis coordinate of the first inspection point, x0 is the x-axis coordinate of the entrance, y0 is the y-axis coordinate of the entrance, z0 is the z-axis coordinate of the entrance, x n+1 is the x-axis coordinate of the last inspection point, y n+1 is the y-axis coordinate of the last inspection point, z n+1 is the z-axis coordinate of the last inspection point, x1 is the x-axis coordinate of the exit, y1 is the y-axis coordinate of the exit, z1 is the z-axis coordinate of the exit, n is the number of inspection points, times_r is the time the drone stays at the inspection point, and times_f is the time the drone stays at the auxiliary position of the inspection point; The first fitness is determined according to the first total time using the ea.sacling function.
5. The method according to claim 2, characterized in that: The method comprises: selecting the first chromosome from the first parent population using a roulette wheel method according to the first fitness to form a first child population, comprising: performing a linear transformation operation on the first chromosome according to the first fitness to map the first chromosome to a continuous segment; The first chromosome is selected according to the principle of the first fitness from large to small to obtain the first offspring population.
6. The method according to claim 2, characterized in that The first crossover operation includes: Randomly selecting two of the first chromosomes; Randomly selecting two identical positions on the two selected first chromosomes as the starting position and the ending position respectively; respectively intercepting the codes between the starting position and the ending position on the two first chromosomes; exchanging the truncated coding on the two first chromosomes; Constructing a mapping relationship between the encodings of the exchange interception; Respectively detecting the repeated codes on the two first chromosomes; Adjusting repeated coding outside the intercepted area according to the mapping relationship; The first mutation operation includes: Randomly select one of the first chromosomes; Randomly select two positions on the selected first chromosome as a starting position and an ending position; Reversing the codes of the starting position and the ending position; The first local optimization operation includes: Calculating the distance matrix of each of the first chromosomes respectively; Using the solve_tsp function to perform the local optimization operation on the first chromosome according to the distance matrix; The first population reinsertion operation comprises: Selecting a plurality of first chromosomes from the first parent population in ascending order of the first fitness, and extracting a first chromosome index from the first chromosomes as the first chromosome index to be deleted; Selecting a plurality of first chromosomes from the first offspring population in descending order of the first fitness, and extracting a first chromosome index from the first chromosomes as the first chromosome index to be inserted; The first chromosome index to be inserted is used to replace the first chromosome index to be deleted.
7. The method according to claim 1, characterized in that According to the exit, entrance, relative position relationship and number of drones, a preset second genetic method is used to generate a drone inspection plan for all towers, including: Encoding the exit, entrance, drone number, and tower number to obtain a second chromosome representing the inspection plan as a second parent population; Calculating a second fitness of each of the second chromosomes of the second parent population; selecting the second chromosome from the second parent population using a roulette wheel method according to the second fitness to form a second offspring population; Performing a second crossover operation, a second mutation operation, a second local optimization operation, and a second population reinsertion operation according to the second offspring population; Selecting a second chromosome from the second parent population and the second offspring population to obtain a new second parent population; Determine whether the current second iteration number is greater than or equal to a second preset value; When it is determined that the second iteration number is greater than or equal to the second preset value, selecting the best individual in the second parent population as the final inspection plan; When it is determined that the second iteration number is less than the second preset value, return to the step of calculating the second fitness of each second chromosome of the second parent population.
8. The method according to claim 7, characterized in that The exit, entrance, drone number, and tower number are encoded to obtain a second chromosome representing the inspection plan as a second parent population, including: The tower number is used as the first layer code, the drone number is used as the second layer code, and the entrance is used as the third layer code; Combining the first layer of code, the second layer of code and the third layer of code to obtain the second chromosome; Calculating the second fitness of each of the second chromosomes of the second parent population includes: Calculate the inspection time of each drone in the second chromosome respectively; Using the ea.sacling function to determine the second fitness according to the maximum value of the inspection time; The method comprises: selecting the second chromosome from the second parent population by using a roulette wheel method according to the second fitness to form a second offspring population, comprising: performing a linear transformation operation on the second chromosome according to the second fitness to map the second chromosome to a continuous segment; The second chromosomes are selected according to the principle of the second fitness from large to small to obtain the second offspring population.
9. The method according to claim 7, characterized in that: The second crossover operation includes: Randomly selecting two of the second chromosomes; For the first layer encoding of the second chromosome, two identical positions are randomly selected on the two selected second chromosomes as the starting position and the ending position respectively; respectively intercepting the codes between the starting position and the ending position on the two second chromosomes; exchanging the truncated coding on the two second chromosomes; Constructing a mapping relationship between the encodings of the exchange interception; Respectively detecting the repeated codes on the two second chromosomes; Adjusting the repeated coding outside the intercepted area according to the mapping relationship; and / or For the second level code and the third level code of the second chromosome, randomly select two identical positions on the two selected second chromosomes as the starting position and the ending position respectively; respectively intercepting the codes between the starting position and the ending position on the two second chromosomes; exchanging the truncated coding on the two second chromosomes; The second mutation operation includes: Randomly selecting one of the second chromosomes; Randomly selecting two positions on the selected second chromosome as a starting position and an ending position; Reversing the codes of the starting position and the ending position; The second local optimization operation includes: Calculate the distance matrix of each second chromosome respectively; Using the solve_tsp function to perform the local optimization operation on the second chromosome according to the distance matrix; The second population reinsertion operation comprises: Selecting a plurality of second chromosomes from the second parent population in ascending order of the second fitness, and extracting a second chromosome index from the second chromosome as the second chromosome index to be deleted; Selecting a plurality of second chromosomes from the second offspring population in descending order of the second fitness, and extracting a second chromosome index from the second chromosome as the second chromosome index to be inserted; The second chromosome index to be inserted is used to replace the second chromosome index to be deleted.
10. A drone tower fault emergency inspection route generation system, characterized in that: The system comprises a processor configured to execute the method according to any one of claims 1 to 9.