Robot control method and device and electronic equipment

By combining the basic trajectory diffusion model and the drift-optimized diffusion model, the robot path generation process is optimized, solving the problem that the path generated by the diffusion model is difficult to achieve optimality, and realizing efficient, feasible and low-energy path planning in complex environments.

CN121733535APending Publication Date: 2026-03-27ZHEJIANG LAB
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511890953.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-15
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing robot paths generated based on diffusion models struggle to achieve the expected optimal levels in key performance indicators such as time consumption and energy consumption. Furthermore, the lack of an effective coupling mechanism between trajectory generation and task performance indicators results in generated paths that can only meet basic feasibility requirements but deviate from optimality.

Method used

A method combining a basic trajectory diffusion model and a drift optimization diffusion model is adopted. By acquiring information about the robot's surrounding environment and motion conditions, a basic trajectory is generated and random noise is superimposed. The drift optimization diffusion model is used to optimize the noisy basic trajectory. The optimal trajectory is selected by combining the task evaluation value, and the trajectory is updated in a rolling manner when there is a state deviation, thereby realizing the optimization and adjustment of the path.

Benefits of technology

While ensuring path feasibility, it significantly improves key performance indicators such as time consumption and energy consumption, and the generated path is closer to the expected optimal level. It improves the consistency between trajectory planning results and task performance objectives and can adjust the running path in a timely manner under external disturbances.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121733535A_ABST
    Figure CN121733535A_ABST
Patent Text Reader

Abstract

The invention relates to a robot control method and device and electronic equipment, and the method comprises the steps: inputting condition input, an initial noisy track and the noise intensity of the initial noisy track into a basic track diffusion model to obtain a basic track, and superposing random noise obeying Gaussian distribution on the basic track to obtain a noisy basic track; optimizing the noisy basic trajectory or optimizing the initial noisy trajectory and the basic trajectory by using a drift optimization diffusion model to obtain candidate trajectories; taking the candidate trajectory which conforms to the motion safety of the robot and has the optimal task evaluation value as the optimal trajectory, and controlling the robot to move according to the optimal trajectory; and when the state deviation between the current motion state of the robot and the optimal track reaches a state deviation threshold value, modifying the candidate track according to the state deviation, and taking the modified candidate track as a new noisy basic track or a new initial noisy track. According to the method, the defect that the path optimality is difficult to ensure when the related diffusion model generates the path is effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of robot control, and more particularly to a robot control method, device, and electronic device. Background Technology

[0002] Robot path planning is one of the core technologies for enabling autonomous navigation and operation of mobile robots, autonomous vehicles, and service robots. Its goal is to generate a collision-free feasible path from the starting point to the destination, based on preset performance indicators such as path length, energy consumption, and safety, given an environmental model and task constraints, and to make necessary adjustments according to environmental changes during execution. The effectiveness of path planning directly affects the operational efficiency, task completion quality, and adaptability to complex scenarios of the robot system, and therefore has always been a key research focus in the field of robotics.

[0003] In recent years, with the development of deep learning and generative models, Diffusion Models (DM), as a typical type of deep generative model, have made significant progress in tasks such as image generation and sequence generation. Introducing diffusion models into robot trajectory or path generation scenarios allows for the learning of the distribution of feasible trajectories in complex environments within a data-driven framework, thereby generating diverse and relatively continuous trajectories and providing new ideas and tools for path planning in high-dimensional spaces. However, for paths generated based on diffusion models, although the model can often generate geometrically feasible and somewhat diverse paths by learning from historical data distributions, it tends to reproduce "common" feasible patterns in the training data during the inference stage. However, in terms of key performance indicators such as time and energy consumption, the generated paths often only meet basic feasibility requirements, significantly deviating from the expected optimal level, making it difficult to guarantee that the obtained path has the desired optimality. Summary of the Invention

[0004] This application provides a robot control method, system, device, computer program product, and medium to address some or all of the shortcomings in the related technologies.

[0005] According to a first aspect of the embodiments of this application, a robot control method is provided, comprising: S1, Obtain information about the robot's surrounding environment and the robot's motion conditions as input conditions; S2, based on the conditional input, the initial noisy trajectory, and the noise intensity of the initial noisy trajectory, the input is fed into the basic trajectory diffusion model to obtain the basic trajectory of the planned robot, and random noise following a Gaussian distribution is superimposed on the basic trajectory to obtain the noisy basic trajectory; the basic trajectory diffusion model is used to generate the basic trajectory from the initial noisy trajectory by denoising; the basic trajectory diffusion model is obtained by training a sample set, each sample in the sample set including training condition information, training environment information, training noisy trajectory, the noise intensity of the training noisy trajectory, and the robot motion trajectory as the target output; S3, use the drift optimization diffusion model to optimize the noisy base trajectory to obtain the optimized candidate trajectory; or, S4, use the drift optimization diffusion model to optimize the initial noisy trajectory and the base trajectory to obtain the optimized candidate trajectory; the drift optimization diffusion model is obtained by training on a derived sample set of the sample set; S5, select the candidate trajectory that meets the robot's motion safety requirements and has the best task evaluation value as the optimal trajectory, and control the robot's motion according to the optimal trajectory; the task evaluation value is used to evaluate the quality of the predetermined characteristics of the trajectory; the predetermined characteristics include at least one of trajectory length, energy consumption or time length of the robot moving from the starting point to the target point; S6, when there is a state deviation between the robot's current motion state and the optimal trajectory, and the value of the state deviation reaches the state deviation value threshold, modify the candidate trajectory according to the state deviation, and use the modified candidate trajectory as the new noisy base trajectory, return to S3, S5 and S6 to continue execution, or use the modified candidate trajectory as the new initial noisy trajectory, return to S2, S4, S5 and S6 to continue execution.

[0006] Optionally, the optimization of the noisy basic trajectory using a drift-optimized diffusion model to obtain optimized candidate trajectories includes: Based on the conditional input, the noisy basic trajectory, and the noise intensity of the noisy basic trajectory, the data are input into the drift optimization diffusion model to obtain the candidate trajectory.

[0007] Optionally, the input based on the conditional input, the initial noisy trajectory, and the noise intensity of the initial noisy trajectory are fed into the basic trajectory diffusion model to obtain the basic trajectory of the planned robot. The initial noisy trajectory and the basic trajectory are then optimized using a drift optimization diffusion model to obtain optimized candidate trajectories, including: The conditions, the initial noisy trajectory, and the noise intensity of the initial noisy trajectory are input into the basic trajectory diffusion model and the drift-optimized diffusion model. The initial noisy trajectory is used as the current noisy trajectory in the first denoising time step. In each denoising time step, the current denoising result is obtained based on the basic denoising result obtained from the basic trajectory diffusion model and the optimized denoising result obtained from the drift-optimized diffusion model, and is used as the current noisy trajectory in the next denoising time step, until all denoising time steps are completed and the candidate trajectory is obtained.

[0008] Optionally, each sample in the derived sample set is obtained in the following manner: Random noise following a Gaussian distribution is superimposed on the robot's motion trajectory to obtain a noisy robot motion trajectory. The training environment information, the training condition information, the noisy robot motion trajectory, and the noise intensity of the noisy robot motion trajectory are input into the basic trajectory diffusion model to obtain a new robot motion trajectory. The trajectory with the higher task evaluation value is selected from the robot's existing trajectory and the new robot trajectory as the new target output. Random noise following a Gaussian distribution is superimposed on the trajectory with the lower task evaluation value in the robot's motion trajectory and the new robot motion trajectory to serve as a new training noise trajectory.

[0009] Optionally, the candidate trajectory and the optimal trajectory respectively include the corresponding task evaluation value and the theoretical motion state parameters and theoretical action parameters of multiple time steps arranged in chronological order; The step of controlling the robot's motion according to the optimal trajectory includes: The robot's motion is controlled based on the theoretical motion state parameters and theoretical motion parameters of the optimal trajectory at the current time step; Before modifying the candidate trajectory based on the state deviation when there is a state deviation between the robot's current motion state and the optimal trajectory, and the value of the state deviation reaches a state deviation value threshold, the method further includes the following steps: Obtain the actual motion state parameters and actual action parameters of the robot; Replace the theoretical motion state parameters and theoretical motion parameters of the current time step with the actual motion state parameters and the actual action parameters; When there is a state deviation between the robot's current motion state and the optimal trajectory, and the value of the state deviation reaches a state deviation value threshold, modifying the candidate trajectory according to the state deviation includes: When there is a state deviation between the robot's current motion state and the theoretical motion state parameters at the current time step, and the value of the state deviation reaches a state deviation threshold, random noise with a preset intensity and following a Gaussian distribution is superimposed on the theoretical motion state parameters, theoretical action parameters, and task evaluation values ​​of the candidate trajectory at all time steps after the current time step; wherein, the preset intensity is determined by the state deviation.

[0010] Optionally, the noise intensity of the noisy baseline trajectory is determined as follows: The actual noise intensity of the noise injected into the trajectory is taken as the noise intensity of the noisy base trajectory; or, Based on the global guidance coefficient, the trajectory and the trajectory with the highest task evaluation value are weighted and combined to obtain the global optimal reference trajectory; The global optimal guiding noise intensity is determined based on the deviation between the global optimal reference trajectory and the trajectory. The actual noise intensity of the noise injected into the trajectory and the global optimal guiding noise intensity are squared and added together. The square root of the sum is taken as the noise intensity of the noisy basic trajectory. Wherein, when the noisy basic trajectory is obtained by superimposing random noise that follows a Gaussian distribution onto the basic trajectory, the trajectory is the basic trajectory; The noisy baseline trajectory is the candidate trajectory when it is obtained by superimposing Gaussian-distributed random noise onto the theoretical motion state parameters, theoretical action parameters, and task evaluation values ​​of the candidate trajectory at all time steps after the current time step.

[0011] Optionally, when the initial noisy trajectory is a random noise trajectory, the noise intensity of the random noise trajectory is used as the noise intensity of the initial noisy trajectory; When the initial noisy trajectory is obtained by superimposing Gaussian-distributed random noise onto the theoretical motion state parameters, theoretical action parameters, and task evaluation values ​​of the candidate trajectory at all time steps after the current time step, the noise intensity of the initial noisy trajectory is determined in the following manner: The actual noise intensity of the noise injected into the candidate trajectory is used as the noise intensity of the noisy base trajectory; or, Based on the global guidance coefficient, the candidate trajectory and the optimal trajectory are weighted and combined to obtain the global optimal reference trajectory; The global optimal guiding noise intensity is determined based on the deviation between the global optimal reference trajectory and the candidate trajectory; The actual noise intensity of the noise injected into the candidate trajectory and the global optimal guiding noise intensity are squared and added together. The square root of the sum is then used as the noise intensity of the noisy base trajectory.

[0012] Optionally, after modifying the candidate trajectory based on the state deviation, the method further includes the step of: The task evaluation value of the candidate trajectory is compared with a preset task evaluation value threshold; When the task evaluation value of the candidate trajectory is lower than the task evaluation value threshold, a preset deviation amount is applied to the task evaluation value of the candidate trajectory; and / or, The step of superimposing random noise following a Gaussian distribution onto the basic trajectory further includes the following steps: Compare the task evaluation value of the noisy basic trajectory with a preset task evaluation value threshold; When the task evaluation value of the noisy baseline trajectory is lower than the task evaluation value threshold, a preset deviation amount is applied to the task evaluation value of the noisy baseline trajectory.

[0013] Optionally, the basic trajectory diffusion model and the drift optimization diffusion model share the same backbone network and at least some network parameters; wherein, the backbone network is provided with an optimization condition switch, when the optimization condition switch is in the closed state, the backbone network constitutes the basic trajectory diffusion model, and when the optimization condition switch is in the open state, the backbone network constitutes the drift optimization diffusion model.

[0014] According to a second aspect of the embodiments of this application, a robot control device is provided, comprising: The condition input acquisition module is used to acquire information about the robot's surrounding environment and the robot's motion conditions as condition inputs. A basic module is used to input the conditional input, the initial noisy trajectory, and the noise intensity of the initial noisy trajectory into a basic trajectory diffusion model to obtain the basic trajectory of the planned robot, and to superimpose random noise following a Gaussian distribution on the basic trajectory to obtain a noisy basic trajectory; the basic trajectory diffusion model is used to generate the basic trajectory from the initial noisy trajectory by denoising; the basic trajectory diffusion model is obtained by training a sample set, each sample in the sample set including training condition information, training environment information, training noisy trajectory, the noise intensity of the training noisy trajectory, and the robot motion trajectory as the target output; The first optimization module is used to optimize the noisy base trajectory using a drift optimization diffusion model to obtain an optimized candidate trajectory; or, the second optimization module is used to optimize the initial noisy trajectory and the base trajectory using a drift optimization diffusion model to obtain an optimized candidate trajectory; the drift optimization diffusion model is obtained by training on a derived sample set of the sample set; The selection module is used to select the candidate trajectory that meets the robot's motion safety requirements and has the best task evaluation value as the optimal trajectory, and to control the robot's motion according to the optimal trajectory; the task evaluation value is used to evaluate the quality of predetermined characteristics of the trajectory; the predetermined characteristics include at least one of trajectory length, energy consumption or time length of the robot moving from the starting point to the target point; The update module is configured to modify the candidate trajectory according to the state deviation when there is a state deviation between the robot's current motion state and the optimal trajectory, and the value of the state deviation reaches a state deviation value threshold. The modified candidate trajectory is then used as the new noisy base trajectory, and the process returns to the first optimization module, the selection module, and the update module to continue execution. Alternatively, the modified candidate trajectory is used as the new initial noisy trajectory, and the process returns to the base module, the second optimization module, the selection module, and the update module to continue execution.

[0015] According to a third aspect of the embodiments of this application, an electronic device is provided, including a processor and a memory, wherein the memory stores instructions that, when the processor executes the instructions, cause the electronic device to perform the aforementioned robot control method.

[0016] The technical solutions provided by the embodiments of this application may include the following beneficial effects: In the robot control method of this application, through steps S1 and S2, the information of the robot's surrounding environment and the robot's motion conditions are used as input conditions, and are input into the basic trajectory diffusion model along with the initial noisy trajectory and the noise intensity of the initial noisy trajectory. The basic trajectory diffusion model is obtained by training a sample set. Each sample in the sample set includes training condition information, training environment information, training noisy trajectory, the noise intensity of the training noisy trajectory, and the robot motion trajectory as the target output. This ensures that the generated basic trajectory of the planned robot has good geometric and dynamic feasibility under the current environment and motion constraints, while maintaining a certain degree of trajectory diversity, thereby providing a reliable initial trajectory basis for subsequent optimization processing.

[0017] Based on this, through steps S3 and / or S4, the drift optimization diffusion model obtained by training on the derived sample set of the sample set is used to optimize the noisy basic trajectory and / or the initial noisy trajectory. This optimizes the candidate trajectory so that, while maintaining feasibility, it improves upon the planned robot's basic trajectory in at least one of the predetermined characteristics, namely, trajectory length, energy consumption or time length of the robot's movement from the starting point to the target point. This makes the generated path closer to the desired optimization requirements in terms of key performance indicators such as time consumption and energy consumption.

[0018] Simultaneously, through step S5, using the task evaluation value used to evaluate the quality of predetermined characteristics of the trajectory, the candidate trajectory that simultaneously satisfies robot motion safety and has the best task evaluation value is selected from multiple optimized candidate trajectories as the optimal trajectory, and the robot motion is controlled according to the optimal trajectory, so that the robot executes according to the trajectory with the better task evaluation value, thereby improving the consistency between trajectory planning results and task performance objectives.

[0019] In addition, in step S6, when there is a state deviation between the robot's current motion state and the optimal trajectory, and the value of the state deviation reaches the state deviation threshold, the optimized candidate trajectory is modified according to the state deviation, and the modified candidate trajectory is used as the new noisy base trajectory or the new initial noisy trajectory, respectively. Then, the process returns to steps S3, S5 and S6 or steps S2, S4, S5 and S6 to continue execution, so as to realize the rolling update of the robot's running trajectory, so that the robot can still adjust its running path in a timely manner and maintain a near-optimal running state even when there are external disturbances or trajectory execution errors.

[0020] In summary, the robot control method of this application, through the synergistic effect of "basic trajectory diffusion generation, drift optimization diffusion, trajectory optimization based on task evaluation value, and trajectory rolling update driven by state deviation", enables the robot motion path generated based on the diffusion model to significantly approach the expected optimal level in key performance indicators such as time consumption and energy consumption while ensuring feasibility and diversity. This effectively solves the technical problem that it is difficult for related diffusion model-generated paths to guarantee path optimality.

[0021] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this application. Attached Figure Description

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

[0023] Figure 1 This is a flowchart illustrating a robot control method according to an embodiment of this application; Figure 2 yes Figure 1 A flowchart illustrating the method for determining the derived training set in the robot control method is shown. Figure 3 This is a schematic diagram of a robot control device according to an embodiment of this application; Figure 4 This is a schematic diagram of another robot control device according to an embodiment of this application. Detailed Implementation

[0024] The technical solutions in the embodiments of this application will be clearly and completely described herein with reference to the accompanying drawings. In the following description, when referring to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements.

[0025] The terms "first" and "second" used in the embodiments of this application are for descriptive convenience only and should not be construed as indicating or implying relative importance.

[0026] Related path planning methods can be broadly categorized into three types: traditional search algorithms, sampling algorithms, and intelligent optimization algorithms. Graph search methods, represented by Dijkstra's shortest path algorithm and the A* algorithm, can obtain globally optimal or near-optimal paths in static scenarios within rasterized or graph-structured environments. However, as the environmental dimension and state space scale increase, the search space expands dramatically, leading to a significant increase in computational and storage overhead, making it difficult to meet the real-time planning requirements of high-dimensional and complex environments. Random sampling methods, represented by the RRT algorithm (Rapidly-exploring Random Tree), can better handle high-dimensional spaces and complex obstacle distributions by performing random sampling and tree-like expansion in continuous space. However, the generated paths often suffer from excessive polyline redundancy, insufficient smoothness and stability, and lack strict guarantees of global optimality. Intelligent optimization methods, such as the ACO (Ant Colony Optimization) algorithm and the PSO (Particle Swarm Optimization) algorithm, can escape local optima and find high-quality paths to a certain extent by relying on swarm intelligence and heuristic search. However, their performance is quite sensitive to parameter settings and heuristic rules. In large-scale or dynamically changing environments, they are prone to slow convergence, getting stuck in local optima, and difficulty in balancing global and real-time performance.

[0027] In recent years, with the development of deep learning and generative models, diffusion models (DM), as a typical type of deep generative model, have made significant progress in tasks such as image generation and sequence generation. Introducing diffusion models into robot trajectory or path generation scenarios allows for learning the distribution of feasible trajectories in complex environments within a data-driven framework, thereby generating diverse and well-continuous trajectories and providing new ideas and tools for path planning in high-dimensional spaces. However, related technical solutions that directly apply diffusion models to robot path planning still have significant limitations: on the one hand, the models mainly focus on fitting the trajectory distribution in the training data, easily repeating frequently occurring path patterns in the dataset, and lack explicit mechanisms for proactive adjustment around specific task objectives such as path length, energy consumption, and time consumption; on the other hand, the random sampling process introduced to obtain trajectory diversity lacks effective constraints and feedback linkage with the online decision-making process under path performance indicators and environmental changes, and trajectory generation, performance evaluation, and rolling adjustment have not yet formed a self-consistent closed loop.

[0028] Therefore, the fundamental shortcoming of related diffusion model-based robot path planning methods is that they are still largely at the level of fitting and randomly generating trajectory distributions. They have not yet deeply coupled trajectory generation with task performance indicators and online decision-making processes under the same mechanism. As a result, although the generated paths are mostly feasible and have a certain degree of diversity, in terms of key performance indicators such as time consumption and energy consumption, the generated paths often only meet the basic feasibility requirements and deviate significantly from the expected optimal level, making it difficult to guarantee that the obtained paths have the expected optimality.

[0029] This application provides a robot control method, system, device, computer program product, and medium. The robot control method of this application will be described in detail below with reference to the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.

[0030] Figure 1 This application illustrates a robot control method according to an exemplary embodiment. For example... Figure 1 As shown, the robot control method includes the following steps: S1: Obtain information about the robot's surrounding environment and motion conditions as input conditions.

[0031] Robot sensors collect environmental perception data, and the controller uses this data to model the environment and generate environmental information. This environmental information can include a map generated from the perception data, a state space representing spatial reachability, data describing the distribution of obstacles and free space, and topological relationships related to navigation. In engineering implementation, a host computer or edge server can model the environment from the perception data and send the environmental information to the controller. The controller then merges and updates this information with the latest environmental perception data acquired by the robot sensors. The controller can also obtain environmental information from external map sources and incrementally update or temporally register this information with the environmental perception data acquired by the robot sensors.

[0032] The controller determines the motion condition information for the current task. The current task can be understood as the specific operation the robot is assigned to complete during this path planning and control process, such as navigating from the starting position to the target workstation to complete a material handling operation, or sequentially reaching multiple inspection points within a predetermined area to complete inspections. The motion condition information consists of task conditions, objectives, and constraints, each fulfilling a different function.

[0033] Task conditions are a set of business parameters for planning and execution strategies, used to organize the path planning process. They may include identifiers of the starting and target states, necessary stops and their order, time windows, resource parameters, and planning preference weights.

[0034] The target is the set of termination states and criteria for mission completion, used to determine the termination conditions for planning and control. These may include target state, arrival distance threshold, attitude error threshold, arrival speed requirement, docking trigger signal, and dwell time requirement.

[0035] Constraints are a set of inviolable boundary conditions used to limit the feasible domain of a trajectory given environmental information. They can include operational constraints and safety constraints. Operational constraints can include upper speed limits, upper acceleration limits, minimum turning radius, maximum slope, and minimum passing width. Safety constraints can include obstacle safety distances, restricted areas, one-way rules, and minimum distance from pedestrians. The controller can check and supplement the aforementioned constraints based on environmental information to match the current scenario.

[0036] Environmental information and motion condition information are used together to define the scene boundaries and feasible regions for path planning. Specifically, the controller, based on environmental information such as maps, obstacle distribution, and topological relationships, and combined with motion condition information such as operational constraints and safety constraints, first determines the spatial range in which the robot is allowed to participate in planning and the areas it is prohibited from entering, thus providing the spatial boundaries for path planning. Within these boundaries, the controller further filters out areas that do not intersect with obstacles and meet conditions such as minimum turning radius, maximum slope, and minimum passage width, based on factors such as obstacle safety distance, passage width, terrain accessibility, and floor connectivity. This forms the feasible region, which is used to subsequently generate candidate trajectories that satisfy collision and passage constraints. The feasible region can be understood as the set of feasible states of the robot's motion trajectory in the state space under the combined constraints of the current environmental and motion condition information. Trajectories within this set are geometrically reachable, kinematically and / or dynamically feasible, and satisfy safety constraints. After obtaining the feasible domain, the controller initializes the robot and determines the initial state of the current task. The initial state may include information such as the robot's initial position, initial posture, velocity, and internal system state. This initial state is consistent with the motion state corresponding to the starting moment in the motion trajectory obtained in subsequent planning and is used as the starting point for the trajectory diffusion generation and optimization process.

[0037] S2, based on the conditional input, the initial noisy trajectory, and the noise intensity of the initial noisy trajectory, is input into the basic trajectory diffusion model to obtain the basic trajectory of the planned robot, and random noise following a Gaussian distribution is superimposed on the basic trajectory to obtain the noisy basic trajectory.

[0038] The basic trajectory diffusion model is used to generate a basic trajectory from the initial noisy trajectory through denoising. The basic trajectory diffusion model is obtained by training on a sample set, each sample of which includes training condition information, training environment information, training noisy trajectory, noise intensity of the training noisy trajectory, and the robot motion trajectory as the target output.

[0039] The initial noisy trajectory can be a random noise sequence obtained by sampling according to a Gaussian distribution.

[0040] Training condition information and training environment information are used to characterize the features corresponding to the robot's surrounding environment information and motion condition information during the training phase, respectively. Semantically, they are consistent with the robot's surrounding environment information and motion condition information during the inference phase, both describing the environmental state and motion constraints in the robot's working scenario. In the sample set, the robot's motion trajectory in each sample is a trajectory used to characterize the robot's motion behavior, obtained under the constraints of the corresponding training environment information and training condition information. The training noise trajectory can be obtained by superimposing Gaussian-distributed random noise onto the robot's motion trajectory.

[0041] Specifically, during the training phase, information about the robot's surrounding environment and motion conditions collected from multiple typical work scenarios can be organized or encoded according to a predetermined format and used as training condition information and training environment information. This information, along with the training noise trajectory and its noise intensity, is then input into the basic trajectory diffusion model so that the basic trajectory diffusion model can learn the mapping relationship between the initial noisy trajectory and the robot's motion trajectory within this type of condition information space.

[0042] During the inference phase, the environmental information and motion conditions of the robot acquired at the current moment are organized or encoded in the same way as in the training phase and then provided as input to the basic trajectory diffusion model. It is not required that the specific values ​​be exactly the same as the training conditions and environment information in the sample set; they only need to fall within the same category of environment and motion conditions covered by the training samples. This setup ensures that when the basic trajectory diffusion model encounters environmental and motion conditions of the same type but with different values ​​than those in the training phase, it can still provide a reasonable basic trajectory for the robot, avoiding situations where categories never encountered in the training phase prevent the generation of an effective trajectory.

[0043] S3, use the drift-optimized diffusion model to optimize the noisy base trajectory to obtain the optimized candidate trajectory. Alternatively, S4, use the drift-optimized diffusion model to optimize both the initial noisy trajectory and the base trajectory to obtain the optimized candidate trajectory. The drift-optimized diffusion model is obtained by training on a derived sample set of the sample set.

[0044] In terms of structural form, both the basic trajectory diffusion model and the drift optimization diffusion model belong to the conditional diffusion generation model with trajectory as the generation object.

[0045] In one alternative embodiment, such as Figure 2 As shown, each sample in the derived sample set is obtained through the following steps: S31. Random noise following a Gaussian distribution is superimposed on the robot's motion trajectory to obtain a noisy robot motion trajectory. The training environment information, training condition information, noisy robot motion trajectory, and noise intensity of the noisy robot motion trajectory are input into the basic trajectory diffusion model to obtain a new robot motion trajectory.

[0046] S32, select the trajectory with the higher task evaluation value from the robot's original trajectory and the new robot trajectory as the new target output.

[0047] S33, random noise following a Gaussian distribution is superimposed on the trajectory with the lower task evaluation value in the robot's motion trajectory and the new robot motion trajectory as a new training noise trajectory.

[0048] It should be noted that steps S31 to S33 above are illustrated using a specific training sample in the sample set as an example. This training sample provides a fixed set of training environment and training conditions information, as well as a robot motion trajectory obtained under this set of information. In the actual construction of the derived sample set, any training sample in the sample set can be used as a unit: for the training environment and training conditions information corresponding to this training sample, under the premise that this set of information remains unchanged, multiple corresponding trajectories can be obtained, such as the robot motion trajectory recorded in the sample set, the trajectory generated by the basic trajectory diffusion model under this set of information, or the trajectory further generated based on the aforementioned trajectory. Any two of these trajectories obtained under the same set of training environment and training conditions information can be processed as a pair of candidate trajectories: calculate the corresponding task evaluation value for each pair of trajectories, determine the trajectory with the higher task evaluation value as the target output in the derived sample set, and add the trajectory with the lower task evaluation value to it by superimposing random noise following a Gaussian distribution as a new training noise trajectory to the derived sample set.

[0049] During training on the derived sample set, the drift-optimized diffusion model uses trajectories with higher task evaluation values ​​as the target output and trajectories with lower task evaluation values ​​as training noise trajectories as input. This guides the model to output trajectories with higher task evaluation values ​​at each denoising time step. It is precisely this training method that enables the drift-optimized diffusion model to optimize the input trajectory, thereby progressively improving predetermined characteristics such as trajectory length, energy consumption, and time taken for the robot to move from the starting point to the target point relative to the input trajectory. This optimization is reflected both in the denoising results at each denoising time step and in the final generated candidate trajectory, while maintaining the model's robustness and accuracy in modeling complex trajectory distributions.

[0050] During training, the robot motion trajectories in the sample set and the target outputs obtained by filtering through task evaluation values ​​in the derived sample set are both used as noise-free target trajectories. They are then used in conjunction with a training noise trajectory and the noise intensity of that training noise trajectory to form trajectory pairs for training.

[0051] For the basic trajectory diffusion model, the robot's motion trajectory is taken as the noise-free target trajectory. Random noise following a Gaussian distribution is superimposed on the robot's motion trajectory according to a preset noise intensity to obtain the training noise trajectory and the noise intensity of the training noise trajectory. The training noise trajectory, the noise intensity of the training noise trajectory, and the training environment information and training condition information of the robot's motion trajectory are input into the basic trajectory diffusion model, so that the basic trajectory diffusion model learns the denoising mapping to recover the robot's motion trajectory from the training noise trajectory under the constraints of the above information.

[0052] For the drift optimization diffusion model, the target output in the derived sample set is taken as the noise-free target trajectory. Random noise following a Gaussian distribution is superimposed on the trajectory with a preset noise intensity on the trajectory with the same training environment and training conditions as the target output and a lower task evaluation value, to obtain a new training noise trajectory and the noise intensity of the new training noise trajectory. The new training noise trajectory, the noise intensity of the new training noise trajectory, and the training environment and training conditions of the target output are input into the drift optimization diffusion model, so that the drift optimization diffusion model learns to recover the denoising mapping of the target output from the new training noise trajectory under the constraints of the above information.

[0053] The noise intensity of the training noise trajectory is used to characterize the level of Gaussian noise actually injected into the trajectory, which can usually be represented by the standard deviation of the Gaussian noise distribution.

[0054] In both the basic trajectory diffusion model and the drift optimization diffusion model, whether in the training or inference phase, as long as the trajectory is generated or reconstructed along the inverse diffusion process based on the learned denoising mapping, the inverse diffusion solution process in the form of ODE (Ordinary Differential Equation) or the inverse diffusion solution process in the form of SDE (Stochastic Differential Equation) can be used to update the trajectory state in multiple steps.

[0055] Specifically, when solving the inverse diffusion equation using the ODE form, the implementation method given by Karras T., Aittala M., Aila T., and Laine S. in the paper "Elucidating the Design Space of Diffusion-Based Generative Models", NeurIPS 2022, can be used to generate the trajectory through the following ODE: When solving the inverse diffusion equation of injected noise using the SDE form, trajectory generation can be achieved through the following SDE: in, The input noisy trajectory or the intermediate noisy trajectory updated after several steps in the denoising process. For reverse diffusion time, This is a noise intensity schedule, used to provide the noise intensity corresponding to the back diffusion time t. For the noise intensity planning table gradient, The fractional function estimated by the model. For the standard Wiener process, This is the noise attenuation coefficient. The input conditions include environmental information and motion condition information.

[0056] In practical discretization calculations of the reverse diffusion process, the noise intensity can be assumed to change linearly with time, i.e., take... At this point, the gradient of the noise intensity schedule with respect to time is constant. In practical numerical implementation, a continuous noise intensity schedule can be created. Perform discrete sampling within a preset minimum noise level. With maximum noise intensity Several discrete noise intensity levels are generated between these levels, and the discrete time steps in the reverse diffusion process are determined accordingly. This is the minimum noise intensity preset in the noise intensity plan table, corresponding to the lower limit of the noise intensity sampling interval during the back diffusion process, and is usually set to 0.01. The maximum noise intensity preset in the noise intensity schedule corresponds to the upper limit of the noise intensity sampling interval, typically set to 50. Specifically, the time step can be determined as follows: : in, The parameter is used to adjust the distribution of time steps and control the density of time steps in different noise intensity ranges. It is usually taken between 5 and 10. To minimize noise intensity, For maximum noise intensity, The number of sampling intensities set on the noise intensity schedule.

[0057] Because in this embodiment, the following is taken The above time steps can be used Directly regarded as the corresponding discrete noise intensity Therefore, it can be understood as in Noise Intensity Plan within Space Equal-interval sampling is performed, and then mapped to obtain a monotonically decreasing set of noise intensity and time step sequences. This allows for the allocation of more time steps in the later stages of backdiffusion with less noise to improve denoising accuracy, while fewer time steps are allocated in the early stages of backdiffusion with more noise to reduce computational overhead. This application does not impose any limitations on this.

[0058] In practical implementation, the noise intensity of Gaussian-distributed random noise injected into the robot motion trajectories in the sample set and the trajectories with lower task evaluation values ​​under the same training environment and conditions as the target output can be set according to a preset noise intensity distribution, rather than fixing the noise intensity to a fixed value. The noise intensity distribution provides a set of selectable noise intensity values. During training, the noise intensity can be selected from the noise intensity distribution for the current training sample in the sample set or derived sample set. Gaussian-distributed random noise is then superimposed onto the robot motion trajectory or the trajectory with the lower task evaluation value in that training sample to obtain a training noise trajectory or a new training noise trajectory. For example, when processing ten training samples in the sample set and / or derived sample set simultaneously, the noise intensity can be selected for each of these ten training samples according to the noise intensity distribution. , Until , noise intensity , Until Ten training noise trajectories or new training noise trajectories are generated by adding noise to the robot's motion trajectory or the trajectory with the lowest task evaluation value in their respective training samples. By using different noise intensities in different training samples, the basic trajectory diffusion model and the drift-optimized diffusion model can learn denoising mappings under various noise intensities during training, which helps to improve the stability and accuracy of the generated trajectories under different noise intensities.

[0059] When step S3 is executed next, without going into the specific iterative denoising process, the process of generating the basic trajectory from the basic trajectory diffusion model in step S2 can be abstractly represented as: in, As the base trajectory for generation, Represents the basic trajectory diffusion model. The input conditions include environmental information and motion condition information. This is the initial noisy trajectory. The noise intensity of the initial noisy trajectory.

[0060] The basic trajectory diffusion model takes an initial noisy trajectory as input and generates a set of basic trajectories for subsequent optimization through a denoising process. ;in, It is a set of basic trajectories. It is the i-th basic trajectory in the set. It represents the total number of basic trajectories in the set. In the specific implementation, the total number... The configuration parameters for the basic trajectory diffusion model can be preset as integers greater than or equal to 1. For example, they can be set to 5, 10, or 20 depending on the computing resources and task complexity, so as to achieve a balance between trajectory diversity and computational overhead. This application does not limit this.

[0061] The process of generating candidate trajectories using the drift optimization diffusion model in step S3 can be abstractly represented as: in, For the generated candidate trajectories, This represents a drift-optimized diffusion model. The input conditions include environmental information and motion condition information. For a noisy baseline trajectory, The noise intensity is the noise level of the noisy baseline trajectory.

[0062] S5 selects the candidate trajectory that meets the requirements of robot motion safety and has the best task evaluation value as the optimal trajectory, and controls the robot's motion according to the optimal trajectory.

[0063] The task evaluation value is used to assess the quality of the predetermined characteristics of the trajectory. These predetermined characteristics include at least one of the following: trajectory length, energy consumption or time duration for the robot to move from the starting point to the target point.

[0064] S6: When there is a state deviation between the robot's current motion state and the optimal trajectory, and the value of the state deviation reaches the state deviation threshold, modify the candidate trajectory according to the state deviation, and use the modified candidate trajectory as the new noisy base trajectory, then return to S3, S5 and S6 to continue execution; or, use the modified candidate trajectory as the new initial noisy trajectory, then return to S2, S4, S5 and S6 to continue execution.

[0065] In the robot control method of this application, through steps S1 and S2, the information of the robot's surrounding environment and the robot's motion conditions are used as input conditions, and are input into the basic trajectory diffusion model along with the initial noisy trajectory and the noise intensity of the initial noisy trajectory. The basic trajectory diffusion model is obtained by training a sample set. Each sample in the sample set includes training condition information, training environment information, training noisy trajectory, the noise intensity of the training noisy trajectory, and the robot motion trajectory as the target output. This ensures that the generated basic trajectory of the planned robot has good geometric and dynamic feasibility under the current environment and motion constraints, while maintaining a certain degree of trajectory diversity, thereby providing a reliable initial trajectory basis for subsequent optimization processing.

[0066] Based on this, through steps S3 and / or S4, the drift optimization diffusion model obtained by training on the derived sample set of the sample set is used to optimize the noisy basic trajectory and / or the initial noisy trajectory. This optimizes the candidate trajectory so that, while maintaining feasibility, it improves upon the planned robot's basic trajectory in at least one of the predetermined characteristics, namely, trajectory length, energy consumption or time length of the robot's movement from the starting point to the target point. This makes the generated path closer to the desired optimization requirements in terms of key performance indicators such as time consumption and energy consumption.

[0067] Simultaneously, through step S5, using the task evaluation value used to evaluate the quality of predetermined characteristics of the trajectory, the candidate trajectory that simultaneously satisfies robot motion safety and has the best task evaluation value is selected from multiple optimized candidate trajectories as the optimal trajectory, and the robot motion is controlled according to the optimal trajectory, so that the robot executes according to the trajectory with the better task evaluation value, thereby improving the consistency between trajectory planning results and task performance objectives.

[0068] In addition, in step S6, when there is a state deviation between the robot's current motion state and the optimal trajectory, and the value of the state deviation reaches the state deviation threshold, the optimized candidate trajectory is modified according to the state deviation, and the modified candidate trajectory is used as the new noisy base trajectory or the new initial noisy trajectory, respectively. Then, the process returns to steps S3, S5 and S6 or steps S2, S4, S5 and S6 to continue execution, so as to realize the rolling update of the robot's running trajectory, so that the robot can still adjust its running path in a timely manner and maintain a near-optimal running state even when there are external disturbances or trajectory execution errors.

[0069] In summary, the robot control method of this application, through the synergistic effect of "basic trajectory diffusion generation, drift optimization diffusion, trajectory optimization based on task evaluation value, and trajectory rolling update driven by state deviation", enables the robot motion path generated based on the diffusion model to significantly approach the expected optimal level in key performance indicators such as time consumption and energy consumption while ensuring feasibility and diversity. This effectively solves the technical problem that it is difficult for related diffusion model-generated paths to guarantee path optimality.

[0070] In one optional embodiment, the basic trajectory diffusion model and the drift optimization diffusion model share the same backbone network and at least some network parameters; wherein, the backbone network is provided with an optimization condition switch, when the optimization condition switch is in the closed state, the backbone network constitutes the basic trajectory diffusion model, and when the optimization condition switch is in the open state, the backbone network constitutes the drift optimization diffusion model.

[0071] The basic trajectory diffusion model and the drift-optimized diffusion model can be uniformly implemented as a conditional diffusion model structure sharing the same backbone network. Specifically, a backbone network is set up to extract features and perform temporal modeling on the input trajectory sequence given environmental and motion conditions. The network layers used for extracting trajectory features and encoding conditional inputs are shared, using the same set of network parameters in both the basic trajectory diffusion model and the drift-optimized diffusion model. Based on the shared features, a first branch is set for basic denoising generation, and a second branch is set for drift optimization generation. A drift optimization condition switch is set in the backbone network. The value of the drift optimization condition switch controls whether the first or second branch is currently activated. During the training phase, either a basic denoising loss based on the sample set or a drift optimization loss based on a derived sample set is used. During the inference phase, it indicates whether the backbone network is currently running in the basic trajectory diffusion model mode or the drift-optimized diffusion model mode, thus functionally switching between the two modes.

[0072] During the training phase, when the drift optimization condition switch is off, only the first branch is activated, and the backbone network operates in the basic trajectory diffusion model mode. At this time, the network receives environmental information, training condition information, training environment information, and the training noise trajectory and its noise intensity as input. Based on features extracted from the shared portion, the first branch generates a predicted trajectory, which is then compared with the robot motion trajectory in the sample set as the target output to calculate the basic denoising loss. This loss is used to train the basic trajectory diffusion model, enabling it to generate the basic trajectory from the initial noisy trajectory during the inference phase through denoising.

[0073] During the training phase, when the drift optimization condition switch is on, only the second branch is activated, and the backbone network operates in drift optimization diffusion model mode. At this time, the network receives environmental information, training condition information, training environment information, and new training noise trajectories and their noise intensities from the derived sample set as input. Based on features extracted from the shared portion, the second branch obtains the optimized trajectory prediction result, which is then compared with the target output in the derived sample set to calculate the drift optimization loss. This loss is used to train the drift optimization diffusion model, enabling it to optimize the noisy base trajectory or initial noisy trajectory during the inference phase, generating candidate trajectories.

[0074] In practical applications, the shared parameters and the first branch parameters can be trained using a sample set when the drift optimization condition switch is off. After the basic trajectory diffusion model converges, the shared parameters are fixed. Then, when the drift optimization condition switch is on, the second branch parameters are mainly updated using a derived sample set. This allows switching between the basic trajectory diffusion model and the drift optimization diffusion model through a single drift optimization condition switch, while sharing the same backbone network and at least some network parameters. This avoids adverse effects on the performance of the basic trajectory diffusion model during the training phase of the drift optimization diffusion model.

[0075] It should be noted that the above implementation method of switching between the basic trajectory diffusion model and the drift-optimized diffusion model by sharing the backbone network and using a drift optimization condition switch is only an exemplary solution. In other embodiments, the basic trajectory diffusion model and the drift-optimized diffusion model can also be trained and deployed using their own independent network structures and parameters. That is, the basic trajectory diffusion model for generating the basic trajectory in step S2 can be trained based on the sample set, and the drift-optimized diffusion model for generating candidate trajectories in steps S3 and / or S4 can be trained based on the derived sample set, without sharing the backbone network and branches. In this case, the two models are still logically called sequentially according to the aforementioned steps. First, the basic trajectory diffusion model generates the basic trajectory based on the initial noisy trajectory, and then the drift-optimized diffusion model generates candidate trajectories based on the basic trajectory or the noisy basic trajectory. This application does not limit this.

[0076] In an optional embodiment, step S3 includes: inputting the conditional input, the noisy base trajectory, and the noise intensity of the noisy base trajectory into the drift optimization diffusion model to obtain candidate trajectories.

[0077] In one optional embodiment, based on conditional input, an initial noisy trajectory, and the noise intensity of the initial noisy trajectory, the data are input into a basic trajectory diffusion model to obtain the basic trajectory of the planned robot. A drift optimization diffusion model is then used to optimize the initial noisy trajectory and the basic trajectory, resulting in optimized candidate trajectories, including: The conditional input, the initial noisy trajectory, and the noise intensity of the initial noisy trajectory are input into the basic trajectory diffusion model and the drift optimization diffusion model. The initial noisy trajectory is used as the current noisy trajectory in the first denoising time step. In each denoising time step, the current denoising result is obtained based on the basic denoising result obtained from the basic trajectory diffusion model and the optimized denoising result obtained from the drift optimization diffusion model, and is used as the current noisy trajectory in the next denoising time step, until all denoising time steps are completed and candidate trajectories are obtained.

[0078] In an implementation where the basic trajectory diffusion model and the drift-optimized diffusion model share the same backbone network and switch between two working modes using a drift-optimized condition switch, the process of jointly denoising and generating candidate trajectories based on the basic trajectory diffusion model and the drift-optimized diffusion model across multiple denoising time steps can specifically include: using the initial noisy trajectory as the current noisy trajectory in the first denoising time step; sequentially executing multiple denoising time steps, in each denoising time step, inputting the current noisy trajectory, the noise intensity of the current noisy trajectory, environmental information, and motion condition information into the shared backbone network to obtain the feature representation of the current noisy trajectory in the backbone network; when the drift-optimized condition switch is in the off state, obtaining the basic denoising result based on the feature representation via the first branch; when the drift-optimized condition switch is in the on state, obtaining the optimized denoising result based on the feature representation via the second branch; and then, according to the preset CFG (Classifier-Free)... Guidance (classifier-guided) coefficients are used to weight and fuse the basic denoising result and the optimized denoising result to obtain the fused denoising result for this denoising time step. This fused denoising result is then used as the current denoising result to update the current noisy trajectory, and the updated noisy trajectory is used as the current noisy trajectory for the next denoising time step. After completing multiple denoising time steps, the final noisy trajectory is determined as the candidate trajectory. Specifically, the current denoising result can be determined by the following formula: in, This indicates the fusion denoising result at the current denoising time step. This represents the basic denoising result obtained by the basic trajectory diffusion model at the current denoising time step. This represents the optimized denoising result obtained by the drift-optimized diffusion model at the current denoising time step. This indicates conditional input, including environmental information and motion condition information. This represents the front-band noise trajectory at the current noise reduction time step. This represents the noise intensity of the initial noisy trajectory. This represents the CFG coefficient. Used to weigh the denoising direction given by the basic trajectory diffusion model against the optimization direction given by the drift-optimized diffusion model: when When the value is small, the basic denoising result of the basic trajectory diffusion model is given higher weight during the update, and the generated trajectory focuses more on maintaining feasibility and stability; when When the value is large, the optimization and denoising results of the drift optimization diffusion model are given higher weight during the update, and the generated trajectory focuses more on improving the task evaluation value and optimizing the performance index, thus achieving a trajectory generation effect that balances feasibility and task optimality between the two generation modes.

[0079] In one optional embodiment, the candidate trajectory and the optimal trajectory each include the corresponding task evaluation value and theoretical motion state parameters and theoretical action parameters of multiple time steps arranged in chronological order.

[0080] In this application, unless otherwise specified, all types of trajectories can be uniformly represented as a sequence consisting of theoretical parameters for multiple time steps and a termination parameter corresponding to the entire trajectory. Trajectories with different names can all use this trajectory representation form unless otherwise specified. Taking the basic trajectory as an example, the basic trajectory can be represented as follows: ;in, It is the basic trajectory. These are the theoretical parameters for the nth time step. It is the termination parameter.

[0081] In this application, any reference to superimposing Gaussian-distributed random noise onto a trajectory or to the theoretical parameters of each time step of the trajectory refers to doing so in the following manner: pre-determining the noise intensity used to characterize the noise amplitude. , The standard deviation of Gaussian noise is expressed as a value with a mean of zero and a variance of 1. The Gaussian distribution is denoted as For a given trajectory to be noise-added, the theoretical parameters at its nth time step are... From Random sampling noise and will and Adding them together gives the noisy parameters. = + ; by each time step The training noise trajectory or a new training noise trajectory is constructed in chronological order. The random noise trajectory, serving as the initial noisy trajectory, refers to a trajectory that is not superimposed on an existing noise-free target trajectory, but rather directly derived from the same Gaussian distribution along time steps. A noisy sequence obtained by continuous sampling can have its sampled values ​​at each time step used as parameters for the initial noisy trajectory.

[0082] Time steps can be used to discretize the continuous motion process of a robot. They can correspond to a fixed control cycle, a preset time interval, or a discrete sampling interval determined by a trajectory planning algorithm; this application does not limit this. Theoretical parameters for each time step... It can include theoretical state parameters and theoretical motion parameters Among them, theoretical state parameters It can be used to characterize the robot's expected state information at that time step, such as position, attitude, velocity, acceleration, joint angles, and / or internal system state; theoretical motion parameters, etc. This can be used to characterize the expected control commands driving the robot's motion at that time step, such as linear velocity commands, angular velocity commands, steering angles, and driving force, torque, or displacement commands for each actuator. In some embodiments, an environmental reward feedback parameter can also be added at each time step to measure the immediate gains at that time step. For example, the reward value calculated by a preset reward function based on the current theoretical state parameters and theoretical action parameters. Termination parameters. It does not change with time steps, but only corresponds to the entire trajectory, and can include a termination signal to indicate whether the trajectory has ended and the trajectory's task evaluation value. Overall indicators, including the task evaluation value. The evaluation value is used to assess the quality of predetermined characteristics of a motion trajectory. These predetermined characteristics include at least one of the following: trajectory length, energy consumption of the robot moving from the starting point to the target point, and time duration. It can be determined by a preset evaluation function. The trajectory is calculated based on predetermined characteristics and further integrated with extended evaluation indicators such as safety and comfort when needed to measure its overall quality. Preferably, to facilitate comparison and optimization on the same time scale, the input and output trajectories of the basic trajectory diffusion model and the drift optimization diffusion model maintain consistency in the number of time steps and time step index. That is, the input random noise trajectory and the output candidate first motion trajectory, as well as the input candidate first motion trajectory and the output candidate second motion trajectory, have the same length and a one-to-one correspondence of time steps on the discrete time axis.

[0083] The trajectories generated by the diffusion model involved in this application all correspond to the complete motion process of the robot from the initial state to the completion of the task under the current task. For the same task, the diffusion model needs to cover all possible planned trajectories under the task, and the duration of different planned trajectories may vary. Therefore, it is difficult to pre-define a fixed trajectory time step length for all possible planned trajectories under the current task.

[0084] Therefore, during the training and inference process of the diffusion model, a maximum number of time steps, not less than the length of various typical planned trajectories under that task, can be pre-set for the current task as the upper limit of the unified sequence length corresponding to that task. For trajectories obtained from actual planning, those that reach the target point and meet the termination condition within fewer than this maximum number of time steps are given theoretical control parameters sequentially according to the control instructions of the actual trajectory in each time step before reaching the termination condition. In the remaining time steps after reaching the termination condition, no new actual control instructions are introduced; instead, these time steps are treated as being determined by the termination parameters corresponding to the trajectory. The continuation of the "trajectory has ended" state can be achieved by uniformly setting the theoretical control parameters of the corresponding time step to default control parameters that match the termination parameters, such as zero control instructions or control instructions that maintain the termination state. This can be understood as using the termination parameters to complete the sequence portion after the actual trajectory ends. In this way, on the one hand, it ensures that all planned trajectories under the current task participate in training and generation in the diffusion model in the form of a uniform length of "time step theoretical control parameter sequence + termination parameter", and on the other hand, it does not rigidly limit the actual step size of the specific trajectory under the task.

[0085] Step S5 includes: controlling the robot's motion based on the theoretical motion state parameters and theoretical motion parameters of the optimal trajectory at the current time step.

[0086] In step S6, if there is a state deviation between the robot's current motion state and the optimal trajectory, and the value of the state deviation reaches the state deviation threshold, then before modifying the candidate trajectory according to the state deviation, the robot's actual motion state parameters and actual action parameters are obtained, and the theoretical motion state parameters and theoretical action parameters of the current time step are replaced by the actual motion state parameters and actual action parameters.

[0087] Step S6 includes: when there is a state deviation between the robot's current motion state and the theoretical motion state parameters at the current time step, and the value of the state deviation reaches a state deviation threshold, a random noise with a preset intensity and following a Gaussian distribution is superimposed on the theoretical motion state parameters, theoretical action parameters, and task evaluation values ​​of the candidate trajectory at all time steps after the current time step. The preset intensity is determined by the state deviation.

[0088] Step S6 can be understood as the process of aligning the robot's current actual motion state parameters, actual action parameters, and theoretical motion state parameters and theoretical action parameters, as well as triggering a replanning process based on the noisy base trajectory or initial noisy trajectory when the state deviation reaches a certain value. Taking position as the motion state as an example, the theoretical motion state parameters of the optimal trajectory at the current time step can give the robot's expected position at that time step. After the robot completes its movement at the current time step, its actual position can be obtained through odometry, IMU, or a positioning system. At this point, the difference between the two is... This reflects the deviation between the robot's current motion state and its optimal trajectory. When the value reaches the state deviation threshold, the theoretical motion state parameters and theoretical action parameters of the candidate trajectory at the current time step are replaced by the actual motion state parameters and actual action parameters of the robot at the current time step.

[0089] Based on this, random noise with a preset intensity and following a Gaussian distribution is superimposed on the theoretical motion state parameters, theoretical action parameters, and task evaluation values ​​of the candidate trajectory for all time steps after the current time step. The preset intensity is determined by the aforementioned state deviation. For example, the larger the state deviation, the larger the preset intensity, thus providing greater adjustment space for subsequent time steps when the deviation is large. After the above noise perturbation processing, a new candidate trajectory can be obtained under the condition of the current position deviation, and the modified candidate trajectory can be used as the new noisy base trajectory or as the new initial noisy trajectory.

[0090] In one alternative embodiment, the noise intensity of the noisy baseline trajectory is determined by one of two methods.

[0091] The first method: using the actual noise intensity of the noise injected into the trajectory as the noise intensity of the noisy base trajectory.

[0092] When the noisy base trajectory is obtained by superimposing random noise that follows a Gaussian distribution onto the base trajectory, the trajectory is the base trajectory, and the noise intensity of the noisy base trajectory can be a small preset value, such as 1 or 2.

[0093] When the noisy basic trajectory is obtained by superimposing random noise following a Gaussian distribution onto the theoretical motion state parameters, theoretical action parameters, and task evaluation values ​​of the candidate trajectory at all time steps after the current time step, the trajectory is a candidate trajectory, and the noise intensity of the noisy basic trajectory is determined by the state deviation.

[0094] The second method involves weighting the trajectory and the trajectory with the highest task evaluation value according to the global guidance coefficient to obtain the global optimal reference trajectory; determining the global optimal guidance noise intensity based on the deviation between the global optimal reference trajectory and the trajectory; and then squaring the actual noise intensity injected into the trajectory and the global optimal guidance noise intensity, adding them together, and taking the square root of the sum as the noise intensity of the noisy base trajectory.

[0095] When using the first method described above, the intensity of the noise injected into the trajectory is used as the noise intensity of the noisy base trajectory. This noise intensity is then used as the noise intensity parameter input for the drift optimization diffusion model when processing the noisy base trajectory. This parameter controls the denoising step size and update range of the drift optimization diffusion model at the corresponding noise level, ensuring that the noisy base trajectory mainly undergoes local perturbation and correction near the current trajectory. In subsequent denoising iterations, the drift optimization diffusion model only updates the noisy base trajectory locally based on this noise intensity parameter. Its update step size and perturbation range are primarily limited by the current trajectory itself, causing the trajectory evolution process to remain mostly within the neighborhood of the current trajectory. Consequently, even if a trajectory with the highest task evaluation value exists as a better overall solution, the noisy base trajectory struggles to quickly move out of its current neighborhood towards this better trajectory within the overall trajectory space, failing to fully reflect the "attractive" effect of the trajectory with the highest task evaluation value.

[0096] Therefore, in order to retain the local correction effect reflected by the intensity of the noise injected into the trajectory, while introducing the global guiding role of the trajectory with the highest task evaluation value for subsequent trajectory evolution, a global optimization mechanism based on the global guidance coefficient can be adopted to adaptively set the noise intensity parameter of the noisy base trajectory of the input drift optimization diffusion model.

[0097] This global optimization mechanism can be understood as follows: the trajectory with the highest task evaluation value is regarded as the global optimal trajectory, and it is used as the benchmark for constructing the global optimal reference trajectory. The global guiding coefficient is used to weight and combine the current trajectory and the trajectory with the highest task evaluation value after the current time step to obtain the corresponding global optimal reference trajectory. Under the adjustment of the global guiding coefficient, the trajectory segment of the current trajectory after the current time step will numerically approach the global optimal trajectory, and the global optimal trajectory will be used as the attraction center to guide the update direction of the current trajectory.

[0098] Specifically, the globally optimal reference trajectory can be determined using the following formula: in, For the i-th globally optimal reference trajectory, This refers to the portion of the i-th trajectory after the current time step. The portion of the trajectory with the highest task evaluation value after the current time step. is the global guidance coefficient, used to adjust the attraction intensity of the trajectory with the highest task evaluation value, t is the current time step, and T is the last time step. It can be represented as ,in, These are the theoretical parameters of the i-th trajectory at the n-th time step. It is the termination parameter of the i-th trajectory.

[0099] Then, it can be based on the globally optimal reference trajectory. With trajectory The deviation between the values ​​determines the corresponding globally optimal guiding noise intensity. After obtaining the globally optimal guiding noise intensity, the noise intensity of the noisy base trajectory is determined using the following formula: in, The actual noise intensity of the noise injected into the trajectory. The optimal guiding noise intensity is determined globally. The noise intensity is the noise level of the noisy baseline trajectory.

[0100] Thus, without a global optimization mechanism, the noise intensity of the noisy base trajectory is determined by the actual noise intensity injected into the trajectory, serving as an input parameter for the drift optimization diffusion model to control the model's denoising step size and update amplitude, thereby locally correcting the trajectory. With a global optimization mechanism, the noise intensity of the noisy base trajectory is jointly determined by the actual noise intensity injected into the trajectory and the globally optimal guiding noise intensity, and is also input into the drift optimization diffusion model. By adjusting the global guiding coefficient, the drift optimization diffusion model adaptively sets the noise intensity of the noisy base trajectory based on local perturbations and global guiding information, thereby guiding the model to balance local correction and global optimization objectives during denoising.

[0101] When the noisy base trajectory is obtained by superimposing random noise that follows a Gaussian distribution onto the base trajectory, the aforementioned trajectory is the base trajectory, and the trajectory with the highest task evaluation value is the base trajectory with the highest task evaluation value.

[0102] When the noisy baseline trajectory is obtained by superimposing Gaussian-distributed random noise onto the theoretical motion state parameters, theoretical action parameters, and task evaluation values ​​of the candidate trajectory at all time steps after the current time step, the aforementioned trajectory is the candidate trajectory, and the trajectory with the highest task evaluation value is the optimal trajectory.

[0103] In one optional embodiment, when the initial noisy trajectory is a random noise trajectory, the noise intensity of the random noise trajectory is used as the noise intensity of the initial noisy trajectory. This noise intensity is a predetermined value, typically set to 20.

[0104] When the initial noisy trajectory is obtained by superimposing Gaussian-distributed random noise on the theoretical motion state parameters, theoretical action parameters, and task evaluation values ​​of the candidate trajectory at all time steps after the current time step, the noise intensity is the same as that of the noisy base trajectory. The noise intensity of the initial noisy trajectory is determined by one of the following two methods.

[0105] The first method uses the actual noise intensity of the noise injected into the candidate trajectory as the noise intensity of the noisy base trajectory.

[0106] The second method involves weighted combination of candidate and optimal trajectories based on the global guidance coefficient to obtain the globally optimal reference trajectory; determining the globally optimal guidance noise intensity based on the deviation between the globally optimal reference trajectory and the candidate trajectory; and summing the squares of the actual noise intensity injected into the candidate trajectory and the globally optimal guidance noise intensity, taking the square root of the sum as the noise intensity of the noisy base trajectory. The specific calculation method for the noise intensity can be the same as the aforementioned method for calculating the noise intensity of the noisy base trajectory; the relevant implementation process is described above and will not be repeated here.

[0107] To introduce additional optimization guidance on trajectories with low task evaluation values ​​but not yet significantly deviating from task requirements and still having room for optimization, and to prevent such trajectories from being prematurely discarded during the task evaluation value-based screening process, in some embodiments, a task evaluation value adjustment mechanism can be set to appropriately increase the task evaluation value of these trajectories so that they can continue to participate in comparison and optimization during subsequent trajectory replanning and optimal trajectory selection.

[0108] In an optional embodiment, after modifying the candidate trajectory according to the state deviation in step S6, the method further includes the steps of: comparing the task evaluation value of the candidate trajectory with a preset task evaluation value threshold; and applying a preset deviation amount to the task evaluation value of the candidate trajectory when the task evaluation value of the candidate trajectory is lower than the task evaluation value threshold.

[0109] For the candidate trajectory obtained in step S6 based on the state deviation modification, firstly, the task evaluation value of the candidate trajectory is compared with a preset task evaluation value threshold: when the task evaluation value of the candidate trajectory is lower than the task evaluation value threshold, the task evaluation value is considered a low evaluation result, and a preset deviation amount is applied to adjust it to obtain an adjusted task evaluation value. This adjusted task evaluation value is then used when selecting the optimal trajectory from multiple candidate trajectories based on the task evaluation value. The adjusted task evaluation value can be determined as follows: in, The adjusted task evaluation value. This is the original task evaluation value. The deviation is a preset value. Through the above processing, the candidate trajectories with slightly lower task evaluation values ​​but still room for improvement in step S6 have their task evaluation values ​​increased to a certain extent. This prevents them from being prematurely discarded when selecting the optimal trajectory due to their slightly lower evaluation values, and helps to retain and further optimize such candidate trajectories during the replanning process.

[0110] In an optional embodiment, after superimposing random noise following a Gaussian distribution on the base trajectory in step S2, the method further includes the steps of: comparing the task evaluation value of the noisy base trajectory with a preset task evaluation value threshold; and applying a preset deviation amount to the task evaluation value of the noisy base trajectory when the task evaluation value of the noisy base trajectory is lower than the task evaluation value threshold.

[0111] For the noisy baseline trajectory obtained in step S2, the controller compares the task evaluation value of the noisy baseline trajectory with a preset task evaluation value threshold. When the task evaluation value of the noisy baseline trajectory is lower than the task evaluation value threshold, a preset deviation is applied to its task evaluation value to obtain an adjusted task evaluation value. The above adjustment can also be achieved using the formula... Perform the calculation.

[0112] It should be noted that the task evaluation threshold used for candidate trajectories and noisy base trajectories can be the same, or different thresholds can be set for different trajectory types. The specific value selection method does not constitute a limitation of this application.

[0113] In one specific implementation, the task evaluation threshold can be set as the average task evaluation value of the current batch of candidate trajectories or noisy basic trajectories. The preset deviation can be determined proportionally to the difference between the task evaluation value and the task evaluation threshold. For example, when the task evaluation value of the candidate trajectory in step S6 or the noisy basic trajectory in step S2 is lower than the task evaluation threshold, a preset proportional coefficient can be used. (A positive number between 0 and 1), the deviation is calculated using the following formula: in, This is the deviation amount. This is the proportionality coefficient. The threshold for task evaluation value, Evaluation of candidate trajectories or noisy basic trajectories.

[0114] This setting allows candidate trajectories with low task evaluation values ​​or noisy base trajectories to numerically approach the task evaluation value threshold. When the task evaluation value threshold is selected to be close to the task evaluation level of the noisy base trajectory or the optimal trajectory with the highest task evaluation value, i.e., the global optimal trajectory, the adjusted task evaluation values ​​used in steps S6 and S2 converge towards the task evaluation value of the global optimal trajectory as a whole. Thus, during the trajectory selection and replanning process, additional optimization guidance is applied to trajectories with low original task evaluation values ​​but room for improvement.

[0115] In an optional embodiment, for cases where the distance between the starting point and the target point is large and the path shape is complex, a hierarchical approach can be used to generate the trajectory based on the aforementioned robot control method. Specifically, firstly, within the overall path range, the starting point is taken as the starting point of the global trajectory, and the target point is taken as the ending point of the global trajectory. Referring to steps S1 to S4 regarding the generation of candidate trajectories using the basic trajectory diffusion model and the drift optimization diffusion model, and the selection of the optimal trajectory, a globally optimal trajectory covering the starting point to the target point is obtained. This globally optimal trajectory is also represented as a sequence of theoretical motion state parameters, theoretical action parameters, and termination parameters for multiple time steps arranged in chronological order. The theoretical motion state parameters for each time step include the robot's position at that time step. It should be noted that in this global trajectory generation process, only trajectory generation and selection based on the diffusion model are involved; the actual robot control actions in steps S5 and S6 do not need to be executed.

[0116] After the globally optimal trajectory is determined, several positions corresponding to time steps from multiple time steps of the globally optimal trajectory can be selected as intermediate reference points, and these intermediate reference points are defined as sub-target points. The selection rules for sub-target points can vary. For example, in one optional implementation, a time step can be selected along the globally optimal trajectory at intervals of approximately M spatial distances, and the position information corresponding to that time step can be used as a sub-target point. In another optional implementation, sub-target points can be selected according to preset time step intervals, time steps where the environment changes significantly, or time steps near obstacle boundaries. This application does not impose any limitations on these methods.

[0117] Subsequently, the trajectory interval between any two adjacent sub-target points on the globally optimal trajectory is considered a local sub-segment. The starting and ending sub-target points of this local sub-segment are used as the new starting and target points. The basic trajectory diffusion model and drift optimization diffusion model are then invoked again, referring to the aforementioned robot control method, to generate a local trajectory. Specifically, the trajectory generation and optimization process shown in steps S1 to S6 can be repeated within each local sub-segment to obtain the locally optimal trajectory within that sub-segment. By sequentially generating locally optimal trajectories between adjacent sub-target points and then piecing them together according to the order of the sub-target points, a gradual refinement generation at both the global and local levels is achieved.

[0118] In practical implementation, the basic trajectory diffusion model and drift optimization diffusion model used to generate the globally optimal trajectory, and the basic trajectory diffusion model and drift optimization diffusion model used to generate the locally optimal trajectory in each local segment, can be configured in multiple ways: they can completely reuse the same set of network structures and parameters, or, while sharing the same backbone network structure, different parameter configurations can be used for global generation and local generation, or they can be instantiated as independent basic trajectory diffusion models and drift optimization diffusion models. Through these methods, multiple cooperating trajectory generation diffusion models can be formed at both the global and local scales to handle the generation and optimization of the global trajectory and the trajectory of each local segment, respectively. This application does not limit this approach.

[0119] Based on the same inventive concept as the robot control method described above, this application also provides a robot control device, such as... Figure 3 As shown, the robot control device 1 includes: a condition input acquisition module 2, a basic module 3, a first optimization module 4, a selection module 6, and an update module 7; or, as... Figure 4 As shown, the robot control device 1 includes: a condition input acquisition module 2, a basic module 3, a second optimization module 5, a selection module 6, and an update module 7.

[0120] The condition input acquisition module 2 is used to acquire information about the robot's surrounding environment and the robot's motion conditions as condition inputs.

[0121] The basic module 3 is used to input the conditional input, the initial noisy trajectory, and the noise intensity of the initial noisy trajectory into the basic trajectory diffusion model to obtain the basic trajectory of the planned robot, and to superimpose random noise following a Gaussian distribution on the basic trajectory to obtain the noisy basic trajectory.

[0122] The basic trajectory diffusion model is used to generate a basic trajectory from an initial noisy trajectory through denoising. The basic trajectory diffusion model is obtained by training on a sample set, where each sample includes training condition information, training environment information, training noisy trajectories, the noise intensity of the training noisy trajectories, and the robot motion trajectory as the target output. The first optimization module 4 is used to optimize the noisy basic trajectory using a drift optimization diffusion model to obtain the optimized candidate trajectory.

[0123] The second optimization module 5 is used to optimize the initial noisy trajectory and the basic trajectory using a drift-optimized diffusion model to obtain optimized candidate trajectories. The drift-optimized diffusion model is obtained by training on a derived sample set of the sample set.

[0124] The selection module 6 is used to select the candidate trajectory that meets the requirements of robot motion safety and has the best task evaluation value as the optimal trajectory, and to control the robot motion according to the optimal trajectory.

[0125] The task evaluation value is used to evaluate the quality of the predetermined characteristics of the trajectory. The predetermined characteristics include at least one of the following: trajectory length, energy consumption or time duration for the robot to move from the starting point to the target point.

[0126] The update module 7 is used to modify the candidate trajectory according to the state deviation when there is a state deviation between the robot's current motion state and the optimal trajectory, and the value of the state deviation reaches the state deviation value threshold. The modified candidate trajectory is then used as the new noisy base trajectory, and the process returns to the first optimization module 4, selection module 6 and update module 7 to continue execution. Alternatively, the modified candidate trajectory is used as the new initial noisy trajectory, and the process returns to the base module 3, second optimization module 5, selection module 6 and update module 7 to continue execution.

[0127] Each module of the robot control device corresponds to a step in the robot control method. The specific implementation process of the function and role of each module in the robot control device can be found in the implementation process of the corresponding step in the robot control method, which can achieve the same technical effect, and will not be repeated here.

[0128] An electronic device provided in this application includes one or more processors for implementing the robot control method described above.

[0129] In some embodiments, the electronic device may include a storage medium. For example, a computer-readable storage medium may store a program that can be invoked by a processor, and may include a non-volatile storage medium. In some embodiments, the electronic device may include memory and an interface. In some embodiments, the electronic device may also include other hardware depending on the specific application.

[0130] The computer-readable storage medium of this application embodiment stores a program thereon, which, when executed by a processor, is used to implement the robot control method described above.

[0131] This application may take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing program code. Computer-readable storage media include permanent and non-permanent, removable and non-removable media, and information storage can be implemented using any method or technology. Information may be computer-readable instructions, data structures, program modules, or other data. Examples of computer-readable storage media include, but are not limited to: phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.

[0132] The aforementioned electronic device can execute the robot control method provided in the embodiments herein. The aforementioned electronic device may include the aforementioned robot control apparatus, such as one or more of a processor, a controller, and a PC (Personal Computer) terminal device. The server terminal device and the PC terminal device may include, but are not limited to, a server, a desktop computer, a tablet computer, or a laptop computer.

[0133] It should be noted that the technical solutions or features described in the above embodiments can be combined or supplemented with each other without conflict. The scope of protection of this application is not limited to the precise structures described in the above embodiments and shown in the accompanying drawings; all modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A robot control method characterized by, The method comprises the following steps: S1, obtaining environment information around a robot and motion condition information of the robot as condition input; S2, inputting the condition input, an initial noisy trajectory and noise intensity of the initial noisy trajectory into a basic trajectory diffusion model to obtain a basic trajectory of the robot, and superimposing random noise subject to a Gaussian distribution on the basic trajectory to obtain a noisy basic trajectory; the basic trajectory diffusion model is used to generate the basic trajectory by denoising from the initial noisy trajectory; the basic trajectory diffusion model is obtained by training a sample set, each sample of the sample set comprising training condition information, training environment information, a training noisy trajectory, noise intensity of the training noisy trajectory and a robot motion trajectory as target output; S3, optimizing the noisy basic trajectory using a drift optimization diffusion model to obtain an optimized candidate trajectory; Alternatively, S4, optimizing the initial noisy trajectory and the basic trajectory using a drift optimization diffusion model to obtain an optimized candidate trajectory; the drift optimization diffusion model is obtained by training a derived sample set of the sample set; S5, taking a candidate trajectory that meets robot motion safety and has an optimal task evaluation value as an optimal trajectory, and controlling the robot to move according to the optimal trajectory; the task evaluation value is used to evaluate the pros and cons of a predetermined characteristic of a trajectory; the predetermined characteristic comprises at least one of a trajectory length, energy consumption or time length of the robot moving from a starting point to a target point; S6, when there is a state deviation between a current motion state of the robot and the optimal trajectory, and a value of the state deviation reaches a state deviation value threshold, modifying the candidate trajectory according to the state deviation, taking the modified candidate trajectory as a new noisy basic trajectory, and returning to S3, S5 and S6 for continuous execution, or taking the modified candidate trajectory as a new initial noisy trajectory, and returning to S2, S4, S5 and S6 for continuous execution.

2. The robot control method of claim 1, wherein, The use of the drift optimization diffusion model to optimize the noisy basic trajectory to obtain an optimized candidate trajectory comprises: inputting the condition input, the noisy basic trajectory and noise intensity of the noisy basic trajectory into the drift optimization diffusion model to obtain the candidate trajectory.

3. The robot control method of claim 1, wherein, The inputting of the condition input, the initial noisy trajectory and noise intensity of the initial noisy trajectory into the basic trajectory diffusion model to obtain the basic trajectory of the robot, and the use of the drift optimization diffusion model to optimize the initial noisy trajectory and the basic trajectory to obtain an optimized candidate trajectory comprise: inputting the condition, the initial noisy trajectory and the noise intensity of the initial noisy trajectory into the basic trajectory diffusion model and the drift optimization diffusion model, taking the initial noisy trajectory as a current noisy trajectory of a first denoising time step, at each denoising time step, obtaining a current denoising result based on a basic denoising result obtained by the basic trajectory diffusion model and an optimized denoising result obtained by the drift optimization diffusion model as a current noisy trajectory of a next denoising time step, until all denoising time steps are completed to obtain the candidate trajectory.

4. The robot control method according to claim 2 or 3, characterized by, Each sample in the derived sample set is obtained by the following way: superimposing random noise subject to a Gaussian distribution on the robot motion trajectory to obtain a noisy robot motion trajectory, inputting the training environment information, the training condition information, the noisy robot motion trajectory and the noise intensity of the noisy robot motion trajectory into the basic trajectory diffusion model to obtain a new robot motion trajectory; selecting a trajectory with a higher task evaluation value from the robot motion trajectory and the new robot motion trajectory as a new target output; superimposing random noise subject to a Gaussian distribution on a trajectory with a lower task evaluation value from the robot motion trajectory and the new robot motion trajectory as a new training noise trajectory.

5. The robot control method according to claim 2 or 3, characterized by, The candidate trajectory and the optimal trajectory respectively include a corresponding task evaluation value and theoretical motion state parameters and theoretical action parameters of a plurality of time steps arranged in time sequence; The control of the robot motion according to the optimal trajectory includes: controlling the robot motion according to the theoretical motion state parameters and the theoretical action parameters of the optimal trajectory at a current time step; Before the modifying of the candidate trajectory according to the state deviation when the current motion state of the robot deviates from the optimal trajectory and the value of the state deviation reaches a state deviation value threshold, the method further includes the steps of: obtaining actual motion state parameters and actual action parameters of the robot; replacing the theoretical motion state parameters and the theoretical action parameters at the current time step with the actual motion state parameters and the actual action parameters; The modifying of the candidate trajectory according to the state deviation when the current motion state of the robot deviates from the optimal trajectory and the value of the state deviation reaches a state deviation value threshold includes: when the current motion state of the robot deviates from the theoretical motion state parameters at the current time step and the value of the state deviation reaches a state deviation value threshold, superimposing random noise subject to a Gaussian distribution with a preset intensity on the theoretical motion state parameters, the theoretical action parameters and the task evaluation value of all time steps of the candidate trajectory after the current time step; wherein the preset intensity is determined by the state deviation.

6. The robot control method of claim 5, wherein the noise intensity of the noisy basic trajectory is determined by the following way: taking the actual noise intensity of the injected noise on the trajectory as the noise intensity of the noisy basic trajectory; or, combining the trajectories and the trajectory with the highest task evaluation value according to a global guidance coefficient to obtain a globally optimal reference trajectory; determining a globally optimal guidance noise intensity according to a deviation of the globally optimal reference trajectory and the trajectory; squaring the actual noise intensity of the noise injected into the trajectory and the globally optimal guidance noise intensity respectively, adding them, and taking the square root of the addition result to obtain a value as the noise intensity of the noisy base trajectory; wherein, when the noisy base trajectory is obtained by superimposing random noise obeying a Gaussian distribution on the base trajectory, the trajectory is the base trajectory; when the noisy base trajectory is obtained by superimposing random noise obeying a Gaussian distribution on the theoretical motion state parameters, the theoretical action parameters and the task evaluation value of the candidate trajectory at all time steps after the current time step, the trajectory is the candidate trajectory.

7. The robot control method of claim 5, wherein, when the initial noisy trajectory is a random noise trajectory, the noise intensity of the random noise trajectory is taken as the noise intensity of the initial noisy trajectory; when the initial noisy trajectory is obtained by superimposing random noise obeying a Gaussian distribution on the theoretical motion state parameters, the theoretical action parameters and the task evaluation value of the candidate trajectory at all time steps after the current time step, the noise intensity of the initial noisy trajectory is determined by: taking the actual noise intensity of the noise injected into the candidate trajectory as the noise intensity of the noisy base trajectory; or, combining the candidate trajectory and the optimal trajectory according to a global guidance coefficient to obtain a globally optimal reference trajectory; determining a globally optimal guidance noise intensity according to a deviation of the globally optimal reference trajectory and the candidate trajectory; squaring the actual noise intensity of the noise injected into the candidate trajectory and the globally optimal guidance noise intensity respectively, adding them, and taking the square root of the addition result to obtain a value as the noise intensity of the noisy base trajectory.

8. The robot control method of claim 5, wherein, the step of modifying the candidate trajectory according to the state deviation further comprises the steps of: comparing the task evaluation value of the candidate trajectory with a preset task evaluation value threshold; when the task evaluation value of the candidate trajectory is lower than the task evaluation value threshold, applying a preset deviation amount to the task evaluation value of the candidate trajectory; and / or, the step of superimposing random noise obeying a Gaussian distribution on the base trajectory further comprises the steps of: comparing the task evaluation value of the noisy base trajectory with a preset task evaluation value threshold; when the task evaluation value of the noisy base trajectory is lower than the task evaluation value threshold, applying a preset deviation amount to the task evaluation value of the noisy base trajectory.

9. The robot control method of claim 1, wherein, The base trajectory diffusion model and the drift optimization diffusion model share the same backbone network and at least part of the network parameters; wherein, the optimization condition switch is arranged in the backbone network, when the optimization condition switch is in the off state, the backbone network constitutes the base trajectory diffusion model, when the optimization condition switch is in the on state, the backbone network constitutes the drift optimization diffusion model.

10. A robot control device characterized by comprising: comprises: a condition input obtaining module, configured to obtain environment information around the robot and motion condition information of the robot as condition input; a base module, configured to input the condition input, an initial noisy trajectory and noise intensity of the initial noisy trajectory into a base trajectory diffusion model to obtain a base trajectory of the robot, and superimpose random noise subject to a Gaussian distribution on the base trajectory to obtain a noisy base trajectory; the base trajectory diffusion model is configured to generate the base trajectory from the initial noisy trajectory by denoising; the base trajectory diffusion model is obtained by training a sample set, each sample of the sample set including training condition information, training environment information, a training noisy trajectory, noise intensity of the training noisy trajectory and a robot motion trajectory as target output; a first optimization module, configured to optimize the noisy base trajectory using a drift optimization diffusion model to obtain an optimized candidate trajectory; or, a second optimization module, configured to optimize the initial noisy trajectory and the base trajectory using a drift optimization diffusion model to obtain an optimized candidate trajectory; the drift optimization diffusion model is obtained by training a derived sample set of the sample set; a selection module, configured to select a candidate trajectory that meets robot motion safety and has an optimal task evaluation value as an optimal trajectory, and control motion of the robot according to the optimal trajectory; the task evaluation value is used to evaluate a predetermined characteristic of a trajectory; the predetermined characteristic includes at least one of a trajectory length, energy consumption or time length of the robot moving from a starting point to a target point; an updating module, configured to, when a current motion state of the robot and the optimal trajectory have a state deviation and a value of the state deviation reaches a state deviation value threshold, modify the candidate trajectory according to the state deviation, use the modified candidate trajectory as a new noisy base trajectory, and return the first optimization module, the selection module and the updating module for continuous execution, or use the modified candidate trajectory as a new initial noisy trajectory, and return the base module, the second optimization module, the selection module and the updating module for continuous execution.

11. An electronic device, comprising: The electronic device includes a processor and a memory, and the memory stores instructions. When the processor executes the instructions, the electronic device performs the robot control method in any one of claims 1-9.