A robot control method, device, apparatus and storage medium

By employing a robot control method that trains fixed encoder parameters offline and updates the decoder online, dynamic mutations are detected in real time and decoder parameters are adjusted. This solves the problems of heavy computational burden and weak generalization ability in existing technologies, and achieves low-latency, high-frequency control and stability and accuracy of dynamic prediction in robot systems.

CN122480948APending Publication Date: 2026-07-31INTELLIGENT BODY TECHNOLOGY (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
INTELLIGENT BODY TECHNOLOGY (BEIJING) CO LTD
Filing Date
2026-04-29
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing robot control methods suffer from heavy computational burden and weak generalization ability when faced with factors such as load changes, component wear and external disturbances. They are difficult to balance speed and stability, and are prone to decreased control accuracy and safety hazards, especially during sudden dynamic changes.

Method used

A robot control method is adopted that uses offline training with fixed encoder parameters and online updates only for the decoder. By extracting latent features from the encoder and combining them with the Bayesian update mechanism of the decoder, dynamic abrupt changes are detected in real time. When abrupt changes occur, the influence of historical data is reduced, the decoder parameters are dynamically adjusted, and the dynamic prediction results and their uncertainties are output.

Benefits of technology

It achieves the real-time requirements of robot systems under low-latency, high-frequency control, has strong generalization ability, can quickly adapt to new dynamic change scenarios, avoids interference from historical information, balances adaptation speed and system stability, and improves the robustness and interpretability of dynamic prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122480948A_ABST
    Figure CN122480948A_ABST
Patent Text Reader

Abstract

This disclosure provides a robot control method, apparatus, device, and storage medium to achieve effective online adaptive control of robot dynamics. The robot control method includes: training a dynamic model comprising an encoder and a decoder; fixing encoder parameters and saving initial decoder parameters after training; extracting latent features corresponding to the robot's current state data and control data using the encoder; updating the credibility of maintained historical state assumptions based on the robot's current real dynamic data, and detecting whether dynamic abrupt changes have occurred; updating decoder parameters based on latent features and abrupt change detection results; reducing the influence of historical data on the current update when abrupt changes are detected; outputting dynamic prediction results and their corresponding uncertainties based on the updated decoder parameters; and determining control commands and applying them to the robot based on the dynamic prediction results and uncertainties.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of robotics, and in particular to a robot control method, apparatus, device, and storage medium. Background Technology

[0002] When robots operate in real-world environments, their dynamic characteristics often change gradually or abruptly due to factors such as load variations, component wear, and external disturbances. If the control system cannot adapt to these changes in a timely manner, it will lead to a decrease in control accuracy and may even cause safety accidents.

[0003] Existing robot control methods typically suffer from problems such as heavy computational burden, weak generalization ability, and difficulty in balancing speed and stability. For example, full model retraining methods have poor real-time performance and cannot meet the requirements for low-latency control. Pre-training interpolation methods can only handle dynamic scenes that have been seen before and cannot cope with changing scenes that have not appeared in the training set. Summary of the Invention

[0004] This disclosure provides a robot control method, apparatus, device, and storage medium to achieve effective online adaptive control of robot dynamics.

[0005] In a first aspect, a robot control method is provided, comprising: training a dynamic model, the model including an encoder and a decoder; fixing the encoder parameters and saving the initial parameters of the decoder after training; extracting latent features corresponding to the robot's current state data and control data using the encoder; updating the credibility of each historical state hypothesis maintained based on the robot's current real dynamic data, and detecting whether a dynamic mutation has occurred based on the credibility, thereby obtaining a mutation detection result; updating the decoder parameters based on the latent features and the mutation detection result; wherein, when a mutation is detected, the influence of historical data on the current update is reduced; outputting a dynamic prediction result and its corresponding uncertainty based on the updated decoder parameters; and determining control commands and applying them to the robot based on the dynamic prediction result and the uncertainty.

[0006] In one implementation, training the dynamics model includes: encoding the robot's state data and control data using an encoder to determine latent features; calculating the predicted dynamics residual of the state at the next time step using the decoder based on the latent features, and determining the state prediction result based on the predicted dynamics residual and the prediction result of the nominal dynamics model; calculating a reconstruction loss based on the error between the state prediction result and the actual state, and calculating a KL divergence loss based on the difference between the distribution of the latent features and the prior distribution; determining a variational lower bound loss consisting of the sum of the reconstruction loss and the KL divergence loss; and jointly training the encoder and the decoder by minimizing the variational lower bound loss.

[0007] In one embodiment, the encoder is used to extract latent features corresponding to the robot's current state data and control data, including: extracting nonlinear dynamic features through a multilayer perceptron network in the encoder based on the robot's current state data and control data, and outputting the mean vector and variance vector of the latent features; the latent features are used to characterize the robot's current dynamic residual structure.

[0008] In one implementation, the credibility of each historical state hypothesis is updated based on the robot's current real dynamic data, and a dynamic mutation is detected based on the credibility to obtain a mutation detection result. This includes: generating candidate hypotheses without mutation and candidate hypotheses with mutation based on the currently maintained historical state hypotheses to obtain a candidate hypothesis set; determining the sum of the cumulative log-likelihood of the previous time step, the log-likelihood of the observed dynamic residual at the current time step, and the log-likelihood of the mutation prior for each candidate hypothesis in the candidate hypothesis set to obtain the current cumulative log-likelihood of each candidate hypothesis as the credibility; sorting the candidate hypotheses according to their corresponding credibility from largest to smallest, retaining the first preset number of candidate hypotheses, and determining that a dynamic mutation has occurred when a mutation candidate hypothesis is among the retained candidate hypotheses to obtain the mutation detection result.

[0009] In one implementation, updating the decoder parameters based on the latent features and the mutation detection result includes: determining a temperature coefficient γ based on the mutation detection result; if the mutation detection result indicates no mutation has occurred, γ = 1; if the mutation detection result indicates a mutation has occurred, γ = β², where β is a preset temperature parameter and 0 < β < 1; and using the inverse of the posterior covariance of γ with respect to the previous time step... Scaling is performed to obtain the modulated prior accuracy. According to the modulated prior accuracy Update the decoder parameters.

[0010] In one implementation, the decoder parameters include posterior covariance and posterior mean; the prior accuracy based on the modulation... The decoder parameters are updated, including based on the modulated prior accuracy. The posterior covariance at the current time is calculated using the following formula, taking into account the latent feature z and the observation noise variance σ² at the current time. : Based on the posterior covariance at the current time The modulated prior accuracy posterior mean of the previous time step and the dynamic residual at the current moment Calculate the posterior mean at the current time using the following formula. : ; wherein, the dynamic residual The difference between the new system state after implementing control inputs and the prediction result of the nominal dynamic model.

[0011] In one implementation, based on the updated decoder parameters, the output dynamic prediction result and its corresponding uncertainty are included, comprising: selecting the hypothesis with the highest confidence as the optimal hypothesis based on the confidence of each historical state hypothesis maintained; and obtaining the decoder posterior mean corresponding to the optimal hypothesis. With posterior covariance and the latent feature variance output by the encoder. Calculate the total uncertainty using the following formula. : ;in, The latent features at the current moment, Represents element-wise product. For structural uncertainty, Cognitive uncertainty; the posterior mean of the decoder based on the optimal hypothesis. With the latent features The predicted value of the dynamic residual is calculated according to the following formula. : Based on the predicted dynamic residual values The dynamic prediction results are determined by comparing them with the prediction results of the nominal dynamic model. Output the dynamic prediction results. and the corresponding total uncertainty .

[0012] In one implementation, determining a control command based on the dynamic prediction result and the uncertainty includes: obtaining the uncertainty. With preset modulation coefficients , ,in , The state cost matrix is ​​calculated according to the following formula. Element-wise modulation is performed to obtain the modulated state-cost matrix. : , Represents element-wise product; based on the modulated state cost matrix Based on the dynamic prediction results, an optimization objective for the optimal control problem is constructed. The optimization objective is to minimize the sum of the weighted cost of state tracking error and the weighted cost of energy consumption of control data within the finite prediction time domain. Within the physical constraints of the control data, the finite time domain optimal control problem is solved in a rolling manner to obtain the optimal control command at the current moment.

[0013] In one embodiment, both the encoder and the decoder employ a multilayer perceptron structure, wherein the activation function of the hidden layer in the multilayer perceptron structure includes an exponential linear unit (ELU); the input dimension of the encoder includes the state dimension and control dimension of the robot, and the output dimension of the decoder includes the state dimension of the robot; the number of network layers, the number of hidden layer nodes, and the latent feature dimension of the encoder and decoder are preset according to the state dimension and control dimension of the robot.

[0014] In one implementation, the hyperparameters preset when updating the historical state assumptions and when updating the decoder parameters include: an upper limit on the number of assumptions, a mutation prior probability, a temperature parameter, a decoder prior variance, and an observation noise variance; wherein the values ​​of each hyperparameter are preset according to the robot's dynamic characteristics and control cycle.

[0015] Secondly, a robot control device is provided, comprising:

[0016] The training module is used to train the dynamic model, which includes an encoder and a decoder; after training, the encoder parameters are fixed and the initial parameters of the decoder are saved. The feature extraction module is used to extract latent features corresponding to the current state data and control data of the robot using the encoder; The detection module is used to update the credibility of each historical state hypothesis maintained based on the robot's current real dynamic data, and detect whether a dynamic mutation has occurred based on the credibility, and obtain the mutation detection result. An update module is used to update the decoder parameters based on the latent features and the mutation detection results; wherein, when a mutation is detected, the influence of historical data on the current update is reduced; The output module is used to output the dynamic prediction results and their corresponding uncertainties based on the updated decoder parameters; The determination module is used to determine control commands and apply them to the robot based on the dynamic prediction results and the uncertainty.

[0017] Thirdly, an apparatus is provided, comprising a processor and a memory, wherein computer instructions are stored in the memory, and the processor is configured to execute the computer instructions to perform the steps of any of the robot control methods described above.

[0018] Fourthly, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, performs the steps of any of the robot control methods described above.

[0019] The robot control method disclosed herein firstly reduces the online computational burden by training offline and fixing encoder parameters, while only updating the decoder online in a lightweight manner, thus meeting the real-time requirements of robot systems for low-latency, high-frequency control. Secondly, by utilizing latent feature extraction and an online decoder update mechanism based on real dynamic data, the model can quickly adapt to novel dynamic mutation scenarios not present in the training set, exhibiting strong generalization ability. Furthermore, this disclosure independently detects dynamic mutations in real time and actively weakens the influence of historical data on the current decoder update when a mutation is detected, effectively distinguishing between gradual and abrupt changes. This avoids continuous interference from outdated historical information, achieving rapid adaptation after mutations and stable accumulation during stable phases, thereby balancing adaptation speed and system stability.

[0020] Furthermore, the embodiments of this disclosure dynamically detect dynamic mutations by maintaining the credibility of each historical state assumption, and obtain dynamic prediction results and their calibrated uncertainties accordingly. This avoids the problems of posterior inconsistency and unbounded growth of prediction variance caused by relying on outdated historical information after mutations, thereby improving the robustness and interpretability of the overall dynamic prediction.

[0021] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and are not intended to limit the technical solutions of this disclosure.

[0022] To make the above-mentioned objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0023] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings used in the embodiments will be briefly described below. These drawings are incorporated in and constitute a part of this specification. They illustrate embodiments conforming to this disclosure and, together with the specification, serve to explain the technical solutions of this disclosure. It should be understood that the following drawings only show some embodiments of this disclosure and should not be considered as limiting the scope. Those skilled in the art can obtain other related drawings based on these drawings without creative effort.

[0024] Figure 1 A flowchart of a robot control method provided in an exemplary embodiment of this disclosure is shown; Figure 2 This illustration shows an overall schematic diagram of robot control provided by an exemplary embodiment of the present disclosure; Figure 3 A schematic diagram of a robot control device 300 provided in an embodiment of this disclosure is shown; Figure 4A schematic diagram of the structure of a device 400 according to an embodiment of the present disclosure is shown. Detailed Implementation

[0025] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. The components of the embodiments of this disclosure described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this disclosure provided in the accompanying drawings is not intended to limit the scope of the claimed disclosure, but merely represents selected embodiments of this disclosure. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without inventive effort are within the scope of protection of this disclosure.

[0026] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0027] In this document, the term "and / or" merely describes a relationship, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Furthermore, the term "at least one" in this document means any combination of at least two of any one or more elements. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.

[0028] Furthermore, the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein.

[0029] Research has revealed that while adaptive control methods for robots exist in related technologies, they still suffer from problems such as heavy computational burden, weak generalization ability, and difficulty in balancing speed and stability. Furthermore, the research found that while Bayesian methods can quantify uncertainty, the reliance on outdated historical information during dynamical abrupt changes can easily lead to posterior inconsistencies and unbounded variance growth. Therefore, this disclosure improves upon the Bayesian method by proposing an online learning scheme that integrates change point detection. This scheme detects dynamical abrupt changes in real time and dynamically adjusts the weights of historical information, resetting the prior when a change occurs, thereby outputting calibrated uncertainty and accurate prediction results.

[0030] The methods of the embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.

[0031] like Figure 1 The diagram shown is a flowchart of a robot control method provided in an embodiment of this disclosure, including: S101: Train the dynamic model, which includes an encoder and a decoder; after training, fix the encoder parameters and save the initial parameters of the decoder.

[0032] During the offline training phase, a dynamic model containing an encoder and decoder is pre-built and trained. The encoder maps the robot's state and control inputs to a low-dimensional latent feature space, while the decoder predicts the dynamic residuals based on this latent feature space. After training, all encoder parameters are fixed so that they are no longer updated during online operation, thus reducing the online computational burden. Simultaneously, the decoder's initial parameters are saved as the starting point for online adaptive updates. By decoupling offline representation learning from online adaptive updates, it is ensured that only the lightweight decoder needs to be updated during the online phase, meeting the robot's real-time control requirements for low latency and high frequency.

[0033] In some embodiments, the training dataset for the offline training phase can consist of a state-control-next state triplet of the robot, collected by a nominal MPC controller to ensure the diversity and coverage of the dataset. For example, for an inverted pendulum platform, 100 trajectories are collected, each containing 500 time steps, totaling 50,000 samples, of which 80% are used for training and 20% for validation. For a drone platform, 9 minutes of expert flight data (sampling frequency 100Hz) are collected, totaling 54,000 samples, covering three fixed load conditions: 10g, 100g, and 200g. These are also divided into training and validation sets in an 80% and 20% ratio. The training set is used to optimize the network parameters of the encoder and decoder, enabling the model to learn the core rules of the mapping from state-control to the next state. The validation set does not participate in parameter updates; it is only used to monitor overfitting during training and evaluate the model's generalization ability. Training stops when the loss on the validation set no longer decreases for several consecutive rounds to determine the optimal model.

[0034] In one implementation, the dynamic model can be trained according to the following steps: S101a: The robot's state and control data are encoded by an encoder to determine latent features. Specifically, the mean and variance of the latent features can be output, that is, the latent features are represented in the form of mean and variance.

[0035] For example, the encoder receives the robot's current state. With control input After nonlinear mapping by a multilayer perceptron (MLP), latent features are output. The mean and variance vectors are obtained. By learning the structured latent feature space of robot dynamics, representation learning and online adaptation are decoupled. Latent features Instead of directly reconstructing the complete state, it focuses on capturing the nominal dynamic model. The uninterpretable dynamic residual structure provides a compact input representation for subsequent Bayesian online updates.

[0036] S101b: Based on the latent features, the predictive dynamic residual of the state at the next time step is calculated by the decoder, and the state prediction result is determined according to the predictive dynamic residual and the prediction result of the nominal dynamic model.

[0037] For example, the decoder receives latent features The predicted value of the output dynamic residual can be expressed mathematically as follows: ; in, Indicates the robot's state at the next moment. The predicted value; This indicates the current state of the robot; This represents the control input applied at the current moment; This is a nominal dynamics model used to predict the state at the next moment based on the current state and control input. This model is built on known physical laws, such as the rigid body dynamics equations of a robot. This is the initial parameter matrix for the decoder, used to linearly map latent features to dynamic residuals; The latent features at the current moment are represented by the encoder from the state-control pair. Extracted from [the data], it is used to characterize nonlinear factors such as unmodeled dynamics, load changes, and external disturbances that are not fully described by the nominal model.

[0038] The above decomposition method breaks down robot dynamics into two parts: a nominal physical model and a data-driven residual compensation term. The nominal physical model retains the interpretability of known physical laws, while the data-driven residual compensation term endows the model with the ability to learn complex nonlinear factors. Furthermore, the decoder is designed as a linear structure; after offline training, only this linear decoder needs to be adapted and updated during online control, thus effectively ensuring the system's real-time computational efficiency.

[0039] S101c: Calculate the reconstruction loss based on the error between the state prediction result and the true state, and calculate the Kullback-Leibler Divergence (KL divergence) loss based on the difference between the distribution of the latent features and the prior distribution. Determine the variational lower bound loss composed of the sum of the reconstruction loss and the KL divergence loss (the reconstruction loss is used to constrain the state prediction accuracy, and the KL divergence loss is used to regularize the latent feature space). By minimizing the variational lower bound loss, jointly train the encoder and the decoder.

[0040] For example, this step, by jointly optimizing the encoder and decoder, enables latent features to possess good distribution characteristics and predictive capabilities while compressing state and control data. Specifically, the training process uses a variational lower bound as the total loss function, which consists of two parts: reconstruction loss and KL divergence loss.

[0041] The reconstruction loss is used to constrain the prediction accuracy of latent features on dynamic residuals, and its mathematical form can be expressed as: ; in: The total number of training samples; For the first The actual next-time state collected from each sample; For the first The current state of each sample at the current moment; For the first Control inputs in each sample; This is a nominal dynamic model used to predict the state at the next moment based on the current state and control input; This is the initial parameter matrix for the decoder; For encoder from The latent feature vectors extracted from them; This represents the square of the vector magnitude, i.e., the sum of squares of the prediction errors.

[0042] The reconstruction loss essentially measures the deviation between the joint prediction result of the nominal model plus latent feature compensation and the true state. By minimizing this loss, the encoder can extract latent features that can effectively compensate for the deficiencies of the nominal model.

[0043] KL divergence loss is used to regularize the latent feature space, causing the latent feature distribution output by the encoder to approximate a preset prior distribution. Its mathematical form can be expressed as: ; in: The latent feature conditional distribution of the encoder output represents the conditional distribution of latent features in a given state. With control conditions Submersion characteristics The probability distribution; The pre-defined prior distribution of latent features is typically a standard Gaussian distribution. That is, a normal distribution with a mean of zero and a covariance of the identity matrix; The KL divergence operator measures the degree of difference between two probability distributions; the smaller the value, the closer the two distributions are. The purpose of KL divergence loss is to prevent "feature collapse" in the latent feature space (i.e., the latent features output by the encoder become overly dispersed or lose their structure), while keeping the latent feature distribution continuous and bounded, thereby improving the model's generalization ability in unseen scenarios.

[0044] The total loss function is defined as the weighted sum of the reconstruction loss and the KL divergence loss, and its mathematical form can be expressed as: ; in, This is a balancing coefficient used to adjust the relative importance between reconstruction accuracy and feature regularization. When the value is large, the model tends to make the latent feature distribution closer to the prior distribution; When the value is small, the model focuses more on improving the accuracy of state prediction.

[0045] The encoder and decoder are jointly trained by minimizing the total loss function described above. The principle behind this training method is that the reconstruction loss ensures that the latent features retain information useful for the dynamic prediction task, while the KL divergence loss constrains the structure of the latent feature space. The two work in balance, avoiding overfitting due to the model's pursuit of prediction accuracy and preventing excessive regularization that would result in a loss of expressive power.

[0046] After training, all encoder parameters are frozen and will not be updated during the online control phase; the decoder's initial parameters... This data is saved as the starting point for online Bayesian adaptation. This allows the online phase to only require lightweight updates to the linear decoder, significantly reducing the computational burden.

[0047] In one embodiment, the encoder and the decoder may adopt a multilayer perceptron structure, wherein the activation function of the hidden layer in the multilayer perceptron structure includes an exponential linear unit (ELU); the input dimension of the encoder includes the state dimension and control dimension of the robot, and the output dimension of the decoder includes the state dimension of the robot; the number of network layers, the number of hidden layer nodes, and the latent feature dimension of the encoder and decoder are preset according to the state dimension and control dimension of the robot.

[0048] This implementation, through a rationally designed network structure and activation function, balances the nonlinear representation capability of latent features with the computational efficiency of online adaptation. Specifically, both the encoder and decoder employ a multilayer perceptron structure, with the activation function of the hidden layers using an Exponential Linear Unit (ELU) to balance nonlinear representation capability with gradient propagation stability. The input dimension of the encoder is jointly determined by the robot's state dimension and control dimension, while the output dimension of the decoder is equal to the robot's state dimension. The number of network layers, the number of hidden layer nodes, and the latent feature dimension are preset differently based on the dynamic complexity of the robot platform.

[0049] For example, for an inverted pendulum platform, the state data can include the position and velocity of the cart, the angle and angular velocity of the pendulum (4 dimensions in total), and the control data includes the push force of the cart (1 dimension). Therefore, the encoder's input dimension is 5 dimensions. The encoder's hidden layer structure is designed, for example, [8, 16, 8], that is, the first layer expands the 5-dimensional input to 8 dimensions, the second layer further increases the dimension to 16 dimensions to extract richer nonlinear features, and the third layer reduces the dimension to 8 dimensions and outputs the mean and variance of the latent features. The latent feature dimension is set to 2 dimensions to compactly express the main patterns of the dynamic residuals. The decoder's output dimension is 4 dimensions, used to reconstruct the 4-dimensional state residual prediction for the next time step. This shallow, low-dimensional design fully fits the low degree-of-freedom characteristics of the inverted pendulum platform, while ensuring the lightweight requirements of online inference.

[0050] For the UAV platform, the state data can include 13 dimensions such as 3D position, 3D velocity, quaternion attitude angles (or Euler angles), and 3D angular velocity. The control input consists of thrust commands from the four motors, totaling 4 dimensions. Therefore, the encoder's input dimension is 17 dimensions. Considering the highly nonlinear and strongly coupled dynamics of UAVs, and the need to adapt to complex scenarios such as sudden changes in in-flight load, the encoder's hidden layer structure is expanded to [64, 128, 64], meaning the number of neurons in the three hidden layers are 64, 128, and 64 respectively, allowing for the extraction of high-dimensional features through a wider network capacity. The 64-dimensional features output from the last hidden layer are then linearly mapped to obtain 8-dimensional latent features, preserving more comprehensive dynamic residual information. The decoder's output dimension is 13 dimensions, corresponding to complete state residual prediction. This high-capacity, high-dimensional design ensures the representation accuracy and generalization ability of the UAV in non-stationary dynamic environments.

[0051] The above differentiated configurations demonstrate the adaptability of this embodiment to different robot platforms: by adjusting the network depth, hidden layer width, and latent feature dimensions, both the real-time performance of simple platforms and the representation accuracy requirements of complex platforms can be met. Furthermore, the encoder is frozen after offline training, and only the parameters of the shallow linear decoder need to be updated during the online phase, ensuring that the above network design does not impose an additional burden on real-time control. Experimental results show that the single-step inference latency of the inverted pendulum platform is less than 0.5ms, and the end-to-end total latency of the UAV platform is less than 15ms, both meeting the real-time control requirements of their respective platforms.

[0052] To better understand and implement the offline training scheme described above, specific hyperparameter configurations and network architecture examples are provided in the table. These configurations are not the only implementation methods, but rather optimal parameters obtained through extensive experimental optimization based on two typical platforms: the inverted pendulum and the drone. They can be used as a reference for deployment on other platforms.

[0053] As shown in Table 1 below, Table 1 lists the core hyperparameter configurations for the offline training phase, including optimizer type (Adam), learning rate (0.001), batch size (128 inverted pendulums / 256 UAVs), training epochs (50 inverted pendulums / 100 UAVs), and KL weights in the variational loss (all set to 0.1). These parameters were optimized through multiple iterations to ensure the representational power and posterior conditionality of latent features. The two platforms used different batch sizes and training epochs, reflecting the more complex dynamics of the UAV platform and the need for more training data and iterations.

[0054] Table 1. Training hyperparameters for offline variational latent dynamics

[0055] Corresponding to the hyperparameters, the specific network structures of the encoder and decoder can also be designed differently according to the platform characteristics. In this embodiment, both the nonlinear encoder and the linear decoder adopt a multilayer perceptron (MLP) structure, and the activation function of the hidden layer is selected as the exponential linear unit (ELU) to balance nonlinear representation capability and gradient propagation stability. Table 2 below shows the specific network architecture of the encoder and decoder of the inverted pendulum and UAV platform, including the input dimension, hidden layer structure and output dimension.

[0056] Table 2 Network Architecture

[0057] Specifically, the encoder's input dimension is determined by both the state dimension and the control dimension: the inverted pendulum platform's state data includes the trolley's position and velocity, and the pendulum's angle and angular velocity (4 dimensions in total), while the control input is the trolley's thrust (1 dimension), so the encoder's input dimension is 5 dimensions; the UAV platform's state data includes 13 dimensions such as three-dimensional position, three-dimensional velocity, quaternion attitude angle, and three-dimensional angular velocity, while the control input is the thrust command of the four motors (4 dimensions), so the encoder's input dimension is 17 dimensions.

[0058] Regarding the hidden layer structure, the inverted pendulum platform adopts a shallow, narrow network design with a hidden layer structure of [8, 16, 8]. That is, the first layer maps the 5-dimensional input to 8 dimensions, the second layer increases it to 16 dimensions to extract nonlinear features, and the third layer compresses it back to 8 dimensions to output the mean and variance of the latent features. The latent feature dimension is set to 2 dimensions to compactly express the main patterns of the dynamic residuals. The UAV platform adopts a deep, wide network design with a hidden layer structure of [64, 128, 64]. That is, the number of neurons in the three hidden layers are 64, 128, and 64, respectively. The higher-dimensional features are extracted through a wider network capacity. The 64-dimensional features output by the last hidden layer are linearly mapped to obtain 8-dimensional latent features to retain more dynamic residual information.

[0059] The decoder receives latent features and outputs residual predictions for the state dimensions after passing through a hidden layer structure symmetrical to the encoder: the decoder for the inverted pendulum platform outputs 4 dimensions, corresponding to the residual predictions for the car's position, speed, pendulum angle, and angular velocity; the decoder for the UAV platform outputs 13 dimensions, corresponding to the residual predictions for the complete state.

[0060] The above configuration examples demonstrate the adaptability of this disclosure to both low-degree-of-freedom and high-degree-of-freedom platforms: shallow narrow networks are used for simple inverted pendulum platforms to ensure real-time performance, while deep wide networks are used for complex UAV platforms to ensure representation accuracy.

[0061] S102: Use the encoder to extract the latent features corresponding to the robot's current state data and control data.

[0062] In practical implementation, during the online operation phase, the robot collects real-time state data and control data at each control cycle. This data is input into a fixed encoder, which outputs a low-dimensional latent feature vector. This latent feature is a compact representation of the current dynamic residual structure, effectively compressing redundant information in the original state-control space while retaining the nonlinear features most relevant to dynamic prediction. This step achieves real-time mapping from high-dimensional observations to structured latent features, providing an efficient and stable input representation for subsequent Bayesian adaptation and uncertainty quantification.

[0063] In one implementation, the aforementioned step of extracting the latent features corresponding to the robot's current state data and control data using an encoder can be further achieved in the following way: Based on the robot's current state and control data, nonlinear dynamic features are extracted through the multilayer perceptron network in the encoder, and the mean vector and variance vector of the latent features are output; the latent features are used to characterize the robot's current dynamic residual structure.

[0064] Specifically, it can be based on the state data collected by the robot at the current moment. With control data The concatenated latent features are then input into an encoder that has been trained offline and has its parameters frozen. This encoder employs a multilayer perceptron (MLP) structure, extracting high-order features closely related to the dynamic residuals from the original state-control space through nonlinear transformations of several hidden layers. The encoder's output layer does not directly output a definite latent feature vector, but rather outputs the parameters of the Gaussian distribution followed by the latent features, i.e., the mean vector. With variance vector Among them, the mean vector The most likely encoding of the current dynamic residual structure, the variance vector This quantifies the uncertainty of the encoding, reflecting the encoder's confidence in its understanding of the current input.

[0065] Output latent features It is not used to reconstruct the complete system state, but is specifically used to characterize the nominal dynamic model. The unexplained portion of the dynamic residual structure includes nonlinear factors such as unmodeled dynamics, load variations, and external disturbances. This probabilistic representation provides two key advantages for subsequent Bayesian online adaptation: first, the mean vector of the latent features serves as the input to the decoder, supporting point prediction of the dynamic residuals; second, the variance vector of the latent features is passed to the uncertainty quantization module, which, together with the uncertainty of the decoder parameters, constitutes the total prediction variance, achieving uncertainty estimation for calibration.

[0066] Through the above implementation method, the encoder only needs to perform a forward propagation once in the online stage to simultaneously output a compact representation of the dynamic residual structure and its confidence level, which not only ensures real-time computing efficiency, but also provides a structured input for uncertainty-aware control.

[0067] S103: Based on the robot's current real dynamic data, update the credibility of each historical state hypothesis maintained, and detect whether a dynamic mutation has occurred based on the credibility, and obtain the mutation detection result.

[0068] This step introduces a change point detection mechanism to determine in real time whether abrupt changes have occurred in the robot's dynamics. During online operation, multiple historical state hypotheses are maintained, each representing a possible history of abrupt changes (e.g., whether abrupt changes have occurred in the past). Whenever new real-world dynamic data is obtained (e.g., the current state and the actual next state under control), the confidence level of each hypothesis is updated based on its interpretability (e.g., through likelihood calculation). Based on the confidence distribution of all hypotheses, it is determined whether a dynamical abrupt change has occurred (e.g., a change from a stationary state to another dynamic characteristic), and a clear abrupt change detection result is output. This enables the robot to proactively perceive non-stationary changes in the external environment or its own state, providing crucial decision-making basis for subsequent adaptive updates.

[0069] In one implementation, the aforementioned step of updating and maintaining the credibility of each historical state hypothesis based on the robot's current real dynamic data, and detecting whether a dynamic abrupt change has occurred, can be further implemented using a multi-hypothesis tracking method based on beam search, specifically including the following sub-steps: Based on the currently maintained historical state assumptions (whether any mutations have occurred in the past), candidate hypotheses without mutations (indicating that no mutation occurred in this step, and extending to new hypotheses) and candidate hypotheses with mutations are generated respectively, resulting in a set of candidate hypotheses. The cumulative log-likelihood of the previous time step (indicating the sum of the confidence of the hypothesis across all past steps), the log-likelihood of the observation dynamics residual at the current time step (indicating the reasonableness of the observed real data under the current assumption), and the prior log probability of mutation (indicating the prior probability of occurrence / non-occurrence of mutation) corresponding to each candidate hypothesis in the set of candidate hypotheses are determined, and the current cumulative log-likelihood of each candidate hypothesis is obtained as the confidence level. The candidate hypotheses are sorted from largest to smallest according to their corresponding confidence levels, and the first preset number of candidate hypotheses are retained. When there is a candidate hypothesis with a mutation among the retained candidate hypotheses, it is determined that a dynamic mutation has occurred, and the mutation detection result is obtained.

[0070] Specifically, firstly, based on each historical state hypothesis maintained at the current time step, candidate extended hypotheses are generated, including no-mutation candidate hypotheses, which assume that no dynamical mutation occurs at the current time step and directly inherits the change point history of the original hypothesis; and mutation candidate hypotheses, which assume that a dynamical mutation occurs at the current time step and adds a change point marker to the history. Thus, a candidate hypothesis set with double the size is generated from the original hypothesis bundle.

[0071] Secondly, for each candidate hypothesis in the candidate hypothesis set, its cumulative log-likelihood at the current time is calculated as a quantitative indicator of the hypothesis's credibility. This cumulative log-likelihood is obtained by adding three terms: the first term is the cumulative log-likelihood inherited from the previous time step, reflecting the sum of the hypothesis's historical credibility over all past time steps; the second term is the log-likelihood of the observed dynamical residuals at the current time, i.e., the log probability of the observed true dynamical residual data occurring under the historical conditions of the change point corresponding to the current candidate hypothesis, used to measure the hypothesis's explanatory power for the current data; the third term is the prior log probability of the mutation, i.e., applying a prior constraint on whether a mutation occurs at the current step based on the preset prior probability of the change point, where the candidate hypothesis without mutation is taken as... If there is a mutation candidate hypothesis, take , This represents the preset prior probability of the change point at each time step. The sum of the above three terms is the current cumulative log-likelihood of the candidate hypothesis.

[0072] Finally, all candidate hypotheses are sorted in descending order of their current cumulative log-likelihood, and only the first preset number (i.e., bundle size) is retained. The most credible candidate hypotheses are selected to form a new hypothesis bundle, thus pruning the hypothesis space and preventing the computational load from increasing exponentially over time. After pruning, it is checked whether there are any candidate hypotheses with a mutation type in the currently retained hypothesis bundle: if so, it is determined that a dynamic mutation has occurred at the current time step; otherwise, it is determined that no mutation has occurred. This mutation detection result will serve as the basis for temperature coefficient modulation in subsequent Bayesian updates.

[0073] Through the above implementation methods, this disclosure achieves online reasoning of change point history in a probabilistic manner: on the one hand, by maintaining multiple high-confidence candidate hypotheses, the uncertainty of the timing of change point occurrence can be handled; on the other hand, the computational complexity is controlled through a bundle pruning mechanism, making it linearly related to the preset bundle size, thus meeting the requirements of real-time robot control. Experimental results show that the timing error of the change point reasoning module on the inverted pendulum platform is less than 2 time steps, with no missed detections or false detections.

[0074] The cumulative log-likelihood (i.e., reliability) described above is essentially a method for calculating the posterior probability of a change point in the logarithmic domain. To further clarify its probabilistic meaning, the equivalent expression of the posterior probability of a change point in the probability domain is given below. In one implementation, the posterior probability of a change point is calculated based on Bayes' rule, using the ratio of the marginal likelihoods of the point without change to the marginal likelihood of the point with change, for example, as shown in the following formula: ; in, The preset prior probabilities for each time step change point. The dynamic residual at the current moment, The latent features at the current moment, A binary latent variable, representing the value at time step [missing information]. Has a dynamical abrupt change (change point) occurred, for example? It can be represented at time step A dynamic mutation occurred. It can be represented at time step No dynamic mutation occurred; This is the conditional probability of observing the residual under the current change point assumption. This posterior probability can be directly used for mutation detection decisions, i.e., when... It can be used to determine when a dynamic mutation occurs; it can also be used as a soft weighting basis for temperature coefficient modulation, that is, to gradually weaken the historical prior accuracy with the continuous value of the posterior probability, replacing the hard decision mutation detection method.

[0075] In the above embodiments, after pruning the candidate hypotheses and obtaining the retained hypothesis bundle, the dynamic change type of the current time step can be determined based on the candidate hypothesis type corresponding to the highest confidence level in the bundle. Specifically, if the highest confidence level is set to the no-mutation type, the current dynamics are determined to be in a no-mutation state; if the highest confidence level is set to the mutation type, a dynamic mutation is determined to have occurred. In an optional embodiment, more fine-grained dynamic change types can be further distinguished: for example, when the confidence level shows a monotonically slow decreasing trend over multiple consecutive time steps, it can be determined to be a gradual drift state; when the confidence level experiences a brief jump followed by a rapid recovery in a single or very few time steps, it can be determined to be a transient fluctuation state. The above fine-grained determination results can be applied to differentiated adaptation strategies, such as using gradual history weakening in the gradual drift state, and skipping the Bayesian update of the current step in the transient fluctuation state to avoid overreaction, thereby further improving robustness and adaptability in complex non-stationary environments.

[0076] As another implementation of the aforementioned beam search change point detection scheme, this disclosure also provides an alternative scheme for determining fine-grained dynamic changes based on confidence distribution characteristics.

[0077] For example, the type of dynamic change can be determined based on the distribution characteristics of the confidence level. The type of dynamic change includes at least two of the following: a stable state, a gradual drift state, a transient fluctuation state, and a dynamic abrupt change state. Specifically, a stable state is defined as the confidence level remaining stable over multiple consecutive time steps; a gradual drift state is defined as the confidence level showing a monotonically slow decreasing trend over multiple consecutive time steps; a transient fluctuation state is defined as the confidence level experiencing a brief jump followed by recovery in a single or very few time steps; and a dynamic abrupt change state is defined as the confidence level experiencing a sharp jump in a single time step. Based on the determined type of dynamic change, a differentiated update strategy is adopted: in a stable state, the temperature coefficient is maintained. Accumulate historical evidence normally; set the temperature coefficient under gradual drift conditions. ,in Historical information is gradually weakened; in transient fluctuation states, the Bayesian update at the current time step is skipped, while maintaining the posterior distribution; in dynamic abrupt changes, a temperature coefficient is set. ,in This weakens historical information.

[0078] This scheme no longer simply categorizes dynamic changes into two types: those with abrupt changes and those without. Instead, it distinguishes four different types of dynamic changes based on the distribution pattern of the credibility of each historical state hypothesis along the time axis: a stationary state is defined as when the credibility remains stable over multiple consecutive time steps; a gradual drift state is defined as when the credibility shows a monotonically slow decreasing trend; a transient fluctuation state is defined as when the credibility experiences a brief jump followed by a rapid recovery; and a dynamical abrupt change state is defined as when the credibility experiences a sharp and sustained jump. Differentiated Bayesian update strategies are adopted for these four different change types: maintaining the temperature coefficient in the stationary state. Accumulate historical evidence normally; set a decay coefficient between 0 and 1 during the gradual drift state. Historical information is gradually weakened; in transient fluctuation states, the update of the current step is skipped directly to keep the posterior distribution unchanged to avoid overreacting to brief disturbances; in dynamical abrupt changes, the temperature coefficient is set to... This approach significantly weakens historical information to achieve rapid reset. The core advantage of this scheme lies in its ability to distinguish between gradual drift and true mutation, and to apply an update strategy with adjustable adaptation strength to each, thereby further improving robustness and adaptability in complex and non-stationary environments.

[0079] S104: Update the decoder parameters based on the latent features and the mutation detection results; wherein, when a mutation is detected, the influence of historical data on the current update is reduced.

[0080] Here, the decoder parameters are updated online by combining the extracted latent features with the mutation detection results obtained in S103. The unique aspect of this update process is that when the mutation detection result indicates a dynamic mutation, the influence of historical data on the current parameter update is actively reduced (e.g., by decreasing the weight of historical posteriors); conversely, if no mutation is detected, historical data is used for recursive updates as normal. This mechanism can quickly forget outdated historical information after a mutation occurs, avoiding its continuous interference with the current prediction, while simultaneously accumulating sufficient historical evidence during stable phases to improve model accuracy. This step achieves differentiated adaptation between mutation and gradual changes, overcoming the bottleneck of the traditional method's trade-off between speed and stability.

[0081] In one implementation, when updating the decoder parameters based on latent features and mutation detection results, a temperature coefficient can be introduced. This enables dynamic control over the influence of historical information. For example, updating the decoder parameters based on the latent features and the mutation detection results includes: determining a temperature coefficient based on the mutation detection results. If the mutation detection result indicates that no mutation has occurred, If the mutation detection result indicates that a mutation has occurred, ,in The preset temperature parameters, and ; as described inverse of the posterior covariance of the previous time step (i.e., posterior precision) is scaled to obtain the modulated prior precision. According to the modulated prior accuracy Update the decoder parameters.

[0082] here, At that time, a standard Bayesian recursive update is performed, which retains all historical prior accuracy. At that time, the prior accuracy of the modulated data decreases, and the influence of historical data on the current update is weakened.

[0083] Specifically, the temperature coefficient γ for the current time step is first determined based on the mutation detection results: if the detection result indicates no mutation has occurred, then the temperature coefficient γ is set... If the test result indicates a mutation, then set... ,in This is a preset temperature parameter, with a value between 0 and 1. For example, for an inverted pendulum platform. For drone platforms Subsequently, the inverse matrix of the posterior covariance of the previous time step is obtained using this γ. (i.e., the previous moment) The inverse of the posterior covariance of each hypothesis simplifies to Scaling is performed to obtain the modulated prior accuracy. (i.e., the modulated prior accuracy with hypothesis index, simplified to) This is used to replace the original Bayesian update formula that substitutes the prior accuracy into the decoder parameters. For example, the complete closed-form update formula is as follows: Posterior covariance at current time: ; Posterior mean at the current time: ; Among them, subscript Indicates the first in the hypothesis bundle A historical state assumption, superscript This represents the index of the decoder's output dimension (for multiple output dimensions, each dimension maintains its own posterior distribution). The latent features at the current moment, To observe the noise variance, For dynamic residuals. When At this time, standard Bayesian recursive updates are performed, preserving all historical prior accuracy. This allows the model to fully utilize historical data to accumulate evidence during the dynamically stable phase, gradually improving prediction accuracy. At this time, the modulated prior accuracy is reduced, which is equivalent to the systematic compression of the weight of historical data, thereby weakening the impact of outdated information on the current update. Through this temperature modulation mechanism, history can be quickly forgotten and the prior can be reset when a dynamic change is detected, so that the posterior distribution can quickly reflect the new dynamic characteristics. At the same time, sufficient historical evidence is maintained during the steady phase, effectively balancing rapid response after a change and refined learning during the steady phase. Experimental results show that in the quadrotor load drop scenario, the stabilization time is reduced by more than 30% compared with existing baseline methods.

[0084] In one implementation, the aforementioned step of updating the decoder parameters based on the modulated prior accuracy can be specifically implemented using the following closed-form Bayesian recursive formula. In this implementation, the decoder parameters include a posterior covariance matrix and a posterior mean vector, which respectively quantify the uncertainty of the decoder parameters and their optimal estimate.

[0085] Specifically, based on the modulated prior accuracy and the latent features at the current moment. and observation noise variance Calculate the posterior covariance at the current time using the following formula. : ; Furthermore, based on the posterior covariance at the current time... The modulated prior accuracy posterior mean of the previous time step and the dynamic residual at the current moment Calculate the posterior mean at the current time using the following formula. : ; Wherein, the dynamic residual The difference between the new system state after implementing control inputs and the prediction result of the nominal dynamic model.

[0086] In this implementation, the online update of the decoder is accomplished using a closed-form Bayesian recursive formula. Here, the decoder's state is described by two parameters: the posterior covariance matrix and the posterior mean vector. The former characterizes the confidence level of the current model parameter estimates (the smaller the covariance, the higher the confidence level), while the latter represents the optimal parameter estimates. The update process consists of two steps: First, using the modulated historical precision (i.e., the inverse of the posterior covariance at the previous time step, after temperature coefficient adjustment)... The new posterior covariance is calculated by combining the scaling, latent features at the current moment, and observation noise variance. This calculation involves adding the information content of historical prior information to the current observation data and then inverting the sum. Next, based on the new posterior covariance, a weighted correction is made by fusing the modulated historical mean contribution with the current observation residuals to obtain a new posterior mean. The dynamic residuals reflect the true dynamic biases that the nominal physical model failed to predict and are the core target that the decoder needs to learn.

[0087] This sparse Bayesian closed-loop update avoids the iterative computations of traditional gradient descent, and all operations are analytical, resulting in extremely fast computation. On a quadcopter platform, a single-step update, including variable-point inference, takes only 7.6ms, fully meeting real-time control requirements. Through this mechanism, the model can be updated in a strictly optimal Bayesian manner at each time step, while maintaining extremely low computational latency.

[0088] In one implementation, the aforementioned closed-loop Bayesian update process utilizes the JAX framework to implement vectorized computation and Just-In-Time (JIT) compilation. Specifically, the update operations of all hypotheses in the variable-point hypothesis bundle are executed in parallel. Leveraging JAX's automatic vectorization capabilities, the process of iterating through hypotheses is transformed into tensor operations, significantly reducing online computation latency. Experimental results show that on a quadcopter platform, the single-step update time, including variable-point inference and Bayesian update, is less than 1 ms, meeting real-time control requirements.

[0089] In one implementation, the hyperparameters preset when updating the historical state assumptions and when updating the decoder parameters include: an upper limit on the number of assumptions, a mutation prior probability, a temperature parameter, a decoder prior variance, and an observation noise variance; wherein the values ​​of each hyperparameter are preset according to the robot's dynamic characteristics and control cycle.

[0090] Among these parameters, the upper limit on the number of assumptions controls the maximum number of historical state assumptions retained during change-point inference; the mutation prior probability characterizes the prior likelihood of a dynamic mutation occurring at each time step; the temperature parameter is used to scale the historical prior accuracy when a mutation occurs; the decoder prior variance defines the initial uncertainty of the model parameters at the start time of online updates; and the observation noise variance reflects the inherent random fluctuations in sensor measurements and dynamic residuals. The values ​​of these hyperparameters are not fixed but are preset differently based on the dynamic characteristics and control cycle of the robot platform.

[0091] For example, after optimization through simulation and real experiments, taking into account the accuracy of variable point detection, adaptation speed and computational efficiency, the specific hyperparameter settings for the inverted pendulum platform and the UAV platform can be shown in Table 3 below: Table 3. Hyperparameters of Online Variable Point Aware Bayesian Adaptation

[0092] For example, for an inverted pendulum platform with relatively simple dynamics and a long control cycle, the upper limit of the number of components K is assumed to be 5, the abrupt change prior probability π is assumed to be 0.05, and the temperature parameter β is assumed to be 0.9. For a UAV platform with highly nonlinear dynamics and a higher control frequency, the upper limit of the number of components K is assumed to be increased to 15 to enhance the tracking ability of complex change point histories. The abrupt change prior probability π remains at 0.05, and the temperature parameter β is assumed to be 0.997, making the history weakening at the time of abrupt change more moderate to adapt to frequent dynamic fluctuations during flight. Through the reasonable configuration of the above hyperparameters, the embodiments of this disclosure can achieve a good balance between change point detection sensitivity and online adaptation stability on different platforms.

[0093] S105: Based on the updated decoder parameters, output the dynamic prediction results and their corresponding uncertainties.

[0094] After updating the decoder parameters online, the updated decoder and current latent features are used to predict the robot's dynamic behavior (such as the next-moment state or dynamic residuals), and the uncertainty corresponding to this prediction is output simultaneously. This uncertainty is a quantitative estimate of the prediction's reliability (e.g., prediction variance). The output is not limited to a single predicted value but also includes its confidence range, providing probabilistic risk information for subsequent control decisions. This step addresses the lack of calibrated uncertainty quantification in traditional adaptive control methods, enabling proactive adoption of conservative strategies in high-uncertainty environments and improving robustness.

[0095] In one implementation, the aforementioned step of outputting dynamic prediction results and their corresponding uncertainties based on the updated decoder parameters can be achieved in the following way: First, based on the credibility of each historical state hypothesis maintained, the hypothesis with the highest credibility is selected as the optimal hypothesis; then, the posterior mean of the decoder corresponding to the optimal hypothesis is obtained. With posterior covariance and the latent feature variance output by the encoder. .

[0096] Then, 1) calculate the total uncertainty according to the following formula. : ; in, The latent features at the current moment, Represents element-wise product. For structural uncertainty, This refers to cognitive uncertainty.

[0097] In the total uncertainty σ_tot² mentioned above, the first term (σ_z²) · (μ ⊙ μ) is called structural uncertainty, which stems from the fuzziness of the encoder's estimation of latent features (i.e., the variance of the encoder output). It reflects the uncertainty that the model structure itself cannot be completely determined. This term still exists even if the decoder parameters are completely known; the second term z • Σ· z is called cognitive uncertainty, which originates from the finite data estimation error of the decoder parameters (i.e., posterior covariance). This term asymptotically shrinks as observation data accumulates. The complete prediction variance formed by the sum of the two terms is strictly bounded and has no risk of explosion in multi-mutation scenarios. This is one of the important theoretical advantages of the method disclosed in this paper compared with traditional Bayesian methods.

[0098] 2) The posterior mean of the decoder based on the optimal hypothesis With the latent features The predicted value of the dynamic residual is calculated according to the following formula. : .

[0099] 3) Based on the predicted dynamic residual values The dynamic prediction results are determined by comparing them with the prediction results of the nominal dynamic model. Here, the residual predictions can be compared with the predictions from the nominal dynamic model. Adding them together yields the complete dynamic prediction results. .

[0100] 4) Output the dynamic prediction results and the corresponding total uncertainty .

[0101] The core of this implementation lies in not directly using a weighted average of all historical state hypotheses, but instead selecting the hypothesis with the highest confidence from the maintained hypothesis bundle as the current optimal hypothesis. Subsequent predictions and uncertainty quantification are all based on this hypothesis. This strategy is possible because this implementation uses Maximum A Posteriori (MAP) fusion instead of full weighted marginalization, thereby significantly reducing online computational overhead with almost no loss of prediction accuracy. The principle is that full Bayesian marginalization requires a weighted average of the prediction distributions of all hypotheses in the hypothesis bundle, with computational costs proportional to the number of hypotheses, and each hypothesis requires maintaining a complete posterior distribution; while MAP fusion only retains the single hypothesis with the highest posterior probability, approximating the prediction distribution of this hypothesis as the overall prediction distribution. Theoretical analysis and experiments both show that when there is a significantly dominant hypothesis in the hypothesis bundle (i.e., when the change point detection is clear or the dynamic change is obvious), the difference in prediction accuracy between MAP fusion and full weighted marginalization is negligible, but the computational overhead is significantly reduced. Reduced to ,in The size is the beam size. This approximation strategy is one of the key design features that ensures the online computational efficiency of this invention.

[0102] After selecting the optimal hypothesis, three pieces of information are obtained: the posterior mean of the decoder corresponding to that hypothesis. With posterior covariance and the latent feature variance of the encoder output. Total uncertainty It consists of two parts: the first part is the structural uncertainty. The first term, originating from the fuzziness in the encoder's estimation of latent features (i.e., the variance of the encoder output), multiplied by the square of the posterior mean, reflects the uncertainty inherent in the model structure itself, which cannot be fully determined. The second term is cognitive uncertainty. It originates from the finite data estimation error of the decoder parameters (i.e., the posterior covariance), which is projected onto the quadratic form of the latent eigenvector and quantified as the specific degree of influence on the current prediction. The sum of the two terms constitutes the total prediction variance of the calibration, which is strictly bounded.

[0103] Predicted values ​​of dynamic residuals The calculation is more direct: the posterior mean under the optimal hypothesis is used. With current latent features To perform the inner product, i.e. Because the decoder is designed in a linear form, this inner product operation is essentially a linear combination, making it extremely computationally efficient. Finally, the residual predictions are compared with the predictions from the nominal dynamics model. Adding them together yields the complete dynamic prediction results. Together with total uncertainty The results are output together for subsequent uncertainty-aware control. Experimental results show that the ARCADE system based on this scheme achieved the best CRMSE index in UAV open-loop prediction, verifying the effectiveness of this uncertainty quantification and prediction method.

[0104] S106: Based on the dynamic prediction results and the uncertainty, determine the control command and apply it to the robot.

[0105] In this step, the dynamic prediction results and their uncertainties obtained in the previous step are used together to calculate the control commands. The determination of the control commands no longer relies solely on the predicted values, but actively incorporates the uncertainties into the control optimization process (e.g., dynamically adjusting the weight of the state tracking error in the cost function). When the uncertainty is high, the controller tends to adopt a more conservative control strategy; when the uncertainty is low, it can more aggressively pursue tracking accuracy. The finally calculated control commands are applied to the robot actuators, completing a closed loop of a full control cycle. This step achieves "uncertainty-aware" control decision-making, enabling the robot to balance safety and tracking performance in non-stationary dynamic environments.

[0106] In one implementation, the aforementioned step of determining the control command based on the dynamic prediction results and their uncertainties can be achieved in the following way: Obtaining uncertainty With preset modulation coefficients , ,in , The state cost matrix is ​​calculated according to the following formula. Element-wise modulation is performed to obtain the modulated state-cost matrix. : , Represents element-wise product; Based on the modulated state cost matrix Based on the dynamic prediction results, an optimization objective for the optimal control problem is constructed. The optimization objective is to minimize the sum of the weighted cost of state tracking error and the weighted cost of energy consumption of control data within the finite prediction time domain. Within the physical constraints of the control data, the finite time domain optimal control problem is solved in a rolling manner to obtain the optimal control command at the current moment.

[0107] The core of this implementation lies in actively integrating the uncertainty quantification results into the optimization process of Model Predictive Control (MPC) to achieve dynamic modulation of the control strategy. This design can be called uncertainty-aware MPC, and its essence is that when the uncertainty of dynamic prediction is high (such as during a dynamic abrupt change), the controller adopts a more conservative control strategy; when the uncertainty is low (such as during a dynamic steady-state phase), the controller focuses on improving trajectory tracking accuracy.

[0108] Specifically, the total uncertainty is first obtained. and two preset modulation coefficients and (All are positive numbers). Then, the logarithmic modulation formula is used. For the original state cost matrix Element-wise scaling is performed. The formula is designed with the following characteristics: when uncertainty... When it approaches 0, It also approaches 0, the modulated cost matrix Approximately equal to the original The controller operates according to its nominal performance. When uncertainty increases, the logarithmic function compresses large changes to prevent excessive inflation of cost weights that could lead to system instability, while maintaining monotonic sensitivity to uncertainty. Therefore, this logarithmic modulation method can better adapt to the control characteristics of different robots.

[0109] After completing cost matrix modulation, with Replace the original The optimization objective of MPC is constructed as follows: within a finite prediction time domain, minimize the weighted sum of state tracking error and control energy consumption, where the weight of state tracking error dynamically changes with uncertainty. Subsequently, within the physical constraints of the control input (such as thrust limit, torque limit, etc.), the optimal control command for the current moment is solved through rolling optimization, and this command is applied to the robot. For example, the specific modulation coefficient configuration of the inverted pendulum and the UAV is as follows: drones Experimental results show that the ARCADE system based on this uncertainty-aware MPC reduces the root mean square error (RMSE) of trajectory tracking by 55% compared to the nominal MPC in the UAV payload drop scenario, verifying the effectiveness of the modulation mechanism.

[0110] As another alternative implementation, the above logarithmic modulation formula can be replaced with linear modulation or exponential modulation. Specifically, linear modulation follows... Direct scaling of the state cost matrix is ​​suitable for scenarios with small uncertainty amplitudes and high modulation sensitivity requirements; exponential modulation, on the other hand, follows... Scaling allows for a stronger response to larger changes in uncertainty.

[0111] The three modulation methods mentioned above—linear modulation, exponential modulation, and logarithmic modulation—are suitable for the control characteristics of different robot platforms. In actual deployment, the most appropriate modulation strategy can be selected according to specific needs. For example, for platforms that require extremely rapid response to sudden changes, linear modulation is more predictable due to its simple proportional relationship, which facilitates controller behavior analysis. For scenarios that require forced conservative control under high uncertainty, the acceleration and amplification effect of exponential modulation can respond more sensitively to changes in uncertainty, prompting the controller to adopt a conservative strategy. For scenarios with a large range of uncertainty changes and where it is necessary to avoid excessive instantaneous modulation that could cause system jitter, logarithmic modulation can make the cost gain tend to level off as uncertainty increases, improving control smoothness while maintaining robustness.

[0112] like Figure 2 The diagram shown is an overall schematic diagram of the robot control provided in an exemplary embodiment of this disclosure, which is divided into two main stages: offline training and online operation.

[0113] In the offline phase, training data consisting of triplets representing the robot's state, control input, and next-time state are first collected. Based on this data, a variational lower bound loss (weighted by reconstruction loss and KL divergence loss) is used to jointly train the encoder and decoder, enabling the encoder to extract effective latent dynamic features and the decoder to predict dynamic residuals based on these features. After training, all encoder parameters are frozen and not updated in the online phase; the decoder's initial parameters are saved as the starting point for online adaptation.

[0114] The online phase comprises four sequentially executed sub-phases. In the feature extraction sub-phase: the robot collects current state and control data and inputs it into the frozen encoder. The encoder extracts low-dimensional latent features through a multilayer perceptron network, which compactly characterize the residual structure that the current nominal dynamics model cannot describe. In the change point perception and model update sub-phase: multiple historical state hypotheses are maintained, and the credibility of each hypothesis is tracked in real time using a bundle search method. Based on real dynamics data, it is determined whether a dynamic abrupt change has occurred: if no abrupt change has occurred, standard Bayesian recursive updates are used to accumulate historical information normally; if a abrupt change is detected, the weight of historical data is weakened through temperature coefficient modulation, allowing the model to quickly forget outdated information and accelerate adaptation to new dynamic characteristics. Based on this, the decoder parameters (posterior mean and posterior covariance) are updated online in a closed-loop analytical form. In the uncertainty quantification sub-stage: the hypothesis with the highest confidence is selected as the optimal hypothesis from the maintained hypothesis bundle. Based on the decoder parameters and latent feature variance of the encoder output according to this hypothesis, the total uncertainty (including structural uncertainty due to encoder fuzziness and cognitive uncertainty due to decoder parameter estimation errors) is decomposed and calculated, and the predicted value of the dynamic residual is output. In the uncertainty-aware control sub-stage: the predicted value of the dynamic residual is added to the nominal model prediction result to obtain the complete dynamic prediction result. At the same time, the total uncertainty is actively integrated into the optimization process of model predictive control, and the state tracking cost matrix is ​​dynamically modulated: when the uncertainty is high, the controller automatically tends to a conservative strategy to prioritize stability; when the uncertainty is low, the controller tends to precise tracking to improve control accuracy. Finally, the optimal control command is solved and applied to the robot, and a new state is obtained to enter the next control cycle.

[0115] After executing control commands, the robot's new state is collected and fed back to the feature extraction module at the next time step, forming a complete perception, reasoning, quantification, and control process, enabling the robot to operate continuously, stably, and with high precision in non-stationary dynamic environments.

[0116] To further reveal the underlying mechanism of the method in the embodiments of this disclosure, a unified loss function framework for the collaborative optimization of offline training and online control modules is presented below. This framework integrates four objectives: representation learning, Bayesian adaptation, change point detection, and uncertainty-aware control, forming a full-link optimization system. The total loss function is defined as follows: ; in: The latent feature reconstruction loss corresponds to the above. ; Fit loss to Bayesian parameters; For consistency loss in variable point detection; To control loss based on uncertainty perception; This is the balance coefficient.

[0117] Latent Feature Reconstruction Loss ; It represents the mathematical expectation, which is the average of all samples; For the actual state in the next moment, For the state prediction results, As a latent feature, This is the regularization coefficient. This loss is used to force the latent features to be compact and to make predictions more accurate.

[0118] Bayesian parameter fitting loss ; These are the decoder parameters at the current moment. For temperature coefficient, The posterior covariance matrix is... This represents the trace of the matrix. The first term is a parameter smoothing constraint, ensuring that the decoder parameters do not change too drastically between adjacent time steps; the second term is a penalty for uncertainty in variable-point driving, where the temperature coefficient... Dynamically adjust based on mutation detection results (when no mutation occurs). When mutation occurs , ).

[0119] Variable point detection consistency loss ; For the point of change, a binary variable ( This indicates that a mutation has occurred. (Indicates no mutation occurred) For dynamic residuals, As a latent feature, For the posterior probability at the change point, The regularization coefficient is . This is the indicator function. The first term is the log-likelihood loss for change point prediction, which encourages the model to accurately predict change points; the second term is the sparse regularization term, which is used to avoid frequent misjudgments of change points and reduce control jitter.

[0120] Uncertainty perception model predicts control loss ; For system status, For reference only. To control the input, The state cost matrix is ​​dynamically modulated by uncertainty. To control the cost matrix. This loss dynamically amplifies with uncertainty, making the controller more conservative under high uncertainty.

[0121] All of the above loss functions are convex and differentiable, therefore satisfying: ; in For encoder parameters, These are the decoder parameters. This property guarantees the global stability of the online learning process, the boundedness of the prediction variance, and the non-divergence of the posterior distribution.

[0122] The above loss function framework describes the optimization objective relationship between the modules in this embodiment. In actual deployment, the offline phase minimizes the weighted sum of the reconstruction loss and the KL divergence loss (i.e., the aforementioned...). The encoder and decoder are trained; in the online phase, the optimization effect of the above loss function is implicitly achieved through the closed-loop process described in S103 to S106 (change point detection, Bayesian closed update, MPC optimization).

[0123] As shown in Table 4 below, Table 4 presents the complete parameter configuration of the MPC controller, including: prediction time domain (10 steps for the inverted pendulum, 20 steps for the UAV), state cost matrix Q (a diagonal matrix, with weights for each dimension set according to platform characteristics), control cost matrix R, target cost matrix, physical constraints of control inputs (thrust limiting for the inverted pendulum, thrust and torque limiting for the UAV), and modulation coefficients α1 and α2 (α1=5 for the inverted pendulum, α1=10 for the UAV, and α2 is 0.001 for both). These parameters directly affect the tracking performance and stability of the controller and require fine-tuning based on the platform's dynamic characteristics.

[0124] Table 4. Core Parameters of Uncertainty-Aware MPC

[0125] To verify the effectiveness and superiority of the proposed Adaptive Robot Control via Change-Aware Bayesian Online Learning (ARCADE) method, this embodiment conducted multiple sets of comparative experiments on an inverted pendulum simulation platform and a quadcopter real flight platform. The experiments selected nominal MPC, L1 adaptive control, Gaussian Process Model Predictive Control (GP-MPC), Multilayer Perceptron Model Predictive Control (MLP-MPC), and a variant of ARCADE without change-awareness (ARCADE-w / o CP) as baseline methods, and comprehensively evaluated them from multiple dimensions such as MPC solution efficiency, dynamic prediction accuracy, and closed-loop trajectory tracking accuracy. Specific experimental results are as follows: 1) For solving the MPC optimization problem, the experiment uses the direct shooting method to discretize the continuous optimal control problem into a finite-dimensional nonlinear programming problem. A Limited-memory Broyden-Fletcher-Goldfarb-Shanno (L-BFGS) optimizer is used for the solution, with a maximum of 20 iterations. At the implementation level, based on the JAX and Optimistix frameworks, differentiability optimization and Just-In-Time (JIT) compilation are supported, significantly improving the solution speed. Experimental results show that the single-step solution time is less than 7ms on the quadrotor ground end and less than 0.5ms on the inverted pendulum simulation platform, both meeting the real-time control requirements of their respective platforms.

[0126] 2) On an inverted pendulum simulation platform, the dynamic prediction accuracy of this disclosed method (ARCADE) was compared with other baseline methods, with the evaluation metric being the cumulative root mean square error (CRMSE). Experimental results show that ARCADE's CRMSE is 5.83±1.18, which is approximately 43% lower than the variable-point-aware variant (ARCADE-w / o CP) of 10.28±2.07, approximately 53% lower than GP-MPC of 12.53±3.01, and approximately 67% lower than MLP-MPC of 17.76±1.99. This comparison clearly demonstrates the significant improvement in dynamic prediction accuracy brought about by the variable-point-aware mechanism.

[0127] 3) In real-world UAV flight experiments, the most challenging test scenario (175g load, 2.5m / s flight speed) was selected to compare the trajectory tracking accuracy of this disclosure (ARCADE) with other methods. The evaluation metric was the root mean square error (RMSE). Experimental results show that ARCADE's trajectory tracking RMSE is 0.120m, which is approximately 55% lower than the nominal MPC's 0.269m, approximately 45% lower than L1 adaptive control's 0.218m, and approximately 11% lower than the variable-point-aware variant (ARCADE-w / o CP)'s 0.135m. This comparison clearly demonstrates the advantages of this disclosure in closed-loop control under strongly nonlinear, highly dynamic, and abruptly changing dynamic scenarios.

[0128] The robot control method provided in this disclosure adopts a modular and decoupled design, which can be quickly migrated to other robot platforms, such as quadrupedal robot dogs, industrial robotic arms, and bipedal robots. Cross-platform deployment only requires the following three steps, without large-scale reconstruction: The first step is to collect the state-control dataset of the target robot. A sufficient number of samples are collected using the nominal controller to cover the robot's typical operating states.

[0129] The second step is to train the variational latent dynamics model offline. Based on the state and control dimensions of the target robot, the multilayer perceptron architecture and latent feature dimensions of the encoder are adjusted, offline training is performed, and the encoder parameters are frozen after training is completed.

[0130] The third step is to fine-tune the online hyperparameters. Based on the control cycle and dynamic characteristics of the target robot, the beam size is fine-tuned. Temperature parameters While hyperparameters such as the MPC modulation coefficient are used, the other parameters can be directly reused.

[0131] In practical deployments, this method has been successfully migrated to quadrupedal robot dogs (load change scenarios), six-axis industrial robotic arms (end-effector load change scenarios), and bipedal robots (upper limb end-effector load change scenarios), achieving high-precision adaptive control in all cases and verifying its cross-platform adaptability.

[0132] The above description is merely a preferred embodiment of this disclosure and is not intended to limit this disclosure. Various modifications and variations can be made to this disclosure by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

[0133] like Figure 3 As shown in the diagram, this disclosure also provides a schematic of a robot control device 300, including: Training module 31 is used to train a dynamic model, which includes an encoder and a decoder; after training, the encoder parameters are fixed and the initial parameters of the decoder are saved. Feature extraction module 32 is used to extract latent features corresponding to the current state data and control data of the robot using the encoder; The detection module 33 is used to update the credibility of each historical state hypothesis maintained based on the robot's current real dynamic data, and detect whether a dynamic mutation has occurred based on the credibility, and obtain a mutation detection result. Update module 34 is used to update decoder parameters based on the latent features and the mutation detection results; wherein, when a mutation is detected, the influence of historical data on the current update is reduced; Output module 35 is used to output the dynamic prediction results and their corresponding uncertainties based on the updated decoder parameters; The determination module 36 is used to determine control commands and apply them to the robot based on the dynamic prediction results and the uncertainty.

[0134] Optionally, the training module 31 is specifically used for: encoding the robot's state data and control data through an encoder to determine latent features; calculating the predicted dynamic residual of the state at the next moment through the decoder based on the latent features, and determining the state prediction result based on the predicted dynamic residual and the prediction result of the nominal dynamic model; calculating the reconstruction loss based on the error between the state prediction result and the true state, and calculating the KL divergence loss based on the difference between the distribution of the latent features and the prior distribution, determining the variational lower bound loss composed of the sum of the reconstruction loss and the KL divergence loss, and jointly training the encoder and the decoder by minimizing the variational lower bound loss.

[0135] Optionally, the feature extraction module 32 is used to extract latent features corresponding to the current state data and control data of the robot using the encoder according to the following steps: based on the current state data and control data of the robot, nonlinear dynamic features are extracted through the multilayer perceptron network in the encoder, and the mean vector and variance vector of the latent features are output; the latent features are used to characterize the current dynamic residual structure of the robot.

[0136] Optionally, the detection module 33 is specifically used to: generate candidate hypotheses without mutation and candidate hypotheses with mutation based on the currently maintained historical state hypotheses, to obtain a set of candidate hypotheses; determine the sum of the cumulative log-likelihood of the previous time step, the log-likelihood of the observation dynamics residual at the current time step, and the log-probability of the mutation prior for each candidate hypotheses in the set of candidate hypotheses, to obtain the current cumulative log-likelihood of each candidate hypothesis, as the confidence level; sort the candidate hypotheses according to the corresponding confidence level from largest to smallest, retain the first preset number of candidate hypotheses, and when there is a candidate hypothesis with mutation among the retained candidate hypotheses, determine that a dynamic mutation has occurred, and obtain the mutation detection result.

[0137] Optionally, the update module 34 is specifically used to update the decoder parameters according to the following method: determining the temperature coefficient γ based on the mutation detection result; if the mutation detection result indicates that no mutation has occurred, γ=1; if the mutation detection result indicates that a mutation has occurred, γ=β², where β is a preset temperature parameter, and 0<β<1; and using the inverse of the posterior covariance of the previous time step with respect to γ. Scaling is performed to obtain the modulated prior accuracy. According to the modulated prior accuracy Update the decoder parameters.

[0138] Optionally, the decoder parameters include posterior covariance and posterior mean; the update module 34 is specifically used to: based on the modulated prior accuracy The posterior covariance at the current time is calculated using the following formula, taking into account the latent feature z and the observation noise variance σ² at the current time. : Based on the posterior covariance at the current time The modulated prior accuracy posterior mean of the previous time step and the dynamic residual at the current moment Calculate the posterior mean at the current time using the following formula. : ; wherein, the dynamic residual The difference between the new system state after implementing control inputs and the prediction result of the nominal dynamic model.

[0139] Optionally, the output module 35 is specifically used for: selecting the hypothesis with the highest confidence level as the optimal hypothesis based on the confidence level of each historical state hypothesis maintained; and obtaining the decoder posterior mean corresponding to the optimal hypothesis. With posterior covariance and the latent feature variance output by the encoder. Calculate the total uncertainty using the following formula. : ;in, The latent features at the current moment, Represents element-wise product. For structural uncertainty, Cognitive uncertainty; the posterior mean of the decoder based on the optimal hypothesis. With the latent features The predicted value of the dynamic residual is calculated according to the following formula. : Based on the predicted dynamic residual values The dynamic prediction results are determined by comparing them with the prediction results of the nominal dynamic model. Output the dynamic prediction results. and the corresponding total uncertainty .

[0140] Optionally, the determining module 36 is specifically used to: obtain the uncertainty. With preset modulation coefficients , ,in , The state cost matrix is ​​calculated according to the following formula. Element-wise modulation is performed to obtain the modulated state-cost matrix. : , Represents element-wise product; based on the modulated state cost matrix Based on the dynamic prediction results, an optimization objective for the optimal control problem is constructed. The optimization objective is to minimize the sum of the weighted cost of state tracking error and the weighted cost of energy consumption of control data within the finite prediction time domain. Within the physical constraints of the control data, the finite time domain optimal control problem is solved in a rolling manner to obtain the optimal control command at the current moment.

[0141] Optionally, both the encoder and the decoder adopt a multilayer perceptron structure, wherein the activation function of the hidden layer in the multilayer perceptron structure includes an exponential linear unit (ELU); the input dimension of the encoder includes the state dimension and control dimension of the robot, and the output dimension of the decoder includes the state dimension of the robot; the number of network layers, the number of hidden layer nodes, and the latent feature dimension of the encoder and decoder are preset according to the state dimension and control dimension of the robot.

[0142] Optionally, the hyperparameters preset when updating the historical state assumptions and when updating the decoder parameters include: upper limit of the number of assumptions, mutation prior probability, temperature parameter, decoder prior variance, and observation noise variance; wherein, the value of each hyperparameter is preset according to the dynamic characteristics and control cycle of the robot.

[0143] The detailed implementation process of each module of the robot control device 300 is essentially the same as the aforementioned method, and can be found in the description of the aforementioned method content, which will not be repeated here.

[0144] Reference Figure 4 The diagram shown is a structural schematic of a device 400 according to an embodiment of this disclosure. The device 400 can be a computer device, a control chip, etc., and can be deployed on a server, a terminal, a robot, a remote control device, etc. It may include a processor 410, a memory 420, and a bus 430. The memory 420 is used to store execution instructions and includes main memory 421 and external memory 422. The main memory 421, also called internal memory, is used to temporarily store computational data in the processor 510, as well as data exchanged with external memory 422 such as a hard disk. The processor 410 exchanges data with the external memory 422 through the main memory 421.

[0145] In this embodiment, the memory 420 is specifically used to store application code executing the scheme of this disclosure, and its execution is controlled by the processor 410. That is, when the electronic device 400 is running, the processor 410 communicates with the memory 420 through the bus 430, or the processor 410 communicates with the memory 420 through other means, so that the processor 410 executes the application code stored in the memory 420, thereby executing the steps of the robot control method described in any of the foregoing embodiments. The memory 420 may be, but is not limited to, Random Access Memory (RAM), Read Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), etc. The processor 410 may be an integrated circuit chip with signal processing capabilities. The aforementioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this disclosure. The general-purpose processor can be a microprocessor or any conventional processor.

[0146] This disclosure also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the robot control method described in any of the above embodiments. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. Available media can be magnetic media, such as hard disks, floppy disks, and magnetic tapes; optical media, such as DVD-ROM, DVD-RAM, DVD-RW, DVD+RW, CD-ROM, CD-RW, CD-RW, and MO (magneto-optical) storage media; and semiconductor storage media, such as flash memory, EEPROM, Dynamic Random Access Memory (DRAM), and Static Random Access Memory (SRAM).

[0147] The computer program can be written in various computer programming languages, including but not limited to C, C++, Python, and custom messages and services under the ROS framework. When the computer program is executed by the processor, it implements the various steps of the robot control method in the embodiments of this disclosure.

[0148] This disclosure also provides a computer program product storing a computer program. When executed by a processor, the computer program performs the steps of the robot control method provided in any of the above embodiments of this disclosure. For details, please refer to the above method embodiments, which will not be repeated here. The computer program product can be implemented using hardware, software, or a combination thereof. In one optional embodiment, the computer program product is specifically embodied as a computer storage medium, which can be a volatile or non-volatile computer-readable storage medium. In another optional embodiment, the computer program product is specifically embodied as a software product, such as a software development kit (SDK), etc.

[0149] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the devices and apparatuses described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. In the several embodiments provided in this disclosure, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection may be through some communication interfaces; the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms.

[0150] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, the functional units in the various embodiments of this disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0151] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0152] Finally, it should be noted that the above-described embodiments are merely specific implementations of this disclosure, used to illustrate the technical solutions of this disclosure, and not to limit it. The protection scope of this disclosure is not limited thereto. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this disclosure; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure, and should all be covered within the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be determined by the protection scope of the claims.

Claims

1. A robot control method, characterized in that, include: Train a dynamic model, which includes an encoder and a decoder; After training is complete, fix the encoder parameters and save the decoder's initial parameters; The encoder is used to extract latent features corresponding to the robot's current state data and control data; Based on the robot's current real dynamic data, the credibility of each historical state hypothesis is updated and maintained, and the dynamic abrupt change is detected based on the credibility to obtain the abrupt change detection result; The decoder parameters are updated based on the latent features and the mutation detection results; wherein, when a mutation is detected, the influence of historical data on the current update is reduced. Based on the updated decoder parameters, output the dynamic prediction results and their corresponding uncertainties; Based on the dynamic prediction results and the uncertainty, control commands are determined and applied to the robot.

2. The method according to claim 1, characterized in that, Training the dynamic model includes: The robot's state and control data are encoded by an encoder to determine latent features; Based on the latent features, the predictive dynamic residual of the state at the next time step is calculated by the decoder, and the state prediction result is determined according to the predictive dynamic residual and the prediction result of the nominal dynamic model. The reconstruction loss is calculated based on the error between the predicted state and the actual state, and the KL divergence loss is calculated based on the difference between the distribution of the latent features and the prior distribution. The variational lower bound loss, which is the sum of the reconstruction loss and the KL divergence loss, is determined. The encoder and the decoder are jointly trained by minimizing the variational lower bound loss.

3. The method according to claim 1, characterized in that, The encoder is used to extract latent features corresponding to the robot's current state data and control data, including: Based on the robot's current state and control data, nonlinear dynamic features are extracted through the multilayer perceptron network in the encoder, and the mean vector and variance vector of the latent features are output; the latent features are used to characterize the robot's current dynamic residual structure.

4. The method according to claim 1, characterized in that, Based on the robot's current real dynamic data, the credibility of each historical state hypothesis is updated and maintained. Then, based on the credibility, a dynamic abrupt change is detected to obtain the abrupt change detection result, including: Based on the currently maintained historical state assumptions, candidate hypotheses without mutations and candidate hypotheses with mutations are generated respectively, resulting in a set of candidate hypotheses; The cumulative log-likelihood of the previous time step, the log-likelihood of the observation dynamics residual at the current time step, and the sum of the prior log probability of the mutation are determined for each candidate hypothesis in the candidate hypothesis set. The current cumulative log-likelihood of each candidate hypothesis is then used as the confidence level. The candidate hypotheses are sorted from highest to lowest according to their corresponding confidence levels. A preset number of candidate hypotheses are retained. When a mutation candidate hypothesis is found among the retained candidate hypotheses, a dynamic mutation is determined to have occurred, and the mutation detection result is obtained.

5. The method according to claim 1, characterized in that, Based on the latent features and the mutation detection results, the decoder parameters are updated, including: The temperature coefficient γ is determined based on the mutation detection result; if the mutation detection result indicates that no mutation has occurred, γ=1; if the mutation detection result indicates that a mutation has occurred, γ=β², where β is a preset temperature parameter, and 0<β<1; The inverse of the posterior covariance of the previous time step with respect to γ Scaling is performed to obtain the modulated prior accuracy. ; Based on the modulated prior accuracy Update the decoder parameters.

6. The method according to claim 5, characterized in that, The decoder parameters include posterior covariance and posterior mean; The prior accuracy based on the modulation Update the decoder parameters, including: Based on the modulated prior accuracy The posterior covariance at the current time is calculated using the following formula, taking into account the latent feature z and the observation noise variance σ² at the current time. : ; Based on the posterior covariance at the current moment The modulated prior accuracy posterior mean of the previous time step and the dynamic residual at the current moment Calculate the posterior mean at the current time using the following formula. : ; Wherein, the dynamic residual The difference between the new system state after implementing control inputs and the prediction result of the nominal dynamic model.

7. The method according to claim 1, characterized in that, Based on the updated decoder parameters, the output dynamic prediction results and their corresponding uncertainties are provided, including: Based on the credibility of each historical state hypothesis maintained, the hypothesis with the highest credibility is selected as the optimal hypothesis; Obtain the decoder posterior mean corresponding to the optimal hypothesis. With posterior covariance and the latent feature variance output by the encoder. ; The total uncertainty is calculated using the following formula. : ; in, The latent features at the current moment, Represents element-wise product. For structural uncertainty, For cognitive uncertainty; Based on the decoder posterior mean corresponding to the optimal hypothesis With the latent features The predicted value of the dynamic residual is calculated according to the following formula. : ; Based on the predicted dynamic residual value The dynamic prediction results are determined by comparing them with the prediction results of the nominal dynamic model. ; Output the dynamic prediction results and the corresponding total uncertainty .

8. The method according to claim 1, characterized in that, Based on the dynamic prediction results and the uncertainty, control commands are determined, including: Obtaining uncertainty With preset modulation coefficients , ,in , ; The state cost matrix is ​​calculated according to the following formula. Element-wise modulation is performed to obtain the modulated state-cost matrix. : , Represents element-wise product; Based on the modulated state cost matrix Based on the dynamic prediction results, an optimization objective for the optimal control problem is constructed; the optimization objective is: within the finite prediction time domain, to minimize the sum of the weighted cost of state tracking error and the weighted cost of energy consumption of control data; Within the physical constraints of the control data, the finite-time optimal control problem is solved in a rolling manner to obtain the optimal control command at the current moment.

9. The method according to claim 1, characterized in that, Both the encoder and the decoder adopt a multilayer perceptron structure, and the activation function of the hidden layer in the multilayer perceptron structure includes an exponential linear unit (ELU). The input dimension of the encoder includes the state dimension and control dimension of the robot, and the output dimension of the decoder includes the state dimension of the robot. The number of network layers, hidden layer nodes, and latent feature dimensions of the encoder and decoder are preset according to the state dimension and control dimension of the robot.

10. The method according to claim 1, characterized in that, The hyperparameters preset when updating the historical state assumptions and when updating the decoder parameters include: upper limit of the number of assumptions, mutation prior probability, temperature parameter, decoder prior variance and observation noise variance; wherein, the value of each hyperparameter is preset according to the dynamic characteristics and control cycle of the robot.

11. A robot control device, characterized in that, include: A training module is used to train a dynamic model, which includes an encoder and a decoder; After training is complete, fix the encoder parameters and save the decoder's initial parameters; The feature extraction module is used to extract latent features corresponding to the current state data and control data of the robot using the encoder; The detection module is used to update the credibility of each historical state hypothesis maintained based on the robot's current real dynamic data, and detect whether a dynamic mutation has occurred based on the credibility, and obtain the mutation detection result. An update module is used to update the decoder parameters based on the latent features and the mutation detection results; wherein, when a mutation is detected, the influence of historical data on the current update is reduced; The output module is used to output the dynamic prediction results and their corresponding uncertainties based on the updated decoder parameters; The determination module is used to determine control commands and apply them to the robot based on the dynamic prediction results and the uncertainty.

12. A device, characterized in that, It includes a processor and a memory, wherein the memory stores computer instructions, and the processor is used to execute the computer instructions to perform the steps of the robot control method according to any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the robot control method as described in any one of claims 1 to 10.