A task progress prediction method and device based on phase perception modeling
By dividing sub-task stages based on keyframes and determining timestamps, and using a stage-aware reward model to train a robot for long-term task progress prediction, the problems of inconsistent progress semantics and insufficient robustness are solved, and accurate task progress prediction is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING YUANLUO TECHNOLOGY CO LTD
- Filing Date
- 2026-04-15
- Publication Date
- 2026-06-02
AI Technical Summary
Existing methods for predicting the progress of long-term tasks suffer from problems such as inconsistent progress semantics, unstable annotation methods, inability to handle local success or failure trajectories, and low-quality samples interfering with model performance, resulting in insufficient accuracy and robustness in progress prediction.
By acquiring trajectory data of the target robot's historical long-term tasks, sub-task stages are divided based on keyframes and stage boundary timestamps are determined. Intra-segment progress and global progress are calculated, and a stage-aware reward model is used for training to predict the progress of the current task.
It achieves semantic unification of robot long-term task progress, adapts to multiple task completion states, improves the accuracy and robustness of progress prediction, and meets the needs of real-time progress prediction.
Smart Images

Figure CN122135273A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of robot task progress prediction technology, and in particular to a task progress prediction method and apparatus based on stage perception modeling. Background Technology
[0002] With the rapid development of embodied intelligence technology, robots are increasingly being used in industrial production, home services and other fields. The demand for long-duration robot operation tasks is also increasing. Long-duration tasks refer to robot operation tasks that have a long duration, contain multiple continuous action steps, have coherent action logic and have clear objectives.
[0003] Currently, long-term task progress prediction has several shortcomings: First, existing methods estimate progress only based on the overall task duration, leading to inconsistent progress semantics across different trajectories, meaning the same progress value may correspond to different task execution states; second, progress labeling methods are unstable, making progress alignment across trajectories difficult; third, progress estimation can only be performed on complete and successful trajectories, resulting in limited model learning samples and insufficient generalization ability; fourth, during the training process of the progress prediction model, low-quality noise samples can easily interfere with model performance, reducing the accuracy and robustness of progress prediction. Summary of the Invention
[0004] In view of this, the purpose of this application is to provide a task progress prediction method and apparatus based on stage-aware modeling. By acquiring the trajectory data of the target robot's historical long-term tasks, dividing the task into sub-task stages based on keyframes and determining the stage boundary timestamps, calculating the intra-segment progress of each time frame and the global progress of the sub-task stage, and training a stage-aware reward model using the target task trajectory dataset for current task progress prediction, this method solves the technical problems of inconsistent progress semantics due to the lack of stage division in existing methods, unstable annotation methods, inability to handle local successful or failed trajectories, and low-quality samples interfering with model performance. It achieves the technical effects of unified progress semantics for long-term robot tasks, adaptability to multiple task completion states, improved progress prediction accuracy and robustness, and meeting the requirements of real-time progress prediction.
[0005] This application provides a task progress prediction method based on stage-aware modeling, the method comprising: Acquire task trajectory data corresponding to multiple long-term tasks collected by the target robot during historical tasks; For each long-term task, based on multiple keyframes corresponding to the long-term task in the task trajectory data, the long-term task is divided into multiple sub-task stages, and based on the task trajectory data, the stage boundary timestamp corresponding to each sub-task stage is determined to obtain an annotated task trajectory dataset with the corresponding annotations of the sub-task stages and the stage boundary timestamps. Based on the labeled task trajectory dataset, the intra-segment progress information corresponding to each time frame in each long-term task and the global progress information corresponding to each sub-task stage in each long-term task are determined respectively, so as to obtain a target task trajectory dataset with the labels corresponding to the intra-segment progress information and the global progress information. The target task trajectory dataset is used to train a preset stage-aware reward model to obtain a task progress prediction model. In response to receiving the feature sequence data collected by the target robot during the current task, the feature sequence data is input into the task progress prediction model to obtain the current task progress result output by the task progress prediction model.
[0006] Furthermore, based on multiple keyframes corresponding to the long-term task in the task trajectory data, the long-term task is divided into multiple sub-task stages, and based on the task trajectory data, the stage boundary timestamp corresponding to each sub-task stage is determined to obtain an annotated task trajectory dataset with annotations corresponding to the sub-task stages and the stage boundary timestamps, including: Based on the action logic corresponding to the long-duration task, multiple keyframes corresponding to the long-duration task are determined in the task trajectory data; Based on the key frame corresponding to the long-term task, the long-term task is divided into multiple sub-task stages. The start time and end time of each sub-task stage are determined from the task trajectory data, and the stage boundary timestamp of each sub-task stage is determined based on the start time and the end time. The task trajectory data is labeled using the sub-task stages and the stage boundary timestamps to obtain a labeled task trajectory dataset.
[0007] Furthermore, the step of using the sub-task stage and the stage boundary timestamps to annotate the task trajectory data to obtain an annotated task trajectory dataset includes: The task trajectory data is labeled according to the sub-task stage and the stage boundary timestamp to obtain a time-labeled task trajectory dataset. Obtain the stage completion status of the subtask stage, and determine the task completion status corresponding to the long-duration task based on the stage completion status; wherein, the task completion status includes one of complete success, partial success and failure; The time-labeled task trajectory dataset is labeled according to the task completion status information to obtain the labeled task trajectory dataset.
[0008] Furthermore, based on the labeled task trajectory dataset, determining the intra-segment progress information corresponding to each time frame in each long-term task and the global progress information corresponding to each sub-task stage in each long-term task includes: For each time frame in each of the long-term tasks, determine the sub-task stage to which the time frame belongs, and based on the time frame and the stage boundary timestamp corresponding to the sub-task stage, determine the intra-segment progress information corresponding to the time frame in the sub-task stage. For a long-term task whose completion status is "completely successful", obtain the first stage weight and the cumulative weight of the first preceding stage corresponding to the sub-task stage, and determine the global progress information corresponding to the sub-task stage based on the intra-segment progress information, the stage weight and the cumulative stage weight. For a long-term task whose task completion status is partially successful, determine the target sub-task stage where the partial success of the long-term task is held, and determine the second stage weight and the cumulative weight of the second preceding stage corresponding to the target sub-task stage. For the target subtask stage and the subtask stages preceding the target subtask stage, based on the intra-segment progress information corresponding to the target subtask stage, the second stage weight, and the second preceding stage cumulative weight, the global progress information corresponding to the target subtask stage is determined, and the sum of the second stage weight and the second preceding stage cumulative weight is determined as the global progress information corresponding to the target subtask stage as a whole. For the sub-task stage that follows the target sub-task stage, under preset boundary conditions, the global progress information corresponding to the target sub-task stage is smoothly decayed by time interpolation to determine the global progress information corresponding to the sub-task stage.
[0009] Furthermore, the stage weights corresponding to the sub-task stages are determined through the following steps: The expert dataset was selected from the labeled task trajectory dataset based on the task duration. For each piece of labeled task trajectory data in the expert dataset, the long-term task corresponding to the labeled task trajectory data is divided into multiple expert sub-task stages in equal proportions; For each expert subtask stage, the ratio between the stage duration corresponding to the expert subtask stage and the total task duration of the long-term task corresponding to the labeled task trajectory data is determined as the expert stage weight corresponding to the expert subtask stage. Based on the expert stage weights, the stage weights corresponding to each subtask stage are determined.
[0010] Furthermore, the stage-aware reward model includes a multilayer perceptron fusion network, a sequence aggregation network, a position encoder, a linear projector, a visual encoder, and a state normalizer; the step of training the preset stage-aware reward model using the target task trajectory dataset to obtain a task progress prediction model includes: Feature extraction and normalization are performed on the target task trajectory dataset to obtain a time series training sample dataset; The linear projector is used to project the visual features and sensor features in the time series training sample dataset into dimensions, and the position encoder is used to add position embedding encoding to the dimensional projection to obtain the target training sample dataset. With stage classification and intra-stage progress estimation as training objectives, the multilayer perceptron fusion network and the sequence aggregation network in the stage-aware reward model are trained in an end-to-end manner based on the target training sample dataset, so that the stage-aware reward model has both stage recognition capability and fine-grained progress estimation capability; wherein, during the training process of the stage-aware reward model, the target training sample dataset is weighted and filtered based on the calculated reward value.
[0011] Furthermore, the target task trajectory dataset includes multi-view image sequence data, sensor data, progress annotation data, and success marker data; the feature extraction and normalization processing of the target task trajectory dataset to obtain a time-series training sample dataset includes: The visual features corresponding to the multi-view image sequence data are extracted using the frozen visual encoder; The sensor data is normalized using the state normalizer to obtain sensor features; Based on the progress annotation data and the success marker data, the visual features and the sensor features are combined into a time series training sample dataset according to the time series; wherein, the time series training sample dataset includes multiple single-frame training sample data, and each single-frame training sample data includes the visual features, the sensor features, the subtask stage information, the intra-segment progress information, the global progress information, and the task completion status annotation information.
[0012] This application embodiment also provides a task progress prediction device based on stage-aware modeling, the task progress prediction device comprising: The data acquisition module is used to acquire task trajectory data corresponding to multiple long-term tasks collected by the target robot during historical tasks; The phase division module is used to divide each long-term task into multiple sub-task phases based on multiple keyframes corresponding to the long-term task in the task trajectory data, and determine the phase boundary timestamp corresponding to each sub-task phase based on the task trajectory data, so as to obtain an annotated task trajectory dataset with the annotations corresponding to the sub-task phases and the phase boundary timestamps. The progress determination module is used to determine, based on the labeled task trajectory dataset, the intra-segment progress information corresponding to each time frame in each long-term task and the global progress information corresponding to each sub-task stage in each long-term task, so as to obtain a target task trajectory dataset with the labels corresponding to the intra-segment progress information and the global progress information. The model training module is used to train a preset stage-aware reward model using the target task trajectory dataset to obtain a task progress prediction model. The model application module is used to respond to the feature sequence data collected by the target robot during the current task, input the feature sequence data into the task progress prediction model, and obtain the current task progress result output by the task progress prediction model.
[0013] This application embodiment also provides an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, the steps of the task progress prediction method based on stage-aware modeling described above are performed.
[0014] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the task progress prediction method based on stage-aware modeling as described above.
[0015] This application provides a task progress prediction method and apparatus based on stage-aware modeling. The method includes: acquiring task trajectory data corresponding to multiple long-term tasks collected by a target robot during historical tasks; for each long-term task, dividing the long-term task into multiple sub-task stages based on multiple keyframes corresponding to the long-term task in the task trajectory data, and determining the stage boundary timestamp corresponding to each sub-task stage based on the task trajectory data to obtain an annotated task trajectory dataset with corresponding annotations of the sub-task stages and the stage boundary timestamps; based on the annotated task trajectory dataset, determining the intra-segment progress information corresponding to each time frame in each long-term task and the global progress information corresponding to each sub-task stage in each long-term task to obtain a target task trajectory dataset with corresponding annotations of the intra-segment progress information and the global progress information; training a preset stage-aware reward model using the target task trajectory dataset to obtain a task progress prediction model; and responding to receiving feature sequence data collected by the target robot during the current task, inputting the feature sequence data into the task progress prediction model to obtain the current task progress result output by the task progress prediction model.
[0016] Compared with existing long-term task progress prediction methods, this method obtains trajectory data of the target robot's historical long-term tasks, divides sub-task stages based on keyframes and determines stage boundary timestamps, calculates the intra-segment progress of each time frame and the global progress of the sub-task stage, trains a stage-aware reward model using the target task trajectory dataset and uses it for current task progress prediction. This solves the technical problems of existing methods, such as inconsistent progress semantics due to lack of stage division, unstable annotation methods, inability to handle local successful or failed trajectories, and low-quality samples interfering with model performance. It achieves unified progress semantics for robot long-term tasks, adapts to multiple task completion states, improves progress prediction accuracy and robustness, and meets the technical requirements of real-time progress prediction.
[0017] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1A flowchart illustrating a task progress prediction method based on stage-aware modeling provided in this application embodiment; Figure 2 This is a schematic diagram illustrating the working principle of a task progress prediction model provided in an embodiment of this application. Figure 3 This is a schematic diagram of the structure of a task progress prediction device based on stage-aware modeling provided in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. Based on the embodiments of this application, every other embodiment obtained by those skilled in the art without inventive effort falls within the scope of protection of this application.
[0021] Research has revealed several shortcomings in current long-term task progress prediction methods: First, existing methods estimate progress based solely on the overall task duration, leading to inconsistent progress semantics across different trajectories—the same progress value may correspond to different task execution states. Second, progress labeling methods are unstable, making progress alignment across trajectories difficult. Third, progress estimation is only possible for complete and successful trajectories, limiting the model's learning samples and resulting in insufficient generalization ability. Fourth, during the training of the progress prediction model, low-quality noise samples can easily interfere with model performance, reducing the accuracy and robustness of progress prediction.
[0022] Based on this, the embodiments of this application provide a task progress prediction method based on stage-aware modeling. By acquiring the trajectory data of the target robot's historical long-term tasks, dividing the task into sub-task stages based on keyframes and determining the stage boundary timestamps, calculating the intra-segment progress of each time frame and the global progress of the sub-task stage, and training a stage-aware reward model using the target task trajectory dataset for current task progress prediction, this method solves the technical problems of inconsistent progress semantics due to the lack of stage division in existing methods, unstable annotation methods, inability to handle local successful or failed trajectories, and low-quality samples interfering with model performance. This method achieves the technical effects of unified progress semantics for long-term robot tasks, adaptability to multiple task completion states, improved progress prediction accuracy and robustness, and meeting the requirements for real-time progress prediction.
[0023] Please see Figure 1 , Figure 1 This is a flowchart illustrating a task progress prediction method based on stage-aware modeling, provided as an embodiment of this application. Figure 1 As shown in the embodiments of this application, the task progress prediction method based on stage-aware modeling is commonly used in robots. The method includes: S101. Obtain the task trajectory data corresponding to multiple long-term tasks collected by the target robot during the historical task process.
[0024] In this embodiment of the application, a long-term task refers to a robot operation task that has a long duration, includes multiple continuous action steps, has coherent action logic, and has a clear objective, such as folding clothes or organizing items; the task trajectory data refers to the collection of various types of data collected by the robot during the execution of the long-term task.
[0025] The target robot is a robot that is expected to perform task progress prediction for long-term tasks using the method described in the embodiments of this application.
[0026] Here, the task trajectory data includes, but is not limited to, multi-view image sequence data, sensor data, and task completion status information.
[0027] The task completion status information includes the task completion status of each long-duration task; according to the task completion criteria, each long-duration task is marked as fully successful, partially successful, or failed; partial success means that it only completed a part of the process and then ended, while failure means that the core sub-task was not completed.
[0028] In this step, all raw data generated by the target robot when it has performed various long-term tasks in the past are obtained, including but not limited to multi-view image sequence data and sensor data, and the task completion status of each long-term task is obtained to form the original task trajectory dataset.
[0029] In this way, we can obtain raw datasets that cover multiple long-term tasks and various types of data, ensuring the comprehensiveness and universality of subsequent processing. This provides a data foundation for stage perception and progress prediction, and provides basic data support for subsequent sub-task stage division, progress calculation and model training, solving the problem of single data source and lack of structured raw data in existing technologies.
[0030] For example, suppose the target robot is controlled to perform 1,000 long-term tasks of folding clothes. Multi-view image sequences, gripper sensor data, force feedback data, and joint state data are collected during each task to form 1,000 original task trajectory data, with each data corresponding to a complete clothing folding task trajectory.
[0031] S102. For each long-term task, based on multiple keyframes corresponding to the long-term task in the task trajectory data, the long-term task is divided into multiple sub-task stages, and based on the task trajectory data, the stage boundary timestamp corresponding to each sub-task stage is determined to obtain an annotated task trajectory dataset with the corresponding annotations of the sub-task stages and the stage boundary timestamps.
[0032] In this embodiment, a keyframe refers to an image frame corresponding to a key action (such as grasping, releasing, pulling, or pushing the target) that occurs during the robot's task execution. It is the core basis for dividing sub-task stages, and the accuracy of the keyframe directly determines the rationality of the sub-task stage division. A sub-task stage refers to multiple ordered and independent sub-action segments obtained by splitting a long-term task according to action logic based on keyframes. Each sub-task stage corresponds to a complete local action, and there is a clear logical connection between each sub-task stage, which together constitute a complete long-term task.
[0033] Here, the stage boundary timestamp refers to the time markers corresponding to the start and end times of each subtask stage, used to clarify the time range of each subtask stage and provide accurate time references for subsequent progress calculations.
[0034] Among them, the labeled task trajectory dataset refers to the structured dataset obtained by labeling the original task trajectory data with sub-task stages and stage boundary timestamps. It can further include task completion status labels. This dataset has a clear structure and complete label information.
[0035] In this step, for each long-term task, multiple keyframes are accurately identified by analyzing the image sequences and sensor data in the task trajectory data. Then, according to the action logic of the task, the long-term task is divided into multiple ordered sub-task stages based on the keyframes. Subsequently, the start and end times of each sub-task stage are determined by combining the image sequences and sensor data, and stage boundary timestamps are generated. Finally, the original task trajectory data is labeled accordingly using the sub-task stages and stage boundary timestamps to form a structured labeled task trajectory dataset. This approach breaks down unordered long-term tasks into ordered sub-task stages, clearly defining the time range and action boundaries of each stage. This addresses the problems of existing technologies, such as the lack of stage division for long-term tasks, chaotic progress estimation, and misalignment of progress across different trajectories. It achieves a structured decomposition of long-term tasks, resulting in a dataset with stage labels and time boundaries. The division of each sub-task stage conforms to the task action logic, and the stage boundary timestamps are accurate and reliable. This provides a structured foundation for subsequent fine-grained progress calculations, ensuring the orderliness and accuracy of progress calculations.
[0036] For example, assuming the target robot is performing a long-term task of folding clothes, for each clothing folding task trajectory, based on the task action logic (picking up clothes, laying flat, folding, placing), combined with image sequences and sensor data, key frames are accurately determined in the image sequence of the task trajectory data. The specific key frames include: image frames of the gripper contacting the clothes when picking up clothes, image frames of the clothes being fully unfolded and wrinkle-free when laying flat, image frames of the folded edge contacting the main body of the clothes when folding at one near corner, image frames of the folded edge contacting the main body of the clothes when folding at one far corner, image frames of the clothes being rotated into position and having a stable posture when rotating 90 degrees, image frames of the folded edge contacting the main body of the clothes when folding at the bottom, image frames of the folded edge contacting the main body of the clothes when folding at 2 / 3, and image frames of the clothes contacting the table and having a flat posture when placing. There are a total of 8 key frames, which correspond to the start or end nodes of the 8 sub-task stages.
[0037] Furthermore, based on the determined 8 keyframes, each garment folding task is divided into 8 ordered sub-task stages, specifically: Stage 1 - Take the garment and move it to the center of the table; Stage 2 - Lay the garment flat; Stage 3 - Fold one corner near the edge; Stage 4 - Fold one corner far from the edge; Stage 5 - Rotate 90 degrees; Stage 6 - Fold the bottom edge; Stage 7 - Fold at 2 / 3 of the way; Stage 8 - Place it in the designated position. Subsequently, based on the sensor data and image sequences in the task trajectory data, the timestamp corresponding to each keyframe is extracted to determine the start and end times of each sub-task stage, generating stage boundary timestamps, such as those for Stage 1. The start time is 0ms after the task begins, and the end time is 2000ms after the task begins, with corresponding boundary timestamps of 0ms and 2000ms. The start time of stage 2 is 2000ms, and the end time is 4500ms, with corresponding boundary timestamps of 2000ms and 4500ms, and so on, until the boundary timestamps of all sub-task stages are determined. Finally, the original task trajectory data is labeled using the sub-task stages and stage boundary timestamps, and the stage ID and corresponding boundary timestamp are labeled on each time frame of each trajectory to obtain the labeled task trajectory dataset.
[0038] In one possible implementation of this application, step S102 may include: S1021. Based on the action logic corresponding to the long-term task, determine multiple keyframes corresponding to the long-term task in the task trajectory data.
[0039] For example, suppose the target robot is controlled to perform a long-term task of folding clothes. Based on the action logic of the clothing folding task (picking up clothes, laying them flat, folding them, and placing them), and combined with the image sequence and sensor data in the task trajectory data, multiple keyframes corresponding to the long-term task are accurately determined in the image sequence of each task trajectory data.
[0040] The keyframes are determined using a dual strategy of "image recognition + sensor data verification". Specific keyframes include: image frames of the gripper contacting the garment when picking it up (simultaneously verifying gripper sensor data; when the gripper changes from open to closed and the force feedback data is greater than 0, the corresponding image frame is the keyframe); image frames of the garment fully unfolded when laid flat (using image recognition algorithms to determine if the garment outline is complete and wrinkle-free, while verifying the stability of the force feedback data); image frames of the folded edge contacting the main body of the garment when one corner is folded (using image recognition to determine the position of the folded edge, and combining force feedback data to verify the contact state); image frames of the folded edge contacting the main body of the garment when one corner is folded; image frames of the garment rotating into position after a 90-degree rotation (using joint state data to verify if the rotation angle is 90 degrees, and combining image recognition to confirm the posture); image frames of the folded edge contacting the main body of the garment when folded at the bottom; image frames of the folded edge contacting the main body of the garment when folded at 2 / 3; and image frames of the garment contacting the table when placed (using force feedback data to verify the force of contact with the table, and combining image recognition to confirm the placement posture). There are a total of 8 keyframes, each corresponding to the start or end node of 8 sub-task stages.
[0041] S1022. Based on the key frame corresponding to the long-term task, the long-term task is divided into multiple sub-task stages.
[0042] For example, based on the 8 keyframes determined in the above example, each long-term task of folding clothing is divided into 8 ordered sub-task stages. The action link between two adjacent keyframes is a sub-task stage. The action logic of each sub-task stage is clear and the boundaries are well-defined. The specific division rules are as follows: Keyframe 1 (clothing contact) to keyframe 2 (laying flat) is stage 1 (clothing moved to the center of the table). The core action of this stage is for the robot to grab the clothing and move it to the center of the table. Keyframe 2 to keyframe 3 (near-end folding contact) is stage 2 (laying clothes flat). The core action is to lay the clothing flat on the table, ensuring no wrinkles. Keyframe 3 to keyframe 4 (far-end folding contact) is stage 3 (near-end corner folding). The core action is to fold one corner of the clothing at the near end. Fold the corners towards the center; keyframes 4 to 5 (rotate to position) constitute stage 4 (folding the far corner), the core action is to fold the far corner of the garment towards the center; keyframes 5 to 6 (lower fold contact) constitute stage 5 (rotate 90 degrees), the core action is to rotate the folded garment 90 degrees to adjust its posture; keyframes 6 to 7 (2 / 3 fold contact) constitute stage 6 (lower fold), the core action is to fold the lower part of the garment towards the center; keyframes 7 to 8 (place contact) constitute stage 7 (2 / 3 fold), the core action is to fold 2 / 3 of the garment towards the center, completing the final folding action; keyframe 8 to the end of the task constitute stage 8 (place to the designated position), the core action is to move the folded garment to the designated position and release the gripper.
[0043] S1023. Determine the start time and end time corresponding to each sub-task stage in the task trajectory data, and determine the stage boundary timestamp corresponding to each sub-task stage based on the start time and the end time.
[0044] In this step, the timestamp corresponding to each keyframe is extracted from the task trajectory data using a time synchronization tool. The timestamp of the previous keyframe is used as the start time of the current sub-task stage, and the timestamp of the next keyframe is used as the end time of the current sub-task stage, thereby determining the stage boundary timestamp corresponding to each sub-task stage.
[0045] S1024. The task trajectory data is labeled using the sub-task stage and the stage boundary timestamp to obtain a labeled task trajectory dataset.
[0046] In this step, the original task trajectory data is labeled using the predefined sub-task stages and the defined stage boundary timestamps. The labeling process uses automated labeling tools combined with manual verification to ensure the accuracy of the labeling.
[0047] Specifically, for each time frame of each task trajectory data, the subtask stage representation and the corresponding stage boundary timestamp (start time and end time) are labeled to obtain the time-labeled task trajectory dataset.
[0048] Furthermore, after the annotation is completed, a portion of the dataset is randomly selected manually for verification, and data with incorrect annotations is removed to ensure the quality of the dataset, laying a solid foundation for subsequent task completion status annotation and progress calculation.
[0049] In one possible implementation of this application, step S1024 may include: S10241. The task trajectory data is labeled according to the sub-task stage and the stage boundary timestamp to obtain a time-labeled task trajectory dataset.
[0050] In this step, based on the divided sub-task stages and the determined stage boundary timestamps, an automated annotation tool is used to annotate each original task trajectory data. The annotation content includes the sub-task stage identifier of each time frame, the start boundary timestamp and the end boundary timestamp of the sub-task stage. After the annotation is completed, manual verification is performed to ensure that the annotation information is accurate and error-free, thus obtaining the time-annotated task trajectory dataset.
[0051] S10242. Obtain the stage completion status of the subtask stage, and determine the task completion status corresponding to the long-term task based on the stage completion status.
[0052] The task completion status includes one of the following: complete success, partial success, and failure.
[0053] Here, complete success means that all sub-task stages are completed, that is, the task is executed up to the termination time of the last sub-task stage; partial success means that only some sub-task stages are completed (1 ≤ number of completed stages < 8), that is, the task is executed up to the termination time of a certain sub-task stage and stops, without continuing to execute subsequent sub-task stages, and the core actions of the completed stages have all met the requirements. For example, only stages 1 to 3 are completed, stages 4 and subsequent stages are not executed, and the actions of stages 1 to 3 all meet the requirements; failure means that no sub-task stage is completed, or an action error occurs during the execution (such as clothing falling, gripper malfunction, serious deviation of folding action), which makes it impossible for the task to continue, or although some stages are completed, the core actions are not met, and the task's stage goal cannot be achieved.
[0054] In this step, the completion status (complete / incomplete) of each sub-task stage in each task trajectory is obtained. The criteria for determining the completion status of a stage are: whether the action of the sub-task stage has been executed to the keyframe corresponding to the termination time. If it has been executed to the termination time, and the sensor data and image sequence show that the core action of the stage has been completed (such as the clothes being wrinkle-free in the flat stage, or the folding edge being in place in the folding stage), then the sub-task stage is in a completed state; if it has not been executed to the termination time, or although it has been executed to the termination time but the core action has not been completed, then it is in an incomplete state.
[0055] S10243. Label the time-labeled task trajectory dataset according to the task completion status information to obtain the labeled task trajectory dataset.
[0056] In this step, based on the above-mentioned task completion status determination results, an automated annotation tool is used to further annotate the time-annotated task trajectory dataset. That is, at the start and end positions of each task trajectory data, the corresponding task completion status (complete success / partial success / failure) is marked, and at the start position of the incomplete stage, the reason for incompleteness (such as action error, external interference, etc.) is marked.
[0057] S103. Based on the labeled task trajectory dataset, determine the intra-segment progress information corresponding to each time frame in each long-term task and the global progress information corresponding to each sub-task stage in each long-term task, so as to obtain a target task trajectory dataset with labels corresponding to the intra-segment progress information and the global progress information.
[0058] In this embodiment, the intra-segment progress information refers to the proportion of progress of a single time frame within its sub-task stage, with a value range of 0 to 1. It is used to reflect the fine-grained progress within the sub-task stage and can accurately reflect the robot's action progress within a single sub-task stage. The global progress information refers to the overall progress of the entire long-term task obtained based on the weights of all sub-task stages and combined with the intra-segment progress information, with a value range of 0 to 1. It achieves semantic consistency of progress across trajectories and ensures that the same global progress value for different execution trajectories corresponds to a consistent task execution state.
[0059] Here, the target task trajectory dataset includes multi-view image sequence data, sensor data, progress annotation data, and success marker data.
[0060] In this step, based on the sub-task stage division and stage boundary timestamps in the labeled task trajectory dataset, for each time frame of each long-term task, the sub-task stage to which it belongs is first determined, and then the intra-segment progress information of the time frame within its sub-task stage is calculated; at the same time, combined with the sub-task stage weights, the global progress information of each sub-task stage under different task states such as complete success and partial success is calculated respectively. Finally, the intra-segment progress information and global progress information are labeled into the labeled task trajectory dataset to form the target task trajectory dataset.
[0061] This step establishes a unified progress calculation standard, enabling precise labeling of fine-grained progress within segments and overall global progress, thus solving the problems of unstable progress labeling, inconsistent semantics across tracks, and inability to adapt to local success / failure tracks in existing technologies.
[0062] In this way, a target dataset with fine-grained progress annotations is obtained, achieving unified progress semantics across trajectories. This can effectively represent the progress of different task states such as complete success and partial success, improve the effective information density of the data, provide high-quality labeled data for model training, and ensure the effectiveness of subsequent model training.
[0063] In one possible implementation of this application, step S103 may include: S1031. For each time frame in each of the long-term tasks, determine the sub-task stage to which the time frame belongs, and based on the time frame and the stage boundary timestamp corresponding to the sub-task stage, determine the intra-segment progress information corresponding to the time frame in the sub-task stage.
[0064] In this step, for each time frame in each long-term task, the time frame is first compared with the boundary timestamps of each subtask stage to accurately determine the subtask stage to which the time frame belongs; then, based on the time frame, the start boundary timestamp and the end boundary timestamp of the subtask stage to which it belongs, the intra-segment progress information corresponding to the time frame in the subtask stage is calculated according to the following formula.
[0065] Segment progress = (current frame time - current stage start time) / (current stage end time - current stage start time), and the range of segment progress is 0 ≤ segment progress ≤ 1.
[0066] When the current frame time equals the start time of the current stage, the progress within the segment is 0, indicating that the subtask stage has just begun; when the current frame time equals the end time of the current stage, the progress within the segment is 1, indicating that the subtask stage has been completed; when the current frame time is between the start and end times, the progress within the segment changes linearly with time, accurately reflecting the progress of the subtask stage.
[0067] For example, assuming the start time of stage 1 is 0ms and the end time is 2000ms, and the time frame of a certain time frame is 1000ms, then the progress within that time frame = (1000-0) / (2000-0) = 0.5, that is, the progress of that time frame within stage 1 is 50%, which means that the robot has completed half of the action in stage 1, that is, it has moved the clothes to the vicinity of the center of the table.
[0068] S1032. For the long-term task whose task completion status is "completely successful", obtain the first stage weight and the first preceding stage cumulative weight corresponding to the sub-task stage, and determine the global progress information corresponding to the sub-task stage based on the intra-segment progress information, the stage weight and the stage cumulative weight.
[0069] In this step, for long-term tasks with a complete and successful completion status, firstly, the first stage weight corresponding to each subtask stage and the cumulative weight of all subtask stages before that subtask stage (i.e., the cumulative weight of the first preceding stage) are obtained; then, based on the intra-segment progress information of each time frame within that subtask stage, the stage weight of that subtask stage, and the cumulative weight of the preceding stage, the global progress information corresponding to that time frame is calculated according to the following formula.
[0070] Global progress = cumulative weight of previous stages + weight of current stage × progress within the segment.
[0071] For example, assuming the weight of stage 1 is 0.15, the weight of stage 2 is 0.2, the cumulative weight of the preceding stages (the weight of stage 1) is 0.15, and the intra-segment progress of a certain time frame in stage 2 is 0.6, then the global progress of that time frame = 0.15 + 0.2 × 0.6 = 0.27, that is, the overall progress of the entire clothing folding task is 27%, which means that the robot has completed all the actions in stage 1 and 60% of the actions in stage 2. The progress semantics are clear and consistent.
[0072] S1033. For the long-term task whose task completion status is partially successful, determine the target sub-task stage where the long-term task is partially successful, and determine the second stage weight and the cumulative weight of the second preceding stage corresponding to the target sub-task stage.
[0073] In one possible implementation of this application, in specific implementation, the step of determining the stage weight corresponding to the sub-task stage in step S103 may include: S103A. Select the expert dataset from the labeled task trajectory dataset according to the task duration.
[0074] In this step, the trajectories with a complete and successful task completion status are selected from the labeled task trajectory dataset. This is because complete and successful trajectories have standardized actions and complete processes, which can accurately reflect the reasonable duration of each sub-task stage. Then, all complete and successful trajectories are sorted in ascending order according to task time, and the batch of trajectories with the shortest time is selected as the expert dataset. Trajectories with short time represent that the robot's actions are efficient and the process is standardized, which can be used as a high-quality reference for stage weight calculation.
[0075] For example, from 600 complete successful trajectories, the 120 trajectories with the shortest time (accounting for 20% of the complete successful trajectories) are selected as the expert dataset to ensure the representativeness and high quality of the expert dataset.
[0076] S103B. For each piece of labeled task trajectory data in the expert dataset, the long-term task corresponding to the labeled task trajectory data is divided into multiple expert sub-task stages in equal proportions.
[0077] In this step, for each labeled task trajectory data in the expert dataset, the long-term task of folding clothes corresponding to the trajectory is divided into multiple expert sub-task stages in equal proportion. That is, each expert sub-task stage corresponds one-to-one with the sub-task stage, and the boundaries and action logic of the stage division are completely consistent, ensuring the consistency of the stage division and providing a unified basis for subsequent weight calculation.
[0078] S103C. For each of the expert subtask stages, the ratio between the stage duration corresponding to the expert subtask stage and the total task duration of the long-term task corresponding to the labeled task trajectory data is determined as the expert stage weight corresponding to the expert subtask stage.
[0079] In this step, for each expert subtask stage, the stage duration (i.e., the difference between the end time and the start time of the stage) and the total task duration of the long-term task corresponding to the labeled task trajectory data (i.e., the difference between the end time and the start time of the entire task) are extracted using a time synchronization tool. The expert stage weight corresponding to the expert subtask stage is then calculated using the following formula.
[0080] Expert stage weight = stage duration corresponding to the expert subtask stage / total task duration of the long-term task.
[0081] For example, assuming the total task duration of an expert trajectory is 15000ms and the duration of stage 1 is 2250ms, then the expert stage weight of stage 1 in the expert trajectory is 2250 / 15000=0.15, that is, the duration of stage 1 in the expert trajectory accounts for 15% of the total task duration.
[0082] S103D. Based on the expert stage weights, determine the stage weights corresponding to each of the sub-task stages.
[0083] In this step, the expert stage weights of the same expert subtask stage for all trajectories in the expert dataset are averaged, and the average value is used as the stage weight corresponding to that subtask stage. This ensures the objectivity and representativeness of the stage weights. The stage weights are fixed values at the dataset level and do not change with individual trajectories, ensuring the consistency of progress semantics across trajectories.
[0084] For example, suppose the stage weights of the 8 sub-task stages are calculated as follows: Stage 1 (0.15), Stage 2 (0.2), Stage 3 (0.18), Stage 4 (0.12), Stage 5 (0.08), Stage 6 (0.1), Stage 7 (0.1), and Stage 8 (0.07). The sum of the weights of all sub-task stages is 1, and the weight of each stage satisfies the constraint that 0 ≤ weight ≤ 1.
[0085] S1034. For the target sub-task stage and the sub-task stages preceding the target sub-task stage, based on the intra-segment progress information corresponding to the target sub-task stage, the second stage weight, and the second preceding stage cumulative weight, determine the global progress information corresponding to the target sub-task stage, and determine the sum of the second stage weight and the second preceding stage cumulative weight as the global progress information corresponding to the target sub-task stage as a whole.
[0086] In this step, for long-term tasks with a partial success status, in order to accurately represent their progress status and avoid incorrectly marking unexecuted stages as completed, a phased calculation method is adopted. The specific calculation process includes: First, determine the target sub-task stage: that is, the sub-task stage where the long-term task is partially and successfully completed, which is the last sub-task stage to be completed. For example, if a certain trajectory only completes stages 1 to 3 and does not execute stage 4 and subsequent stages, then the target sub-task stage is stage 3, which is the last sub-task stage to be completed for that trajectory.
[0087] Then, determine the relevant parameters: obtain the stage weight (second stage weight) corresponding to the target subtask stage and the cumulative weight of all subtask stages before the target subtask stage (second preceding stage cumulative weight). For example, if the target subtask stage is stage 3, its weight is 0.18, and the cumulative weight of the preceding stages (stage 1, stage 2) is 0.15 + 0.2 = 0.35. Finally, the global progress of the target subtask stage and preceding stages is calculated: For the target subtask stage and all subtask stages preceding it, based on the intra-segment progress information of each time frame, the weight of the second stage, and the cumulative weight of the second preceding stage, the global progress information corresponding to each time frame is calculated according to the global progress calculation formula for a complete successful trajectory. At the same time, the sum of the cumulative weight of the second preceding stage and the weight of the second stage is determined as the global progress information corresponding to the target subtask stage as a whole. For example, if the target subtask stage is stage 3, its overall global progress = 0.35 + 0.18 = 0.53, that is, the maximum global progress of this trajectory when it is partially successful is 53%, which means that the trajectory has completed 53% of the task.
[0088] S1035. For the sub-task stage located after the target sub-task stage, under preset boundary conditions, the global progress information corresponding to the target sub-task stage is smoothly decayed by time interpolation to determine the global progress information corresponding to the sub-task stage.
[0089] In this step, the global progress of the stages following the target subtask stage is calculated: For all subtask stages following the target subtask stage, under preset boundary conditions, the global progress information corresponding to the target subtask stage is smoothly decayed by time interpolation to determine the global progress information corresponding to the subtask stage.
[0090] Here, the boundary conditions include: the global progress at the moment of local successful completion is equal to the global progress corresponding to the entire target sub-task stage, and the global progress at the moment of final trajectory completion is equal to 0.
[0091] In this embodiment, linear interpolation is used for attenuation to ensure smooth and reasonable progress changes. For example, if the target subtask is stage 3, the local success end time is 8000ms, the global progress is 0.53, and the trajectory final end time is 10000ms, then in the interval of 8000ms-10000ms, the global progress linearly decreases from 0.53 to 0, and at 10000ms the global progress is 0, accurately reflecting the state that the trajectory has not completed the subsequent stages.
[0092] S104. The preset stage-aware reward model is trained using the target task trajectory dataset to obtain the task progress prediction model.
[0093] In this embodiment, the stage-aware reward model includes a multilayer perceptron fusion network, a sequence aggregation network, a position encoder, a linear projector, a visual encoder, and a state normalizer.
[0094] The system comprises the following components: a visual encoder for extracting visual features from multi-view image sequence data; a CLIP visual encoder with parameter freezing to avoid overfitting and outputting 512-dimensional features; a state normalizer for normalizing sensor data to eliminate dimensional differences between different dimensions, for example, using Min-Max normalization to map the data to the [0,1] interval; a linear projector for projecting both visual and sensor features to unify their dimensions, projecting both features to 256 dimensions in this embodiment; a position encoder for adding position embedding codes to the projected features to preserve the position information of the time series, with the position embedding code dimension matching the projected feature dimension (256 dimensions) using a sinusoidal position encoding method; a multilayer perceptron fusion network for fusing the projected visual and sensor features to obtain fused features, with 3 layers and ReLU activation function; and a sequence aggregation network for modeling the fused features, extracting contextual information from the time series, and achieving stage recognition and progress estimation, using a causal multi-frame Transformer with 6 encoder layers and 8 attention heads.
[0095] Here, the stage-aware reward model refers to a sequence model specifically designed for long-term task progress prediction. It has the dual capabilities of stage recognition and progress estimation. Its core includes modules such as multilayer perceptron fusion network and sequence aggregation network, which can effectively process time series data and extract the stage features and progress features of the task. The task progress prediction model refers to a model that, after being trained on the target task trajectory dataset, can receive the current task feature sequence data and output the progress result. It has real-time response capability and can meet the real-time progress prediction needs of robot long-term tasks.
[0096] In this step, the target task trajectory dataset is used as training data. First, the data is preprocessed by feature extraction, normalization and other methods to obtain training samples that meet the requirements of model training. Then, the training samples are input into the preset stage-aware reward model. With stage classification and intra-stage progress estimation as the core objectives, the model is jointly trained in an end-to-end manner. During the training process, the samples are weighted and filtered based on the reward value to optimize the model parameters until the model converges. Finally, a task progress prediction model that can be used for real-time progress prediction is obtained. This step, through model training, enables the model to possess the dual capabilities of stage recognition and progress estimation, addressing the problems of weak generalization ability, poor noise resistance, and inability to adapt to various task states in existing models, thereby improving the model's prediction accuracy and robustness.
[0097] In this way, a high-precision and robust task progress prediction model is obtained. This model can simultaneously identify task stages and output fine-grained progress, has strong noise resistance, and can adapt to different execution trajectories and task completion states, thus meeting the real-time progress prediction requirements in practical applications.
[0098] Specifically, firstly, a pre-defined stage-aware reward model is constructed. The model structure includes a multilayer perceptron fusion network (MLP fusion network), a sequence aggregation network (causal multi-frame Transformer), a position encoder, a linear projector, a visual encoder (using a CLIP encoder), and a state normalizer. The initial values of the parameters of each module are set according to industry standards. Then, the target task trajectory dataset is used as training data. Feature extraction and normalization are performed on the data to obtain a time-series training sample dataset. Next, dimensional projection and position embedding are performed on the training samples to obtain the target training sample dataset. Finally, with stage classification and intra-stage progress estimation as the core training objectives, the model is trained in an end-to-end manner. During the training process, samples are weighted and filtered based on reward values to optimize model parameters until the model's loss function converges. The model parameters are then saved to obtain the task progress prediction model.
[0099] In one possible implementation of this application, step S104 may include: S1041. Perform feature extraction and normalization on the target task trajectory dataset to obtain a time series training sample dataset.
[0100] In one possible implementation of this application, step S1041 may include: S10411. Extract the corresponding visual features from the multi-view image sequence data using the frozen visual encoder.
[0101] In this step, a frozen visual encoder (the CLIP visual encoder in this embodiment) is used to extract visual features from the multi-view image sequence data in the target task trajectory dataset. Specifically, each frame of the multi-view image sequence is input into the CLIP encoder, which extracts and encodes features from the image and outputs the 512-dimensional visual features of that frame.
[0102] Here, to avoid overfitting and ensure the stability and universality of visual features, all parameters of the encoder are frozen and not used in the model training process; they are only used to extract fixed-dimensional visual features.
[0103] S10412. The sensor data is normalized using the state normalizer to obtain sensor features.
[0104] In this step, a state normalizer is used to normalize the sensor data (gripper sensing data, force feedback data, and joint state data) in the target task trajectory dataset. Since the dimensions of different types of sensor data are quite different (e.g., the unit of gripper force is N, and the unit of joint angle is degrees), directly inputting them into the model will affect the training effect. Therefore, the Min-Max normalization method is adopted to map all sensor data to the [0,1] interval, eliminate the dimension differences of data in different dimensions, and ensure the consistency and comparability of the data.
[0105] The normalization formula is: Normalized data = (Original data - Minimum data value) / (Maximum data value - Minimum data value).
[0106] Here, the normalized sensor data is the sensor feature, with the same dimension as the original sensor data. It can be directly used in the subsequent feature fusion and model training process. At the same time, the normalized sensor features and the extracted visual features are synchronously aligned to ensure that the two types of features correspond one-to-one in the time dimension. This avoids feature misalignment due to time deviation, which would affect the model's feature extraction and progress prediction of the task trajectory. It provides high-quality basic feature data for subsequent dimensional unification through a linear projector and feature fusion through an MLP fusion network.
[0107] S10413. Based on the progress marking data and the success marking data, combine the visual features and the sensor features into a time series training sample dataset according to the time series.
[0108] The time-series training sample dataset includes multiple single-frame training sample data, and each single-frame training sample data includes the visual features, the sensor features, the subtask stage information, the intra-segment progress information, the global progress information, and the task completion status annotation information.
[0109] In this step, the data is concatenated and integrated in chronological order to form the feature sequence corresponding to a single task trajectory. Simultaneously, label information such as intra-segment progress, global progress, and subtask stage IDs are extracted for each task trajectory and associated with the feature sequence one-to-one, ensuring that each feature frame corresponds to a unique progress and stage label. Subsequently, the feature sequences and corresponding labels of all task trajectories are standardized according to a unified format, unifying the sample dimension, time step, and data type, ultimately generating a time-series training sample dataset.
[0110] S1042. The linear projector is used to perform dimensional projection on the visual features and sensor features in the time series training sample dataset, and the position encoder is used to add position embedding encoding to the dimensional projection to obtain the target training sample dataset.
[0111] In this step, a linear projector is used to project the visual features and sensor features in the time series training sample dataset into 256 dimensions, ensuring that the dimensions of the two features are consistent and facilitating subsequent fusion processing. Then, a position encoder is used to add position embedding encoding to the features after dimensional projection. The dimension of the position embedding encoding is consistent with the dimension of the projected features (256 dimensions), which is used to preserve the positional relationship of each frame in the time series and avoid the model losing temporal order information, thus obtaining the target training sample dataset.
[0112] S1043. Using stage classification and intra-stage progress estimation as training objectives, the multilayer perceptron fusion network and the sequence aggregation network in the stage-aware reward model are trained in an end-to-end manner based on the target training sample dataset, so that the stage-aware reward model has both stage recognition capability and fine-grained progress estimation capability.
[0113] In this step, stage classification and intra-stage progress estimation are taken as the core training objectives, while global progress estimation and task success probability prediction are also taken into account. Based on the target training sample dataset, the MLP fusion network and sequence aggregation network in the stage-aware reward model are trained in an end-to-end manner.
[0114] For example, during training, the batch size is set to 32 (balancing training efficiency and model performance), the learning rate is 1e-4 (using cosine annealing to adjust the learning rate and avoid overfitting), the training epochs are 100, the Adam optimizer is used for parameter optimization, and the loss function is a weighted sum of cross-entropy loss (used for stage classification) and mean squared error loss (used for progress estimation) until the model's loss function converges (loss value is below 0.001), at which point the model's performance reaches its optimal level.
[0115] In the training process of the stage-aware reward model, the target training sample dataset is weighted and filtered based on the calculated reward value.
[0116] Specifically, during model training, in order to reduce the interference of low-quality samples on model performance and improve the robustness and prediction accuracy of the model, the target training sample dataset is weighted and filtered based on the calculated reward value.
[0117] In this embodiment, the reward value is calculated as follows: the reward value for expert data samples and complete successful samples is 1.0 (high weight). These samples are of high quality and have complete information, contributing greatly to model training. The reward value for partially successful samples is 0.7 (medium weight). These samples contain some effective information and can assist model learning. The reward value for failed samples and noisy samples (such as samples with abnormal sensor data or blurred images) is 0.1 (low weight). These samples are of low quality and interfere significantly with model training. Samples with a reward value lower than 0.3 are directly screened out from the training set to ensure the high quality of training samples.
[0118] Furthermore, once the model training converges, the model parameters are saved to obtain the task progress prediction model. This model can take multiple frames of feature sequences as input and output the current task's stage classification result (sub-task stage identifier), the progress value within the stage, and the global progress value. Optionally, it can output the task success probability prediction result and meet the requirements for real-time progress prediction.
[0119] S105. In response to receiving the feature sequence data collected by the target robot during the current task, the feature sequence data is input into the task progress prediction model to obtain the current task progress result output by the task progress prediction model.
[0120] In this embodiment, the feature sequence data refers to the set of features obtained after preprocessing such as feature extraction and normalization, which is the multi-view image sequence data and sensor data collected in real time by the acquisition device during the robot's current task execution, and is the input data of the task progress prediction model.
[0121] In this step, when the target robot performs a new long-term task, it collects multi-view image sequences and sensor data in real time during the task process. The collected data is preprocessed by feature extraction, normalization and other methods to obtain feature sequence data. Then, the feature sequence data is input into the trained task progress prediction model in real time. The model processes the input data and outputs the current sub-task stage, intra-segment progress value and global progress value, thus completing the real-time prediction of the current task progress.
[0122] This step enables real-time progress prediction for long-term tasks, providing accurate decision support for robot task management, process optimization, and fault diagnosis, and solving the problems of lagging progress prediction, inability to provide real-time feedback, and difficulty in meeting actual management and control needs in existing technologies. In this way, the current task's stage identifier, intra-segment progress, and global progress can be output in real time. The prediction accuracy is high and the response speed is fast, which can meet the real-time control requirements of long-term robot operations in real scenarios and effectively improve the controllability and intelligence level of robot task execution.
[0123] For example, when the target robot performs a new clothing folding task, multi-view image sequences and sensor data are collected in real time during the task process. The collected data undergoes feature extraction and normalization processing consistent with the training phase to obtain feature sequence data. Subsequently, the feature sequence data is input into the trained task progress prediction model in real time. The model processes the input data quickly and outputs the current sub-task stage, intra-segment progress value, and global progress value, thereby realizing real-time prediction of the current task progress and providing accurate support for robot task management.
[0124] For example, please refer to Figure 2 , Figure 2 This is a schematic diagram illustrating the working principle of a task progress prediction model provided in an embodiment of this application. Figure 2 As shown, the task progress prediction model receives two types of core data: Image Frames are continuous video frames from the robot's camera, providing visual information about the external environment; Joint State is the robot's ontological perception data, such as joint angles and angular velocities, providing the robot's own posture information.
[0125] Furthermore, such as Figure 2 As shown, the upper branch is for macroscopic stage estimation. The image and joint state are input into the StageEstimator, processed by the Classification Head, and output the current stage prediction. The lower branch is for microscopic subtask estimation, which aims to predict specific motion parameters or control sequences. The image and joint state are input into the SubtaskEstimator, processed by the Regression Head, and output predicted time series data.
[0126] Furthermore, such as Figure 2As shown, during feature extraction, the visual flow uses a visual encoder, namely the CLIP model, which is a powerful pre-trained visual language model that captures rich semantic information; the state flow (green on the right) uses a State Normalizer to standardize the raw joint state data, eliminating the influence of dimensions and accelerating convergence.
[0127] Furthermore, such as Figure 2 As shown, visual features and state features are mapped to the same vector space by a Linear Projector, which maps features of two different modalities and dimensions to the same vector space for subsequent mathematical operations.
[0128] Furthermore, such as Figure 2 As shown, the Pos. Embedding (position encoder) is used to add positional information, allowing the model to know which frame comes first and which comes later; the Transformer Sequential Aggregator (sequence aggregation network) uses the Transformer's self-attention mechanism to capture long-distance temporal dependencies. It not only integrates "visual" and "state" information, but also "past" and "present" information; the MLP Fusion Net (multilayer perceptron fusion network) performs nonlinear transformations to further refine features and output a high-dimensional feature representation after deep fusion.
[0129] The task progress prediction method based on stage-aware modeling provided in this application obtains trajectory data of the target robot's historical long-term tasks, divides sub-task stages based on keyframes and determines stage boundary timestamps, calculates the intra-segment progress of each time frame and the global progress of the sub-task stages, trains a stage-aware reward model using the target task trajectory dataset and uses it for current task progress prediction. This solves the technical problems of existing methods, such as inconsistent progress semantics due to lack of stage division, unstable annotation methods, inability to handle local successful or failed trajectories, and low-quality samples interfering with model performance. It achieves the technical effects of unified progress semantics for long-term robot tasks, adaptability to multiple task completion states, improved progress prediction accuracy and robustness, and meeting the requirements for real-time progress prediction.
[0130] Please see Figure 3 , Figure 3 This is a schematic diagram of a task progress prediction device based on stage-aware modeling, provided as an embodiment of this application. Figure 3 As shown, the task progress prediction device 300 includes: The data acquisition module 310 is used to acquire task trajectory data corresponding to multiple long-term tasks collected by the target robot during historical tasks. The stage division module 320 is used to divide each long-term task into multiple sub-task stages based on multiple keyframes corresponding to the long-term task in the task trajectory data, and determine the stage boundary timestamp corresponding to each sub-task stage based on the task trajectory data, so as to obtain an annotated task trajectory dataset with the annotations corresponding to the sub-task stages and the stage boundary timestamps. The progress determination module 330 is used to determine, based on the labeled task trajectory dataset, the intra-segment progress information corresponding to each time frame in each long-term task and the global progress information corresponding to each sub-task stage in each long-term task, so as to obtain a target task trajectory dataset with the labels corresponding to the intra-segment progress information and the global progress information. The model training module 340 is used to train a preset stage-aware reward model using the target task trajectory dataset to obtain a task progress prediction model. The model application module 350 is used to respond to receiving the feature sequence data collected by the target robot during the current task, input the feature sequence data into the task progress prediction model, and obtain the current task progress result output by the task progress prediction model.
[0131] Furthermore, when the stage division module 320 is used to divide the long-term task into multiple sub-task stages based on multiple keyframes corresponding to the long-term task in the task trajectory data, and to determine the stage boundary timestamp corresponding to each sub-task stage based on the task trajectory data, so as to obtain an annotated task trajectory dataset with annotations corresponding to the sub-task stages and the stage boundary timestamps, the stage division module 320 is used to: Based on the action logic corresponding to the long-duration task, multiple keyframes corresponding to the long-duration task are determined in the task trajectory data; Based on the key frame corresponding to the long-term task, the long-term task is divided into multiple sub-task stages. The start time and end time of each sub-task stage are determined from the task trajectory data, and the stage boundary timestamp of each sub-task stage is determined based on the start time and the end time. The task trajectory data is labeled using the sub-task stages and the stage boundary timestamps to obtain a labeled task trajectory dataset.
[0132] Furthermore, when the stage division module 320 is used to annotate the task trajectory data using the sub-task stages and the stage boundary timestamps to obtain an annotated task trajectory dataset, the stage division module 320 is used to: The task trajectory data is labeled according to the sub-task stage and the stage boundary timestamp to obtain a time-labeled task trajectory dataset. Obtain the stage completion status of the subtask stage, and determine the task completion status corresponding to the long-duration task based on the stage completion status; wherein, the task completion status includes one of complete success, partial success and failure; The time-labeled task trajectory dataset is labeled according to the task completion status information to obtain the labeled task trajectory dataset.
[0133] Furthermore, when the progress determination module 330 determines, based on the labeled task trajectory dataset, the intra-segment progress information corresponding to each time frame in each long-term task and the global progress information corresponding to each sub-task stage in each long-term task, the progress determination module 330 is used to: For each time frame in each of the long-term tasks, determine the sub-task stage to which the time frame belongs, and based on the time frame and the stage boundary timestamp corresponding to the sub-task stage, determine the intra-segment progress information corresponding to the time frame in the sub-task stage. For a long-term task whose completion status is "completely successful", obtain the first stage weight and the cumulative weight of the first preceding stage corresponding to the sub-task stage, and determine the global progress information corresponding to the sub-task stage based on the intra-segment progress information, the stage weight and the cumulative stage weight. For a long-term task whose task completion status is partially successful, determine the target sub-task stage where the partial success of the long-term task is held, and determine the second stage weight and the cumulative weight of the second preceding stage corresponding to the target sub-task stage. For the target subtask stage and the subtask stages preceding the target subtask stage, based on the intra-segment progress information corresponding to the target subtask stage, the second stage weight, and the second preceding stage cumulative weight, the global progress information corresponding to the target subtask stage is determined, and the sum of the second stage weight and the second preceding stage cumulative weight is determined as the global progress information corresponding to the target subtask stage as a whole. For the sub-task stage that follows the target sub-task stage, under preset boundary conditions, the global progress information corresponding to the target sub-task stage is smoothly decayed by time interpolation to determine the global progress information corresponding to the sub-task stage.
[0134] Furthermore, when determining the stage weight corresponding to the sub-task stage, the progress determination module 330 is used to: The expert dataset was selected from the labeled task trajectory dataset based on the task duration. For each piece of labeled task trajectory data in the expert dataset, the long-term task corresponding to the labeled task trajectory data is divided into multiple expert sub-task stages in equal proportions; For each expert subtask stage, the ratio between the stage duration corresponding to the expert subtask stage and the total task duration of the long-term task corresponding to the labeled task trajectory data is determined as the expert stage weight corresponding to the expert subtask stage. Based on the expert stage weights, the stage weights corresponding to each subtask stage are determined.
[0135] Furthermore, the stage-aware reward model includes a multilayer perceptron fusion network, a sequence aggregation network, a position encoder, a linear projector, a visual encoder, and a state normalizer; when the model training module 340 is used to train the preset stage-aware reward model using the target task trajectory dataset to obtain a task progress prediction model, the model training module 340 is used for: Feature extraction and normalization are performed on the target task trajectory dataset to obtain a time series training sample dataset; The linear projector is used to project the visual features and sensor features in the time series training sample dataset into dimensions, and the position encoder is used to add position embedding encoding to the dimensional projection to obtain the target training sample dataset. With stage classification and intra-stage progress estimation as training objectives, the multilayer perceptron fusion network and the sequence aggregation network in the stage-aware reward model are trained in an end-to-end manner based on the target training sample dataset, so that the stage-aware reward model has both stage recognition capability and fine-grained progress estimation capability; wherein, during the training process of the stage-aware reward model, the target training sample dataset is weighted and filtered based on the calculated reward value.
[0136] Furthermore, when the model training module 340 uses a target task trajectory dataset including multi-view image sequence data, sensor data, progress annotation data, and success marker data, and performs feature extraction and normalization on the target task trajectory dataset to obtain a time-series training sample dataset, the model training module 340 is used to: The visual features corresponding to the multi-view image sequence data are extracted using the frozen visual encoder; The sensor data is normalized using the state normalizer to obtain sensor features; Based on the progress annotation data and the success marker data, the visual features and the sensor features are combined into a time series training sample dataset according to the time series; wherein, the time series training sample dataset includes multiple single-frame training sample data, and each single-frame training sample data includes the visual features, the sensor features, the subtask stage information, the intra-segment progress information, the global progress information, and the task completion status annotation information.
[0137] The task progress prediction device based on stage-aware modeling provided in this application acquires trajectory data of the target robot's historical long-term tasks, divides sub-task stages based on keyframes and determines stage boundary timestamps, calculates the intra-segment progress of each time frame and the global progress of the sub-task stages, trains a stage-aware reward model using the target task trajectory dataset and uses it for current task progress prediction. This solves the technical problems of existing methods, such as inconsistent progress semantics due to lack of stage division, unstable annotation methods, inability to handle local successful or failed trajectories, and low-quality samples interfering with model performance. It achieves the technical effects of unified progress semantics for long-term robot tasks, adaptability to multiple task completion states, improved progress prediction accuracy and robustness, and meeting the requirements for real-time progress prediction.
[0138] Please see Figure 4 , Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 4 As shown, the electronic device 400 includes a processor 410, a memory 420, and a bus 430.
[0139] The memory 420 stores machine-readable instructions executable by the processor 410. When the electronic device 400 is running, the processor 410 communicates with the memory 420 via the bus 430. When the machine-readable instructions are executed by the processor 410, they can perform the operations described above. Figure 1 The steps of the task progress prediction method based on stage-aware modeling in the method embodiment shown are described in detail in the method embodiment, and will not be repeated here.
[0140] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can perform the above-described actions. Figure 1 The steps of the task progress prediction method based on stage-aware modeling in the method embodiment shown are described in detail in the method embodiment, and will not be repeated here.
[0141] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0142] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the shown or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0143] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0144] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0145] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0146] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The scope of protection of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A task progress prediction method based on stage-aware modeling, characterized in that, The method includes: Acquire task trajectory data corresponding to multiple long-term tasks collected by the target robot during historical tasks; For each long-term task, based on multiple keyframes corresponding to the long-term task in the task trajectory data, the long-term task is divided into multiple sub-task stages, and based on the task trajectory data, the stage boundary timestamp corresponding to each sub-task stage is determined to obtain an annotated task trajectory dataset with the corresponding annotations of the sub-task stages and the stage boundary timestamps. Based on the labeled task trajectory dataset, the intra-segment progress information corresponding to each time frame in each long-term task and the global progress information corresponding to each sub-task stage in each long-term task are determined respectively, so as to obtain a target task trajectory dataset with the labels corresponding to the intra-segment progress information and the global progress information. The target task trajectory dataset is used to train a preset stage-aware reward model to obtain a task progress prediction model. In response to receiving the feature sequence data collected by the target robot during the current task, the feature sequence data is input into the task progress prediction model to obtain the current task progress result output by the task progress prediction model.
2. The method according to claim 1, characterized in that, The process involves dividing the long-duration task into multiple sub-task stages based on multiple keyframes corresponding to the task trajectory data, and determining the stage boundary timestamps corresponding to each sub-task stage based on the task trajectory data, to obtain an annotated task trajectory dataset with annotations corresponding to the sub-task stages and the stage boundary timestamps, including: Based on the action logic corresponding to the long-duration task, multiple keyframes corresponding to the long-duration task are determined in the task trajectory data; Based on the key frame corresponding to the long-term task, the long-term task is divided into multiple sub-task stages. The start time and end time of each sub-task stage are determined from the task trajectory data, and the stage boundary timestamp of each sub-task stage is determined based on the start time and the end time. The task trajectory data is labeled using the sub-task stages and the stage boundary timestamps to obtain a labeled task trajectory dataset.
3. The method according to claim 2, characterized in that, The task trajectory data is labeled using the sub-task stages and the stage boundary timestamps to obtain a labeled task trajectory dataset, including: The task trajectory data is labeled according to the sub-task stage and the stage boundary timestamp to obtain a time-labeled task trajectory dataset. Obtain the stage completion status of the subtask stage, and determine the task completion status corresponding to the long-duration task based on the stage completion status; wherein, the task completion status includes one of complete success, partial success and failure; The time-labeled task trajectory dataset is labeled according to the task completion status information to obtain the labeled task trajectory dataset.
4. The method according to claim 3, characterized in that, The step of determining, based on the labeled task trajectory dataset, the intra-segment progress information corresponding to each time frame in each long-term task and the global progress information corresponding to each sub-task stage in each long-term task, includes: For each time frame in each of the long-term tasks, determine the sub-task stage to which the time frame belongs, and based on the time frame and the stage boundary timestamp corresponding to the sub-task stage, determine the intra-segment progress information corresponding to the time frame in the sub-task stage. For a long-term task whose completion status is "completely successful", obtain the first stage weight and the cumulative weight of the first preceding stage corresponding to the sub-task stage, and determine the global progress information corresponding to the sub-task stage based on the intra-segment progress information, the stage weight and the cumulative stage weight. For a long-term task whose task completion status is partially successful, determine the target sub-task stage where the partial success of the long-term task is held, and determine the second stage weight and the cumulative weight of the second preceding stage corresponding to the target sub-task stage. For the target subtask stage and the subtask stages preceding the target subtask stage, based on the intra-segment progress information corresponding to the target subtask stage, the second stage weight, and the second preceding stage cumulative weight, the global progress information corresponding to the target subtask stage is determined, and the sum of the second stage weight and the second preceding stage cumulative weight is determined as the global progress information corresponding to the target subtask stage as a whole. For the sub-task stage that follows the target sub-task stage, under preset boundary conditions, the global progress information corresponding to the target sub-task stage is smoothly decayed by time interpolation to determine the global progress information corresponding to the sub-task stage.
5. The method according to claim 4, characterized in that, The stage weights corresponding to the sub-task stages are determined through the following steps: The expert dataset was selected from the labeled task trajectory dataset based on the task duration. For each piece of labeled task trajectory data in the expert dataset, the long-term task corresponding to the labeled task trajectory data is divided into multiple expert sub-task stages in equal proportions; For each expert subtask stage, the ratio between the stage duration corresponding to the expert subtask stage and the total task duration of the long-term task corresponding to the labeled task trajectory data is determined as the expert stage weight corresponding to the expert subtask stage. Based on the expert stage weights, the stage weights corresponding to each of the sub-task stages are determined.
6. The method according to claim 1, characterized in that, The stage-aware reward model includes a multilayer perceptron fusion network, a sequence aggregation network, a position encoder, a linear projector, a visual encoder, and a state normalizer; the step of training the preset stage-aware reward model using the target task trajectory dataset to obtain a task progress prediction model includes: Feature extraction and normalization are performed on the target task trajectory dataset to obtain a time series training sample dataset; The linear projector is used to project the visual features and sensor features in the time series training sample dataset into dimensions, and the position encoder is used to add position embedding encoding to the dimensional projection to obtain the target training sample dataset. With stage classification and intra-stage progress estimation as training objectives, the multilayer perceptron fusion network and the sequence aggregation network in the stage-aware reward model are trained in an end-to-end manner based on the target training sample dataset, so that the stage-aware reward model has both stage recognition capability and fine-grained progress estimation capability; wherein, during the training process of the stage-aware reward model, the target training sample dataset is weighted and filtered based on the calculated reward value.
7. The method according to claim 6, characterized in that, The target task trajectory dataset includes multi-view image sequence data, sensor data, progress annotation data, and success marker data; the target task trajectory dataset undergoes feature extraction and normalization processing to obtain a time-series training sample dataset, including: The visual features corresponding to the multi-view image sequence data are extracted using the frozen visual encoder; The sensor data is normalized using the state normalizer to obtain sensor features; Based on the progress annotation data and the success marker data, the visual features and the sensor features are combined into a time series training sample dataset according to the time series; wherein, the time series training sample dataset includes multiple single-frame training sample data, and each single-frame training sample data includes the visual features, the sensor features, the subtask stage information, the intra-segment progress information, the global progress information, and the task completion status annotation information.
8. A task progress prediction device based on stage-aware modeling, characterized in that, The task progress prediction device includes: The data acquisition module is used to acquire task trajectory data corresponding to multiple long-term tasks collected by the target robot during historical tasks; The phase division module is used to divide each long-term task into multiple sub-task phases based on multiple keyframes corresponding to the long-term task in the task trajectory data, and determine the phase boundary timestamp corresponding to each sub-task phase based on the task trajectory data, so as to obtain an annotated task trajectory dataset with the annotations corresponding to the sub-task phases and the phase boundary timestamps. The progress determination module is used to determine, based on the labeled task trajectory dataset, the intra-segment progress information corresponding to each time frame in each long-term task and the global progress information corresponding to each sub-task stage in each long-term task, so as to obtain a target task trajectory dataset with the labels corresponding to the intra-segment progress information and the global progress information. The model training module is used to train a preset stage-aware reward model using the target task trajectory dataset to obtain a task progress prediction model. The model application module is used to respond to the feature sequence data collected by the target robot during the current task, input the feature sequence data into the task progress prediction model, and obtain the current task progress result output by the task progress prediction model.
9. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. The machine-readable instructions are executed by the processor to perform the steps of the task progress prediction method based on stage-aware modeling as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the task progress prediction method based on stage-aware modeling as described in any one of claims 1 to 7.