An AUV docking control method and system based on large language model semantic supervision and hierarchical trust
By constructing a four-layer hierarchical control architecture and a hierarchical trust mechanism, combined with semantic supervision of a large language model and multi-level safety barriers, the docking failure problem caused by sensor degradation and ocean current interference in AUV docking control was solved, achieving docking control that balances high success rate and real-time performance.
Patent Information
- Application Number
- CN202610527071.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-21
- Publication Date
- 2026-07-10
AI Technical Summary
Existing AUV docking control methods suffer from control target mismatch when facing complex operating conditions such as sudden ocean currents, sensor signal degradation, or multiple interferences, leading to a decrease in docking success rate. Furthermore, Large Language Models (LLMs) have limitations in real-time performance and computational resources.
A control method based on semantic supervision and hierarchical trust based on large language models is adopted. By constructing a four-layer hierarchical control architecture, including a perception/estimation layer, a semantic state construction layer, an LLM semantic supervision decision layer, and a bottom continuous control layer, combined with a hierarchical trust mechanism and multi-level safety barriers, the LLM output is corrected to achieve stable guidance and precise control.
It improves the docking success rate to 95% in various challenging scenarios, has semantic layer decision-making capabilities, meets real-time control requirements, supports offline deployment, and adapts to new scenario expansion.
Smart Images

Figure CN122363323A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of autonomous control technology for underwater robots, specifically to an AUV docking control method and system based on semantic supervision and hierarchical trust using a large language model. It is particularly suitable for end-of-life docking control in scenarios with multiple uncertainties, such as sensor signal degradation, sudden ocean current interference, and non-cooperative target maneuvers. Background Technology
[0002] Autonomous recovery and docking of AUVs (Autonomous Underwater Vehicles) are key technologies for achieving long-term ambush, refueling, and data transmission. The docking process requires the AUV to accurately track dynamic targets (such as surface support vessels or mobile charging stations) and achieve centimeter-level attitude and position alignment at the end of its flight. Existing docking control methods are mainly divided into two categories: 1. Traditional control methods: These mainly employ PID control, line-of-sight (LOS) guidance, or model predictive control (MPC). These methods rely on precise mathematical models, and the parameter tuning process is complex. While MPC performs well in simple scenarios, it often suffers from control target mismatch when facing complex conditions such as abrupt ocean currents, severe sensor signal degradation, or multiple interferences due to a lack of high-level semantic understanding and online strategy adjustment capabilities. For example, it may excessively pursue angle alignment at long distances while neglecting forward thrust, or fail to adaptively switch control strategies when sensors are lost, leading to a significant drop in docking success rate (experiments show that pure MPC has a success rate of only 60% in abrupt ocean current scenarios and drops to 20% in scenarios with multiple interferences).
[0003] 2. Learning-based methods: In recent years, Deep Reinforcement Learning (DRL) and Large Language Models (LLM) have been introduced into this field. While LLM possesses powerful reasoning and generalization capabilities and can handle complex semantic instructions, directly applying it to AUV real-time control has three significant drawbacks: a) Poor real-time performance: The inference latency of LLM is usually on the order of seconds, which cannot meet the real-time requirements of AUV low-level control (which usually requires more than 10Hz).
[0004] b) Limited computing resources: The AUV's onboard embedded computing platform has limited computing power, making it difficult to support the online operation of models with a large number of parameters.
[0005] c) Output uncertainty: The output of LLM is random. If its decisions are directly injected into the underlying controller without constraints (such as directly setting the cost function weight of MPC), it may cause a serious deviation in the control objective and lead to docking failure. Summary of the Invention
[0006] The purpose of this invention is to overcome the shortcomings of the existing technology and to propose an AUV docking control method and system based on semantic supervision and hierarchical trust of a large language model.
[0007] In view of this, the present invention proposes an AUV docking control method based on semantic supervision and hierarchical trust of large language models, including: Step 1: Receive sensor data from the AUV in real time; Step 2: Construct a high-level semantic state descriptor based on the distance between the AUV and the docking station, angle error, target speed, sensor status, and historical trajectory within the sliding window; Step 3: Based on the high-level semantic state descriptor, generate a complete policy from the lightweight policy network obtained by the large language model or distillation, including control mode switching, controller selection, speed constraints, and control parameter adjustment suggestions; Step 4: Combining the hierarchical trust mechanism and multi-level safety barriers, the output of the large language model is corrected, and the correction results are applied to the underlying controller to achieve stable guidance and precise control during the AUV docking process.
[0008] As an improvement to the above method, step 1 further includes maintaining a validity flag for the target azimuth angle, retaining the last valid estimate during sensor loss, and recording the duration of the loss.
[0009] As an improvement to the above method, the high-level semantic state descriptor constructed in step 2 includes: Task Phase: The docking process is divided into five phases based on distance and angle errors: specifically, these include: cruise phase: distance greater than 15m; approach phase: distance 5~15m; align phase: distance 1~5m and angle error greater than the set value; dock phase: distance 1~5m and angle error less than the set value; terminal phase: distance less than 1m. Sensor reliability is determined based on the packet loss ratio of historical data within the sliding window and the timeout duration of the most recent valid azimuth angle: when the packet loss is less than 15% and the timeout is less than 3 seconds, it is considered good; when the packet loss is less than 50%, it is considered degraded or unreliable. Progress status: determined by the rate of change of the difference between the first and last distances of the sliding window: warming_up for the first 5 seconds; stalled when the rate of change is less than 0.02 m / s; slow or good when the rate of change is less than 0.1 m / s. Oscillation risk: determined by the number of sign flips of the pitch error within the sliding window: less than 3 times is low; 3-5 times is medium; more than 5 times is high. Target behavior: Determined based on a comprehensive maneuver score of changes in target speed and heading; End-point stability: Calculated only when the distance is less than 2m, and judged comprehensively based on the standard deviation of distance, standard deviation of angle and sensor reliability in the most recent 3 seconds; Risk level: Different levels are determined by combining sensor reliability, end-point stability, and progress status.
[0010] As an improvement to the above method, in step 3, the input of the large language model is prompt words, and the output is a complete strategy in JSON format; wherein, the prompt words include: The system role description clarifies that the large language model is an AUV docking supervisor rather than a direct controller. Physical state information, including precise values for distance, angle error, target velocity, and sensor status; Semantic state JSON, including the high-level semantic state descriptor constructed in step 2; The complete strategy includes: control mode, controller selection, speed limit, angular velocity limit, priority, and MPC cost function weight suggestions, and there are corresponding setting ranges for speed limit, angular velocity limit, and MPC cost function weight suggestions.
[0011] As an improvement to the above method, the MPC cost function includes two key weights: distance weights. And azimuth weight It is used to determine the controller's priority between shortening the distance and aligning the angle; it outputs two weight suggestions at each decision strategy update: position weight. correspond and azimuth weight correspond The two weights are injected into the cost function of MPC, replacing the fixed default weights; the cost function minimized by the MPC controller in each optimization step. for:
[0012] in Let k be the predicted distance at step k. Let be the azimuth error at step k. The predicted distance at step N, The azimuth error at step N is... This refers to the weight during the terminal phase.
[0013] As an improvement to the above method, decision guidance is embedded in the prompt words to prevent the large semantic model from making overly conservative decisions due to semantic understanding biases. The decision guidance includes: Rule 1: When the distance is greater than 15m and the sensor reliability is not unreliable, maintain the aggressive approach strategy, and prioritize the control mode as approach, the priority as distance, and the controller as mpc; Rule 2: The recover, hold, or fallback modes must not be used at long distances simply because the progress status is warming_up or slow; the distance of the long distance phase is greater than 15m. Rule 3: During the cruise phase, the speed limit shall not be less than 0.8 m / s, unless the sensor reliability is unreliable; Rule 4: Safety takes precedence over speed of progress during the terminal phase; Rule 5: The MPC controller is used by default.
[0014] As an improvement to the above method, the decision guidance introduces a state change threshold mechanism: the previous decision strategy is reused when the following conditions are met simultaneously: (1) The distance is in the long distance range, that is, the distance is greater than 15m; (2) The sensor reliability is good; (3) The progress status is good and there is no risk of oscillation; (4) The rate of change of distance is less than 8% and the change of angle is less than 5°; When the AUV enters a medium-to-close range or when the environment changes significantly, the latest decision-making strategy is obtained. The medium-to-close range is defined as a distance of no more than 15m.
[0015] As an improvement to the above method, the operating mode of step 3 includes: Rule-based mode: Suitable for scenarios without network connection or extremely sensitive to latency, it generates strategies based solely on distance segmentation and sensor status according to preset rules; API mode: Whenever the set time is reached, the LLM API is called, and the physical state and semantic state are input as structured prompt words. The large language model is required to output the complete strategy in JSON format. Policy Network Mode: Suitable for embedded offline deployment, using pre-trained lightweight policy network inference; Hybrid mode: Prioritize the LLM API, fall back to the policy network on failure, and fall back to the rules on further failure.
[0016] As an improvement to the above method, the layered trust mechanism in step 4 includes: (1) Long distance range: that is, the distance is greater than 15m, the weight suggestions of the large language model are completely blocked and the default value is adopted; if the sensor is reliable but the large language model suggests the recover, hold or fallback mode, it is corrected to the approach mode and the speed lower limit is not lower than 0.8m / s; (2) Mid-distance interval: that is, the distance is within the range of 5~15m, and the Q weight of the output of the large language model is judged and restricted. The maximum is 10; if If it is greater than 10, then Revised to ×10; (3) Near distance interval: When the distance is less than 5m, the Q weight suggestion of the large language model is adopted.
[0017] As an improvement to the above method, step 4, the multi-level safety barrier, modifies the complete strategy output by the large language model based on distance and sensor status, including: Long-distance guardrail: When the distance is greater than 15m, if the sensor is reliable, force the mode to approach, prioritize distance, and set the speed limit to 0.8m / s; change the recover or fallback mode to approach. For guardrails at medium to close range: when the distance is within 1 to 5 meters, if the sensor is reliable, the recover and fallback functions will be corrected to the align or dock stage; the speed limit will be dynamically set according to the angle error. Extremely close proximity guardrail: When the distance is less than or equal to 1m: the speed limit shall not exceed 0.30m / s; End-of-line protection: When the distance is less than 0.2m, it will force entry into the terminal stage Terminal Hold mode, with a speed limit of 0.15m / s and an angle accuracy requirement tightened to 1°.
[0018] On the other hand, this invention provides an AUV docking control system based on large language model semantic supervision and hierarchical trust, which adopts a four-layer hierarchical control architecture, including: The perception / estimation layer is used to receive sensor data from the AUV in real time. The semantic state construction layer is used to construct high-level semantic state descriptors based on the distance between the AUV and the docking station, angle error, target speed, sensor status, and historical trajectory within the sliding window. The LLM semantic supervision decision layer is used to generate a complete strategy from the large language model based on the high-level semantic state descriptor, including control mode switching, controller selection, speed constraints, and control parameter adjustment suggestions; and The bottom continuous control layer is used to combine a hierarchical trust mechanism and multi-level safety barriers to correct the output of the large language model, and apply the correction results to the bottom controller to achieve stable guidance and precise control during the AUV docking process.
[0019] As an improvement to the above system, when the LLM semantic supervision decision layer suggests switching the underlying controller, a soft transition mechanism using linear interpolation is adopted.
[0020] As an improvement to the above system, the update frequency of the LLM semantic supervision decision layer is much lower than that of the underlying controller. Between two policy updates, the underlying controller continues to run using the most recent policy parameters.
[0021] As an improvement to the above system, the LLM semantic supervision decision layer deploys a large language model and a lightweight policy network obtained by distillation; wherein the specific training of the lightweight policy network includes: The strategy and corresponding state information of the large language model output are modified by combining a hierarchical trust mechanism and multi-level security barriers and written into the distillation log file to form distillation samples. The modified strategy includes at least: controller selection, operating mode, priority, speed limit, angular velocity limit, risk level, position weight, and azimuth weight. The state information includes at least: current distance, azimuth error, target speed, sensor validity, and semantic state. A distance-adaptive weighted training method is adopted to assign different weights to samples in different distance intervals until the training requirements are met, resulting in a well-trained lightweight policy network.
[0022] As an improvement to the above system, the lightweight policy network is a fully connected policy network, which includes an input layer, a fully connected layer, a ReLU layer, a fully connected layer, a ReLU layer, a fully connected layer, a ReLU layer, and an output layer connected in sequence.
[0023] Compared with the prior art, the advantages of the present invention are: 1. Good robustness: In four challenging scenarios, the average success rate of the method of this invention is 95%, while that of pure MPC is 55%.
[0024] 2. Possesses semantic-level decision-making capabilities: It can utilize semantic state information to identify sensor degradation, target maneuvering, and propulsion stagnation, and adjust high-level strategies accordingly.
[0025] 3. Clear security boundaries: By using a layered trust mechanism and multi-level security barriers to constrain LLM outputs, the risk of high-level policies directly affecting low-level controls is reduced.
[0026] 4. Meets real-time control requirements: The LLM supervisor uses a low-frequency update strategy, while the underlying controller operates in a high-frequency closed-loop manner, with the two separated on a time scale.
[0027] 5. Capable of distillation and offline deployment: It can automatically record distillation samples and train a lightweight policy network, replacing the online API in a network-free environment.
[0028] 6. Easy to expand and deploy: Supports four operating modes: Rule, API, Policy, and Hybrid. New scenarios can be adapted by adjusting prompts or supplementing distillation data. Attached Figure Description
[0029] Figure 1 This is a schematic diagram of hierarchical control. Detailed Implementation
[0030] This invention proposes a novel LLM semantic supervision + hierarchical trust method: LLM does not directly control the underlying execution, but acts as a high-level semantic supervisor, outputting control strategy suggestions based on the constructed semantic state; at the same time, it introduces a distance-adaptive hierarchical trust mechanism and multi-level security barriers to ensure that the LLM's decision suggestions are adopted within a reasonable range, balancing intelligent decision-making with security and controllability.
[0031] This invention proposes a docking control method based on semantic supervision and hierarchical trust using a large language model for dynamic AUV docking tasks. The core innovation of this method lies in: (1) Construct a four-layer hierarchical control architecture: perception / estimation layer, semantic state construction layer, LLM semantic supervision decision layer, and bottom continuous control layer, where LLM is positioned as a strategy advisor rather than a direct controller; (2) Design a semantic state construction module to transform the original sensor data and historical trajectory information into high-level semantic descriptors (such as task stage, sensor reliability, progress status, oscillation risk, target behavior characteristics) for LLM to perform inference; (3) A distance-adaptive layered trust mechanism is proposed, which implements partition constraints on the weights (Q_pos / Q_yaw) of the MPC cost function proposed by LLM: the Q weight proposal of LLM is blocked in the long distance stage, the Q weight ratio is restricted in the medium distance stage, and the trust is fully implemented in the short distance stage, thereby preventing LLM from giving too high angle weights in the long distance, which would cause the propulsion to stagnate. (4) Design multi-level safety guardrails and correct the control mode, speed limit and angular velocity limit output by LLM by distance and sensor status perception to ensure system safety.
[0032] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and embodiments.
[0033] Example 1 This method achieves three core capabilities by constructing a four-layer architecture: high-level semantic supervision and decision-making, dynamic MPC parameter injection, and low-level precise execution. The specific steps are as follows: Step 1: Receive sensor data from the AUV in real time; Step 2: Construct a high-level semantic state descriptor based on the distance between the AUV and the docking station, angle error, target speed, sensor status, and historical trajectory within the sliding window; Step 3: Based on the high-level semantic state descriptor, generate a complete policy from the lightweight policy network obtained by the large language model or distillation, including control mode switching, controller selection, speed constraints, and control parameter adjustment suggestions; Step 4: Combining the hierarchical trust mechanism and multi-level safety barriers, the output of the large language model is corrected, and the correction results are applied to the underlying controller to achieve stable guidance and precise control during the AUV docking process.
[0034] The following is a detailed explanation.
[0035] I. Environment and Task Modeling a) Dynamic modeling A six-degree-of-freedom dynamic model of the AUV was established, focusing on the state variables in the horizontal plane, where (x, y) represents the position, ψ represents the heading angle, and u, v, and r represent the longitudinal velocity, lateral velocity, and yaw rate, respectively. A hydrodynamic model based on the SPARUS II AUV from the University of Girona, Spain, was adopted, considering added mass, drag, and Coriolis forces.
[0036] b) Target motion model A dynamic target motion model is constructed to simulate the random speed changes and steering maneuvers of the mother ship. The target cruises at a baseline speed, with random acceleration and steering disturbances superimposed to simulate uncoordinated maneuvers in a real-world scenario.
[0037] c) Sensor Model An acoustic sensor model is constructed, incorporating Gaussian white noise and random packet loss probability. Multiple degradation modes are supported: normal packet loss (5%~8% probability), persistent signal interruption (sensor_blackout, packet loss rate 30% lasting more than 5 seconds), and severe degradation (sensor_severe, packet loss rate 50% lasting more than 10 seconds), simulating various instabilities in real underwater acoustic channels.
[0038] d) Environmental disturbance model A current disturbance model is constructed to support constant background current, current_gust (randomly varying pulsed current), and current_surge (a strong lateral current of 0.8 m / s applied at a specific time). It also supports a multi-disturbance superposition mode (hard), simultaneously applying current_gust, sensor degradation, and target maneuvering.
[0039] Two- or four-layer hierarchical control architecture This invention designs a four-layer hierarchical control architecture, such as... Figure 1 As shown, from bottom to top, they are: The first layer—the bottom continuous control layer—contains a PID controller and an MPC controller. The PID controller uses a line-of-sight (LOS) algorithm to convert position error into the desired heading, suitable for long-range, rapid approach. The MPC controller, based on a simplified AUV dynamics model, solves for the optimal bow roll rate sequence within the roll time domain T. Its cost function consists of a distance cost (weighted) (default 1.0) and azimuth cost (weight) The two controllers (default 20.0) are weighted together—these two weights determine the priority allocation of the controller between tracking and alignment, and are key parameters affecting docking behavior. The two controllers are dynamically scheduled by the upper-level supervisor, and a linear interpolation soft transition (transition time of 1 second) is used during switching to avoid sudden thrust changes.
[0040] The second layer—the perception / estimation layer—receives sensor data in real time, maintains the validity flag of the target azimuth angle (sensor_valid), retains the last valid estimate during sensor loss, and records the duration of the loss for use by the upper layer.
[0041] The third layer—the semantic state construction layer—transforms raw numerical information such as distance, angle error, sensor status, and target velocity, combined with historical data within a sliding window (default 10 seconds), into a high-level semantic descriptor. This includes the following seven dimensions: (i) Mission phase: Based on distance and angle errors, the docking process is divided into five phases: cruise (>15m), approach (5~15m), align (1~5m with a large angle), dock (1~5m with a small angle), and terminal (<1m); (ii) Sensor reliability: Based on the packet loss ratio within the sliding window and the timeout duration of the most recent valid azimuth angle, it is determined as good (packet loss <15% and timeout <3 seconds), degraded (packet loss <50%), or unreliable; (iii) Progress status: determined by the rate of change of the distance difference between the beginning and end of the window, i.e., warming_up (first 5 seconds), stalled (rate of change <0.02m / s), slow (<0.1m / s), or good; (iv) Oscillation risk: determined as low (<3 times), medium (3~5 times), or high (>5 times) based on the number of sign flips of the pitch error within the window; (v) Target behavior: Determined as steady or maneuvering based on the combined maneuver score of changes in target speed and heading; (vi) Terminal stability: Calculated only when the distance is <2m, and judged as stable, watch or unstable based on the standard deviation of distance, standard deviation of angle and sensor reliability in the last 3 seconds. (vii) Risk level: low, medium, or high, determined by a combination of sensor reliability, end-point stability, and progress status.
[0042] The fourth layer—the LLM semantic supervision decision layer—generates a complete policy based on the output of the semantic state construction layer. This policy includes control mode, controller selection, speed limit, yaw rate limit, priority, and MPC cost function weight suggestions (Q_pos, Q_yaw). This layer supports four operating modes: (a) Rule Mode: This mode does not call the LLM API and generates a strategy based solely on distance segmentation and sensor status according to preset rules. It is suitable for scenarios without network connectivity or those extremely sensitive to latency. (b) API Mode: The LLM API (e.g., Qwen-3Max) is called every 0.5 to 1.0 seconds, inputting the physical and semantic states as structured prompts. The LLM is required to output the complete policy in JSON format. The output is then sent to the underlying layer after being validated by the security guardrail. (c) Policy Network Mode: Does not call the LLM API, uses pre-trained lightweight policy network (MLP) inference, suitable for embedded offline deployment; (d) Hybrid mode: Prioritizes the use of the LLM API, falls back to the policy network on failure, and falls back to the rules on further failure.
[0043] III. LLM Cue Word Design and Semantic Interaction This invention calls cloud-based large language models (such as Deepseek or Alibaba Cloud Qwen-Max) via an OpenAI-compatible HTTP API interface. Each call constructs a dialogue request containing system and user messages: the system message defines the LLM's role as a "high-level supervisor for AUV docking tasks, outputting only JSON"; the user message is the structured prompts described below. The request parameters are set to temperature=0.2 to reduce output randomness. The natural language text returned by the LLM is used by a JSON parser to extract a valid JSON object; if parsing fails (e.g., returning an invalid format or network timeout), the call is considered invalid, and the system automatically reverts to the rule-based pattern generation strategy to ensure uninterrupted control.
[0044] a) Prompt word structure The prompt consists of three parts: (1) System role description, which clarifies that the LLM is an AUV docking supervisor rather than a direct controller; (2) Physical status information, which includes precise values of distance, angle error, target speed, and sensor status; and (3) Semantic status JSON, which includes the above seven-dimensional semantic descriptors.
[0045] b) Output constraints The LLM output must be in strict JSON format, including phase_name, controller, mode, priority, risk_level, reason_tag, speed_limit, yaw_rate_limit, etc. and There are 10 fields in total. The speed_limit value ranges from [0.0, 1.2] m / s, and the yaw_rate_limit value ranges from [0.09, 0.52] rad / s. and [0.1, 50.0].
[0046] c) Decision-making guidance rules Embed the following proven decision guidance in the prompts to prevent LLMs from making overly conservative decisions due to semantic comprehension biases: Rule 1: When distance > 15m and sensor reliability is not unreliable, maintain an aggressive approach strategy, prioritizing mode=approach, priority=distance, and controller=mpc; Rule 2: Do not use recover / hold / fallback modes at long distances just because the progress status is warming_up or slow—these conservative modes should only be used for real sensor risks or end-point instability; Rule 3: For long-range operations, the speed_limit should not be less than 0.8 m / s, unless the sensor reliability is unreliable; Rule 4: End-stage security takes precedence over speed of progress; Rule 5: Unless there is a good reason (such as the computational advantage of PID in simple scenarios), use the MPC controller by default.
[0047] These guidance rules essentially encode engineering experience into natural language constraints, compensating for the lack of domain-specific control experience in LLMs. Experiments show that after removing these guidance rules, the recovery mode trigger rate of LLMs in the long-distance phase increased from <5% to approximately 35%, resulting in a significant increase in docking time.
[0048] d) Optimization of call frequency To reduce API call costs and network latency risks, this invention introduces a state change threshold mechanism: when the following conditions are met simultaneously, the strategy returned by the previous API is reused without initiating a new call: (i) The distance is in the long distance range (>D_far); (ii) The sensor reliability is good; (iii) The progress status is good and there is no risk of oscillation; (iv) Distance change rate less than 8% and angle change less than 5°. This mechanism can reduce the number of API calls by approximately 40% to 60% during long-range cruise without affecting policy quality. When the AUV enters medium to close range or the environment changes significantly, each policy update triggers a new API call to obtain the latest decision.
[0049] e) Strategy parsing and injection process The JSON policy returned by LLM is transformed into underlying control instructions through the following process: (i) Field extraction: Extract the fields controller, mode, priority, speed_limit, yaw_rate_limit, Q_pos, and Q_yaw from the JSON. Use default values for missing fields (controller defaults to mpc, speed_limit defaults to 1.2m / s).
[0050] (ii) Numerical pruning: speed_limit is pruned to [0, 1.2] m / s, yaw_rate_limit is pruned to [0, 0.52] rad / s, and Q_pos and Q_yaw are pruned to [0.1, 50.0]. If Q value parsing fails (e.g., LLM returns a non-numeric string), the field is set to null, and MPC uses the default weights.
[0051] (iii) Security Fence Modification: The strategy is modified to be distance-adaptive according to the layered trust mechanism and multi-level security fences described in Sections 5 and 6.
[0052] (iv) Distillation log: The revised final policy, together with the original semantic state, is written into the distillation log (JSONL format) to form a high-quality mapping pair of "semantic state → final policy" for use in subsequent policy network training.
[0053] (v) Execution: The controller field in the final strategy determines whether to use MPC or PID; speed_limit and yaw_rate_limit are passed to the underlying controller as constraint parameters; Q_pos and Q_yaw (if not empty) are injected into the MPC cost function to replace the default weights.
[0054] IV. Dynamic Q-weighted injection MPC cost function As mentioned earlier, the cost function of the MPC controller contains two key weights: distance weights. And azimuth weight These factors determine the controller's priority between reducing distance and aligning angle. In traditional methods, these two weights remain fixed throughout the docking process (by default). and It cannot dynamically adjust the control strategy according to real-time environmental changes.
[0055] One of the core innovations of this invention is the introduction of a dynamic Q-weight injection mechanism: allowing the LLM semantic supervisor to output two weight proposal values based on the current semantic state during each policy update, namely, the position weight (…). ,correspond ) and azimuth weight ( ,correspond This is then injected into the cost function of the MPC, replacing the fixed default weights. The MPC controller minimizes the following cost function in each optimization step:
[0056] in Let k be the predicted distance at step k. Let be the azimuth error at step k. The predicted distance at step N, The azimuth error at step N is... Weights for the terminal phase. When the LLM supervisor suggests... and When not empty, MPC uses the suggested value instead of the default weight. For example, in sensor degradation scenarios, LLM might suggest increasing the weight. (Distance-priority) is used to avoid invalid angle corrections due to unreliable angle information; however, during close-range precision alignment, LLM may increase... Alignment with emphasis on angle.
[0057] This dynamic Q-weight injection feature can be independently switched on and off via system configuration. When the feature is disabled, the LLM output... and If not adopted, MPC always runs with fixed default weights. In this case, LLM only affects the underlying behavior through high-level strategies such as control mode and speed limits. Ablation experiments show that dynamic Q-weight injection brings a 30-50 percentage point improvement in success rate in sensor degradation scenarios, verifying the effectiveness of this mechanism.
[0058] V. Distance-Adaptive Hierarchical Trust Mechanism Directly adopting the Q-weights recommended by LLM carries risks: experiments have shown that LLM tends to assign excessively high Q-weights in the long-range phase. Value (e.g.) , This causes the MPC cost function to overemphasize angle alignment while neglecting propulsion distance. The AUV begins repeatedly adjusting its angle at long distances without advancing, its propulsion speed approaches zero, and it ultimately times out and fails. In hard scenarios with multiple interferences, the unconstrained dynamic Q-weights result in a success rate of only 20%.
[0059] To address this, the present invention proposes a distance-adaptive hierarchical trust mechanism, dividing the docking process into three trust intervals: (1) Long distance interval ( ): Completely disable the Q-weight recommendation of LLM, and If set to None, MPC will run using its engineered default weights. Meanwhile, if the sensor is reliable but LLM recommends conservative modes such as recover / fallback / damp, the safety barrier will correct it to approach mode and ensure the lower speed limit is not lower than 0.8 m / s.
[0060] (2) Medium distance interval ( ): Allows LLM injection of Q weights, but with limitations The upper limit is 10. If the ratio recommended by LLM exceeds 10 (e.g. =40, =2), then will Revised to ×10 (i.e. 20) to prevent excessive angle weighting.
[0061] (3) Close-range interval ( ): Fully trust the Q-weight recommendations of the LLM (after cropping the range [0.1, 50.0]. At this stage, the AUV is close to the target, and precise angle alignment is indeed crucial.
[0062] The layered trust mechanism is remarkably effective: in hard scenarios with multiple interferences, the success rate increases from 20% to 80%; in sensor degradation scenarios, it maintains a 100% success rate with no performance regression.
[0063] VI. Multi-level safety railings In addition to the hierarchical trust mechanism, this invention also designs a multi-level safety barrier based on distance and sensor status to modify the complete strategy output by LLM: a) Long-distance guardrail ( When the sensor is reliable, the forced mode is approach, the priority is distance, and the speed lower limit is 0.8m / s; conservative modes such as recover / fallback are modified to approach.
[0064] b) Medium and close distance guardrails ( When the sensor is reliable, correct the recover / fallback to align (angle error > 8°) or dock (angle error ≤ 8°); dynamically set the speed limit according to the angle error (0.05~0.20m / s when the angle is large, 0.20~0.45m / s when the angle is small).
[0065] c) Extremely close proximity guardrail ( ): The speed limit is no more than 0.30 m / s.
[0066] d) End protection ( ): Forced entry into Terminal Hold mode, with a speed limit of 0.15m / s and angle accuracy requirements tightened to 1°.
[0067] VII. Controller Soft Switching and Real-time Deployment a) Controller soft switching When the LLM supervisor suggests switching the underlying controller (e.g., from PID to MPC), a soft transition mechanism using linear interpolation is employed. Within the transition duration T_blend (default 1.0 second), the actual thrust... ,in The thrust is increased linearly from 0 to 1 to avoid attitude disturbances caused by sudden changes in thrust.
[0068] b) Policy update frequency The LLM supervisor updates the policy at intervals of 0.5 to 1.0 seconds (far lower than the 10Hz frequency of the underlying controller). Between updates, the underlying controller continues to run using the most recent policy parameters. This frequency division design, which speeds up execution while slowing down decision-making, ensures that the second-level delay of the LLM does not affect the real-time performance of the control.
[0069] c) Distillation and Offline Deployment During API mode operation, the system automatically collects distillation training data (see Section 8 for details), enabling the system to be deployed offline without relying on the cloud API.
[0070] Example 2 Embodiment 2 of the present invention provides an AUV docking control system based on semantic supervision and hierarchical trust of a large language model. Based on the method of Embodiment 1, the system adopts a four-layer hierarchical control architecture, including: The perception / estimation layer is used to receive sensor data from the AUV in real time. The semantic state construction layer is used to construct high-level semantic state descriptors based on the distance between the AUV and the docking station, angle error, target speed, sensor status, and historical trajectory within the sliding window. The LLM semantic supervision decision layer is used to generate a complete strategy from the large language model based on the high-level semantic state descriptor, including control mode switching, controller selection, speed constraints, and control parameter adjustment suggestions; and The bottom continuous control layer is used to combine a hierarchical trust mechanism and multi-level safety barriers to correct the output of the large language model, and apply the correction results to the bottom controller to achieve stable guidance and precise control during the AUV docking process.
[0071] Online distillation and lightweight deployment: To balance the semantic decision-making capabilities of large language models with practical underwater deployment conditions, this invention further introduces a distillation training and lightweight deployment mechanism on top of online supervision via the LLM API. During API mode operation, distillation samples are automatically collected, and a lightweight policy network is trained offline. In the deployment phase, this policy network replaces the online API or works in conjunction with it, thus forming an implementation path of "online supervision, offline distillation, and lightweight deployment."
[0072] a) Distillation data acquisition In API+Dynamic Q mode, whenever the large language model outputs a high-level policy, the system first modifies the policy based on the hierarchical trust mechanism and security guardrail, and then writes the modified final policy and corresponding state information into the distillation log file to form a distillation sample.
[0073] The state information includes at least: current distance, azimuth error, target speed, sensor validity, and semantic state.
[0074] The final strategy includes at least: controller selection, mode, priority, speed limit, angular velocity limit, risk level, position weight Q_pos, and azimuth weight Q_yaw.
[0075] Therefore, the object of distillation in this invention is not the original output of the large language model, but the final executable strategy after being modified by the hierarchical trust mechanism and security guardrail.
[0076] b) Policy Network Structure This invention employs a lightweight, fully connected policy network as the distillation model. The policy network takes 12-dimensional features as input, including 4 physical state variables and 8 semantic encoding features; and outputs 17-dimensional control decision variables.
[0077] The policy network structure is as follows: Input layer (12-dimensional) → Fully connected layer (128-dimensional) → ReLU → Fully connected layer (128-dimensional) → ReLU → Fully connected layer (64-dimensional) → ReLU → Output layer (17-dimensional).
[0078] The output includes at least the controller selection, speed limit, angular velocity limit, Q_pos, Q_yaw, and classification results for mode, priority, and risk_level.
[0079] c) Distance-adaptive weighted training method Considering the large number of samples in the long-distance phase of the docking process, while the close-range and terminal phases have a greater impact on docking success or failure, this invention employs a distance-adaptive weighted training method, assigning different weights to samples in different distance intervals to improve the learning effect in critical phases. Specifically, for each distillation sample, the following total loss function is constructed:
[0080] Where d represents the docking distance corresponding to the current sample, and w(d) represents the distance adaptive weight function.
[0081]
[0082] Samples in the terminal stage are given a larger weight; samples in the near stage are given a medium weight; and samples in the far stage are given a basic weight.
[0083] Indicates the controller selection loss. Indicates speed limitation loss, Indicates angular velocity limitation loss, and These represent the position-weighted and azimuth-weighted losses, respectively. , and These represent the categorized losses based on operating mode, priority, and risk level, respectively. These are the weighting coefficients for the risk level loss term. This embodiment uses the Adam optimizer for training, with a learning rate of... . Use binary cross-entropy loss; and Mean squared error loss is used; , and Cross-entropy loss is used.
[0084] d) Deployment mode and rollback mechanism During the deployment phase, the system can load the trained policy network and run it in policy mode. The policy network receives 12-dimensional input features, outputs high-level control policy parameters, and transmits them to the lower-level controller after post-processing and security constraint procedures.
[0085] Example 3 A 6-DOF simulation experimental platform based on the dynamic parameters of a real AUV (SPARUS II) was constructed.
[0086] Five independent experiments were run under each of the six operating conditions (a total of 180 runs) to compare the seven control strategies. The LLM used in the example is Qwen3-Max.
[0087] Table 1 Comparison of Control Strategies Used in the Experiment
[0088] Table 2 Test conditions and interference environment settings
[0089] Successful docking criteria: terminal distance <0.1m, time limit 300 seconds.
[0090] Table 3 Success Rate Comparison (%)
[0091] Table 4 Average docking time (s)
[0092] The results show: (1) In difficult scenarios, the method of this invention (API+dynamic, including hierarchical trust mechanism) has a success rate of 100% in sudden ocean currents (MPC is only 60%), and also achieves 100% in scenarios with complete sensor darkness and severe degradation (MPC is 80% and 60% respectively), which proves the core value of LLM semantic supervision.
[0093] (2) Dynamic Q weights make a significant contribution in sensor degradation scenarios: Compared with API+fixed, API+dynamic improves the success rate by 30 percentage points (70% to 100%) in sensor_blackout and by 50 percentage points (50% to 100%) in sensor_severe.
[0094] (3) The layered trust mechanism has outstanding effect: In hard scenarios, the success rate of API+dynamic is only 20% without layered trust, but it increases to 80% after the introduction, and does not affect the performance of other scenarios.
[0095] (4) In simple scenarios (none, current_gust), the API+dynamic connection time (86s, 81s) is better than or close to MPC (119s, 73s), proving that LLM supervision does not introduce additional overhead in simple scenarios.
[0096] It is worth noting that in the embodiments of the above system, the modules included are divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional module are only for easy differentiation and are not used to limit the scope of protection of the present invention.
[0097] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to the embodiments, those skilled in the art should understand that modifications or equivalent substitutions to the technical solutions of the present invention do not depart from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. An AUV docking control method based on semantic supervision and hierarchical trust of large language models, comprising: Step 1: Receive sensor data from the AUV in real time; Step 2: Construct a high-level semantic state descriptor based on the distance between the AUV and the docking station, angle error, target speed, sensor status, and historical trajectory within the sliding window; Step 3: Based on the high-level semantic state descriptor, generate a complete policy from the lightweight policy network obtained by the large language model or distillation, including control mode switching, controller selection, speed constraints, and control parameter adjustment suggestions; Step 4: Combining the hierarchical trust mechanism and multi-level safety barriers, the output of the large language model is corrected, and the correction results are applied to the underlying controller to achieve stable guidance and precise control during the AUV docking process.
2. The AUV docking control method based on semantic supervision and hierarchical trust of a large language model according to claim 1, characterized in that, Step 1 also includes maintaining a validity flag for the target azimuth angle, retaining the last valid estimate during sensor loss, and recording the duration of the loss.
3. The AUV docking control method based on semantic supervision and hierarchical trust of a large language model according to claim 1, characterized in that, The high-level semantic state descriptor constructed in step 2 includes: Task Phase: The docking process is divided into five phases based on distance and angle errors: specifically, these include: cruise phase: distance greater than 15m; approach phase: distance 5~15m; align phase: distance 1~5m and angle error greater than the set value; dock phase: distance 1~5m and angle error less than the set value; terminal phase: distance less than 1m. Sensor reliability is determined based on the packet loss ratio of historical data within the sliding window and the timeout duration of the most recent valid azimuth angle: when the packet loss is less than 15% and the timeout is less than 3 seconds, it is considered good; when the packet loss is less than 50%, it is considered degraded or unreliable. Progress status: determined by the rate of change of the difference between the first and last distances of the sliding window: warming_up for the first 5 seconds; stalled when the rate of change is less than 0.02m / s; slow or good when the rate of change is less than 0.1m / s. Oscillation risk: determined by the number of sign flips of the pitch error within the sliding window: less than 3 times is low; 3-5 times is medium; more than 5 times is high. Target behavior: Determined based on a comprehensive maneuver score of changes in target speed and heading; End-point stability: Calculated only when the distance is less than 2m, and judged comprehensively based on the standard deviation of distance, standard deviation of angle and sensor reliability in the most recent 3 seconds; Risk level: Different levels are determined by combining sensor reliability, end-point stability, and progress status.
4. The AUV docking control method based on semantic supervision and hierarchical trust of a large language model according to claim 3, characterized in that, In step 3, the input to the large language model is prompt words, and the output is a complete strategy in JSON format; wherein, the prompt words include: The system role description clarifies that the large language model is an AUV docking supervisor rather than a direct controller. Physical state information, including precise values for distance, angle error, target velocity, and sensor status; Semantic state JSON, including the high-level semantic state descriptor constructed in step 2; The complete strategy includes: control mode, controller selection, speed limit, angular velocity limit, priority, and MPC cost function weight suggestions, and there are corresponding setting ranges for speed limit, angular velocity limit, and MPC cost function weight suggestions.
5. The AUV docking control method based on semantic supervision and hierarchical trust of a large language model according to claim 4, characterized in that, The MPC cost function includes two key weights: distance weights. And azimuth weight This is used to determine the priority of the controller between shortening the distance and aligning the angle; Each time the decision strategy is updated, two weight suggestions are output: position weight. correspond and azimuth weight correspond The two weights are then injected into the cost function of MPC, replacing the fixed default weights. The cost function minimized by the MPC controller in each optimization step for: in Let k be the predicted distance at step k. Let be the azimuth error at step k. The predicted distance at step N, The azimuth error at step N is... This refers to the weight during the terminal phase.
6. The AUV docking control method based on semantic supervision and hierarchical trust of a large language model according to claim 4, characterized in that, The prompts embed decision guidance to prevent the large semantic model from making overly conservative decisions due to semantic understanding biases. This decision guidance includes: Rule 1: When the distance is greater than 15m and the sensor reliability is not unreliable, maintain the aggressive approach strategy, and prioritize the control mode as approach, the priority as distance, and the controller as mpc; Rule 2: The recover, hold, or fallback modes must not be used at long distances simply because the progress status is warming_up or slow; the distance of the long distance phase is greater than 15m. Rule 3: During the cruise phase, the speed limit shall not be less than 0.8 m / s, unless the sensor reliability is unreliable; Rule 4: Safety takes precedence over speed of progress during the terminal phase; Rule 5: The MPC controller is used by default.
7. The AUV docking control method based on semantic supervision and hierarchical trust of a large language model according to claim 6, characterized in that, The decision guidance introduces a state change threshold mechanism: the previous decision strategy is reused when the following conditions are met simultaneously: (1) The distance is in the long distance range, that is, the distance is greater than 15m; (2) The sensor reliability is good; (3) The progress status is good and there is no risk of oscillation; (4) The rate of change of distance is less than 8% and the change of angle is less than 5°; When the AUV enters a medium-to-close range or when the environment changes significantly, the latest decision-making strategy is obtained. The medium-to-close range is defined as a distance of no more than 15m.
8. The AUV docking control method based on semantic supervision and hierarchical trust of a large language model according to claim 1, characterized in that, The operating modes of step 3 include: Rule-based mode: Suitable for scenarios without network connection or extremely sensitive to latency, it generates strategies based solely on distance segmentation and sensor status according to preset rules; API mode: Whenever the set time is reached, the LLM API is called, and the physical state and semantic state are input as structured prompt words. The large language model is required to output the complete strategy in JSON format. Policy Network Mode: Suitable for embedded offline deployment, using pre-trained lightweight policy network inference; Hybrid mode: Prioritize the LLM API, fall back to the policy network on failure, and fall back to the rules on further failure.
9. The AUV docking control method based on semantic supervision and hierarchical trust of a large language model according to claim 5, characterized in that, The layered trust mechanism in step 4 includes: (1) Long distance range: that is, the distance is greater than 15m, the weight suggestions of the large language model are completely blocked and the default value is adopted; if the sensor is reliable but the large language model suggests the recover, hold or fallback mode, it is corrected to the approach mode and the speed lower limit is not lower than 0.8m / s; (2) Mid-distance interval: that is, the distance is within the range of 5~15m, and the Q weight of the output of the large language model is judged and restricted. The maximum is 10; if If it is greater than 10, then Revised to ×10; (3) Near distance interval: When the distance is less than 5m, the Q weight suggestion of the large language model is adopted.
10. The AUV docking control method based on semantic supervision and hierarchical trust of a large language model according to claim 3, characterized in that, Step 4, the multi-level safety barrier, modifies the complete strategy output by the large language model based on distance and sensor status, including: Long-distance guardrail: When the distance is greater than 15m, if the sensor is reliable, force the mode to approach, prioritize distance, and set the speed limit to 0.8m / s; change the recover or fallback mode to approach. For guardrails at medium to close range: when the distance is within 1 to 5 meters, if the sensor is reliable, the recover and fallback functions will be corrected to the align or dock stage; the speed limit will be dynamically set according to the angle error. Extremely close proximity guardrail: When the distance is less than or equal to 1m: the speed limit shall not exceed 0.30m / s; End-of-line protection: When the distance is less than 0.2m, it will force entry into the terminal stage Terminal Hold mode, with a speed limit of 0.15m / s and an angle accuracy requirement tightened to 1°.
11. An AUV docking control system based on semantic supervision and hierarchical trust using a large language model, characterized in that, A four-layer hierarchical control architecture is adopted, including: The perception / estimation layer is used to receive sensor data from the AUV in real time. The semantic state construction layer is used to construct high-level semantic state descriptors based on the distance between the AUV and the docking station, angle error, target speed, sensor status, and historical trajectory within the sliding window. The LLM semantic supervision decision layer is used to generate a complete strategy from the large language model based on the high-level semantic state descriptor, including control mode switching, controller selection, speed constraints, and control parameter adjustment suggestions; and The bottom continuous control layer is used to combine a hierarchical trust mechanism and multi-level safety barriers to correct the output of the large language model, and apply the correction results to the bottom controller to achieve stable guidance and precise control during the AUV docking process.
12. The AUV docking control system based on large language model semantic supervision and hierarchical trust as described in claim 11, when the LLM semantic supervision decision layer suggests switching the underlying controller, a soft transition mechanism of linear interpolation is adopted.
13. In the AUV docking control system based on large language model semantic supervision and hierarchical trust as described in claim 12, the update strategy frequency of the LLM semantic supervision decision layer is much lower than the frequency of the underlying controller. Between two strategy updates, the underlying controller continues to run using the most recent strategy parameters.
14. The AUV docking control system based on large language model semantic supervision and hierarchical trust as described in claim 12, wherein a large language model and a lightweight policy network obtained by distillation are deployed in the LLM semantic supervision decision layer; The specific training of the lightweight policy network includes: The strategy and corresponding status information of the large language model output, which are obtained by combining a hierarchical trust mechanism and multi-level security barriers, are written into the distillation log file to form distillation samples. The revised strategy includes at least: controller selection, operating mode, priority, speed limit, angular velocity limit, risk level, position weight, and azimuth weight; the status information includes at least: current distance, azimuth error, target velocity, sensor validity, and semantic status. A distance-adaptive weighted training method is adopted to assign different weights to samples in different distance intervals until the training requirements are met, resulting in a well-trained lightweight policy network.
15. The AUV docking control system based on semantic supervision and hierarchical trust of a large language model according to claim 12, wherein the lightweight policy network is a fully connected policy network, comprising an input layer, a fully connected layer, a ReLU layer, a fully connected layer, a ReLU layer, a fully connected layer, a ReLU layer, and an output layer connected in sequence.