Unmanned aerial vehicle device perception method, apparatus and device supporting perception large model switching

By establishing listening and inference threads in the UAV device and managing configuration variables to dynamically switch detection models, the stability problem of model switching during UAV flight is solved, ensuring mission continuity and efficient switching.

CN123160913APending Publication Date: 2026-11-24SHENZHEN EGGMA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611221044.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-12
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

When switching desired detection models during flight, direct switching can easily lead to program crashes or target loss, affecting the stability and reliability of model switching.

Method used

In the perception program of the drone device, a listening thread and an inference thread are established. The timestamp and update instructions of the configuration file are obtained through the listening thread. The confidence threshold, intersection-over-union threshold and file path of the expected detection model are managed by global configuration variables in shared memory. The detection model is dynamically switched to avoid restarting the inference service.

Benefits of technology

It achieves continuity and stability for UAVs during mission execution, avoids attitude reset and positioning drift caused by restarts, simplifies operation procedures, and improves model switching efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123160913A_ABST
    Figure CN123160913A_ABST
Patent Text Reader

Abstract

This application relates to the fields of unmanned aerial vehicle (UAV) technology and visual perception technology. It discloses a UAV device perception method, apparatus, and device supporting large-scale perception model switching. The method includes: establishing a listening thread and an inference thread; during the flight of the UAV device, acquiring the timestamp of the configuration file and the update instruction of the configuration file through the listening thread; when the timestamp of the configuration file is inconsistent with the previously recorded timestamp or when an update instruction is received, reading the confidence threshold, intersection-over-union (IoU) threshold, and the file path of the desired detection model from the configuration file; determining whether the file path of the desired detection model is consistent with the file path of the original detection model; when the file path of the desired detection model is inconsistent with the file path of the original detection model, switching the current detection model to the desired detection model based on the metadata of the desired detection model and the inference thread. This application can improve the switching efficiency of the desired detection model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of unmanned aerial vehicle (UAV) technology and visual perception technology, and in particular to UAV device perception methods, devices and equipment that support large-scale perception model switching. Background Technology

[0002] When performing tasks such as inspection, reconnaissance, and search and rescue, unmanned aerial vehicles (UAVs) typically need to use expectation detection models for real-time target detection. Due to the varied nature of the mission scenarios, expectation detection models require frequent adjustments.

[0003] In existing technologies, when UAVs need to switch expectation detection models during flight, they mainly use a direct switching method. However, this direct switching method is prone to causing the inference thread to read half-updated data, leading to program crashes or target loss. Therefore, it is detrimental to improving the stability and reliability of expectation detection model switching. Thus, how to switch expectation detection models during UAV flight is a technical problem that urgently needs to be solved. Summary of the Invention

[0004] The embodiments of this application provide a method, apparatus, and device for supporting the switching of large-scale perception models for unmanned aerial vehicles (UAVs), in order to solve the aforementioned technical problem of how to switch the desired detection model during the flight of an UAV.

[0005] In a first aspect, embodiments of this application provide a UAV device perception method that supports large-scale perception model switching, applied to UAV devices, the UAV device perception method comprising: In the perception program of the drone device, a listening thread and an inference thread are established. During the flight of the drone device, the timestamp of the configuration file and the update instructions of the configuration file are obtained through the listening thread. When the timestamp in the configuration file is inconsistent with the timestamp of the last record or when an update instruction is received, read the confidence threshold, intersection-over-union threshold and the file path of the expected detection model from the configuration file. Write the confidence threshold, intersection-over-union (IoU) threshold, and the file path of the desired detection model into a global configuration variable in shared memory; Before each frame of the inference task starts, the control inference thread reads the confidence threshold, intersection-over-union threshold, and file path of the expected detection model from the global configuration variables in shared memory, and determines whether the file path of the expected detection model is consistent with the file path of the original detection model. When the file path of the desired detection model is inconsistent with the file path of the original detection model, the current detection model is switched to the desired detection model based on the metadata, inference thread, and predefined switching method of the desired detection model.

[0006] In one possible implementation of the first aspect, a listening thread and an inference thread are established in the perception program of the UAV device. During the flight of the UAV device, the listening thread obtains the timestamp of the configuration file and the update instructions for the configuration file, including: In the perception program of the UAV device, a listening thread and an inference thread are established. The perception program of the UAV device refers to the target detection software system running on the embedded computing platform of the UAV device. During the flight of the drone, a listening thread scans the timestamp of the configuration file at a fixed frequency and listens for update instructions for the configuration file issued by the ground station. The configuration file is stored in the storage medium of the airborne embedded computing platform.

[0007] In one possible implementation of the first aspect, the confidence threshold, intersection-over-union (IoU) threshold, and the file path of the desired detection model are written into a global configuration variable in shared memory, including: Atomic operations are used to write the confidence threshold, intersection-over-union (IoU) threshold, and file path of the desired detection model into a global configuration variable in shared memory. An atomic operation is an operation that will not be interrupted by the thread scheduling mechanism during execution.

[0008] In one possible implementation of the first aspect, when the file path of the desired detection model is inconsistent with the file path of the original detection model, the current detection model is switched to the desired detection model based on the metadata, inference thread, and predefined switching method of the desired detection model, including: When the file path of the expected detection model is different from the file path of the original detection model, the expected detection model is loaded into memory through the file path of the expected detection model, the memory address of the expected detection model is obtained, and it is checked whether the inference of the current frame has been completed. During the period between the completion of inference for the current frame and the input of image data for the next frame into the inference engine, the category mapping table and input size parameters of the expected detection model are read from the metadata of the expected detection model. From the input size parameters, the input height and input width of the expected detection model are obtained. The input height of the expected detection model is divided by the original image height to obtain the height scaling ratio, and the input width of the expected detection model is divided by the original image width to obtain the width scaling ratio. The minimum value between the width scaling ratio and the height scaling ratio is selected as the scaling ratio coefficient. The scaling ratio coefficient and the category mapping table of the expected detection model are written into the configuration parameters of the expected detection model. After the configuration parameters are executed, the memory address of the original detection model in the inference thread is updated to the memory address of the expected detection model. The current detection model is switched to the expected detection model using the memory address of the expected detection model.

[0009] In one possible implementation of the first aspect, after updating the memory address of the original detection model in the inference thread to the memory address of the desired detection model when the file path of the desired detection model is inconsistent with the file path of the original detection model, the UAV device perception method further includes: Obtain the resource release command and release the computing resources currently occupied by the detection model using the resource release command.

[0010] In one possible implementation of the first aspect, after obtaining the resource release command and releasing the computing resources currently occupied by the detection model through the resource release command, the UAV device perception method further includes: Obtain the successful switch command for the current detection model and send the successful switch command to the ground station.

[0011] In one possible implementation of the first aspect, the current detection model refers to the large perception model currently in operation by the UAV equipment; The expectation detection model refers to the large perception model of the expected operation of the drone equipment.

[0012] In one possible implementation of the first aspect, the memory address of the expectation detection model is the starting address of the storage space occupied by the expectation detection model after it is loaded into memory; The memory address of the original detection model is the starting address of the storage space occupied by the original detection model after it is loaded into memory.

[0013] Secondly, embodiments of this application provide a UAV device sensing apparatus that supports large-scale sensing model switching, applied to UAV devices, including: The acquisition module is used to establish a listening thread and an inference thread in the perception program of the drone device. During the flight of the drone device, the listening thread acquires the timestamp of the configuration file and the update instructions of the configuration file. The reading module is used to read the confidence threshold, intersection-over-union threshold, and file path of the expected detection model from the configuration file when the timestamp of the configuration file is inconsistent with the timestamp of the last record or when an update instruction is received. The write module is used to write the confidence threshold, intersection-over-union threshold, and file path of the desired detection model to a global configuration variable in shared memory; The judgment module is used to control the inference thread to read the confidence threshold, intersection-over-union threshold and the file path of the expected detection model from the global configuration variables in shared memory before the inference task starts in each frame, and to determine whether the file path of the expected detection model is consistent with the file path of the original detection model. The switching module is used to switch the current detection model to the desired detection model when the file path of the desired detection model is inconsistent with the file path of the original detection model, based on the metadata of the desired detection model, the inference thread, and a predefined switching method.

[0014] Thirdly, embodiments of this application provide a drone device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the drone device perception method described in the first aspect above.

[0015] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the unmanned aerial vehicle (UAV) device perception method described in the first aspect above.

[0016] Fifthly, embodiments of this application provide a computer program product that, when run on a drone device, causes the drone device to execute the drone device perception method described in the first aspect.

[0017] The beneficial effects of the embodiments of this application are as follows: Firstly, when the file path of the desired detection model is inconsistent with the file path of the original detection model, the current detection model is switched to the desired detection model based on the metadata, inference thread, and predefined switching method of the desired detection model. The switching process of the desired detection model is completed dynamically during program execution without restarting the inference service or reloading the entire application. When the UAV is performing target tracking tasks, it can maintain a hovering state or continue flying without landing or interrupting the flight mission for model upgrades. This avoids attitude reset, positioning drift, and mission interruption caused by restarting, thus ensuring the continuity and stability of the flight mission. Secondly, the operation process is greatly simplified by eliminating the need to manually modify startup parameters, recompile, or restart the service, and significantly shortens the switching time of the desired detection model, thereby improving the switching efficiency of the desired detection model during the flight of the drone equipment. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1This is a flowchart illustrating the drone device perception method provided in an embodiment of this application; Figure 2 A schematic block diagram of the UAV equipment sensing device provided in the embodiments of this application; Figure 3 This is a schematic diagram of the structure of the unmanned aerial vehicle (UAV) device provided in an embodiment of this application. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. All other embodiments obtained by those skilled in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.

[0021] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0022] It should be understood that in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance. The terms "comprising," "including," "having," and their variations all mean "including but not limited to," unless otherwise specifically emphasized.

[0023] Furthermore, the technical solutions of the various embodiments can be combined with each other, but only if they are based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such combination of technical solutions does not exist and is not within the scope of protection claimed in this application.

[0024] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.

[0025] Please see Figure 1 , Figure 1 This is a flowchart illustrating the drone device perception method provided in an embodiment of this application, which can be applied to drone devices.

[0026] like Figure 1 As shown, the drone device perception method provided in this application includes the following steps, which are detailed below: S101, a listening thread and an inference thread are established in the perception program of the drone equipment. During the flight of the drone equipment, the timestamp of the configuration file and the update instruction of the configuration file are obtained through the listening thread. Specifically, a listening thread and an inference thread are established in the perception program of the drone equipment. During the flight of the drone equipment, the listening thread obtains the timestamp of the configuration file and the update instructions for the configuration file, including: In the perception program of the UAV device, a listening thread and an inference thread are established. The perception program of the UAV device refers to the target detection software system running on the embedded computing platform of the UAV device. During the flight of the drone, a listening thread scans the timestamp of the configuration file at a fixed frequency and listens for update instructions for the configuration file issued by the ground station. The configuration file is stored in the storage medium of the airborne embedded computing platform.

[0027] S102, when the timestamp in the configuration file is inconsistent with the timestamp of the last record or when an update instruction is received, read the confidence threshold, intersection-over-union threshold and the file path of the expected detection model in the configuration file; S103, write the confidence threshold, intersection-over-union threshold and the file path of the expected detection model into the global configuration variables of shared memory; Specifically, the confidence threshold, intersection-over-union (IoU) threshold, and the file path of the desired detection model are written into global configuration variables in shared memory, including: Atomic operations are used to write the confidence threshold, intersection-over-union (IoU) threshold, and file path of the desired detection model into a global configuration variable in shared memory. An atomic operation is an operation that will not be interrupted by the thread scheduling mechanism during execution.

[0028] Specifically, the confidence threshold, intersection-over-union (IoU) threshold, and the file path of the desired detection model are written into a global configuration variable in shared memory. This ensures that parameter updates and inference execution do not interfere with each other, while also ensuring that the parameters used in each frame are complete and consistent during processing, without being corrupted midway, and automatically taking effect in the next frame.

[0029] A confidence threshold is a score assigned to each predicted bounding box. This score represents the model's confidence that the predicted bounding box contains the target and that the class classification is correct. The confidence threshold is a preset threshold value used to determine which predicted bounding boxes are reliable and which should be discarded.

[0030] The Crossover Union (CUI) threshold is a threshold value used in non-maximum suppression (NMS) processing. CUI measures the degree of overlap between two predicted bounding boxes, and its calculation formula is: the intersection area of ​​the two predicted boxes divided by the union area of ​​the two predicted boxes. The value ranges from 0 to 1. The CUI threshold is a preset overlap threshold used to determine whether two predicted boxes target the same object.

[0031] S104, before each frame inference task starts, control the inference thread to read the confidence threshold, intersection-over-union threshold and the file path of the expected detection model from the global configuration variables of shared memory, and determine whether the file path of the expected detection model is consistent with the file path of the original detection model. In continuous processing scenarios of video streams, sensor data streams, or image sequences, input data is organized and transmitted in frames as the basic unit. Each frame contains complete spatial or spatiotemporal information. The inference thread performs target detection operations on each frame in sequence. The detection operation on a single frame constitutes an inference task.

[0032] Specifically, the control inference thread reads the confidence threshold, intersection-over-union (IoU) threshold, and expected detection model file path from global configuration variables in shared memory. This design replaces disk input / output and file parsing operations with memory-level access, compressing the reading time from milliseconds to nanoseconds.

[0033] S105, when the file path of the expected detection model is inconsistent with the file path of the original detection model, the current detection model is switched to the expected detection model based on the metadata, inference thread and predefined switching method of the expected detection model.

[0034] Specifically, when the file path of the desired detection model differs from that of the original detection model, the current detection model is switched to the desired detection model based on the metadata, inference thread, and predefined switching method of the desired detection model. This includes: When the file path of the expected detection model is different from the file path of the original detection model, the expected detection model is loaded into memory through the file path of the expected detection model, the memory address of the expected detection model is obtained, and it is checked whether the inference of the current frame has been completed. During the period between the completion of inference for the current frame and the input of image data for the next frame into the inference engine, the category mapping table and input size parameters of the expected detection model are read from the metadata of the expected detection model. From the input size parameters, the input height and input width of the expected detection model are obtained. The input height of the expected detection model is divided by the original image height to obtain the height scaling ratio, and the input width of the expected detection model is divided by the original image width to obtain the width scaling ratio. The minimum value between the width scaling ratio and the height scaling ratio is selected as the scaling ratio coefficient. The scaling ratio coefficient and the category mapping table of the expected detection model are written into the configuration parameters of the expected detection model. After the configuration parameters are executed, the memory address of the original detection model in the inference thread is updated to the memory address of the expected detection model. The current detection model is switched to the expected detection model using the memory address of the expected detection model.

[0035] During the period between the completion of inference for the current frame and the input of image data for the next frame into the inference engine, the inference thread enters an idle waiting state, and a new round of inference tasks is triggered immediately after the data for the next frame is ready.

[0036] The UAV device perception method further includes, after updating the memory address of the original detection model to the memory address of the expected detection model in the inference thread when the file path of the desired detection model is inconsistent with the file path of the original detection model: Obtain the resource release command and release the computing resources currently occupied by the detection model using the resource release command.

[0037] The UAV perception method, after obtaining the resource release command and releasing the computing resources currently occupied by the detection model using the resource release command, further includes: Obtain the successful switch command for the current detection model and send the successful switch command to the ground station.

[0038] Among them, the Ground Control Station (GCS) is the ground command and control terminal of the UAV system, which is essentially a software and hardware platform that integrates communication, monitoring and control functions.

[0039] A two-way communication link is established between the ground station and the UAV via a wireless data link. The uplink is used by the ground station to send flight control commands, mission planning parameters, and model switching commands to the UAV; the downlink is used by the UAV to transmit real-time status data, perceived images, and execution result confirmation information back to the ground station. Based on this architecture, after completing the model switch, the UAV sends a switch success command to the ground station, ensuring that ground operators can promptly receive the execution result of the model switch task.

[0040] Among them, the current detection model refers to the large perception model currently in operation by the drone equipment; Among them, the expectation detection model refers to the large perception model of the expected operation of the drone equipment.

[0041] Among them, the perception big model is a neural network model based on a deep learning architecture and trained on massive amounts of data. It has the ability to perform semantic understanding and structured parsing of multimodal inputs and can perform perception tasks including object detection, semantic segmentation, instance segmentation, pose estimation, and 3D reconstruction.

[0042] For example, the perception big model has the ability to detect objects, locate the position of objects in images or video frames, and identify the category of objects.

[0043] For ease of explanation, the following example is provided: For example, when drones perform inspection tasks during the day, the current detection model has high detection accuracy for targets under sufficient lighting conditions.

[0044] When the flight mission continues into dusk or night, the UAV equipment switches to infrared thermal imaging sensors to collect data. Since the current detection model performs poorly in infrared images, the operator issues a model switching command through the ground control center, calling the desired detection model. This desired detection model, trained on infrared image data, gains the ability to detect targets at night. After the system completes the model memory address update, the inference thread automatically switches to the desired detection model to perform inference from the next frame onwards. This allows for accurate detection of thermal targets in the infrared image, achieving a smooth transition between day and night missions.

[0045] The memory address of the expected detection model is the starting address of the storage space occupied by the expected detection model after it is loaded into memory; The memory address of the original detection model is the starting address of the storage space occupied by the original detection model after it is loaded into memory.

[0046] In this process, the memory address of the original detection model in the inference thread is updated to the memory address of the desired detection model. The memory address of the original detection model only involves overwriting the pointer variable value and does not involve copying, moving, or reloading the model weight data in memory or reloading the file. Therefore, the switching time is only in the microsecond range, which is much lower than the second-level time required by the traditional unloading and reloading method. As a result, the switching process of the desired detection model has no perceptible impact on the inference frame rate. The inference thread can continue to run without unloading the original model, restarting the inference service, or re-initializing the operating environment. Therefore, the UAV can remain hovering or fly continuously during tasks such as aerial patrol, target tracking, or autonomous obstacle avoidance without landing or interrupting the flight mission for model upgrades. This avoids flight control attitude reset, inertial navigation positioning drift, and detection mission interruption caused by program restart, ensuring the continuity and stability of the flight mission.

[0047] By introducing a scaling factor, input images with different resolutions and aspect ratios are uniformly scaled to the standard input size of the detection model. This ensures that image data from different camera models, different acquisition distances, or different flight altitudes have a consistent spatial representation before entering the detection model, eliminating feature distribution shifts introduced by differences in the original image size. This ensures that the desired detection model has the same response characteristics to data from different sources.

[0048] The beneficial effects of the embodiments of this application are as follows: Firstly, when the file path of the desired detection model is inconsistent with the file path of the original detection model, the current detection model is switched to the desired detection model based on the metadata, inference thread, and predefined switching method of the desired detection model. The switching process of the desired detection model is completed dynamically during program execution without restarting the inference service or reloading the entire application. When the UAV is performing target tracking tasks, it can maintain a hovering state or continue flying without landing or interrupting the flight mission for model upgrades. This avoids attitude reset, positioning drift, and mission interruption caused by restarting, thus ensuring the continuity and stability of the flight mission. Secondly, the operation process is greatly simplified by eliminating the need to manually modify startup parameters, recompile, or restart the service, and significantly shortens the switching time of the desired detection model, thereby improving the switching efficiency of the desired detection model during the flight of the drone equipment.

[0049] For the drone device perception method described in the above embodiments, please refer to [link / reference]. Figure 2 , Figure 2 This is a schematic block diagram of the UAV equipment sensing device provided in the embodiments of this application. Figure 2 The UAV sensing device 200 shown can be applied to, for example... Figure 1 The application scenario diagram shows a drone device. The following section uses a drone device as an example to illustrate this. Figure 2 The UAV equipment sensing device 200 shown will be described in detail. The UAV equipment sensing device 200 may include an acquisition module 201, a reading module 202, a writing module 203, a judgment module 204, and a switching module 205.

[0050] The acquisition module 201 is used to establish a listening thread and an inference thread in the perception program of the UAV device. During the flight of the UAV device, the listening thread is used to acquire the timestamp of the configuration file and the update instruction of the configuration file. The reading module 202 is used to read the confidence threshold, intersection-over-union threshold and file path of the expected detection model from the configuration file when the timestamp of the configuration file is inconsistent with the timestamp of the last record or when an update instruction is received. The writing module 203 is used to write the confidence threshold, intersection-over-union threshold, and file path of the expected detection model to the global configuration variables in shared memory; The judgment module 204 is used to control the inference thread to read the confidence threshold, intersection-over-union threshold and the file path of the expected detection model from the global configuration variables of shared memory before the inference task starts in each frame, and to determine whether the file path of the expected detection model is consistent with the file path of the original detection model. The switching module 205 is used to switch the current detection model to the desired detection model when the file path of the desired detection model is inconsistent with the file path of the original detection model, based on the metadata, inference thread and predefined switching method of the desired detection model.

[0051] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0052] The beneficial effects of the embodiments of this application are as follows: Firstly, when the file path of the desired detection model is inconsistent with the file path of the original detection model, the current detection model is switched to the desired detection model based on the metadata, inference thread, and predefined switching method of the desired detection model. The switching process of the desired detection model is completed dynamically during program execution without restarting the inference service or reloading the entire application. When the UAV is performing target tracking tasks, it can maintain a hovering state or continue flying without landing or interrupting the flight mission for model upgrades. This avoids attitude reset, positioning drift, and mission interruption caused by restarting, thus ensuring the continuity and stability of the flight mission. Secondly, the operation process is greatly simplified by eliminating the need to manually modify startup parameters, recompile, or restart the service, and significantly shortens the switching time of the desired detection model, thereby improving the switching efficiency of the desired detection model during the flight of the drone equipment.

[0053] Please see Figure 3 , Figure 3 This is a schematic diagram of the structure of the unmanned aerial vehicle (UAV) device provided in an embodiment of this application.

[0054] like Figure 3 As shown, Figure 3 The unmanned aerial vehicle (UAV) device includes: at least one processor 30, a memory 31, and a computer program 32 stored in the memory 31 and executable on the at least one processor 30, wherein the processor 30 executes the computer program 32 to implement the steps in any of the above-described method embodiments.

[0055] The drone device may include, but is not limited to, processor 30 and memory 31. Those skilled in the art will understand that... Figure 3 This is merely an example of a drone device and does not constitute a limitation on drone devices. It may include more or fewer components than shown in the illustration, or a combination of certain components, or different components, such as input / output devices, network access devices, etc.

[0056] The processor 30 is used to run a computer program 32 stored in the memory 31, and performs the following steps when executing the computer program 32: In the perception program of the drone device, a listening thread and an inference thread are established. During the flight of the drone device, the timestamp of the configuration file and the update instructions of the configuration file are obtained through the listening thread. When the timestamp in the configuration file is inconsistent with the timestamp of the last record or when an update instruction is received, read the confidence threshold, intersection-over-union threshold and the file path of the expected detection model from the configuration file. Write the confidence threshold, intersection-over-union (IoU) threshold, and the file path of the desired detection model into a global configuration variable in shared memory; Before each frame of the inference task starts, the control inference thread reads the confidence threshold, intersection-over-union threshold, and file path of the expected detection model from the global configuration variables in shared memory, and determines whether the file path of the expected detection model is consistent with the file path of the original detection model. When the file path of the desired detection model is inconsistent with the file path of the original detection model, the current detection model is switched to the desired detection model based on the metadata, inference thread, and predefined switching method of the desired detection model.

[0057] The processor 30 may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors, field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0058] In some embodiments, the memory 31 may be an internal storage unit of the drone device, such as a hard drive or memory of the drone device. In other embodiments, the memory 31 may also be an external storage device of the drone device, such as a plug-in hard drive, SmartMediaCard (SMC), SecureDigital (SD) card, or FlashCard equipped on the drone device.

[0059] Furthermore, the memory 31 may include both internal storage units and external storage devices of the UAV equipment. The memory 31 is used to store the operating system, applications, bootloader, data, and other programs, such as the program code of the computer program. The memory 31 can also be used to temporarily store data that has been output or will be output.

[0060] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.

[0061] This application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps described in the various method embodiments above.

[0062] The computer-readable storage medium may also be a sensing device of the UAV or an external storage device of the UAV, such as a plug-in hard drive, smart media card (SMC), secure digital (SD) card, flash card, or non-transitory computer-readable storage medium equipped on the UAV sensing device or UAV.

[0063] Since the computer program stored in the computer-readable storage medium can execute any of the UAV device perception methods supporting large-scale perception model switching provided in the embodiments of this application, the computer-readable storage medium can achieve the beneficial effects that any of the UAV device perception methods supporting large-scale perception model switching provided in the embodiments of this application can achieve, as detailed in the preceding embodiments, and will not be repeated here.

[0064] This application provides a computer program product that, when run on a drone device, causes the drone device to execute the aforementioned drone device perception method.

[0065] The computer program product, loaded onto the drone equipment, can perform the following steps: In the perception program of the drone device, a listening thread and an inference thread are established. During the flight of the drone device, the timestamp of the configuration file and the update instructions of the configuration file are obtained through the listening thread. When the timestamp in the configuration file is inconsistent with the timestamp of the last record or when an update instruction is received, read the confidence threshold, intersection-over-union threshold and the file path of the expected detection model from the configuration file. Write the confidence threshold, intersection-over-union (IoU) threshold, and the file path of the desired detection model into a global configuration variable in shared memory; Before each frame of the inference task starts, the control inference thread reads the confidence threshold, intersection-over-union threshold, and file path of the expected detection model from the global configuration variables in shared memory, and determines whether the file path of the expected detection model is consistent with the file path of the original detection model. When the file path of the desired detection model is inconsistent with the file path of the original detection model, the current detection model is switched to the desired detection model based on the metadata, inference thread, and predefined switching method of the desired detection model.

[0066] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.

[0067] Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium includes: an entity or device for carrying the computer program code to the UAV equipment, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium.

[0068] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0069] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A perception method for unmanned aerial vehicle (UAV) devices that supports large-scale perception model switching, characterized in that, The drone sensing method is applied to unmanned aerial vehicle (UAV) devices and includes: In the perception program of the drone device, a listening thread and an inference thread are established. During the flight of the drone device, the timestamp of the configuration file and the update instructions of the configuration file are obtained through the listening thread. When the timestamp in the configuration file is inconsistent with the timestamp of the last record or when an update instruction is received, read the confidence threshold, intersection-over-union threshold and the file path of the expected detection model from the configuration file. Write the confidence threshold, intersection-over-union (IoU) threshold, and the file path of the desired detection model into a global configuration variable in shared memory; Before each frame of the inference task starts, the control inference thread reads the confidence threshold, intersection-over-union threshold, and file path of the expected detection model from the global configuration variables in shared memory, and determines whether the file path of the expected detection model is consistent with the file path of the original detection model. When the file path of the desired detection model is inconsistent with the file path of the original detection model, the current detection model is switched to the desired detection model based on the metadata, inference thread, and predefined switching method of the desired detection model.

2. The UAV device sensing method according to claim 1, characterized in that, In the perception program of the drone device, a listening thread and an inference thread are established. During the flight of the drone device, the listening thread obtains the timestamp of the configuration file and the update instructions for the configuration file, including: In the perception program of the UAV device, a listening thread and an inference thread are established. The perception program of the UAV device refers to the target detection software system running on the embedded computing platform of the UAV device. During the flight of the drone, a listening thread scans the timestamp of the configuration file at a fixed frequency and listens for update instructions for the configuration file issued by the ground station. The configuration file is stored in the storage medium of the airborne embedded computing platform.

3. The UAV device sensing method according to claim 1, characterized in that, Write the confidence threshold, intersection-over-union (IoU) threshold, and the file path of the desired detection model into a global configuration variable in shared memory, including: Atomic operations are used to write the confidence threshold, intersection-over-union (IoU) threshold, and file path of the desired detection model into a global configuration variable in shared memory. An atomic operation is an operation that will not be interrupted by the thread scheduling mechanism during execution.

4. The UAV device sensing method according to claim 1, characterized in that, When the file path of the desired detection model differs from that of the original detection model, the current detection model is switched to the desired detection model based on the metadata, inference thread, and predefined switching method of the desired detection model. This includes: When the file path of the expected detection model is different from the file path of the original detection model, the expected detection model is loaded into memory through the file path of the expected detection model, the memory address of the expected detection model is obtained, and it is checked whether the inference of the current frame has been completed. During the period between the completion of inference for the current frame and the input of image data for the next frame into the inference engine, the category mapping table and input size parameters of the expected detection model are read from the metadata of the expected detection model. From the input size parameters, the input height and input width of the expected detection model are obtained. The input height of the expected detection model is divided by the original image height to obtain the height scaling ratio, and the input width of the expected detection model is divided by the original image width to obtain the width scaling ratio. The minimum value between the width scaling ratio and the height scaling ratio is selected as the scaling ratio coefficient. The scaling ratio coefficient and the category mapping table of the expected detection model are written into the configuration parameters of the expected detection model. After the configuration parameters are executed, the memory address of the original detection model in the inference thread is updated to the memory address of the expected detection model. The current detection model is switched to the expected detection model using the memory address of the expected detection model.

5. The UAV device sensing method according to claim 1, characterized in that, After updating the memory address of the original detection model to the memory address of the expected detection model in the inference thread when the file path of the desired detection model is inconsistent with the file path of the original detection model, the UAV device perception method further includes: Obtain the resource release command and release the computing resources currently occupied by the detection model using the resource release command.

6. The UAV device sensing method according to claim 1, characterized in that, After obtaining the resource release command and releasing the computing resources currently occupied by the detection model through the resource release command, the UAV device perception method further includes: Obtain the successful switch command for the current detection model and send the successful switch command to the ground station.

7. The UAV device sensing method according to claim 1, characterized in that, The current detection model refers to the large perception model currently in operation by the drone equipment; The expectation detection model refers to the large perception model of the expected operation of the drone equipment.

8. The UAV equipment sensing method according to claim 1, characterized in that, The memory address of the expected detection model is the starting address of the storage space occupied by the expected detection model after it is loaded into memory; The memory address of the original detection model is the starting address of the storage space occupied by the original detection model after it is loaded into memory.

9. A sensing device for unmanned aerial vehicles (UAVs) that supports large-scale sensing model switching, characterized in that, Applied to drone equipment, including: The acquisition module is used to establish a listening thread and an inference thread in the perception program of the drone device. During the flight of the drone device, the listening thread acquires the timestamp of the configuration file and the update instructions of the configuration file. The reading module is used to read the confidence threshold, intersection-over-union threshold, and file path of the expected detection model from the configuration file when the timestamp of the configuration file is inconsistent with the timestamp of the last record or when an update instruction is received. The write module is used to write the confidence threshold, intersection-over-union threshold, and file path of the desired detection model to a global configuration variable in shared memory; The judgment module is used to control the inference thread to read the confidence threshold, intersection-over-union threshold and the file path of the expected detection model from the global configuration variables in shared memory before the inference task starts in each frame, and to determine whether the file path of the expected detection model is consistent with the file path of the original detection model. The switching module is used to switch the current detection model to the desired detection model when the file path of the desired detection model is inconsistent with the file path of the original detection model, based on the metadata of the desired detection model, the inference thread, and a predefined switching method.

10. A drone device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the UAV device perception method as described in any one of claims 1 to 7.