Cell-oriented complex environment gas leakage unmanned aerial vehicle inspection obstacle avoidance method and system

By combining a multi-source sensor array and an adaptive enhancement algorithm with a deep cyclic double-Q decision optimization model and a dynamic obstacle game avoidance decision algorithm, the challenges of gas leak detection and obstacle avoidance by UAVs in complex community environments were solved, achieving stable signal extraction and reasonable path planning.

CN123047622APending Publication Date: 2026-11-06GUANGDONG FORAN TECHNOLOGY CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611279536.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-21
Publication Date
2026-11-06

AI Technical Summary

Technical Problem

In complex residential environments, existing technologies cannot effectively solve the problems of weak signal extraction and obstacle avoidance when drones are detecting gas leaks, leading to missed detections, false alarms, and obstacle avoidance oscillations.

Method used

A multi-source sensor array is used for signal acquisition. The algorithm combines a weak leakage signal adaptive enhancement algorithm and a deep cyclic double-Q decision optimization model. The weak leakage feature spectral lines are extracted through spectrum recombination and phase compensation. A three-dimensional grid cost potential field is constructed using a dynamic obstacle game avoidance decision algorithm. The heading and speed are adjusted in real time to generate an obstacle avoidance cruise path.

Benefits of technology

The system can stably extract weak leakage characteristics under strong background fluctuations and dynamic obstacle environments, improve the accuracy of close-range positioning of leakage sources and the rationality of cruise paths, and solve the problems of missed detection, false alarms and obstacle avoidance oscillations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123047622A_ABST
    Figure CN123047622A_ABST
Patent Text Reader

Abstract

The application discloses a cell complex environment-oriented gas leakage unmanned aerial vehicle inspection obstacle avoidance method and system, relates to the technical field of gas leakage inspection obstacle avoidance, and comprises the following steps: collecting mixed echo signal and interference spectrum signal output by a multi-source sensing array, and extracting weak leakage characteristic spectrum lines through a weak leakage signal adaptive enhancement algorithm; outputting a heading angle correction amount and a speed adjustment amount through a deep cycle double-Q decision optimization model according to the fluctuation characteristics of the spectrum line time sequence; driving a dynamic obstacle game avoidance decision algorithm to construct a three-dimensional grid cost potential field, and solving an avoidance turning angle and a pitch angle in real time; performing space-time correlation aggregation by using a cell gas inspection space-time data intelligent analysis engine to generate a leakage source confidence distribution grid map; superimposing and fusing the confidence distribution grid map and the three-dimensional grid cost potential field to output an obstacle avoidance cruise path sequence; and converting the flight control command into a flight control instruction and applying the flight control instruction to a rudder surface and a rotor speed regulator. The application realizes deep coupling of leakage detection and obstacle avoidance decision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of gas leak inspection and obstacle avoidance technology, and in particular to a method and system for gas leak inspection and obstacle avoidance using drones in complex residential environments. Background Technology

[0002] In gas leak inspection scenarios, residential buildings are densely distributed, overhead cables are intertwined, vegetation is severely obstructing the view, and there are a large number of fixed obstacles such as air conditioner outdoor units, clothes racks, and solar water heaters, as well as dynamic mobile interference sources such as pets, children's toys, and drones. When drones perform gas leak detection tasks in low-altitude, low-speed flight, they need to extract weak leak signals from strong background noise and avoid sudden obstacles in real time in narrow passages and between buildings. This places a collaborative constraint on detection sensitivity and obstacle avoidance real-time performance.

[0003] Existing technologies typically employ a single gas chromatograph sensor or infrared absorption spectrometer mounted on a drone platform. This sensor collects gas concentration data and sets a fixed threshold to determine the leak point. Simultaneously, it relies on ultrasonic ranging or monocular vision combined with traditional artificial potential field methods to measure obstacle distances and plan detours. At the detection end, lock-in amplification or wavelet threshold denoising methods are often used to preprocess the sensor signal and extract amplitude changes. At the obstacle avoidance end, a repulsive force field is constructed based on the obstacle position in the current frame, and the heading is adjusted along the resultant force direction. The detection path and obstacle avoidance path are generated separately and independently, and then fused into the final flight trajectory through a weighted superposition method.

[0004] However, existing technologies have two main drawbacks: First, the fixed threshold judgment method cannot adapt to baseline drift and interference signal fluctuations caused by changes in wind speed, temperature, and humidity in a residential environment. This results in weak leakage events being frequently missed or falsely reported under strong background fluctuations. At the same time, the ability of phase-locked amplification and wavelet denoising to suppress non-stationary random interference is limited, making it difficult to maintain stable weak feature extraction performance during dynamic flight. Second, the traditional artificial potential field method relies solely on the current instantaneous obstacle position information for avoidance decisions. It lacks the memory and utilization of obstacle movement trends and past interaction experiences. When encountering suddenly appearing dynamic obstacles in dense buildings, it is prone to oscillations or getting trapped in local minima, making it unable to escape effectively. Furthermore, the independent generation of detection and obstacle avoidance paths and the subsequent weighted fusion method sever the dominant role of the spatial distribution of leakage concentration in path selection, causing UAVs to often deviate from the optimal approach direction due to obstacle avoidance constraints when they need to approach the leakage source. Summary of the Invention

[0005] In order to overcome the shortcomings and deficiencies of existing technologies, this invention provides a method and system for unmanned aerial vehicle (UAV) inspection and obstacle avoidance for gas leaks in complex residential environments.

[0006] The technical solution adopted in this invention is a method for drone inspection and obstacle avoidance for gas leaks in complex residential environments, comprising the following steps: S1, collecting radio frequency aliasing echo signals and laser interferometric spectrum signals output by the multi-source sensor array on the drone, and performing spectrum reconstruction and phase compensation through a weak leakage signal adaptive enhancement algorithm to extract weak leakage feature spectral lines; S2, based on the time series fluctuation characteristics of the weak leakage feature spectral lines, superimposing cyclic state feedback in the action value estimation through a deep cyclic double-Q decision optimization model, and outputting heading angle correction and speed adjustment; S3, based on the heading angle... The correction and speed adjustment quantities drive the dynamic obstacle avoidance decision-making algorithm to construct a three-dimensional grid cost potential field, and calculate the avoidance steering angle and pitch angle in real time; S4, the community gas inspection spatiotemporal data intelligent analysis engine performs spatiotemporal correlation aggregation on the leakage characteristic spectrum to generate a grid map of leakage source confidence distribution; S5, the leakage source confidence distribution grid map and the three-dimensional grid cost potential field are superimposed and fused, and the comprehensive cost value of each grid point is adjusted with dynamic weight coefficients to output the obstacle avoidance cruise path sequence; S6, the obstacle avoidance cruise path sequence is converted into flight control commands and applied to the control surfaces and rotor speed controller.

[0007] Furthermore, the expression for the weak leakage signal adaptive enhancement algorithm in S1 is: ; in, For a moment The amplitude of the enhanced instantaneous electric field output. For a moment The input is the original aliased echo electric field amplitude. Angular frequency Interference phase spectrum function at the location, The center angular frequency of the laser interferogram signal. With the center angular frequency and time interval The adaptive transfer function is the independent variable; through Construct amplitude estimates of weak leakage characteristic spectral lines ,in, The width of the sliding time window. For integration time variable, For a moment The output amplitude modulus, This is the phase compensation factor. This represents the rate of change of the phase compensation factor with respect to time.

[0008] Furthermore, the expression for the deep cyclic double-Q decision optimization model in S2 is: ; in, The target action value function, For a moment The state vector, For a moment The action vector is composed of the selected heading angle correction and speed adjustment. For state Next action Instant rewards received As a discount factor, This represents the number of state transition samples taken from the circular memory pool. For sample index, For the first The state vector of the next time step in each sample Candidate actions in the action space, To evaluate the action value function; based on Constructing a loop state feedback correction term ,in, For the time window of cyclic backtracking, For the backtracking step index, The maximum number of backtracking steps, For the first The decay weighting coefficient of the step. For a moment The loop-gated hidden state vector. For a moment The action vector to be executed For a moment The state vector outputs the heading angle correction and speed adjustment based on... and The gradient direction of the sum is determined.

[0009] Furthermore, the expression for the dynamic obstacle game avoidance decision-making algorithm in S3 is: ;

[0010] in, To calculate the avoidance steering angle in real time, To achieve real-time calculation of the pitch angle avoidance, The total number of grid cells occupied by dynamic obstacles detected in the 3D grid cost potential field. For obstacle grid indexing, For the first The three-dimensional spatial coordinate vector of each obstacle grid. For position The repulsive potential function derived from the grid substitution value is located at [location]. The first The horizontal, vertical, and triangular coordinates of each obstacle grid in a three-dimensional coordinate system. To prevent small constants with zero singular values ​​in the denominator, the turning angle is avoided. With avoidance pitch angle Constructing angular vectors .

[0011] Furthermore, the multi-source sensor array carried by the UAV includes a four-channel differential radio frequency receiving antenna array and a dual-wavelength laser transceiver probe group. The operating center frequency of the radio frequency receiving antenna array is set to 2.45 GHz, and the dual-wavelength laser transceiver probe group includes 1.65 micrometer band and 3.33 micrometer band. In the weak leakage signal adaptive enhancement algorithm, the window function for spectrum reconstruction adopts the Hanning window with a window length of 256 sampling points and a phase compensation cutoff frequency of 15 Hz. In the deep cyclic double-Q decision optimization model, the capacity of the cyclic memory pool is set to 2048 transition samples, the discount factor is 0.95, and the hidden state dimension of the cyclic gate unit is 64 dimensions. In the dynamic obstacle game avoidance decision algorithm, the grid size of the three-dimensional grid cost potential field is set to 0.2 meters, and the gain coefficient of the repulsive potential function is 2.5. In the community gas inspection spatiotemporal data intelligent analysis engine, the time window width for spatiotemporal correlation aggregation is 30 seconds, and the spatial neighborhood radius is 1.5 meters. During superposition and fusion, the dynamic weight coefficient is linearly adjusted with the distance between the UAV and the leakage source in the range of 0.3 to 0.7.

[0012] Further, S2 includes the following sub-steps: S21, acquiring the time series of weak leakage characteristic spectral lines, using the difference between the spectral line amplitude at the current moment and the spectral line amplitude at the previous moment as the input increment of the cyclic gating unit to drive the iterative update of the hidden state; S22, concatenating the iteratively updated hidden state with the current moment's state vector, inputting it into the dual-Q evaluation network to output two sets of action value estimates in parallel; S23, selecting the smaller value among the two sets of action value estimates as the conservative estimation benchmark, and then determining the optimal action index by summing the conservative estimation benchmark with the cyclic state feedback correction term; S24, retrieving the corresponding heading angle correction and speed adjustment amount from the action space based on the optimal action index and outputting them.

[0013] Further, S3 includes the following sub-steps: S31, read the potential function value of each grid point in the current three-dimensional grid cost potential field, and extract the set of grids whose potential function values ​​exceed the dynamic threshold as a potential threat grid group; S32, for each grid in the potential threat grid group, calculate its spatial azimuth and elevation angles relative to the current position of the UAV, and generate a threat direction distribution histogram; S33, locate the angle interval with the minimum cumulative threat intensity in the threat direction distribution histogram, and generate a preliminary avoidance angle based on the center direction of the angle interval; S34, perform a difference operation between the preliminary avoidance angle and the current body attitude angle, and output the avoidance turning angle and pitch angle after proportional adjustment.

[0014] Further, step S4 includes the following sub-steps: S41, marking the amplitude of the leakage characteristic spectral line on a three-dimensional spatial coordinate according to the sampling time to form a sparse leakage event point cloud with timestamps; S42, for each event point in the sparse leakage event point cloud, spreading the confidence contribution value from the point to the surrounding neighborhood, with the contribution value decreasing exponentially with the spatial Euclidean distance; S43, accumulating the confidence contribution values ​​from different event points at the same grid position, and performing a moving average processing on the accumulation result within a time window; S44, normalizing the accumulated confidence value after moving average processing onto the grid map, and outputting a grid map of the leakage source confidence distribution.

[0015] Further, S5 includes the following steps: S51, extracting grid points in the leakage source confidence distribution grid map where the confidence value is greater than a preset high confidence threshold, and marking them as high-priority inspection target points; S52, reading the basic obstacle avoidance cost value of each grid point in the three-dimensional grid cost potential field, and multiplying the basic obstacle avoidance cost value by a decay factor at the grid where the high-priority inspection target point is located; S53, taking the current UAV position as the starting point and the high-priority inspection target point as the ending point, using a dynamic weighting coefficient to weighted sum the decayed obstacle avoidance cost value and the confidence value to obtain the comprehensive cost value; S54, performing gradient descent search on the comprehensive cost value grid map to generate an obstacle avoidance cruise path sequence connecting the starting point and the ending point.

[0016] This system, designed for drone-based gas leak detection and obstacle avoidance in complex residential environments, comprises: a radio frequency laser aliasing signal acquisition unit, consisting of a four-channel differential radio frequency receiving antenna and a dual-wavelength laser transceiver probe, which acquires aliased echo signals and interferogram signals and outputs them to an adaptive spectral enhancement unit; an adaptive spectral enhancement unit, whose input is connected to the output of the radio frequency laser aliasing signal acquisition unit, internally encapsulates a weak leak signal adaptive enhancement algorithm, performs spectral reconstruction and phase compensation on the input signal, and outputs a weak leak characteristic spectral line to a dual-Q cyclic decision control unit; and a dual-Q cyclic decision control unit, whose inputs are connected to the outputs of the adaptive spectral enhancement unit and the aircraft attitude sensing module, internally encapsulates a deep cyclic dual-Q decision optimization model, and outputs a heading angle correction. The speed adjustment is fed to the dynamic potential field game avoidance unit; the dynamic potential field game avoidance unit, whose input is connected to the output of the dual-Q cycle decision control unit, internally encapsulates the dynamic obstacle game avoidance decision algorithm, calculates the avoidance steering angle and pitch angle in real time and feeds them to the spatiotemporal data fusion planning unit; the spatiotemporal data fusion planning unit, whose input is connected to the output of the adaptive spectral enhancement unit and the output of the dynamic potential field game avoidance unit, internally encapsulates the community gas inspection spatiotemporal data intelligent analysis engine, generates a leak source confidence distribution grid map and superimposes a three-dimensional grid cost potential field before outputting the obstacle avoidance cruise path sequence; the flight attitude servo execution unit, whose input is connected to the output of the spatiotemporal data fusion planning unit, includes a control surface driver and a rotor speed controller, which converts the obstacle avoidance cruise path sequence into control surface deflection commands and rotor speed commands and applies them to the corresponding actuators respectively.

[0017] Beneficial Effects: This invention proposes a method and system for UAV inspection and obstacle avoidance in complex residential environments involving gas leaks. Through the spectrum recombination and phase compensation mechanism in the weak leak signal adaptive enhancement algorithm, it continuously and stably extracts weak leak characteristic spectral lines even under strong background fluctuations. This solves the defects of fixed threshold judgment methods, which suffer from missed detections or false alarms due to baseline drift and interference fluctuations. Simultaneously, it utilizes the cyclic gating hidden state in the deep cyclic double-Q decision optimization model to remember and feedback historical obstacle avoidance interaction experience, overcoming the limitation of traditional artificial potential field methods that rely solely on the current instantaneous obstacle position information. This effectively suppresses avoidance oscillations and local minima caused by dynamic obstacles between dense buildings. Furthermore, by dynamically weighting and merging the leak source confidence distribution grid map with the three-dimensional grid cost potential field, the spatial distribution information of the leak concentration obtained from detection directly dominates the comprehensive cost calculation in obstacle avoidance path planning. This solves the defect in existing technologies where the detection path and obstacle avoidance path are generated independently and then spliced ​​together, thus severing the dominant role of leak information on the path. This improves the accuracy of leak source proximity positioning and the rationality of the cruise path while ensuring the safe flight of the UAV. Attached Figure Description

[0018] Figure 1 This is a flowchart illustrating the overall process of the method of the present invention. Figure 2 This is a flowchart of method step S2 of the present invention; Figure 3 This is a flowchart of method step S3 of the present invention; Figure 4 This is a flowchart of method step S4 of the present invention; Figure 5 This is a flowchart of step S5 of the method of the present invention; Figure 6 This is a visualization of the system interface of the present invention; Figure 7 This is a diagram showing the execution of the system backend code of the present invention. Detailed Implementation

[0019] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. The application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0020] like Figure 1 As shown, a method for UAV inspection and obstacle avoidance in complex residential environments involving gas leaks includes the following steps: S1, collecting radio frequency aliased echo signals and laser interferometric spectrum signals output from the multi-source sensor array on the UAV, and performing spectrum reconstruction and phase compensation through a weak leak signal adaptive enhancement algorithm to extract weak leak feature spectral lines; S2, based on the time series fluctuation characteristics of the weak leak feature spectral lines, a deep cyclic double-Q decision optimization model is used to superimpose cyclic state feedback in the action value estimation, outputting heading angle correction and speed adjustment; S3, based on the heading angle correction and speed adjustment... The algorithm adjusts the degree of deviation to drive the dynamic obstacle game-based avoidance decision-making algorithm to construct a three-dimensional grid cost potential field and calculates the avoidance steering angle and pitch angle in real time; S4, it uses the community gas inspection spatiotemporal data intelligent analysis engine to perform spatiotemporal correlation aggregation on the leakage characteristic spectrum and generate a grid map of the leakage source confidence distribution; S5, it superimposes and fuses the grid map of the leakage source confidence distribution with the three-dimensional grid cost potential field, adjusts the comprehensive cost value of each grid point with dynamic weight coefficients, and outputs the obstacle avoidance cruise path sequence; S6, it converts the obstacle avoidance cruise path sequence into flight control commands and applies them to the control surfaces and rotor speed controller.

[0021] The implementation of step S1 is as follows: The four-channel differential RF receiving antenna array and the dual-wavelength laser transceiver probe group mounted on the UAV are activated. The operating center frequency of the RF receiving antenna array is set to 2.45 GHz. The dual-wavelength laser transceiver probe group includes 1.65 μm and 3.33 μm bands. Simultaneously, RF aliasing echo signals and laser interferogram signals are acquired at a rate of 2000 sampling points per second. The acquired time-domain signals are input into a weak leakage signal adaptive enhancement algorithm. This algorithm first performs a spectrum reconstruction operation on the RF aliasing echo signal, using a window length of 25. The signal is segmented and windowed using a Hanning window with 6 sampling points, with a segment overlap rate of 50%. Then, phase compensation is performed on the reconstructed spectrum based on the phase information of the laser interferogram signal. The cutoff frequency for phase compensation is set to 15Hz. Low-frequency phase disturbances below 15Hz are filtered out, while high-frequency phase components above 15Hz are retained and used to reconstruct the spectral phase. After spectral reconstruction and phase compensation, spectral lines with amplitudes greater than 3 dB of the background noise floor are extracted from the processed spectrum as weak leakage characteristic spectral lines. These characteristic spectral lines are continuously output to the subsequent processing module at a data rate of one set per second.

[0022] The implementation of step S2 is as follows: The weak leakage feature spectral lines output from S1 are arranged in chronological order to form a time series. The difference between the spectral line amplitude at the current moment and the spectral line amplitude at the previous moment is calculated as the input increment of the cyclic gating unit. The hidden state dimension of the cyclic gating unit is set to 64 dimensions. The input increment drives the hidden state to be iteratively updated according to the gating mechanism. The iteratively updated hidden state is concatenated with the current state vector in the feature dimension. The state vector includes data in six dimensions, including the current heading angle, pitch angle, flight speed, and three-dimensional spatial coordinates of the UAV. The concatenated feature vector has a dimension of 70 dimensions. This 70-dimensional feature vector is simultaneously input into two... Two evaluation networks with identical structures but different initial weights are used. Each network outputs a set of action value estimates. The action space includes 35 discrete combinations of heading angle corrections from -15 degrees to +15 degrees and speed adjustments from -0.5 meters to +0.5 meters. The smaller value between the two outputs is selected as a conservative estimation benchmark. The sum of this conservative estimation benchmark and the cyclic state feedback correction term is used to determine the optimal action index. The cyclic memory pool capacity is set to 2048 transfer samples, and the discount factor is set to 0.95. Based on the optimal action index, the corresponding heading angle correction and speed adjustment values ​​are retrieved from the action space and output.

[0023] Step S3 is implemented as follows: The potential function values ​​of each grid point in the current three-dimensional grid potential field are read. The range of the three-dimensional grid potential field is a spatial area centered on the current position of the UAV, 50 meters by 50 meters horizontally and 20 meters vertically. The grid size is set to 0.2 meters. The potential function values ​​are calculated from obstacle distance information jointly measured by the millimeter-wave radar and binocular vision camera mounted on the UAV. Grids with potential function values ​​exceeding a dynamic threshold are extracted as a potential threat grid group. The dynamic threshold is set to twice the average value of the potential function values ​​of all grids at the current moment. For each grid in the potential threat grid group, the center point of that grid relative to the current position of the UAV is calculated. The horizontal, vertical, and longitudinal axis deviations of the position are used to calculate the spatial azimuth and elevation angles based on these three axial deviation values. The azimuth and elevation angles of all threat grids are statistically analyzed in 5-degree intervals to generate a threat direction distribution histogram. The three consecutive intervals with the lowest cumulative threat intensity are located in the histogram, and the weighted average of the center directions of these three intervals is taken as the initial avoidance angle. The initial avoidance angle is differentially calculated with the current aircraft attitude angle. The difference result is multiplied by a proportional gain coefficient of 2.5 to generate the avoidance turning angle and pitch angle. The range of the avoidance turning angle is limited to ±30 degrees, and the range of the pitch angle is limited to ±15 degrees.

[0024] The implementation of step S4 is as follows: The weak leakage characteristic spectral lines output from S1 are marked on three-dimensional spatial coordinates according to the sampling time. The three-dimensional spatial coordinates are jointly provided by the UAV's onboard GPS and inertial measurement unit, with a positioning accuracy of ±0.1 meters in the horizontal direction and ±0.15 meters in the vertical direction. The marked data forms a sparse leakage event point cloud with timestamps. Each event point in the point cloud includes five dimensions of information: spatial horizontal axis coordinates, vertical axis coordinates, spectral line amplitude, and timestamp. For each event point in the sparse leakage event point cloud, a radius of 1.5 meters is drawn from that point outwards. The confidence contribution value of diffusion within the spherical neighborhood is calculated by multiplying the spectral amplitude of that point by an exponential decay factor of the spatial Euclidean distance. The decay constant of the exponential decay factor is 0.3 per meter. After receiving confidence contribution values ​​from different event points at the same grid location, these contribution values ​​are accumulated. After accumulation, the accumulated results for each grid location within a time window of 30 seconds are processed by moving average, with a step size of 5 seconds. The accumulated confidence value after moving average is linearly mapped to an integer grayscale range of 0 to 255. Finally, the leakage source confidence distribution raster map is output in the form of a grayscale image.

[0025] Step S5 is implemented as follows: Traverse all grid points in the leakage source confidence distribution grid map output from S4, extract grid points with confidence grayscale values ​​greater than a preset high confidence threshold (set to a grayscale value of 200), and mark these high confidence grid points as high-priority inspection target points. Then, read the basic obstacle avoidance cost value of each grid point in the three-dimensional grid cost potential field from S3. For the grid position marked as a high-priority inspection target point, multiply the basic obstacle avoidance cost value at that position by a decay factor of 0.3. The significantly reduced cost value after decay makes the UAV more inclined to approach high-confidence areas. Using the current location of the UAV as the search starting point and the nearest high-priority inspection target point as the search ending point, the decayed obstacle avoidance cost value is... The value and confidence grayscale values ​​are weighted and summed. The dynamic weight coefficient is linearly adjusted according to the horizontal distance between the position of the maximum grayscale value in the confidence distribution grid of the current UAV and the leakage source. When the horizontal distance is greater than 10 meters, the obstacle avoidance weight coefficient is 0.7 and the confidence weight coefficient is 0.3. When the horizontal distance is less than 2 meters, the obstacle avoidance weight coefficient is 0.3 and the confidence weight coefficient is 0.7. The intermediate distance is calculated by linear interpolation. After weighted summation, the comprehensive cost value of each grid point is obtained. Gradient descent search is performed on the comprehensive cost value grid. The step size of gradient descent is 0.4 meters and the maximum number of iterations is limited to 500 steps. After the search converges, the obstacle avoidance cruise path sequence connecting the starting point and the ending point is output. The path sequence consists of a series of three-dimensional spatial coordinate points arranged in chronological order.

[0026] The implementation of step S6 is as follows: The target position coordinates to be reached at the current moment in the obstacle avoidance cruise path sequence output in S5 are compared with the current position coordinates of the UAV. The desired heading angle and desired pitch angle of the target position relative to the current position of the UAV are calculated. The difference between the desired heading angle and the current actual heading angle is calculated by a proportional-integral-derivative controller and converted into a control surface deflection command. The proportional coefficient is set to 1.2, the integral coefficient is set to 0.05, and the derivative coefficient is set to 0.01. The control surface deflection command is output to the rudder and elevator servo in the form of a pulse width modulation signal. The servo response time is 0.05 seconds, and the deflection angle range is -30 degrees to +30 degrees. The difference between the desired pitch angle and the current actual pitch angle is calculated by the proportional-integral-derivative controller and then converted into another control surface deflection command, which is output to the elevator. The difference between the desired flight speed and the current actual flight speed is calculated by the proportional controller and then converted into a rotor speed control command with a proportional coefficient of 0.8. The rotor speed control command is output to the electronic speed controllers of the four rotors in the standard control signal format of the electronic speed controller. The electronic speed controller drives the brushless motor to adjust the speed. The motor speed adjustment range is 3,000 rpm to 10,000 rpm. All control commands are continuously output at an update rate of 50 times per second until the UAV reaches the end position of the obstacle avoidance cruise path sequence.

[0027] Preferably, the expression for the weak leakage signal adaptive enhancement algorithm in S1 is: ; in, For a moment The amplitude of the enhanced instantaneous electric field output. For a moment The input is the original aliased echo electric field amplitude. Angular frequency Interference phase spectrum function at the location, The center angular frequency of the laser interferogram signal. With the center angular frequency and time interval The adaptive transfer function is the independent variable; through Construct amplitude estimates of weak leakage characteristic spectral lines ,in, The width of the sliding time window. For integration time variable, For a moment The output amplitude modulus, This is the phase compensation factor. This represents the rate of change of the phase compensation factor with respect to time.

[0028] Specifically, the amplitude of the aliased echo electric field of the original input to the weak leakage signal adaptive enhancement algorithm is modulated in the time domain by strong background noise and flight platform vibration. To recover the true amplitude of the weak leakage signal, a phase correction factor related to the angular frequency is introduced. This correction factor is obtained by taking the partial derivative of the interference phase spectrum function with respect to the angular frequency and then taking the value at the center angular frequency. This partial derivative value reflects the sensitivity of the phase to changes with the angular frequency. The product of this sensitivity and the adaptive transfer function is integrated over the entire integration time variable range because the phase deviation of the leakage signal at different times has a cumulative effect. The integration operation can eliminate the instantaneous amplitude attenuation caused by random phase jitter. The independent variables of the adaptive transfer function are the center angular frequency and the time interval. The center angular frequency is determined by the main peak frequency of the laser interferogram signal. The frequency value corresponding to this main peak frequency in the 1.65-micron band is approximately 181 THz. The time interval is the value at the current sampling time. The difference between the current sampling time and the previous sampling time is 0.0005 seconds. The specific value of the adaptive transfer function is obtained by looking up the amplitude gain at the center angular frequency based on the pre-calibrated sensor response curve. The amplitude gain ranges from 0.8 to 1.2. Multiplying the input electric field amplitude by this integral result yields the enhanced instantaneous electric field amplitude. The amplitude estimate is constructed by multiplying the average value of the modulus integral over a sliding time window of the enhanced instantaneous electric field amplitude by the exponential term of the phase compensation factor with respect to time. The time window width is 0.1 seconds. The average value of the modulus integral reflects the average level of signal energy over a period of time. The exponential term of the phase compensation factor with respect to time characterizes the modulation effect of the phase change trend on the amplitude. This modulation effect is approximately exponentially increasing in the range of leakage characteristic frequencies below 15Hz. Through this formula, a stable amplitude estimate can be extracted from the enhanced signal containing residual noise as the input feature of the subsequent decision model.

[0029] Preferably, the expression for the deep cyclic double-Q decision optimization model in S2 is: ; in, The target action value function, For a moment The state vector, For a moment The action vector is composed of the selected heading angle correction and speed adjustment. For state Next action Instant rewards received As a discount factor, This represents the number of state transition samples taken from the circular memory pool. For sample index, For the first The state vector of the next time step in each sample Candidate actions in the action space, To evaluate the action value function; based on Constructing a loop state feedback correction term ,in, For the backtracking step index, The maximum number of backtracking steps, For the first The decay weighting coefficient of the step. For a moment The loop-gated hidden state vector. For a moment The action vector to be executed For a moment The state vector outputs the heading angle correction and speed adjustment based on... and The gradient direction of the sum is determined.

[0030] Specifically, the objective action value function of the deep recurrent double-Q decision optimization model considers both the immediate reward of the current action and the future cumulative discounted reward. However, directly using a single evaluation network can easily lead to overestimation bias. Therefore, two sets of evaluation networks are introduced for parallel computation, and the smaller value is taken as the benchmark for the objective value to suppress overestimation. In the formula, the immediate reward is jointly determined by the current state vector and the action vector. The state vector includes six continuous variables, including heading angle, pitch angle, flight speed, and three-dimensional spatial coordinates. The action vector is a two-dimensional discrete combination of heading angle correction and speed adjustment. Random sampling is performed from the recurrent memory pool, and 32 samples are drawn from the memory pool at each time step for batch computation. The state vector of each sample at the next time step is input. The evaluation network obtains the Q-values ​​corresponding to all candidate actions. The action with the largest Q-value is selected, and this Q-value is used to calculate the target value. The target value is related to the loop-gated hidden state. The formula for the loop state feedback correction term introduces a weighted cumulative integral of the partial derivative of the target value with respect to the hidden state at past time steps. The integration time window is 0.5 seconds, the backtracking step number is 4 steps, and the decay weight coefficient decreases exponentially by 0.7 as the number of steps increases. This integral accumulation term can feed back the decision gradient information from multiple past time steps to the current time step. The integration operation covers the continuous time domain, making the feedback signal smooth and continuous. The summation operation summarizes the gradients of multiple backtracking steps. The gradient direction of the corrected target value added to the original target value is used to determine the action selection strategy.

[0031] Preferably, the expression for the dynamic obstacle game avoidance decision algorithm in S3 is: ;

[0032] in, To calculate the avoidance steering angle in real time, To achieve real-time calculation of the pitch angle avoidance, The total number of grid cells occupied by dynamic obstacles detected in the 3D grid cost potential field. For obstacle grid indexing, For the first The three-dimensional spatial coordinate vector of each obstacle grid. For position The repulsive potential function derived from the grid substitution value is located at [location]. The first The horizontal, vertical, and triangular coordinates of each obstacle grid in a three-dimensional coordinate system. To prevent small constants with zero singular values ​​in the denominator, the turning angle is avoided. With avoidance pitch angle Constructing angular vectors .

[0033] Specifically, in the 3D grid cost potential field of the dynamic obstacle game avoidance decision algorithm, each obstacle grid generates a repulsive effect on the UAV. The direction and magnitude of this repulsive effect are determined by the spatial gradient of the repulsive potential function at that grid position. The specific value of the repulsive potential function is obtained by exponentially mapping the grid cost value. The mapping relationship ensures that for every 0.1 unit increase in the cost value, the value of the repulsive potential function increases to 1.5 times its original value. In order to integrate the total repulsive effect of all obstacles in 3D space and convert it into the UAV's avoidance steering angle and pitch angle, it is necessary to divide the sum of the gradient products of each obstacle grid in the horizontal and vertical directions by the sum of the gradient products in the vertical and ordinate directions. The horizontal, vertical, and ordinate axes correspond to the three orthogonal directions of the spatial rectangular coordinate system, respectively. The gradient product in the numerator reflects the obstacle The deflection torque generated by the coupling in the horizontal and vertical directions is reflected by the gradient product in the denominator. The arctangent function of the ratio of the torques in the two directions is used to obtain the comprehensive avoidance angle vector. The numerator and denominator are summed over all detected obstacle grids. The total number of obstacle grids detected at the current moment changes dynamically according to the millimeter-wave radar scanning results, and its value ranges from 10 to 200. To prevent the denominator value from being too small and causing calculation overflow, a small constant with a value of 0.001 is superimposed in the denominator. This formula compresses the distribution information of all obstacles in three-dimensional space into a two-dimensional angle vector through gradient product and product operation, so that the UAV can make a single and clear avoidance steering angle and pitch angle decision based on the global obstacle distribution.

[0034] Preferably, the multi-source sensor array carried by the UAV includes a four-channel differential radio frequency receiving antenna array and a dual-wavelength laser transceiver probe group, wherein the operating center frequency of the radio frequency receiving antenna array is set to 2.45 GHz, and the dual-wavelength laser transceiver probe group includes a 1.65 micrometer band and a 3.33 micrometer band; in the weak leakage signal adaptive enhancement algorithm, the window function for spectrum reconstruction adopts a Hanning window with a window length of 256 sampling points and a phase compensation cutoff frequency of 15 Hz; in the deep cyclic double-Q decision optimization model, the capacity of the cyclic memory pool is set to 2048 transition samples, the discount factor is 0.95, and the hidden state dimension of the cyclic gate unit is 64 dimensions; in the dynamic obstacle game avoidance decision algorithm, the grid size of the three-dimensional grid cost potential field is set to 0.2 meters, and the gain coefficient of the repulsive potential function is 2.5; in the community gas inspection spatiotemporal data intelligent analysis engine, the time window width for spatiotemporal correlation aggregation is 30 seconds, and the spatial neighborhood radius is 1.5 meters; during superposition and fusion, the dynamic weight coefficient is linearly adjusted with the distance between the UAV and the leakage source within the range of 0.3 to 0.7.

[0035] Preferred, such as Figure 2 The S2 step includes the following sub-steps: S21, acquiring the time series of weak leakage characteristic spectral lines, using the difference between the spectral line amplitude at the current moment and the spectral line amplitude at the previous moment as the input increment of the cyclic gating unit to drive the iterative update of the hidden state; S22, concatenating the iteratively updated hidden state with the current moment's state vector, inputting it into the dual-Q evaluation network to output two sets of action value estimates in parallel; S23, selecting the smaller value among the two sets of action value estimates as the conservative estimation benchmark, and then determining the optimal action index by summing the conservative estimation benchmark with the cyclic state feedback correction term; S24, retrieving the corresponding heading angle correction and speed adjustment amount from the action space based on the optimal action index and outputting them.

[0036] Specifically, in S21, the time series of weak leakage feature spectral lines is acquired. This series is continuously input at a rate of one set of data per second. The difference between the spectral line amplitude at the current moment and the spectral line amplitude at the previous moment is calculated. The difference may be positive or negative. This difference is used as the input increment of the cyclic gating unit, driving the update gate and reset gate inside the unit to iteratively update the hidden state according to the gating mechanism. The hidden state has 64 dimensions. The update gate controls the proportion of the hidden state information from the previous moment that is retained to the current moment, and the reset gate controls the degree to which the current input increment rewrites the hidden state. The iteratively updated hidden state retains the historical spectral line fluctuation trend and integrates the current increment information. In S22, the iteratively updated 64-dimensional hidden state is concatenated with the current moment's state vector. The state vector includes real-time data in six dimensions: heading angle, pitch angle, flight speed, and three-dimensional spatial coordinates. After concatenation, a 70-dimensional feature vector is formed. This feature vector is simultaneously input into two fully connected evaluation networks with the same structure but different initial weights. Each network consists of three hidden layers with 128, 64, and 32 neurons respectively. Each network outputs a set of action value estimates, and the action space includes 25 discrete actions. In S23, the smaller value for each action from the two sets of action value estimates is selected to form a conservative estimation baseline vector. This baseline vector is added to the cyclic state feedback correction term to obtain the corrected comprehensive value vector. The feedback correction term is a weighted sum of gradient information from the past four time steps, with the weights decreasing exponentially by 0.7. The action index corresponding to the maximum value is selected from the corrected comprehensive value vector. In S24, the corresponding heading angle correction and speed adjustment values ​​are retrieved from a pre-generated action lookup table based on this action index. The heading angle correction is discretized in a step of 5 degrees within the range of -15 degrees to +15 degrees, and the speed adjustment is discretized in a step of 0.25 meters per second within the range of -0.5 meters per second to +0.5 meters per second. The retrieval results are output to the dynamic potential field game avoidance unit.

[0037] Preferred, such as Figure 3 The S3 step includes the following sub-steps: S31, read the potential function value of each grid point in the current three-dimensional grid cost potential field, and extract the grid set whose potential function value exceeds the dynamic threshold as the potential threat grid group; S32, for each grid in the potential threat grid group, calculate its spatial azimuth and elevation angles relative to the current position of the UAV, and generate a threat direction distribution histogram; S33, locate the angle interval with the minimum cumulative threat intensity in the threat direction distribution histogram, and generate a preliminary avoidance angle based on the center direction of the angle interval; S34, perform a difference operation between the preliminary avoidance angle and the current body attitude angle, and output the avoidance turning angle and pitch angle after proportional adjustment.

[0038] Specifically, in S31, the potential function values ​​of all grid points in the current 3D grid cost potential field are read. The potential field covers a spatial area of ​​50 meters by 50 meters horizontally and 20 meters vertically, with a total of 6.25 million grid points (250 x 250 x 100). A dynamic threshold is set to 2.2 times the average potential function value of all grid points at the current moment. All grid points are traversed to extract the set of grid points whose potential function values ​​exceed this threshold; this set is the potential threat grid group. In S32, for each grid in the potential threat grid group, the deviation values ​​of the three axes are obtained by subtracting the current 3D spatial coordinates of the UAV from the 3D spatial coordinates of the grid's center point. Based on the deviation values, the spatial azimuth and elevation angles of the grid relative to the UAV are calculated. The azimuth angle ranges from -180 degrees to +180 degrees, and the elevation angle ranges from... From -90 degrees to +90 degrees, the azimuth and elevation angles of all threat grids are statistically analyzed in two-dimensional intervals consisting of 5-degree azimuth and 5-degree elevation angles, generating a two-dimensional threat direction distribution histogram. In S33, the histogram searches for the consecutive 3x3 two-dimensional intervals with the lowest cumulative threat intensity. The center direction of these 9 intervals is taken and the initial avoidance angle is calculated by weighted averaging of the threat intensity of each interval. This angle includes azimuth and elevation components. In S34, the azimuth component of the initial avoidance angle is differentially calculated with the current aircraft yaw angle, and the elevation component is differentially calculated with the current aircraft pitch angle. The two differential values ​​are multiplied by a proportional gain coefficient of 2.5, and the product results are limited to a range of ±30 degrees as the avoidance turning angle and a range of ±15 degrees as the avoidance pitch angle, and then output.

[0039] Preferred, such as Figure 4 The S4 step includes the following sub-steps: S41, marking the amplitude of the leakage characteristic spectral line on a three-dimensional spatial coordinate according to the sampling time to form a sparse leakage event point cloud with timestamps; S42, for each event point in the sparse leakage event point cloud, spreading the confidence contribution value from the point to the surrounding neighborhood, with the contribution value decreasing exponentially with the spatial Euclidean distance; S43, accumulating the confidence contribution values ​​from different event points at the same grid position, and performing a moving average processing on the accumulation result within a time window; S44, normalizing the accumulated confidence value after moving average processing onto the grid map, and outputting a leakage source confidence distribution grid map.

[0040] Specifically, in S41, the amplitude of the leakage characteristic spectral line is bound to the corresponding three-dimensional spatial coordinates according to the sampling time. The three-dimensional spatial coordinates are jointly provided by the airborne global positioning system and the inertial measurement unit, with a horizontal positioning accuracy of ±0.1 meters and a vertical positioning accuracy of ±0.15 meters. After binding, each event point includes five fields: horizontal axis coordinate, vertical axis coordinate, spectral line amplitude, and timestamp. All event points constitute a sparse leakage event point cloud. In S42, for each event point in the point cloud, the confidence contribution value is diffused outward from the spatial coordinates of that point to a spherical neighborhood. The radius of the spherical neighborhood is fixed at 1.5 meters. The magnitude of the contribution value is equal to the spectral line amplitude of that event point multiplied by the negative exponent of the natural constant. The independent variable in the exponent is the spatial Euclidean constant. The distance is divided by the attenuation constant 0.3 meters, meaning that the contribution value decreases exponentially with increasing distance, and when the distance is zero, the contribution value is equal to the spectral amplitude itself; in S43, the confidence contribution values ​​from different event points at the same grid position are summed to obtain the original cumulative confidence of the grid position. Then, the original cumulative confidence of each grid position within a 30-second time window is processed by moving average, with a moving step size of 5 seconds, that is, the average value of the past 30 seconds is calculated every 5 seconds; in S44, the cumulative confidence value after moving average is normalized to the maximum and minimum values ​​within the entire grid map range. The normalized value is multiplied by 255 and the integer part is taken to obtain grayscale values ​​from 0 to 255. Finally, the leakage source confidence distribution grid map is output in grayscale image format.

[0041] Preferred, such as Figure 5 The S5 step includes the following steps: S51, extracting grid points in the confidence distribution grid map of the leakage source where the confidence value is greater than a preset high confidence threshold, and marking them as high-priority inspection target points; S52, reading the basic obstacle avoidance cost value of each grid point in the three-dimensional grid cost potential field, and multiplying the basic obstacle avoidance cost value by a decay factor at the grid where the high-priority inspection target point is located; S53, taking the current UAV position as the starting point and the high-priority inspection target point as the ending point, using a dynamic weighting coefficient to weighted sum the decayed obstacle avoidance cost value and the confidence value to obtain the comprehensive cost value; S54, performing gradient descent search on the comprehensive cost value grid map to generate an obstacle avoidance cruise path sequence connecting the starting point and the ending point.

[0042] Specifically, in S51, the grayscale values ​​of all grid points in the confidence distribution grid map of the leakage source are read, and grid points with grayscale values ​​greater than the preset high confidence threshold of 200 are extracted and marked as high-priority inspection target points. If no grid point with a grayscale value greater than 200 exists, the threshold is lowered to 150 and the grid points are extracted again. In S52, the basic obstacle avoidance cost value of each grid point in the three-dimensional grid cost potential field is read. This cost value is a floating-point number between 0 and 100. The larger the value, the higher the obstacle risk at that location. For the grid location marked as a high-priority inspection target point, the basic obstacle avoidance cost value at that location is multiplied by a decay factor of 0.3 to significantly reduce the obstacle avoidance cost in the high-confidence area. In S53, the current position of the UAV is used as the search starting point, and the high-priority inspection target point closest to the starting point is used as the search ending point. The distance between the starting point and the ending point is calculated. The Manhattan distance is used to dynamically calculate obstacle avoidance weight and confidence weight coefficients. When the Manhattan distance is greater than 10 meters, the obstacle avoidance weight is 0.7 and the confidence weight is 0.3. When the distance is less than 2 meters, the obstacle avoidance weight is 0.3 and the confidence weight is 0.7. The intermediate distance is determined by linear interpolation to determine the two weights. The attenuated obstacle avoidance cost of each grid point is multiplied by the obstacle avoidance weight and the confidence gray value is multiplied by the confidence weight, and then summed to obtain the comprehensive cost. In S54, gradient descent search is performed on the comprehensive cost value grid map with the starting point as the initial position. The gradient descent step size is 0.4 meters. In each iteration, the direction with the largest decrease in comprehensive cost value among the 26 directions in the neighborhood of the current point is selected to move one step. The maximum number of iteration steps is limited to 500 steps. If the destination is reached within 500 steps, the path sequence is output. Otherwise, the current optimal point is used as the destination to output the path sequence.

[0043] This system, designed for drone-based gas leak detection and obstacle avoidance in complex residential environments, comprises: a radio frequency laser aliasing signal acquisition unit, consisting of a four-channel differential radio frequency receiving antenna and a dual-wavelength laser transceiver probe, which acquires aliased echo signals and interferogram signals and outputs them to an adaptive spectral enhancement unit; an adaptive spectral enhancement unit, whose input is connected to the output of the radio frequency laser aliasing signal acquisition unit, internally encapsulates a weak leak signal adaptive enhancement algorithm, performs spectral reconstruction and phase compensation on the input signal, and outputs a weak leak characteristic spectral line to a dual-Q cyclic decision control unit; and a dual-Q cyclic decision control unit, whose inputs are connected to the outputs of the adaptive spectral enhancement unit and the aircraft attitude sensing module, internally encapsulates a deep cyclic dual-Q decision optimization model, and outputs a heading angle correction. The speed adjustment is fed to the dynamic potential field game avoidance unit; the dynamic potential field game avoidance unit, whose input is connected to the output of the dual-Q cycle decision control unit, internally encapsulates the dynamic obstacle game avoidance decision algorithm, calculates the avoidance steering angle and pitch angle in real time and feeds them to the spatiotemporal data fusion planning unit; the spatiotemporal data fusion planning unit, whose input is connected to the output of the adaptive spectral enhancement unit and the output of the dynamic potential field game avoidance unit, internally encapsulates the community gas inspection spatiotemporal data intelligent analysis engine, generates a leak source confidence distribution grid map and superimposes a three-dimensional grid cost potential field before outputting the obstacle avoidance cruise path sequence; the flight attitude servo execution unit, whose input is connected to the output of the spatiotemporal data fusion planning unit, includes a control surface driver and a rotor speed controller, which converts the obstacle avoidance cruise path sequence into control surface deflection commands and rotor speed commands and applies them to the corresponding actuators respectively.

[0044] This paper presents a method and system for UAV inspection and obstacle avoidance in complex residential environments to detect gas leaks. Firstly, an adaptive enhancement algorithm for weak leak signals is used to perform spectral reconstruction and phase compensation on multi-source aliased signals. This enables stable extraction of weak leak spectral lines against strong fluctuations caused by wind disturbances and temperature and humidity changes in the residential environment, significantly improving the detection probability of low-concentration leak events. Secondly, a deep cyclic double-Q decision optimization model utilizes cyclically gated hidden states to remember and provide feedback on past obstacle avoidance experiences. This allows the UAV to make continuous decisions based on historical interaction experience when encountering dynamic and sudden obstacles, effectively avoiding the oscillation of avoidance paths and local deadlock problems caused by relying solely on current instantaneous data in traditional methods. Thirdly, the three-dimensional grid cost potential field constructed by the dynamic obstacle game avoidance decision algorithm is superimposed and fused with the leak source confidence distribution grid map generated by the residential gas inspection spatiotemporal data intelligent analysis engine during the path planning stage. This allows the spatial distribution of the leak to directly participate in the dynamic weighted calculation of the comprehensive cost value, eliminating the mismatch bias caused by splicing the detection path and obstacle avoidance path after they are generated independently.

[0045] like Figure 6The image shows the operational status visualization monitoring interface of the UAV inspection and obstacle avoidance system for gas leaks in complex residential environments, as described in this invention. It displays the real-time progress of UAV inspection tasks, aircraft attitude parameters, leak detection results, obstacle avoidance potential field distribution, and the operational status of each functional unit. The top area of ​​the interface displays task overview information, including task name, task number, UAV number, takeoff time, flight duration, and inspection area range. It also simultaneously displays the current ambient temperature and the status of online maintenance personnel, supporting full-cycle visual management of the task. The left side of the middle section of the interface features the UAV real-time attitude monitoring module, intuitively displaying the real-time values ​​of roll angle, pitch angle, and yaw angle. This corresponds to the output data of the aircraft attitude sensing module in this invention, providing real-time status input for the dual-Q cycle decision control unit. The right side of the middle section displays an electronic map of the residential buildings, marking the gas pipeline route, leak hotspot locations, dynamic obstacle distribution, and planned obstacle avoidance routes. The map is overlaid with a heat map of leak source confidence, corresponding to the leak source confidence distribution raster map generated by the spatiotemporal data fusion planning unit of this invention, intuitively presenting the spatial distribution of high-confidence leak areas. The lower center of the interface features a 3D grid-based cost potential field visualization area. Color gradients represent the grid's cost value, showcasing the repulsive potential field distribution constructed by the dynamic obstacle avoidance game algorithm. This distinguishes between high-risk and low-risk spatial areas, assisting maintenance personnel in assessing the rationality of obstacle avoidance paths. The bottom area of ​​the interface displays the operational status of six functional units in modules, corresponding to the RF laser aliasing signal acquisition, adaptive spectral enhancement, dual-Q loop decision control, dynamic potential field game avoidance, spatiotemporal data fusion planning, and flight attitude servo execution modules. It simultaneously displays core parameter curves such as the amplitude of the four-channel differential RF antenna, the re-normalized waveform of the dual-wavelength laser interferometric spectrum, the heading angle correction, the avoidance steering angle, and the motor speed command. The right side simultaneously displays operational indicators such as remaining battery power, estimated range, response time, cumulative mileage, and highest leakage confidence level, enabling monitoring and control of the entire inspection and obstacle avoidance process, providing intuitive data support for on-site maintenance decisions.

[0046] like Figure 7The diagram shows the backend code engineering architecture and runtime interface of the UAV inspection and obstacle avoidance system for gas leaks in complex residential environments, as described in this invention. This system carries the full-process algorithm logic and business scheduling logic of the inspection and obstacle avoidance method described in this invention. The project adopts a layered software architecture design. The project root directory contains a source code directory, a project build configuration file, and a project startup script. The source code layer is divided into a controller layer, service layer, model layer, data access layer, and resource configuration directory according to functional responsibilities. Each layer module forms a one-to-one mapping relationship with the six functional units of the system of this invention. The controller layer includes a radio frequency laser acquisition and control class, exposing a full-process pipeline trigger interface to receive inspection task requests and raw data from multiple sources. This corresponds to the data access and task scheduling functions of the radio frequency laser aliasing signal acquisition unit in this invention. The service layer sequentially includes spectral enhancement service, dual-Q decision service, dynamic game avoidance service, spatiotemporal fusion planning service, and flight servo execution service. These encapsulate weak leakage signal adaptive enhancement algorithm, deep cyclic dual-Q decision optimization model, dynamic obstacle game avoidance decision algorithm, community gas inspection spatiotemporal data intelligent analysis engine, and control surface rotor control logic, respectively, fully covering all calculation and decision-making processes from S1 to S6 of this invention. The model layer defines standardized data structures such as leakage confidence grid, path sequence, and control output for structured data transfer between modules. The data access layer provides persistent storage capability for device status, and the resource directory stores system operating parameter configurations. The console at the bottom of the interface outputs the system startup and operation log, displaying the character encoding format and service initialization status, verifying the software implementation path of the method described in this invention; each service module forms a serial call link through dependency injection, which can automatically complete the entire process of signal enhancement, decision control, potential field construction, path fusion and control command output, realizing the automated and closed-loop operation of gas leak detection and obstacle avoidance decision-making, and providing software support for the engineering deployment of the system.

[0047] The adaptive enhancement algorithm of this invention replaces the fragile processing method of fixed threshold plus wavelet denoising with robust suppression of non-stationary interference, and solves the problems of missed detection and false alarm caused by baseline drift and random fluctuations. The dynamic response mode combining cyclic decision-making and game-theoretic avoidance replaces the passive obstacle avoidance method that generates a repulsive force field based solely on the current obstacle position. Combined with the direct modulation of the path cost value by the leakage confidence, the UAV can not only robustly avoid dynamic obstacles in dense building environments, but also always approach the high confidence area of ​​the leakage source, ultimately achieving synergistic optimization of safety and detection efficiency.

[0048] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "set," "install," "connect," "link," and "fix" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal communication between two components. Those skilled in the art will understand the specific meaning of the above terms in this invention based on the specific circumstances.

[0049] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various equivalent changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A method for unmanned aerial vehicle (UAV) inspection and obstacle avoidance for gas leaks in complex residential environments, characterized in that: Includes the following steps: S1: Collect the radio frequency aliasing echo signal and laser interferogram signal output by the multi-source sensor array carried by the UAV, and perform spectrum reconstruction and phase compensation through the weak leakage signal adaptive enhancement algorithm to extract the weak leakage feature spectral lines. S2, based on the time series fluctuation characteristics of the weak leakage characteristic spectrum, outputs the heading angle correction and speed adjustment by superimposing the cyclic state feedback in the action value estimation through the deep cyclic double-Q decision optimization model; S3, based on the heading angle correction and speed adjustment, drives the dynamic obstacle game avoidance decision algorithm to construct a three-dimensional grid cost potential field and calculate the avoidance steering angle and pitch angle in real time; S4 utilizes the community gas inspection spatiotemporal data intelligent analysis engine to perform spatiotemporal correlation aggregation of leakage characteristic spectral lines, generating a raster map of leakage source confidence distribution. S5 overlays and fuses the leak source confidence distribution grid map with the three-dimensional grid cost potential field, adjusts the comprehensive cost value of each grid point with dynamic weight coefficients, and outputs the obstacle avoidance cruise path sequence. S6 converts the obstacle avoidance cruise path sequence into flight control commands, which are then applied to the control surfaces and rotor speed controller.

2. The method for UAV inspection and obstacle avoidance for gas leaks in complex residential environments as described in claim 1, characterized in that, The expression for the weak leakage signal adaptive enhancement algorithm in S1 is: ; in, For a moment The amplitude of the enhanced instantaneous electric field output. For a moment The input is the original aliased echo electric field amplitude. Angular frequency Interference phase spectrum function at the location, The center angular frequency of the laser interferogram signal. With center angular frequency and time interval The adaptive transfer function is the independent variable; through Construct amplitude estimates of weak leakage characteristic spectral lines ,in, The width of the sliding time window. For integration time variable, For a moment The output amplitude modulus, This is the phase compensation factor. This represents the rate of change of the phase compensation factor with respect to time.

3. The method for UAV inspection and obstacle avoidance for gas leaks in complex residential environments as described in claim 1, characterized in that, The expression for the deep cyclic double-Q decision optimization model in S2 is: ; in, The target action value function, For a moment The state vector, For a moment The action vector is composed of the selected heading angle correction and speed adjustment. For state Next action Instant rewards received As a discount factor, This represents the number of state transition samples taken from the circular memory pool. For sample index, For the first The state vector of the next time step in each sample Candidate actions in the action space, To evaluate the action value function; based on Constructing a loop state feedback correction term ,in, For the backtracking step index, The maximum number of backtracking steps, For the first The decay weighting coefficient of the step. For a moment The loop-gated hidden state vector. For a moment The action vector to be executed For a moment The state vector outputs the heading angle correction and speed adjustment based on... and The gradient direction of the sum is determined.

4. The method for UAV inspection and obstacle avoidance for gas leaks in complex residential environments as described in claim 1, characterized in that, The expression for the dynamic obstacle game avoidance decision-making algorithm in S3 is as follows: ; in, To calculate the avoidance steering angle in real time, To achieve real-time calculation of the pitch angle avoidance, The total number of grid cells occupied by dynamic obstacles detected in the 3D grid cost potential field. For obstacle grid indexing, For the first The three-dimensional spatial coordinate vector of each obstacle grid. For position The repulsive potential function derived from the grid substitution value is located at [location]. The first The horizontal, vertical, and triangular coordinates of each obstacle grid in a three-dimensional coordinate system. To prevent small constants with zero singular values ​​in the denominator, the turning angle is avoided. With avoidance pitch angle Constructing angular vectors .

5. The method for UAV inspection and obstacle avoidance for gas leaks in complex residential environments as described in claim 1, characterized in that, The multi-source sensor array carried by the UAV includes a four-channel differential radio frequency receiving antenna array and a dual-wavelength laser transceiver probe group. The operating center frequency of the radio frequency receiving antenna array is set to 2.45 GHz, and the dual-wavelength laser transceiver probe group includes a 1.65 micrometer band and a 3.33 micrometer band. In the weak leakage signal adaptive enhancement algorithm, the window function for spectrum reconstruction adopts the Hanning window with a window length of 256 sampling points and a phase compensation cutoff frequency of 15 Hz. In the deep cyclic double-Q decision optimization model, the capacity of the cyclic memory pool is set to 2048 transition samples, the discount factor is 0.95, and the hidden state dimension of the cyclic gating unit is 64-dimensional. In the dynamic obstacle game avoidance decision algorithm, the grid size of the three-dimensional grid cost potential field is set to 0.2 meters, and the gain coefficient of the repulsive potential function is 2.

5. In the community gas inspection spatiotemporal data intelligent analysis engine, the time window width of spatiotemporal correlation aggregation is 30 seconds, and the spatial neighborhood radius is 1.5 meters. During superposition and fusion, the dynamic weight coefficient is linearly adjusted with the distance between the UAV and the leak source in the range of 0.3 to 0.

7.

6. The method for UAV inspection and obstacle avoidance for gas leaks in complex residential environments according to claim 1, characterized in that, S2 includes: The time series of weak leakage feature spectral lines is obtained, and the difference between the spectral line amplitude at the current moment and the spectral line amplitude at the previous moment is used as the input increment of the cyclic gating unit to drive the hidden state iterative update. The iteratively updated hidden state is concatenated with the current state vector and input into the dual-Q evaluation network to output two sets of action value estimates in parallel. The smaller value of the two sets of action value estimates is selected as the conservative estimation benchmark. The optimal action index is determined by the sum of the conservative estimation benchmark and the cyclic state feedback correction term. Based on the optimal action index, the corresponding heading angle correction and speed adjustment are retrieved from the action space and output.

7. The method for UAV inspection and obstacle avoidance for gas leaks in complex residential environments according to claim 1, characterized in that, S3 includes: Read the potential function value of each grid point in the current three-dimensional grid cost potential field, and extract the grid set whose potential function value exceeds the dynamic threshold as the potential threat grid group; for each grid in the potential threat grid group, calculate its spatial azimuth and elevation angle relative to the current position of the UAV, and generate a threat direction distribution histogram. Locate the angle interval with the minimum cumulative threat intensity in the threat direction distribution histogram, and generate a preliminary avoidance angle based on the center direction of this angle interval; perform a differential calculation between the preliminary avoidance angle and the current aircraft attitude angle, and output the avoidance turning angle and pitch angle after proportional adjustment.

8. The method for UAV inspection and obstacle avoidance for gas leaks in complex residential environments according to claim 1, characterized in that, S4 includes: The amplitudes of the leakage characteristic spectral lines are marked on three-dimensional spatial coordinates according to the sampling time to form a sparse leakage event point cloud with timestamps. For each event point in the sparse leakage event point cloud, the confidence contribution value is diffused outward from the point as the center to the surrounding neighborhood. The contribution value decays exponentially with the spatial Euclidean distance. The confidence contribution values ​​from different event points at the same grid position are accumulated, and the accumulated result is processed by a moving average within a time window. The accumulated confidence values ​​after moving average processing are normalized onto the raster graph, and the confidence distribution raster graph of the leakage source is output.

9. The method for UAV inspection and obstacle avoidance for gas leaks in complex residential environments according to claim 1, characterized in that, S5 includes: Extract grid points in the confidence distribution grid map of the leakage source where the confidence value is greater than the preset high confidence threshold, and mark them as high-priority inspection target points; Read the basic obstacle avoidance cost value of each grid point in the three-dimensional grid cost potential field, and multiply the basic obstacle avoidance cost value by the attenuation factor at the grid where the high-priority inspection target point is located. Starting from the current drone location and ending at the high-priority inspection target point, the comprehensive cost value is obtained by weighting the attenuated obstacle avoidance cost value with the confidence value using dynamic weighting coefficients. Gradient descent search is performed on the integrated cost grid to generate an obstacle avoidance cruise path sequence connecting the start and end points.

10. A drone-based inspection and obstacle avoidance system for gas leaks in complex residential environments, characterized in that: The system is applied to the drone inspection and obstacle avoidance method for gas leaks in complex residential environments as described in claim 1, comprising: The radio frequency laser aliasing signal acquisition unit consists of a four-channel differential radio frequency receiving antenna and a dual-wavelength laser transceiver probe. It acquires aliasing echo signals and interferogram signals and outputs them to the adaptive spectral enhancement unit. The adaptive spectral enhancement unit connects to the output of the radio frequency laser aliasing signal acquisition unit at its input end. It internally encapsulates a weak leakage signal adaptive enhancement algorithm. After performing spectral reconstruction and phase compensation on the input signal, it outputs a weak leakage characteristic spectral line to the dual-Q cyclic decision control unit. The dual-Q cyclic decision control unit has its inputs connected to the outputs of the adaptive spectral enhancement unit and the body attitude sensing module, respectively. It internally encapsulates a deep cyclic dual-Q decision optimization model and outputs the heading angle correction and speed adjustment to the dynamic potential field game avoidance unit. The dynamic potential field game avoidance unit connects to the output of the dual-Q loop decision control unit at its input end. It internally encapsulates a dynamic obstacle game avoidance decision algorithm, which calculates the avoidance steering angle and pitch angle in real time and feeds them to the spatiotemporal data fusion planning unit. The spatiotemporal data fusion planning unit connects to the output of the adaptive spectral enhancement unit and the output of the dynamic potential field game avoidance unit at its input end. Internally, it encapsulates a spatiotemporal data intelligent analysis engine for community gas inspection, generates a grid map of the confidence distribution of the leak source, and outputs an obstacle avoidance cruise path sequence after superimposing a three-dimensional grid cost potential field. The flight attitude servo actuator, whose input end is connected to the output end of the spatiotemporal data fusion planning unit, includes a control surface driver and a rotor speed controller. It converts the obstacle avoidance cruise path sequence into control surface deflection commands and rotor speed commands and applies them to the corresponding actuators.