Method, device and medium for obtaining unmanned aerial vehicle route based on large language model
By using drone flight path planning technology based on large language models, the problem of low efficiency in drone arrival and identification of police situations in emergency response scenarios has been solved, enabling accurate and timely acquisition of event information and improving event handling efficiency.
Patent Information
- Application Number
- CN202511195379.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-26
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2045-08-26
AI Technical Summary
In emergency response scenarios, drones are inefficient at reaching target locations and identifying incidents, mainly due to the scarcity of drone pilots and the ambiguity of incident addresses, which prevents drones from quickly and accurately locating and photographing, thus affecting the timely acquisition and processing of incident information.
By employing a large language model-based approach, the target location and event are extracted from the police incident shooting instruction text to generate a drone flight path. The target area image is segmented using a preset altitude and event detection is performed to generate waypoints, enabling real-time drone shooting and event recognition.
This improves the accuracy of event information identification and processing efficiency, ensuring comprehensive acquisition and timely processing of event information.
Smart Images

Figure CN120707599B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of unmanned aerial vehicle route planning, in particular to a method and device for obtaining an unmanned aerial vehicle route based on a large language model and a medium. BACKGROUND
[0002] In the current police receiving and handling scene, after the police receiving and handling center receives a police situation, a pilot needs to control a police unmanned aerial vehicle to immediately fly to the police situation occurrence location and transmit the on-site situation back to the control center. However, the efficiency of this scene in implementation is not high. On the one hand, the pilot needs to be familiar with the local environment to quickly control the unmanned aerial vehicle to reach the target position, and the pilot resources meeting the conditions are relatively scarce. On the other hand, the description of the police situation address is often fuzzy, and generally only a certain area. Therefore, after the unmanned aerial vehicle flies to the target area, the pilot often needs to further find the specific position of the police situation occurrence according to experience, the shooting efficiency is low, and the shooting height needs to be repeatedly adjusted manually according to the event identification situation, which affects the timely acquisition and processing of police event information. SUMMARY
[0003] In view of the above technical problems, the present application provides a method and device for obtaining an unmanned aerial vehicle route based on a large language model, which can generate a track point and a corresponding route according to the shooting range of a target area image corresponding to a target location and a target event detection result, thereby improving the identification accuracy of event information and improving the event processing efficiency.
[0004] According to a first aspect of the present application, a method for obtaining an unmanned aerial vehicle route based on a large language model is provided, comprising the following steps:
[0005] S100, based on the received police shooting instruction text, a target location and a target event are extracted from the police shooting instruction text by a preset large language model.
[0006] S200, when the target location is a preset area type, an initial shooting height h1 of the unmanned aerial vehicle and a target shooting point based on the initial shooting height h1 are determined to generate a first route of the unmanned aerial vehicle and obtain a target area image corresponding to the target location; the preset area type is an aggregated area data defined by administration or user.
[0007] S300, according to a preset shooting range corresponding to a target shooting height h2, each sub-area image is divided, and a target event occurrence label corresponding to each sub-area image is obtained; the target event occurrence label is any one of yes and no; wherein h2
[0008] S400, according to the order of the target event occurrence label from yes to no, each sub-area image corresponding to the track point is traversed, and a second route corresponding to the target shooting height h2 is generated.
[0009] S500, acquiring the to-be-analyzed image corresponding to each sub-region photographed by the unmanned aerial vehicle in sequence according to the second flight route and performing real-time detection of the target event, until the target event is detected from the to-be-analyzed image, the corresponding to-be-analyzed image is sent to the background, and a final flight route is obtained; wherein the sub-region and the sub-region image correspond to each other.
[0010] According to a second aspect of the present application, a non-transitory computer readable storage medium is provided, the storage medium stores at least one instruction or at least one program, the at least one instruction or the at least one program is loaded and executed by a processor to realize the above-mentioned method for obtaining an unmanned aerial vehicle flight route based on a large language model.
[0011] According to a third aspect of the present application, an electronic device is provided, comprising a processor and the above-mentioned non-transitory computer readable storage medium.
[0012] The present application has at least the following beneficial effects:
[0013] The present application provides a method for obtaining an unmanned aerial vehicle flight route based on a large language model, which first extracts a target location and a target event from the received police shooting instruction text, obtains a target region image corresponding to the target location when the target location is a preset region type, can cover the target location region to prevent the event information shot from being not comprehensive; then the target region image is divided according to the shooting range corresponding to the target shooting height, and the target event occurrence label corresponding to each sub-region image is obtained, the setting of the target shooting height makes the subsequent shot image clearer, which is conducive to obtaining more comprehensive and accurate event information; then the track points corresponding to each sub-region image are traversed in the order from the target event occurrence label to the non-target event occurrence label, a second flight route is generated, and the to-be-analyzed image of the sub-region photographed by the unmanned aerial vehicle at each track point along the second flight route is acquired and real-time detection is performed, until the target event is detected from the to-be-analyzed image, the flight route generated by the above-mentioned method is conducive to improving the recognition accuracy of event information and improving the event processing efficiency. BRIEF DESCRIPTION OF DRAWINGS
[0014] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor.
[0015] Figure 1 The flowchart of the method for obtaining an unmanned aerial vehicle flight route based on a large language model provided by the embodiment of the present application is shown.
[0016] Figure 2A schematic diagram of a position relationship between a preset starting point and a preset target point is provided for an embodiment of the present application. DETAILED DESCRIPTION
[0017] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0018] An unmanned aerial vehicle route acquisition method based on a large language model is provided in an embodiment of the present application, as shown in the method comprising the following steps: Figure 1
[0019] S100, based on the received police shooting instruction text, a target location and a target event are extracted from the police shooting instruction text by a preset large language model. In a specific implementation, the target location is determined to be a specific address or a region by a natural language processing module; it can be understood that the target location is determined to be a preset specific address type or a preset region type by a pre-trained binary classification model, for example, the specific location is a certain lane and a certain number, and a region can be an apartment or a park.
[0020] S200, when the target location is a preset region type, an initial shooting height h1 of the unmanned aerial vehicle and a target shooting point based on the initial shooting height h1 are determined to generate a first route of the unmanned aerial vehicle and acquire a target region image corresponding to the target location; the preset region type is an aggregated region data obtained by administrative division or user self-definition.
[0021] Specifically, the initial shooting height h1 of the unmanned aerial vehicle and the target shooting point based on the initial shooting height h1 are determined by the following steps:
[0022] S201, based on the boundary coordinates of the target location, the center point of the rectangular region corresponding to the boundary coordinates of the target location is marked; it can be understood that the boundary coordinates of the target location are obtained by calling a GIS module.
[0023] S202, according to the shooting parameters of the unmanned aerial vehicle, the initial shooting height h1 of the unmanned aerial vehicle corresponding to the center point of the rectangular region is determined, so that the range of the unmanned aerial vehicle shooting at the height h1 covers the rectangular region corresponding to the boundary coordinates of the target location. In a specific implementation, distortion is not considered.
[0024] Specifically, h1 satisfies the following conditions:
[0025] wherein L and W are the length and width of the rectangular region respectively, and alpha and beta are the horizontal and vertical angles of view of the camera respectively.
[0026] S203, determine the target shooting point according to the center point of the rectangular region and the initial shooting height h1; it can be understood that the position at the initial shooting height h1 in the vertical direction corresponding to the center point of the rectangular region is determined as the target shooting point.
[0027] In the above, when obtaining the overall view image of the target site, the larger height calculated is selected to ensure that the rectangular region can be completely covered, and by obtaining the overall view image of the target site, it can prevent the omission of subsequent event information shooting in the case that the specific position of the event is not described in the police information, and further ensure the comprehensiveness and reliability of the event information acquisition.
[0028] Further, after the step S100, the method further comprises the following steps:
[0029] S210, when the target site is a preset specific address type, calling a GIS module to obtain the position coordinates of the target site, and taking the obtained position coordinates as the target terminal point; the preset specific address type is positioning data accurate to a building unit.
[0030] S220, generating a target flight path corresponding to the unmanned aerial vehicle according to a flight path planning algorithm, so that the unmanned aerial vehicle flies to the target terminal point according to the target flight path.
[0031] In this embodiment, when the target site has specific position information, the flight path can be generated directly according to the flight path planning algorithm, so that the unmanned aerial vehicle can quickly reach the specific shooting position.
[0032] S300, according to the shooting range corresponding to the preset target shooting height h2, the target region image is divided, and the target event occurrence label corresponding to each sub-region image is obtained; the target event occurrence label is any one of yes and no; it can be understood that each sub-region image obtained after division is sent to the target event detection model, and the event corresponding to the sub-region image is obtained, and if the similarity with the target event is higher than the similarity threshold, the target event occurrence label corresponding to the sub-region image is set to yes.
[0033] Specifically, h2 < h1.
[0034] Further, the target shooting height h2 is determined by the following steps:
[0035] S10, obtaining a set of historical shooting images manually labeled; the set of historical shooting images includes a set of image samples corresponding to each preset event type and a plurality of shooting heights and event information corresponding to each set of image samples. For example, the plurality of shooting heights can be 20m~100m, and every 10m is a grade, and the event information can include the number of vehicles, the number of personnel and fire, etc.
[0036] S20, for any preset event type corresponding to several shooting heights and event information, obtaining the event detection accuracy corresponding to each shooting height; it can be understood that: the detection result of the event detection module is compared with the labeled event information, and the event detection accuracy is obtained, wherein different preset event types are calculated separately to obtain the corresponding event detection accuracy.
[0037] S30, according to the event detection accuracy corresponding to each shooting height, constructing the height-accuracy relationship fitting curve corresponding to the preset event type.
[0038] S40, based on the target event corresponding to the preset event type, finding out the maximum shooting height corresponding to the preset accuracy from the height-accuracy relationship fitting curve corresponding to the target event, and determining the maximum shooting height as the target shooting height h2.
[0039] It should be noted that, since the present scheme is for a larger area, the shooting height is usually less than the shooting height covering the overall situation under the condition of meeting the preset accuracy, and if there is a special case, that is, h2≥h1, the accuracy can also be met, and in this case, h2=h1 is set.
[0040] The above, the obtained target region image is a larger range image, and the target event occurring locally cannot be clearly displayed, so a suitable shooting height needs to be determined to ensure that the event detection accuracy meets the requirements, so that the obtained event information is more accurate, which is beneficial to the staff to master the clear event situation in time and give reasonable treatment measures in time.
[0041] Further, the target region image is divided in the S300 step by the following steps:
[0042] S301, when the width of the shooting range corresponding to the target region image is an integer multiple of the width of the shooting range corresponding to the target shooting height h2, the target region image is divided based on the shooting range corresponding to the target shooting height h2; it can be understood that: when the width of the shooting range P1 corresponding to the target region image is an integer multiple of the width of the shooting range P2 corresponding to the target shooting height h2, the length of P1 is also an integer multiple of the length of P2. In the specific implementation, since the shooting proportion of the unmanned aerial vehicle is consistent, the ratio of the length and width of the image is a fixed value, and the number of divided sub-region images is the ratio of the area of P1 to the area of P2.
[0043] S302, when the width of the shooting range corresponding to the target area image is not an integer multiple of the width of the shooting range corresponding to the target shooting height h2, the length and width of the target area image are extended until the width of the shooting range corresponding to the obtained virtual area frame is an integer multiple of the width of the shooting range corresponding to the target shooting height h2; wherein the virtual area frame coincides with the center of the target area image.
[0044] S303, based on the shooting range corresponding to the target shooting height h2, the virtual area frame is evenly divided to realize the division of the target area image; it can be understood that: according to the size of the virtual area frame, the edge image after the division is removed The blank area after the extension is the sub-area image corresponding to the target area image.
[0045] The above, since the event detection accuracy of the image shot according to the target shooting height can meet the demand, when the target place is divided into regions, the target area image is evenly divided based on the shooting range corresponding to the target shooting height as the reference benchmark, the preliminary positioning of the shooting point when h2 height shooting is realized, and the shooting comprehensiveness of the event information in the target place and the event information accuracy of each sub-region shooting are guaranteed.
[0046] S400, according to the target event occurrence label, the track points corresponding to each sub-area image are traversed from high to low in order to generate the second flight line corresponding to the target shooting height h2.
[0047] Specifically, in the S400 step, the track points corresponding to the sub-area image are obtained by the following steps:
[0048] S401, according to the pixel coordinates corresponding to the center point of the sub-area image, the first world coordinates in the world coordinate system corresponding to the center point of the sub-area image are obtained.
[0049] Specifically, the S401 step includes the following steps:
[0050] S4011, the pixel coordinates corresponding to the center point of the sub-area image are converted into the camera coordinates corresponding to the center point of the sub-area image; wherein the camera coordinates (X c , Y c , Z c ) corresponding to the center point of the sub-area image satisfy the following conditions:
[0051] (X c , Y c , Z c) = (Z0x (u-u0) x dx / f, Z0x (v-v0) x dy / f, Z0), wherein, Z0 is the depth distance from the target point to the camera optical center, dx and dy respectively represent the pixel size in horizontal and vertical directions, f is the focal length of the camera, u and v are respectively the horizontal coordinate and vertical coordinate in the pixel coordinates corresponding to the center point of the sub-region image, u0 and v0 are respectively the horizontal coordinate and vertical coordinate in the pixel coordinates corresponding to the principal point.
[0052] S4012, the camera coordinates corresponding to the center point of the sub-region image are converted into the first world coordinates (X e , Y e , Z e ) corresponding to the center point of the sub-region image.
[0053] Specifically, the conversion process meets the following conditions:
[0054] , wherein r is a 3x3 rotation matrix, and t is a 3x1 translation vector.
[0055] S402, the vertical coordinate in the first world coordinates is replaced by the target shooting height h2, to obtain the second world coordinates corresponding to each sub-region image; it can be understood that the second world coordinates corresponding to the sub-region image refer to the world coordinates corresponding to the target shooting height to which the sub-region image is mapped.
[0056] S403, the second world coordinates corresponding to each sub-region image are taken as the sub-region image corresponding track points; it can be understood that the second world coordinates include longitude, latitude and vertical height.
[0057] The above, the corresponding track points are calculated through the center point of the sub-region image, so that the unmanned aerial vehicle can completely shoot the region range in the sub-region image when shooting at the track point position, the shooting height is lower, the clarity is higher, and the identification accuracy of the event information is improved.
[0058] Further, the step S400 further includes the following steps:
[0059] S410, taking the target shooting point as the starting point, and based on the track points corresponding to the sub-region image with the target event occurrence label, a first sub-track is generated by a track planning algorithm. For example, the track planning algorithm can be A-Star algorithm.
[0060] S420, taking the last track point in the first sub-track as a new starting point, and based on the track points corresponding to the sub-region image without the target event occurrence label, a second sub-track is generated by a track planning algorithm.
[0061] S430, merging the first sub-route and the second sub-route to obtain a second route; it can be understood that merging the first sub-route and the second sub-route means connecting the end point of the first sub-route with the start point of the second sub-route.
[0062] By dividing the target region image according to the shooting range of the target shooting height and obtaining the track points corresponding to the target shooting height for each sub-region image, the flight route of the UAV can be obtained, so that the UAV can shoot the sub-region at each track point when flying along the flight route, which is beneficial to improve the identification accuracy of event information, and generating the flight route from the label in the order from yes to no is beneficial to timely shooting the target event, timely obtaining event information and improving event processing efficiency.
[0063] S500, obtaining the to-be-analyzed image corresponding to each sub-region shot by the UAV according to the second route and performing real-time detection of the target event, and when the target event is detected from the to-be-analyzed image, sending the corresponding to-be-analyzed image to the background to obtain a final flight route; it can be understood that the UAV shoots at each track point in the second route. In a specific implementation, the to-be-analyzed image is sent to the event detection module in real time for event identification.
[0064] Specifically, each sub-region corresponds to a sub-region image; it can be understood that the sub-region refers to the ground area corresponding to the sub-region image.
[0065] When the target event detection module detects the target event, the corresponding to-be-analyzed image is sent to the control center in time and the task is ended, and the flight route obtained by the above method enables the UAV to quickly and accurately detect the specific position of the event occurrence and the event information.
[0066] Further, the step S500 further includes the following steps:
[0067] S501, when the target event is detected from the to-be-analyzed image, determining the event occurrence region corresponding to the target event in the to-be-analyzed image; it can be understood that the event detection module can identify the event occurrence region when detecting the target event.
[0068] S502, if the center point of the event occurrence region is located within a preset center range in the to-be-analyzed image, sending the to-be-analyzed image to the background and ending the flight; otherwise, sending the to-be-analyzed image to the background and controlling the UAV to translate to the position corresponding to the target shooting height h2 of the center point of the event occurrence region according to a preset translation step, and when the translation ends, a new to-be-analyzed image is shot, and step S501 is returned to be executed until the flight is ended; a person skilled in the art sets the preset translation step according to actual needs, for example, 5m.
[0069] The above, when the target event is photographed, also considers the position of the target event in the image to be analyzed. When the position of the target event is greatly offset, it is considered that only part or a small part of the event occurrence area is photographed, and therefore the flight path point at this time needs to adjust the flight trajectory, and the unmanned aerial vehicle is translated along the direction of the center of the event occurrence area, and the flight height is kept unchanged, so that the image to be analyzed photographed again can contain more event occurrence areas. The real-time dynamic adjustment of the flight path is conducive to the identification and analysis of the overall event.
[0070] In one other embodiment, in step S200, when generating the first flight path of the unmanned aerial vehicle, if the distance between the current position of the unmanned aerial vehicle and the target shooting point is greater than a given distance threshold, the first flight path needs to be path planned. The given distance threshold is set by those skilled in the art according to actual needs, which will not be described here again. The purpose is to plan a long-range path.
[0071] The unmanned aerial vehicle to be planned is described as a target unmanned aerial vehicle below, which specifically includes the following steps:
[0072] P100, based on the obstacle information received before the start time of the preset flight path planning period, calculate the initial flight path of the target unmanned aerial vehicle in the preset airspace range; the preset starting point of the preset airspace range is the position point corresponding to the time length of the original flight path of the target unmanned aerial vehicle from the current time T1; It can be understood that the preset airspace range refers to the future flight path section corresponding to a future flight path of the target unmanned aerial vehicle in the preset flight path planning period, that is, the range corresponding to a future flight path of the target unmanned aerial vehicle in the current flight path. In a specific implementation, the initial flight path is calculated by a flight path planning algorithm, such as the A-Star algorithm.
[0073] Specifically, the obstacle information includes dynamic obstacle information and static obstacle information. For example, the static obstacle information includes obstacles such as buildings and trees whose heights are within the flight path planning height range, and the static obstacle information can be detected by an on-board sensor.
[0074] Further, the dynamic obstacle information includes the broadcast packet sent by a given unmanned aerial vehicle and the dynamic flying object detected by the on-board sensor of the target unmanned aerial vehicle within a preset time window before the start time of the preset flight path planning period of the target unmanned aerial vehicle; It can be understood that the given unmanned aerial vehicle is an unmanned aerial vehicle within a certain airspace range and has a probability of affecting the flight trajectory of the target unmanned aerial vehicle, for example, an unmanned aerial vehicle belonging to the same city area as the target unmanned aerial vehicle. In one implementation scenario, if a branch swings due to wind direction, it will be detected as a dynamic flying object by the on-board sensor.
[0075] Specifically, the time length corresponding to the preset flight path planning period is obtained by the following steps:
[0076] P01, estimating the acquisition time length corresponding to the target planning path according to the data amount corresponding to the received obstacle information. For example, the acquisition time length of the target planning path is estimated according to the historical calculation data amount and the calculation time length.
[0077] P02, taking the acquisition time length corresponding to the target planning path as the time length corresponding to the preset path planning period.
[0078] Further, T1 meets the following conditions:
[0079] T1≥T2+T0, wherein T2 is the time length corresponding to the preset path planning period, and T0 is a preset fault tolerance time length. For example, the preset fault tolerance time length can be 1 second.
[0080] In the above, the time length of the preset path planning period and the fault tolerance time length are limited, and then the flight distance of the target unmanned aerial vehicle after flying for the time length is estimated, so as to reasonably determine the path section to be planned, and ensure that the acquisition of the target planning path is completed before the planned path section is reached, so that the target unmanned aerial vehicle can seamlessly connect the current path and the target planning path, and ensure the stable flight of the target unmanned aerial vehicle.
[0081] P200, if no new obstacle information is received when calculating the initial path, taking the initial path as the target planning path; otherwise, judging whether the initial path and the new obstacle exist trajectory conflict, if the trajectory conflict exists, continuing to execute the original path of the target unmanned aerial vehicle at the preset starting point, otherwise, taking the initial path as the to-be-confirmed path.
[0082] Specifically, whether the initial path and the new obstacle exist trajectory conflict is judged by the following steps:
[0083] P201, if the new obstacle is a static obstacle, judging whether the closest distance between the initial path and the static obstacle is less than a first preset distance threshold. The first preset distance threshold is set by the person skilled in the art according to the actual demand, which will not be repeated here.
[0084] P202, if it is less than the first preset distance threshold, it is determined that the initial path and the new obstacle exist trajectory conflict, otherwise, it is determined that the initial path and the new obstacle do not exist trajectory conflict.
[0085] P203, if the new obstacle is a dynamic flying object, judging whether there is at least one time point such that the distance between the initial path and the predicted trajectory of the dynamic flying object is less than a second preset distance threshold; wherein the second preset distance threshold is greater than the first preset distance threshold. The second preset distance threshold is set by the person skilled in the art according to the actual demand, which will not be repeated here.
[0086] P204, if there is at least one time point, it is determined that the initial flight path and the new obstacle exist trajectory conflict; otherwise, it is determined that the initial flight path and the new obstacle do not exist trajectory conflict.
[0087] Since the new obstacle information may be received during the calculation of the initial flight path, it is only necessary to determine whether the trajectory conflicts when the trajectory conflicts, and the data processing efficiency is improved. Since the unmanned aerial vehicle is affected by wind and other factors, the flight position is slightly skewed, so a distance threshold is set. If the distance is less than the distance threshold, it is considered that there is a risk of trajectory conflict, and since the predicted trajectory of the dynamic flying object has a certain deviation, a larger distance threshold is set for the dynamic obstacle relative to the static obstacle, to avoid the risk of trajectory conflict, thereby ensuring the normal flight of the unmanned aerial vehicle.
[0088] P300, detecting whether new obstacle information is received within the judgment period corresponding to the trajectory conflict, if received, continuing to execute the original flight path of the target unmanned aerial vehicle at the preset starting point, otherwise, determining the to-be-confirmed flight path as the target planning path.
[0089] Since the judgment time corresponding to the trajectory conflict is much shorter than the calculation time corresponding to the initial flight path, the probability of receiving new obstacle information during the judgment process of the trajectory conflict is extremely small. Based on this situation, the initial flight path is abandoned when new obstacle information is received, and it is not necessary to determine whether there is a trajectory conflict again, thereby avoiding the situation that the target planning path is obtained for a long time, and the target unmanned aerial vehicle cannot fly according to the target planning path at the preset starting point.
[0090] P400, if the target unmanned aerial vehicle receives new obstacle information during the execution of the target planning path and determines that the new obstacle and the target planning path exist trajectory conflict, restarting the preset flight path planning period and updating the preset airspace range, returning to execute step P100 until the end point is reached; otherwise, the preset target point of the preset airspace range is taken as a new preset starting point and the preset airspace range is updated, the starting time of the preset flight path planning period is determined and step P100 is returned to execute until the end point is reached; it can be understood that: the end point is the target shooting point.
[0091] Specifically, the starting time of the determined preset flight path planning period refers to the time corresponding to the time when the predicted target unmanned aerial vehicle flies to the preset target point is pushed back by T1 time length.
[0092] The target unmanned aerial vehicle will fly according to the target planning path when reaching the preset starting point and detect new obstacles through the on-board sensor. If it is judged that the detected new obstacles have trajectory conflicts with the target planning path, a new trajectory planning step is restarted. If there is no trajectory conflict, the trajectory planning cycle needs to be started before reaching the target point, realizing trajectory planning of one trajectory section after another, reducing the problem of excessively high calculation complexity caused by the increase in the number of unmanned aerial vehicles, and realizing real-time dynamic trajectory adjustment of the unmanned aerial vehicle according to the surrounding environment, thereby adapting to the high dynamic airspace environment.
[0093] Further, as shown in Figure 2 The preset target point in the preset airspace range is obtained by the following steps:
[0094] P10, taking the preset starting point as the center of the sphere, setting the intersection of the line between the preset starting point and the endpoint and the sphere with a radius R as the to-be-confirmed point; wherein R is the preset trajectory planning section length; it can be understood that: the length of the planned trajectory each time is R, that is, R refers to the distance between the preset starting point and the preset target point in the preset airspace range.
[0095] In a specific embodiment, the preset trajectory planning section length is obtained by the following steps:
[0096] P11, taking the current position of the target unmanned aerial vehicle as the reference, obtaining the total number of unmanned aerial vehicles score and static object complexity score in the target airspace range corresponding to the future original trajectory of the target unmanned aerial vehicle; it can be understood that: in each trajectory planning, the target airspace range is dynamically adjusted according to the current position of the target unmanned aerial vehicle.
[0097] In a specific embodiment, the person skilled in the art sets the scoring rules of the total number of unmanned aerial vehicles and the scoring rules of the static object complexity according to the actual needs. For example, the more the number of unmanned aerial vehicles, the higher the total number of unmanned aerial vehicles score, and the more the static objects in the target airspace range, the higher the static object complexity score.
[0098] P12, according to the total number of unmanned aerial vehicles score and the static object complexity score in the target airspace range, the airspace complexity degree score corresponding to the target airspace range is calculated.
[0099] Specifically, the airspace complexity degree score D corresponding to the target airspace range meets the following conditions:
[0100] D = w1 x d1 + w2 x d2, wherein d1 is the total number of unmanned aerial vehicles score, d2 is the static object complexity score, and w1 and w2 are preset weights corresponding to the total number of unmanned aerial vehicles score and the static object complexity score, respectively.
[0101] P13, according to the preset correspondence relationship between the airspace complexity score and the length of the flight path planning section, a preset flight path planning section length is obtained.
[0102] Specifically, the preset flight path planning section length is inversely proportional to the airspace complexity score.
[0103] P20, if the to-be-confirmed point is located inside any obstacle, a point located outside the obstacle and closest to the to-be-confirmed point on the spherical surface is used as the target point, otherwise, the to-be-confirmed point is used as the target point.
[0104] In the above, when obtaining the preset flight path planning section length, the airspace complexity is considered, and two dimensions of the number of unmanned aerial vehicles and static obstacles are introduced, so that the obtained airspace complexity is more reasonable. Since the higher the airspace complexity, the greater the probability of trajectory conflict of the unmanned aerial vehicle, a smaller preset flight path planning section length is set to increase the flight path planning frequency, thereby effectively ensuring the safe flight of the target unmanned aerial vehicle in the high dynamic airspace environment.
[0105] Embodiments of the application also provide a non-transitory computer readable storage medium, which can be arranged in an electronic device to save at least one instruction or at least one program related to a method in the method embodiment, and the at least one instruction or the at least one program is loaded and executed by the processor to realize the method provided by the above embodiments.
[0106] Embodiments of the application also provide an electronic device, which comprises a processor and the aforementioned non-transitory computer readable storage medium.
[0107] Although some specific embodiments of the application have been described in detail by examples, those skilled in the art should understand that the above examples are only for illustration, and are not intended to limit the scope of the application. Those skilled in the art should also understand that various modifications can be made to the embodiments without departing from the scope and spirit of the application. The scope of the application is defined by the appended claims.
Claims
1. A method for obtaining a UAV flight path based on a large language model, characterized in that, The method comprises the following steps: S100, based on the received shooting instruction text of the police case, a target location and a target event are extracted from the shooting instruction text of the police case by a preset large language model; S200, when the target location is a preset area type, determining an initial shooting height h1 of the unmanned aerial vehicle and a target shooting point based on the initial shooting height h1 to generate a first flight path of the unmanned aerial vehicle and obtain a target area image corresponding to the target location; the preset area type is an aggregated area data defined by administrative division or user self-definition; S300, according to a preset shooting range corresponding to a target shooting height h2, the target area image is segmented, and a target event occurrence label corresponding to each sub-area image is obtained; the target event occurrence label is any one of yes and no; wherein h2 < h1; The target area image is segmented by the following steps: S301, when the width of the shooting range corresponding to the target area image is an integer multiple of the width of the shooting range corresponding to the target shooting height h2, the target area image is evenly segmented based on the shooting range corresponding to the target shooting height h2; S302, when the width of the shooting range corresponding to the target area image is not an integer multiple of the width of the shooting range corresponding to the target shooting height h2, the target area image is extended in length and width until the width of the shooting range corresponding to the virtual area frame obtained is an integer multiple of the width of the shooting range corresponding to the target shooting height h2; wherein the virtual area frame coincides with the center of the target area image; S303, the virtual area frame is evenly segmented based on the shooting range corresponding to the target shooting height h2 to segment the target area image; S400, according to the order of the target event occurrence label from yes to no, each sub-area image corresponding to the flight path point is traversed to generate a second flight path corresponding to the target shooting height h2; S500, each sub-area corresponding to the image to be analyzed is obtained by the unmanned aerial vehicle according to the second flight path, and real-time detection of the target event is performed, until the target event is detected from the image to be analyzed, the corresponding image to be analyzed is sent to the background, and the final flight path is obtained; wherein the sub-area corresponds to the sub-area image one by one.
2. The method of claim 1, wherein, In the S200 step, the initial shooting height h1 of the unmanned aerial vehicle and the target shooting point based on the initial shooting height h1 are determined by the following steps: S201, based on the boundary coordinates of the target location, the center point of the rectangular area corresponding to the boundary coordinates of the target location is marked; S202, according to the shooting parameters of the unmanned aerial vehicle, the initial shooting height h1 corresponding to the center point of the rectangular area is determined, so that the range of the unmanned aerial vehicle shooting at h1 height covers the rectangular area corresponding to the boundary coordinates of the target location; S203, according to the center point of the rectangular area and the initial shooting height h1, the target shooting point is determined. 3.The method of claim 1, wherein, The target shooting height h2 is determined by the following steps: S10, a set of artificially labeled historical shooting images is obtained; the set of historical shooting images includes an image sample subset corresponding to each preset event type and a plurality of shooting heights and event information corresponding to each image sample subset; S20, for any preset event type corresponding to a plurality of shooting heights and event information, obtaining an event detection accuracy rate corresponding to each shooting height; S30, constructing a height-accuracy rate relationship fitting curve corresponding to the preset event type according to the event detection accuracy rate corresponding to each shooting height; S40, based on the target event corresponding to the preset event type, finding out the maximum shooting height corresponding to the height-accuracy rate relationship fitting curve of the target event when the preset accuracy rate is met, and determining the maximum shooting height as the target shooting height h2.
4. The method of claim 1, wherein, In the S400 step, the track points corresponding to the sub-region images are obtained by the following steps: S401, obtaining a first world coordinate in the world coordinate system corresponding to the sub-region image center point according to the pixel coordinates corresponding to the sub-region image center point; S402, replacing the vertical coordinate in the first world coordinate with the target shooting height h2 to obtain the second world coordinate corresponding to each sub-region image; S403, taking the second world coordinate corresponding to each sub-region image as the track point corresponding to the sub-region image. 5.The method of claim 1, wherein, The S400 step further includes the following steps: S410, taking the target shooting point as the starting point, and based on the track points corresponding to the sub-region images with the target event occurrence label of yes, generating a first sub-route through the track planning algorithm; S420, taking the last track point in the first sub-route as a new starting point, and based on the track points corresponding to the sub-region images with the target event occurrence label of no, generating a second sub-route through the track planning algorithm; S430, merging the first sub-route and the second sub-route to obtain a second route. 6.The method of claim 1, wherein, The S500 step further includes the following steps: S501, when the target event is detected from the to-be-analyzed image, determining the event occurrence region corresponding to the target event in the to-be-analyzed image; S502, if the center point of the event occurrence region is located within the preset center range in the to-be-analyzed image, sending the to-be-analyzed image to the background and ending the flight; otherwise, sending the to-be-analyzed image to the background and controlling the UAV to translate to the position corresponding to the target shooting height h2 of the center point of the event occurrence region according to the preset translation step, and shooting a new to-be-analyzed image when the translation ends, and returning to execute step S501 until the flight ends. 7.The method of claim 1, wherein, After the S100 step, the method further includes the following steps: S210, when the target location is a preset specific address type, calling a GIS module to obtain the position coordinates of the target location, and taking the obtained position coordinates as the target terminal point; The preset specific address type is positioning data accurate to a building unit; S220, generating a target track corresponding to the UAV according to the track planning algorithm, so that the UAV flies to the target terminal point according to the target track. 8.A non-transitory computer readable storage medium having stored therein at least one instruction or at least one piece of program, characterized in that, The at least one instruction or the at least one program is loaded and executed by the processor to implement the method for obtaining a UAV route based on a large language model according to any one of claims 1-7.
9. An electronic device, comprising: The processor and the non-transitory computer readable storage medium as claimed in claim 8. The processor and the non-transitory computer readable storage medium as claimed in claim 8.
Citation Information
Patent Citations
Method, device and storage medium for establishing alarm situation prediction model based on space-time
CN109472419A
Unmanned aerial vehicle adaptive path planning method and device based on multi-resolution semantic segmentation, equipment and storage medium
CN119512151A