Method and device for obtaining route of unmanned aerial vehicle based on large language model, and medium
Through drone route planning technology based on a large language model, the low efficiency of drones in police response scenarios has been solved, and fast and accurate acquisition and processing of police information has been achieved.
Patent Information
- Application Number
- CN202511195379.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-26
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2045-08-26
AI Technical Summary
In the police response scenario, existing drone technologies are inefficient in reaching target locations and identifying police incidents. This is mainly due to the scarcity of pilot resources and the ambiguity of police incident addresses, which leads to low efficiency in drone photography, affecting the timely acquisition and processing of event information.
Using a method based on a large language model, the target locations and events are extracted from the police shooting instruction text to generate drone routes. The images are segmented at different heights and areas for event detection, and track waypoints are generated to detect target events in real time.
It improves the recognition accuracy and processing efficiency of event information, ensuring that drones can quickly and accurately identify and transmit alarm information.
Smart Images

Figure CN120707599A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of unmanned aerial vehicle (UAV) route planning, and in particular to a method, device, and medium for obtaining a UAV route based on a large language model. Background Art
[0002] In the current police response scenario, upon receiving a call, the police response center must dispatch a pilot to fly a police drone immediately to the scene and transmit the on-site situation back to the command center. However, this scenario is inefficient. Firstly, the pilot must be familiar with the local environment to quickly control the drone to the target location, and qualified pilots are relatively scarce. Secondly, the description of the call address is often vague, typically only specifying a specific area. Therefore, after the drone arrives at the target area, the pilot must rely on experience to further locate the specific location of the call. This results in low filming efficiency and requires repeated manual adjustment of the camera height based on event identification, hindering the timely acquisition and processing of police event information. Summary of the Invention
[0003] In response to the above technical problems, the present invention provides a method, device and medium for obtaining drone routes based on a large language model, which can generate track waypoints and corresponding routes according to the shooting range of the target area image corresponding to the target location and the target event detection results, which is conducive to improving the recognition accuracy of event information and improving event processing efficiency.
[0004] According to a first aspect of the present invention, a method for obtaining a drone route based on a large language model is provided, comprising the following steps: S100, based on the received police incident shooting instruction text, extracting the target location and target event from the police incident shooting instruction text through a preset large language model.
[0005] S200, when the target location is a preset area type, determine the initial shooting height h1 of the drone and the target shooting point based on the initial shooting height h1 to generate the first route of the drone and obtain the target area image corresponding to the target location; the preset area type is aggregated area data through administrative division or user-defined.
[0006] S300, segmenting the target area image according to the shooting range corresponding to the preset target shooting height h2, and obtaining the target event occurrence label corresponding to each sub-area image; the target event occurrence label is either yes or no; wherein h2
[0007] S400 , traversing the track waypoints corresponding to each sub-region image in the order of target event occurrence labels from presence to absence, and generating a second route corresponding to the target shooting height h2.
[0008] S500, obtain the image to be analyzed corresponding to each sub-area photographed sequentially by the drone along the second route and perform real-time detection of the target event. When the target event is detected from the image to be analyzed, the corresponding image to be analyzed is sent to the background to obtain the final route; wherein the sub-area corresponds to the sub-area image one-to-one.
[0009] According to a second aspect of the present invention, a non-transitory computer-readable storage medium is provided, wherein the storage medium stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by a processor to implement the above-mentioned method for obtaining a drone route based on a large language model.
[0010] According to a third aspect of the present invention, there is provided an electronic device comprising a processor and the above-mentioned non-transitory computer-readable storage medium.
[0011] The present invention has at least the following beneficial effects: The present invention provides a method for obtaining a drone route based on a large language model. First, a target location and a target event are extracted from a received police shooting instruction text. When the target location is a preset area type, a target area image corresponding to the target location is obtained, which can cover the target location area to prevent the captured event information from being incomplete. Then, the target area image is segmented according to the shooting range corresponding to the target shooting height, and a target event occurrence label corresponding to each sub-area image is obtained. By setting the target shooting height, the subsequently captured images are made clearer, which is conducive to obtaining more comprehensive and accurate event information. Then, the track waypoints corresponding to each sub-area image are traversed in order from the presence to the absence of the target event occurrence label to generate a second route. The image to be analyzed of the sub-area captured at each track waypoint when the drone flies along the second route is obtained and real-time detection is performed until the target event is detected from the image to be analyzed. The route generated in the above manner is conducive to improving the recognition accuracy of event information and improving event processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0013] Figure 1 A flowchart of a method for obtaining a drone route based on a large language model provided by an embodiment of the present invention; Figure 2 A schematic diagram of the positional relationship between a preset starting point and a preset target point provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0014] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making any creative efforts shall fall within the scope of protection of the present invention.
[0015] The embodiment of the present invention provides a method for obtaining a UAV route based on a large language model, such as Figure 1 As shown, the method includes the following steps: S100: Based on the received police incident filming instruction text, a target location and target event are extracted from the police incident filming instruction text using a preset large language model. In a specific implementation, the natural language processing module determines that the target location is a specific address or an area. This can be understood as: using a pre-trained binary classification model to determine that the target location is a preset specific address type or a preset area type, for example, a specific location is a certain lane number, and an area can be a residential community or a park.
[0016] S200, when the target location is a preset area type, determine the initial shooting height h1 of the drone and the target shooting point based on the initial shooting height h1 to generate the first route of the drone and obtain the target area image corresponding to the target location; the preset area type is aggregated area data through administrative division or user-defined.
[0017] Specifically, the initial shooting height h1 of the drone 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, marks the center point of the rectangular area corresponding to the boundary coordinates of the target location; this can be understood as: obtaining the boundary coordinates of the target location by calling a GIS module.
[0018] S202: Based on the drone's shooting parameters, determine the initial shooting height h1 corresponding to the center point of the rectangular area, so that the range of the drone's shooting at the height h1 covers the rectangular area corresponding to the boundary coordinates of the target location. In the specific implementation, distortion is not considered.
[0019] Specifically, h1 meets the following conditions: , where L and W are the length and width of the rectangular area, respectively, and α and β are the horizontal and vertical viewing angles of the camera, respectively.
[0020] S203 , determining a target shooting point according to the center point of the rectangular area and the initial shooting height h1 ; this can be understood as: determining a position at the initial shooting height h1 in the vertical direction corresponding to the center point of the rectangular area as the target shooting point.
[0021] As mentioned above, when obtaining a full-view image of the target location, a larger calculated height is selected to ensure that the rectangular area can be completely covered. By obtaining a full-view image of the target location, it is possible to prevent omissions in the shooting of subsequent event information when the specific location of the incident is not described in the police information, thereby ensuring the comprehensiveness and reliability of the acquisition of event information.
[0022] Furthermore, after step S100, the method further includes the following steps: S210, when the target location is a preset specific address type, calling the GIS module to obtain the location coordinates of the target location, and using the obtained location coordinates as the target end point; the preset specific address type is positioning data accurate to the building unit.
[0023] S220: Generate a target track corresponding to the UAV according to a track planning algorithm, so that the UAV flies to the target destination according to the target track.
[0024] In this embodiment, when the target location has specific location information, the track can be directly generated according to the track planning algorithm, so that the drone can quickly reach the specific shooting location.
[0025] S300, according to the shooting range corresponding to the preset target shooting height h2, the target area image is segmented, and the target event occurrence label corresponding to each sub-area image is obtained; the target event occurrence label is either yes or no; it can be understood as: each sub-area image obtained after segmentation is sent to the target event detection model, and the event corresponding to the sub-area image is obtained. If the similarity with the target event is higher than the similarity threshold, the target event occurrence label corresponding to the sub-area image is set to: yes.
[0026] Specifically, h2
[0027] Furthermore, the target shooting height h2 is determined by the following steps: S10: Obtain a manually labeled historical image sample set; the historical image sample set includes an image sample subset corresponding to each preset event type, and a number of shooting heights and event information corresponding to each image sample subset. For example, the shooting heights may range from 20m to 100m, with each height being 10m apart. Event information may include the number of vehicles, the number of people, and fires, etc.
[0028] S20, for a number of shooting heights and event information corresponding to any preset event type, obtain the event detection accuracy corresponding to each shooting height; this can be understood as: comparing the detection results of the event detection module with the marked event information to obtain the event detection accuracy, wherein different preset event types calculate their own corresponding event detection accuracy separately.
[0029] S30 , constructing a height-accuracy relationship fitting curve corresponding to a preset event type according to the event detection accuracy corresponding to each shooting height.
[0030] S40 , based on the preset event type corresponding to the target event, find the maximum shooting height corresponding to the preset accuracy from the height-accuracy relationship fitting curve corresponding to the target event, and determine the maximum shooting height as the target shooting height h2.
[0031] It should be noted that since this solution is carried out for a larger area, when the preset accuracy needs to be met during shooting, the shooting height is usually lower than the shooting height that covers the entire picture. If there are special circumstances, that is, when h2≥h1, the accuracy can also be met, and in this case it is set to h2=h1.
[0032] As mentioned above, the target area image obtained is an image of a larger range, and the target event occurring locally cannot be clearly displayed. Therefore, it is necessary to determine a suitable shooting height to ensure that the event detection accuracy meets the requirements and make the obtained event information more accurate, which is conducive to the staff to grasp the clear event situation in a timely manner and give reasonable handling measures in a timely manner.
[0033] Furthermore, in step S300, 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. This can be understood as follows: when the width of the shooting range P1 corresponding to the target area 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 a specific implementation, since the drone's shooting ratio is consistent, the ratio of the image's length to width is a fixed value, and the number of segmented sub-area images is the ratio of the area of P1 to the area of P2.
[0034] 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 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.
[0035] S303, based on the shooting range corresponding to the target shooting height h2, the virtual area frame is evenly divided to achieve segmentation of the target area image; it can be understood that: even segmentation is performed according to the size of the virtual area frame, and the edge image after segmentation removes the extended blank area, which is the sub-area image corresponding to the target area image.
[0036] As mentioned above, since the event detection accuracy of the image captured at the target shooting height can meet the requirements, when the target location is divided into regions, the target area image is evenly divided with the shooting range corresponding to the target shooting height as the reference benchmark to achieve preliminary positioning of the shooting point when shooting at the h2 height, ensuring the comprehensiveness of the event information in the target location and the accuracy of the event information captured in each sub-area.
[0037] S400 , traversing the track waypoints corresponding to each sub-region image in the order of target event occurrence labels from presence to absence, and generating a second route corresponding to the target shooting height h2.
[0038] Specifically, in step S400, the track waypoints corresponding to the sub-region image are obtained through the following steps: S401 , obtaining a first world coordinate in a world coordinate system corresponding to the center point of the sub-region image according to the pixel coordinate corresponding to the center point of the sub-region image.
[0039] Specifically, step S401 includes the following steps: S4011, converting the pixel coordinates corresponding to the center point of the sub-region image into the camera coordinates corresponding to the center point of the sub-region image; wherein the camera coordinates corresponding to the center point of the sub-region image (X c , Y c , Z c ) meets the following conditions: (X c , Y c , Z c)=(Z0×(u-u0)×dx / f,Z0×(v-v0)×dy / f,Z0), where Z0 is the depth distance from the target point to the optical center of the camera, dx and dy represent the pixel sizes in the horizontal and vertical directions, respectively, f is the focal length of the camera, u and v are the horizontal and vertical coordinates of the pixel coordinates corresponding to the center point of the sub-region image, and u0 and v0 are the horizontal and vertical coordinates of the pixel coordinates corresponding to the principal point, respectively.
[0040] S4012, convert the camera coordinates corresponding to the center point of the sub-region image into the first world coordinates (X e , Y e , Z e ).
[0041] Specifically, the conversion process meets the following conditions: , where r is a 3×3 rotation matrix and t is a 3×1 translation vector.
[0042] S402, using the target shooting height h2 to replace the vertical coordinates in the first world coordinates 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 sub-region image mapped to the target shooting height.
[0043] S403 , using the second world coordinates corresponding to each sub-region image as the track waypoint corresponding to the sub-region image; it can be understood that the second world coordinates include longitude, latitude and vertical height.
[0044] As described above, the corresponding track waypoint is calculated by the center point of the sub-area image, so that the drone can completely capture the area range in the sub-area image when shooting at the track waypoint position, with a lower shooting height and higher clarity, which is conducive to improving the recognition accuracy of event information.
[0045] Furthermore, step S400 further includes the following steps: S410 , starting from the target shooting point and based on the track waypoints corresponding to the sub-region images with the target event occurrence label, a first sub-route is generated by a track planning algorithm. For example, the track planning algorithm may be an A-Star algorithm.
[0046] S420: Using the last track waypoint in the first sub-route as a new starting point, and generating a second sub-route through a track planning algorithm based on track waypoints corresponding to a plurality of sub-region images with target event occurrence labels as none.
[0047] 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 and the starting point of the second sub-route.
[0048] As mentioned above, by dividing the target area image according to the shooting range of the target shooting height and obtaining the track waypoints corresponding to each sub-area image at the target shooting height, the drone's flight route can be obtained, so that the drone can shoot the sub-area at each track waypoint when flying along the flight route, which is beneficial to improving the recognition accuracy of event information, and by generating routes in order from label to no label, it is beneficial to timely capture the target event, timely obtain event information and improve event processing efficiency.
[0049] S500: Acquire images corresponding to each sub-area captured sequentially by the drone along the second route and perform real-time detection of target events. Once a target event is detected in the images, the corresponding images are sent to the backend to determine the final route. This can be understood as the drone capturing images at each waypoint along the second route. In a specific implementation, the images are sent in real time to the event detection module for event recognition.
[0050] Specifically, the sub-region corresponds to the sub-region image one-to-one; it can be understood that the sub-region refers to the ground area corresponding to the sub-region image.
[0051] As mentioned above, when the target event detection module detects a target event, it promptly sends the corresponding image to be analyzed to the control center and ends the task. The route obtained by the above method enables the drone to quickly and accurately detect the specific location and event information of the event.
[0052] Furthermore, step S500 further includes the following steps: S501, when a target event is detected from the image to be analyzed, determining the event occurrence area corresponding to the target event in the image to be analyzed; it can be understood that: when detecting the target event, the event detection module can identify the event occurrence area.
[0053] In step S502, if the center point of the event area is within the preset center range of the image to be analyzed, the image to be analyzed is sent to the backend and the navigation is terminated; otherwise, the image to be analyzed is sent to the backend and the drone is controlled to translate toward the center point of the event area corresponding to the target shooting height h2 according to the preset translation step length, and a new image to be analyzed is captured at the end of the translation, and the process returns to step S501 until the navigation is terminated; technicians in this field can set the preset translation step length according to actual needs, for example, 5m.
[0054] As mentioned above, when capturing the target event, the position of the target event in the image to be analyzed is also taken into consideration. When the position offset of the target event is large, it is considered that only part or a small part of the target event occurrence area is captured. Therefore, the flight trajectory needs to be adjusted at this time, and the drone is translated along the direction of the center of the event occurrence area, while ensuring that the flight altitude remains unchanged, so that the image to be analyzed captured again can include more of the event occurrence area. The real-time dynamic adjustment of the route is conducive to the identification and overview analysis of the overall event.
[0055] In another embodiment, in step S200, when generating the first route of the drone, if the distance between the current position of the drone and the target shooting point is greater than a given distance threshold, path planning is required for the first route. Those skilled in the art set the given distance threshold according to actual needs, which will not be repeated here. The purpose is to plan a long-distance path.
[0056] The following describes the UAV whose path is to be planned as the target UAV, and specifically includes the following steps: P100 calculates the target drone's initial track within a preset airspace based on obstacle information received before the start of a preset track planning period. The preset starting point of the preset airspace is the position in the target drone's original track that is T1 away from the current time. This can be understood as meaning that the preset airspace refers to the target drone's future track segment during the preset track planning period, i.e., the range corresponding to a future segment of the target drone's current track. In a specific implementation, the initial track is calculated using a track planning algorithm, such as the A-Star algorithm.
[0057] Specifically, the obstacle information includes dynamic obstacle information and static obstacle information. For example, static obstacle information includes obstacles such as buildings and trees whose heights are within the planned trajectory altitude range. Static obstacle information can be detected by onboard sensors.
[0058] Furthermore, the dynamic obstacle information includes broadcast messages from a given drone received by the target drone within a preset time window before the start of a preset trajectory planning period, as well as dynamic flying objects detected by the target drone's onboard sensors. This information can be understood as meaning that the given drone is a drone within a certain airspace that has a probability of affecting the target drone's flight trajectory, such as drones located in the same urban area as the target drone. In one implementation scenario, a tree branch swaying due to wind direction would be detected as a dynamic flying object by the onboard sensors.
[0059] Specifically, the duration corresponding to the preset track planning period is obtained through the following steps: P01: Estimate the acquisition time of the target planned path based on the amount of data corresponding to the received obstacle information. For example, estimate the acquisition time of the target planned path based on the amount of historical calculation data and calculation time.
[0060] P02, the acquisition duration corresponding to the target planned path is used as the duration corresponding to the preset track planning period.
[0061] Furthermore, T1 meets the following conditions: T1≥T2+T0, where T2 is the duration corresponding to the preset track planning period, and T0 is the preset fault tolerance time. For example, the preset fault tolerance time may be 1 second.
[0062] As mentioned above, the duration of the preset trajectory planning period and the fault tolerance period are limited, and then the flight distance of the target UAV after flying for this duration is estimated to reasonably determine the trajectory section to be planned, and ensure that the target planned path is acquired before reaching the planned trajectory section, so that the target UAV can seamlessly connect the current trajectory and the target planned path to ensure the stable flight of the target UAV.
[0063] P200: If no new obstacle information is received when calculating the initial track, the initial track is used as the target planning path; otherwise, it is determined whether there is a trajectory conflict between the initial track and the new obstacle. If there is a trajectory conflict, the original track of the target UAV is continued at the preset starting point. Otherwise, the initial track is used as the track to be confirmed.
[0064] Specifically, the following steps are used to determine whether there is a trajectory conflict between the initial track and the new obstacle: P201: If the new obstacle is a static obstacle, determine whether the closest distance between the initial track and the static obstacle is less than a first preset distance threshold. Those skilled in the art can set the first preset distance threshold according to actual needs, which will not be described in detail here.
[0065] P202: If the distance is less than the first preset distance threshold, it is determined that there is a trajectory conflict between the initial track and the new obstacle; otherwise, it is determined that there is no trajectory conflict between the initial track and the new obstacle.
[0066] P203: If the new obstacle is a dynamic object, determine whether there is at least one time point when the distance between the initial track and the predicted track of the dynamic object is less than a second preset distance threshold; where the second preset distance threshold is greater than the first preset distance threshold. Those skilled in the art will determine the second preset distance threshold based on actual needs, and this description is omitted here.
[0067] P204: If there is at least one time point, it is determined that there is a trajectory conflict between the initial track and the new obstacle; otherwise, it is determined that there is no trajectory conflict between the initial track and the new obstacle.
[0068] As mentioned above, since new obstacle information may also be received during the calculation stage of the initial track, there is no need to recalculate the track at this time, and it is only necessary to determine whether the tracks conflict, which improves data processing efficiency. When determining whether there is a track conflict between the initial track and the new obstacle, since the drone will be affected by wind and other factors, resulting in a slight deviation in the flight position, a distance threshold is set. As long as the distance is less than the distance threshold, it is considered that there is a risk of track conflict. Moreover, since there is a certain deviation in the predicted track of dynamic flying objects, a larger distance threshold is set for dynamic obstacles than for static obstacles to avoid the risk of track conflict, thereby ensuring the normal flight of the drone.
[0069] P300 detects whether new obstacle information is received during the judgment period corresponding to the trajectory conflict. If so, the original track of the target UAV is continued at the preset starting point. Otherwise, the track to be confirmed is determined as the target planned path.
[0070] As mentioned above, since the judgment time corresponding to the trajectory conflict is much shorter than the calculation time corresponding to the initial track, the probability of receiving new obstacle information during the trajectory conflict judgment process is extremely small. Based on this situation, when the new obstacle information is received, the initial track can be abandoned without having to determine whether there is a trajectory conflict again. This avoids falling into multiple loops and causing the acquisition time of the target planned path to be too long, which in turn causes the target UAV to be unable to fly according to the target planned path at the preset starting point.
[0071] P400, if the target UAV receives new obstacle information during the execution of the target planned path and determines that the new obstacle has a trajectory conflict with the target planned path, restart the preset track planning period and update the preset airspace range, and return to step P100 until the end point is reached; conversely, the preset target point of the preset airspace range is used as the new preset starting point and the preset airspace range is updated, the starting time of the preset track planning period is determined and the return to step P100 is executed until the end point is reached; it can be understood that: the end point is the target shooting point.
[0072] Specifically, the starting time of the preset trajectory planning period is the time corresponding to the duration T1 reversed from the time when the predicted target UAV flies to the preset target point.
[0073] As mentioned above, when the target UAV reaches the preset starting point, it will fly according to the target planned path and detect new obstacles through onboard sensors. If it is determined that the detected new obstacle has a trajectory conflict with the target planned path, a new track planning step will be restarted. If there is no trajectory conflict, the track planning cycle needs to be started before reaching the target point, and track planning is implemented one track segment after another, which reduces the problem of excessive computational complexity caused by the increase in the number of UAVs, and realizes the real-time dynamic track adjustment of the UAV according to the surrounding environment, thereby adapting to the highly dynamic airspace environment.
[0074] Furthermore, if Figure 2 As shown, the preset target point within the preset airspace is obtained through the following steps: P10, with the preset starting point as the center of the sphere, sets the intersection of the line between the preset starting point and the end point and the sphere with a radius of R as the point to be confirmed; where R is the length of the preset track planning section; it can be understood that: the length of the track planned 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.
[0075] In a specific embodiment, the preset track planning segment length is obtained through the following steps: P11, based on the current position of the target UAV, obtains the total number score of UAVs and the static object complexity score within the target airspace corresponding to the target UAV's future original trajectory. This can be understood as follows: each time trajectory planning is performed, the target airspace range is dynamically adjusted according to the current position of the target UAV.
[0076] In specific implementations, those skilled in the art will define scoring rules for the total number of drones and the complexity of static objects based on actual needs. For example, the greater the number of drones, the higher the total number score; the greater the number of static objects within the target airspace, the higher the static object complexity score.
[0077] P12, based on the total number score of drones and the complexity score of static objects in the target airspace, calculate the airspace complexity score corresponding to the target airspace range.
[0078] Specifically, the airspace complexity score D corresponding to the target airspace range meets the following conditions: D=w1×d1+w2×d2, where d1 is the total number of drones score, d2 is the static object complexity score, w1 and w2 are the preset weights corresponding to the total number of drones score and the static object complexity score, respectively.
[0079] P13, according to the preset correspondence between the airspace complexity score and the trajectory planning segment length, obtain the preset trajectory planning segment length; it can be understood that: there are several airspace complexity score intervals and several trajectory planning segment length intervals preset, and the airspace complexity score intervals and the trajectory planning segment length intervals correspond one to one.
[0080] Specifically, the length of the preset trajectory planning segment is inversely proportional to the airspace complexity score.
[0081] P20, if the point to be confirmed is inside any obstacle, use the point outside the obstacle and closest to the point to be confirmed on the sphere as the target point; otherwise, use the point to be confirmed as the target point.
[0082] As mentioned above, when obtaining the preset trajectory planning segment length, the airspace complexity is taken into consideration, and the two dimensions of the number of drones and static obstacles are introduced to make the obtained airspace complexity more reasonable. Since the higher the airspace complexity, the greater the probability of trajectory conflict among drones, a smaller preset trajectory planning segment length is set, and the trajectory planning frequency is increased to effectively ensure the safe flight of the target drone in a highly dynamic airspace environment.
[0083] An embodiment of the present invention also provides a non-transitory computer-readable storage medium, which can be set in an electronic device to store at least one instruction or at least one program related to implementing a method in a method embodiment. The at least one instruction or the at least one program is loaded and executed by the processor to implement the method provided in the above embodiment.
[0084] An embodiment of the present invention further provides an electronic device including a processor and the aforementioned non-transitory computer-readable storage medium.
[0085] Although some specific embodiments of the present invention have been described in detail by way of example, it should be understood by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present invention. It should also be understood by those skilled in the art that various modifications may be made to the embodiments without departing from the scope and spirit of the present invention. The scope of the present invention is defined by the appended claims.
Claims
1. A method for obtaining drone routes based on a large language model, characterized in that: The method comprises the following steps: S100, based on the received police incident shooting instruction text, extracting the target location and target event from the police incident shooting instruction text by using a preset large language model; S200, when the target location is a preset area type, determining an initial shooting height h1 of the drone and a target shooting point based on the initial shooting height h1, so as to generate a first flight path of the drone and acquire an image of the target area corresponding to the target location; the preset area type is aggregated area data defined by administrative division or user-defined; S300, segmenting the target area image according to the shooting range corresponding to the preset target shooting height h2, and obtaining the target event occurrence label corresponding to each sub-area image; the target event occurrence label is either yes or no; wherein h2 < h1; S400, traversing the track waypoints corresponding to each sub-region image in the order from target event occurrence labels to target event occurrence labels, and generating a second route corresponding to the target shooting height h2; S500, obtain the image to be analyzed corresponding to each sub-area photographed sequentially by the drone along the second route and perform real-time detection of the target event. When the target event is detected from the image to be analyzed, the corresponding image to be analyzed is sent to the background to obtain the final route; wherein the sub-area corresponds to the sub-area image one-to-one.
2. The method for obtaining a UAV route based on a large language model according to claim 1, characterized in that: In step S200, the initial shooting height h1 of the drone 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, marking the center point of the rectangular area corresponding to the boundary coordinates of the target location; S202: Determine an initial shooting height h1 of the drone corresponding to the center point of the rectangular area based on the drone's shooting parameters, so that the range of the drone's shooting at the height h1 covers the rectangular area corresponding to the boundary coordinates of the target location; S203 : Determine a target shooting point according to the center point of the rectangular area and the initial shooting height h1 .
3. The method for obtaining a UAV route based on a large language model according to claim 1, characterized in that: Determine the target shooting height h2 through the following steps: S10, obtaining a manually annotated historical image sample set; the historical image sample set includes an image sample subset corresponding to each preset event type and a number of shooting heights and event information corresponding to each image sample subset; S20, for a plurality of shooting heights and event information corresponding to any preset event type, obtaining an event detection accuracy rate corresponding to each shooting height; S30, constructing a height-accuracy relationship fitting curve corresponding to a preset event type based on the event detection accuracy corresponding to each shooting height; S40 , based on the preset event type corresponding to the target event, find the maximum shooting height corresponding to the preset accuracy from the height-accuracy relationship fitting curve corresponding to the target event, and determine the maximum shooting height as the target shooting height h2.
4. The method for obtaining a UAV route based on a large language model according to claim 1, characterized in that: In step S300, 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 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; S303 : dividing the virtual area frame equally based on the shooting range corresponding to the target shooting height h2 to achieve segmentation of the target area image.
5. The method for obtaining a UAV route based on a large language model according to claim 1, characterized in that: In step S400, the track waypoints corresponding to the sub-region image are obtained through the following steps: S401, obtaining a first world coordinate corresponding to the center point of the sub-region image in a world coordinate system according to the pixel coordinate corresponding to the center point of the sub-region image; S402, replacing the vertical coordinates in the first world coordinates with the target shooting height h2 to obtain the second world coordinates corresponding to each sub-region image; S403: Use the second world coordinates corresponding to each sub-region image as a track waypoint corresponding to the sub-region image.
6. The method for obtaining a UAV route based on a large language model according to claim 1, characterized in that: Step S400 also includes the following steps: S410, starting from the target shooting point and based on the track waypoints corresponding to the sub-region images with the target event occurrence label, generating a first sub-route through a track planning algorithm; S420, using the last track waypoint in the first sub-route as a new starting point and generating a second sub-route using a track planning algorithm based on track waypoints corresponding to a plurality of sub-region images having a target event occurrence label of "none"; S430: Merge the first sub-route and the second sub-route to obtain a second route.
7. The method for obtaining a UAV route based on a large language model according to claim 1, characterized in that: Step S500 also includes the following steps: S501, when a target event is detected from the image to be analyzed, determining an event occurrence area corresponding to the target event in the image to be analyzed; In step S502, if the center point of the event area is within the preset center range of the image to be analyzed, the image to be analyzed is sent to the backend and the navigation ends. Otherwise, the image to be analyzed is sent to the backend and the drone is controlled to translate toward the center point of the event area corresponding to the target shooting height h2 according to the preset translation step size. A new image to be analyzed is captured at the end of the translation, and the process returns to step S501 until the navigation ends.
8. The method for obtaining a UAV route based on a large language model according to claim 1, characterized in that: After step S100, the method further includes the following steps: S210, when the target location is a preset specific address type, calling the GIS module to obtain the location coordinates of the target location, and using the obtained location coordinates as the target destination; The preset specific address type is positioning data accurate to the building unit; S220: Generate a target track corresponding to the UAV according to a track planning algorithm, so that the UAV flies to the target destination according to the target track.
9. A non-transitory computer-readable storage medium, wherein at least one instruction or at least one program is stored in the storage medium, 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 drone route based on a large language model as described in any one of claims 1-8.
10. An electronic device, characterized in that: The device comprises a processor and the non-transitory computer-readable storage medium as claimed in claim 9.
Citation Information
Patent Citations
Method, device and storage medium for establishing alarm situation prediction model based on space-time
CN109472419A
Multi-unmanned aerial vehicle cooperative full-coverage path planning method and device, storage medium and terminal
CN112097770A
Aerial AI acquisition, inspecting and early warning method and device for water bank events
CN113221657A
Automated aerial data capture for 3D modeling of unknown objects in unknown environments
CN118103669A
Unmanned aerial vehicle water area shoreline patrol method and computer readable storage medium
CN118521922A