A robot task recovery method and system
By acquiring information about the sub-steps and execution progress of the interrupted task, analyzing irreversibility, inertia retention, and reentry impedance, calculating the recovery reward, and dynamically determining the recovery strategy, the problem of rigid robot task recovery schemes is solved, adaptive task recovery is achieved, and task continuity and execution efficiency are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 广州云趣信息科技有限公司
- Filing Date
- 2026-06-10
- Publication Date
- 2026-07-10
AI Technical Summary
Existing robot task recovery solutions cannot cope with changes in environmental conditions or adjustments to task intent, resulting in rigid recovery strategies that cannot adapt and lead to ineffective operations and wasted resources.
By acquiring information about the sub-steps and execution progress of the interrupted task, analyzing irreversibility, inertia retention, and reentry impedance, calculating the recovery reward, and dynamically determining the recovery strategy, adaptive task recovery is achieved.
Robots can flexibly adjust their recovery behavior according to environmental changes and intention drift, maximizing the preservation of the value of completed work, avoiding execution failures caused by rigid recovery, and improving task continuity and execution efficiency.
Smart Images

Figure CN122353637A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of robot intelligent control technology, specifically to a robot task recovery method and system. Background Technology
[0002] Most existing robot task interruption recovery solutions rely on preset fixed breakpoint markers and static task parameters. The robot pre-enters fixed execution points for each task node. After an unexpected task interruption, the operation is restarted directly from the interruption point based solely on the breakpoint record. Environmental and task-related data are only temporarily stored in the runtime cache. The task is resumed by matching the subsequent recovery start position based on preset rules.
[0003] However, existing methods struggle to handle situations where the environmental state changes significantly or the task intent is adjusted during an interruption. For example, if a robot interrupts its task due to obstacle avoidance, the original path may become unavailable, or the user may change the task objective midway. However, traditional state machines still attempt to continue execution from the breakpoint, leading to invalid operations, wasted resources, or even task failure. They cannot dynamically determine the most reasonable recovery strategy for each step and can only execute rigid preset actions. Summary of the Invention
[0004] This invention provides a robot task recovery method and system, aiming to solve the technical problem that existing technologies suffer from rigid robot task recovery strategies and an inability to adaptively adjust due to changes in environmental conditions or task intent during interruptions.
[0005] In view of the above problems, the present invention provides a robot task recovery method and system.
[0006] In a first aspect, the present invention provides a robot task recovery method, comprising: When the robot is interrupted during the execution of a multi-step task, it obtains information about the sub-steps of the interrupted task and the execution progress of each sub-step. Based on the operation type and completion progress of each sub-step, the irreversibility of each sub-step is analyzed and obtained; The task inertia retention rate is calculated based on the duration of the interruption, changes in the environmental state during the interruption, and changes in the task intent. Based on the operation type of each sub-step, analyze and obtain the cost consumed by the first execution of the sub-step and the additional cost of re-entry, and calculate the sub-step re-entry impedance of each sub-step; Based on the irreversibility of the sub-step, the inertia retention of the task, and the reentry impedance of the sub-step, the recovery reward of each sub-step is calculated and obtained. The recovery strategy for each sub-step is determined based on the recovery reward of each sub-step.
[0007] In a second aspect, the present invention provides a robot task recovery system, comprising: The interrupted task progress acquisition module is used to acquire information about the sub-steps of the interrupted task and the execution progress of each sub-step when the robot is interrupted during the execution of a multi-step task. The irreversibility analysis module is used to analyze and obtain the irreversibility of each sub-step based on the operation type and completion progress of each sub-step. The inertia retention calculation module is used to calculate the task inertia retention based on the duration of the interruption, changes in the environmental state during the interruption, and changes in the task intent. The reentry impedance calculation module is used to analyze and obtain the cost consumed by the first execution of the sub-step and the additional cost of reentry based on the operation type of each sub-step, and to calculate the sub-step reentry impedance of each sub-step. The recovery reward calculation module is used to calculate and obtain the recovery reward of each sub-step based on the irreversibility of the sub-step, the inertia retention of the task, and the reentry impedance of the sub-step. The recovery strategy determination module is used to determine the recovery strategy for each sub-step based on the recovery reward of each sub-step.
[0008] One or more technical solutions provided in this invention have at least the following technical effects or advantages: This invention provides a robot task recovery method and system. By introducing a task memory model and a multi-dimensional recovery reward calculation mechanism, it achieves adaptive and intelligent task recovery. First, the execution progress of each sub-step of the interrupted task is acquired, and the irreversibility of the sub-steps is analyzed based on the operation type and completion progress to identify which steps have irrevocably changed the environmental state. Second, the task inertia retention degree is calculated by combining the interruption duration, environmental changes, and intent changes, quantifying the continued value of the original task logic after the interruption. Then, the reentry impedance of the sub-steps is calculated based on the operation type and consumed costs to assess the additional cost of re-executing a certain step. Finally, the recovery reward is comprehensively obtained, and the optimal strategy is dynamically determined for each sub-step. This invention enables the robot to flexibly adjust its recovery behavior according to environmental changes and intent drift, maximizing the preservation of the value of completed work while avoiding execution failures caused by rigid recovery, thus improving task continuity and execution efficiency in dynamic and complex environments. Attached Figure Description
[0009] Figure 1 This is a flowchart illustrating a robot task recovery method provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the overall logic of a robot task recovery method provided in an embodiment of the present invention; Figure 3A schematic diagram of an irreversibility reference value mapping table for a robot task recovery method provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of a robot task recovery system provided in an embodiment of the present invention; The components represented by each number in the attached diagram are explained below: Interrupted task progress acquisition module 11, irreversibility analysis module 12, inertia retention calculation module 13, reentry impedance calculation module 14, recovery reward calculation module 15, recovery strategy determination module 16. Detailed Implementation
[0010] This invention provides a robot task recovery method and system to address the technical problem that existing technologies suffer from rigid robot task recovery strategies and an inability to adaptively adjust due to changes in environmental conditions or task intent during interruptions.
[0011] Example 1, as Figure 1 , Figure 2 As shown, the present invention provides a robot task recovery method, the method comprising: S100: When the robot is interrupted during the execution of a multi-step task, obtain the sub-step information of the interrupted task and the execution progress of each sub-step.
[0012] When a robot performs a multi-step task, an interruption event occurs, and the robot needs to resume normal execution from a paused state. To formulate appropriate recovery strategies for different sub-steps, it is essential to have a complete understanding of the overall structure of the interrupted task and the progress of each sub-step. Without sub-step information, it is impossible to distinguish which sub-steps have been completed and which have not yet started; without execution progress information, it is impossible to determine how much work a running sub-step has accomplished. Therefore, it is crucial to collect basic task information and execution status immediately after an interruption to provide necessary data support for subsequent analysis of sub-step irreversibility, reentry impedance, and other parameters.
[0013] Step S100 in the method provided in this embodiment of the invention includes: When the robot is interrupted during the execution of a multi-step task, the task identifier and task description of the currently executing task are obtained from the robot's task management module. The task identifier is used to query and obtain the sub-step information of the task. The sub-step information includes the sub-step number, operation type, operation object and execution order of each sub-step in the task. The execution status of each sub-step when the interruption occurs is obtained, wherein the execution status includes three states: not started, in execution, and completed. For a sub-step with an execution status of in execution, the current completion progress of the sub-step is further obtained, wherein the current completion progress is the proportion of the amount of operations performed by the sub-step to the total amount of operations of the sub-step.
[0014] First, when the robot is interrupted during the execution of a multi-step task, it retrieves the task identifier and task description of the currently executing task from the robot's task management module. The task management module is a software functional unit stored within the robot, used to record basic information about the currently running task and the execution status of each sub-step. The task management module is initialized when the robot starts a multi-step task and is continuously updated during task execution. The task identifier is a unique number or name that identifies a task. The task description is a brief textual description of the task content, for example, a factory equipment inspection task: sequentially checking the temperature and vibration parameters of three pieces of equipment, A, B, and C.
[0015] Specifically, the robot's task management module has a current task pointer, which points to a task control block. The task control block contains a task identifier field and a task description field. When an interruption occurs, the robot retrieves the task identifier and task description by reading the corresponding fields in the task control block pointed to by the current task pointer.
[0016] For example, in a factory inspection task, the robot is performing sub-step 4: spraying a measured amount of cooling agent onto the overheated parts of the equipment. At this moment, a worker accidentally enters the robot's operating area, and the robot stops urgently. After the interruption, the robot reads the task identifier INSP_TEMP_001 from the task management module, with the task description: Perform temperature anomaly handling on equipment No. 3 on production line: spray cooling agent, retest, and report.
[0017] Secondly, the sub-step information of the task is retrieved based on the task identifier. This sub-step information includes the sub-step number, operation type, operation object, and execution order within the task. The sub-step information is a data set comprising the independent execution units of a multi-step task. Each sub-step includes its sub-step number, operation type, operation object, and execution order within the task.
[0018] The sub-step number indicates its sequential position within the task, typically a positive integer such as 1, 2, or 3. The operation type refers to the specific action category of the sub-step, including physical movement, information acquisition, operation execution, and communication interaction. The operation object refers to the target object or data affected by the sub-step, such as an infrared thermal imager, a cooling agent nozzle, or a temperature record file. The execution order refers to the sequential dependencies of the sub-steps within the task, usually consistent with the sub-step number.
[0019] Specifically, the task management module maintains a sub-step information table, with the task identifier as the primary key. The robot uses the task identifier as the query condition to read all corresponding sub-step records from the sub-step information table. Each record contains the sub-step number, operation type, operation object, and execution order. The robot arranges the read sub-step information according to the execution order to form a sub-step sequence.
[0020] For example, for task identifier INSP_TEMP_001, the robot queries and obtains the following sub-step information: Sub-step 1, operation type is physical movement, operation object is point A, execution order is first; Sub-step 2, operation type is information acquisition, operation object is infrared thermal imager, execution order is second; Sub-step 3, operation type is operation execution, operation object is temperature judgment logic, execution order is third; Sub-step 4, operation type is operation execution, operation object is cooling agent injection port, execution order is fourth; Sub-step 5, operation type is information acquisition, operation object is infrared thermal imager, execution order is fifth; Sub-step 6, operation type is communication interaction, operation object is MES system reporting interface, execution order is sixth.
[0021] Next, the execution status of each sub-step when the interruption occurs is obtained, wherein the execution status includes three states: not started, in execution, and completed. For a sub-step with an execution status of in execution, the current completion progress of the sub-step is further obtained, wherein the current completion progress is the proportion of the amount of operations performed by the sub-step to the total amount of operations of the sub-step.
[0022] The execution status represents the execution stage of a sub-step at the time of the interruption. There are three execution statuses: not started, in progress, and completed. Not started means the sub-step has not yet been initiated; in progress means the sub-step has been initiated but not yet completed; completed means the sub-step has been fully executed. The completion progress is defined only for sub-steps in the in progress state. The completion progress equals the proportion of operations already performed by the sub-step to the total number of operations performed by the sub-step, and its value is a real number greater than 0 and less than 1.
[0023] Specifically, the robot's task management module continuously records the status of each sub-step during task execution. When a sub-step begins execution, its status changes from "not started" to "in execution"; when the sub-step completes execution, its status changes to "completed." For sub-steps in execution, the robot also records a progress counter, which updates linearly based on the amount of work done in the sub-step. When an interruption occurs, the robot iterates through all sub-steps, reading the status field of each sub-step; for sub-steps with the status "in execution," it reads their progress counter and divides the current value of the counter by the total amount of work done in that sub-step to obtain the completion progress.
[0024] For example, when a factory inspection task is interrupted, the robot queries the execution status of each sub-step as follows: Sub-step 1 completed; Sub-step 2 completed; Sub-step 3 completed; Sub-step 4 in progress; Sub-step not started; Sub-step 6 not started. In sub-step 4, the total operation is spraying 100 ml of cooling agent, and the robot has sprayed 40 ml, so the completion progress = 40 / 100 = 0.4.
[0025] In this embodiment of the invention, by collecting the task identifier, task description, sub-step information, and execution status and completion progress of each sub-step of the interrupted task, the robot obtains the complete sub-step structure of the interrupted task and the precise execution stage of each sub-step at the time of interruption. This enables the robot to clearly distinguish between completed sub-steps, in-process sub-steps, and unstarted sub-steps, and quantifies the proportion of operations performed in in-process sub-steps to the total operations. This provides an accurate data foundation for subsequent calculations of sub-step irreversibility, task inertia retention, sub-step reentry impedance, and recovery reward, achieving comprehensive perception of the interrupted task status.
[0026] S200: Based on the operation type and completion progress of each sub-step, analyze and obtain the irreversibility of each sub-step.
[0027] In the recovery process of a multi-step task, the parts of different sub-steps that have been completed before the interruption have different degrees of reversibility. Some sub-steps, such as moving, taking pictures, and communicating, can be re-executed even after completion, with a low degree of irreversibility; while other sub-steps, such as spraying cooling agents on equipment and physical assembly, change the environmental state once executed and cannot be easily rolled back. For sub-steps with a high degree of irreversibility, repeated execution should be avoided as much as possible; for sub-steps with a low degree of irreversibility or even those that can be completely restarted, it is preferable to reset and redo them. Therefore, it is necessary to quantify the irreversibility of each sub-step by combining its operation type and its actual progress, in order to express the constraint strength of the already executed part of the sub-step on subsequent recovery behavior.
[0028] Step S200 in the method provided in this embodiment of the invention includes: The corresponding irreversibility baseline value is obtained by querying the operation type of each sub-step, wherein the operation type includes physical movement, information collection, operation execution and communication interaction. For sub-steps whose execution status is completed, the irreversibility is directly taken as the irreversibility baseline value of the sub-step; For a sub-step that is in execution, the irreversibility baseline value of the sub-step is multiplied by the completion progress of the sub-step to obtain the sub-step irreversibility. For a sub-step whose execution state is "not started", the irreversibility of the sub-step is set to zero.
[0029] First, the corresponding irreversibility baseline value is obtained based on the operation type of each sub-step. The operation types include physical movement, information acquisition, operation execution, and communication interaction. The irreversibility baseline value is a preset numerical value representing the inherent degree of irreversible change to the environment caused by a sub-step of a certain operation type in its completed state. The irreversibility baseline value ranges from 0 to 1, with a larger value indicating stronger irreversibility. The irreversibility baseline values for different operation types are preset according to their physical or logical characteristics.
[0030] The rules for setting the operation type and its irreversibility baseline value are as follows: Physical Movement: This involves the robot moving from one location to another. Since the robot's pose requirements are low, the movement usually does not cause permanent changes to the environment, and the cost of re-moving is small. Therefore, a low irreversibility baseline value is assigned, such as 0.1. Information Acquisition: This involves using sensors to collect data such as temperature, images, and vibration. This type of operation can be re-executed at any time and does not cause any physical changes to the environment. Therefore, the lowest irreversibility baseline value is assigned, such as 0.05. Operation Execution: This involves altering physical objects, such as spraying cooling agents, tightening screws, or grasping objects. This type of operation may change the environmental state, and the change is difficult or impossible to reverse. Its irreversibility baseline value needs to be set according to whether the specific operation involves changes to the physical object: If the operation will permanently change the state of the object, such as the consumption of spraying agents or the deformation of parts, a higher irreversibility baseline value is set, such as 0.8; if the operation is only a temporary contact, such as pressing a switch, a medium-low irreversibility baseline value is set, such as 0.3. Communication and interaction category: Sending data or receiving instructions to external systems, such as reporting to the MES system or requesting cloud services. Communication transmissions can be repeatedly initiated without producing additional consequences, so a low irreversibility baseline value is assigned, set to 0.05.
[0031] Specifically, an irreversible reference value mapping table is pre-stored in the robot's memory, such as... Figure 3As shown, this table uses the operation type as the key and the corresponding irreversibility baseline value as the value. For each sub-step, the robot reads its operation type field and then looks up the irreversibility baseline value for that operation type in the mapping table. For example, by looking up the irreversibility baseline value mapping table, the irreversibility baseline values for each sub-step are obtained: Sub-step 1 is a physical movement type, with an irreversibility baseline value of 0.1; Sub-step 2 is an information acquisition type, with an irreversibility baseline value of 0.05; Sub-step 3 is an operation execution type, with an irreversibility baseline value of 0.3; Sub-step 4 is an operation execution type, with an irreversibility baseline value of 0.8; Sub-step 5 is an information acquisition type, with an irreversibility baseline value of 0.05; Sub-step 6 is a communication interaction type, with an irreversibility baseline value of 0.05.
[0032] Secondly, for sub-steps whose execution status is completed, the irreversibility is directly taken as the irreversibility baseline value of the sub-step; for sub-steps whose execution status is in progress, the irreversibility baseline value of the sub-step is multiplied by the completion progress of the sub-step to obtain the sub-step irreversibility; for sub-steps whose execution status is not started, the sub-step irreversibility is taken as zero.
[0033] The irreversibility of a substep is a value ranging from 0 to 1, used to quantify the degree of irreversible change to the environment caused by the currently executed portion of a substep. The higher the irreversibility of a substep, the more difficult it is to undo the executed actions, and the more difficult it is to repeat the execution of the substep during subsequent recovery.
[0034] First, for sub-steps whose execution status is "completed," all operations of that sub-step have been executed. Therefore, its irreversibility is directly taken as the irreversibility baseline value of that sub-step. That is: Sub-step irreversibility = Irreversibility baseline value.
[0035] Secondly, for sub-steps in the execution state, only a portion of the operations have been completed. The degree of irreversible change caused by the completed portion is proportional to the completion progress. Therefore, multiplying the irreversibility baseline value by the completion progress yields the sub-step irreversibility. That is: Sub-step irreversibility = Irreversible baseline value × Completion progress.
[0036] Furthermore, for substeps whose execution state is "not started", the substep has not yet performed any operations, so it does not change the environment and its irreversibility is set to zero.
[0037] For example, based on the execution status and completion progress of each sub-step at the interruption time obtained in S100, the robot calculates the irreversibility of each sub-step as follows: Sub-step 1: Execution status is completed, irreversibility baseline value is 0.1, sub-step irreversibility = 0.1. Sub-step 2: Execution status is completed, irreversibility baseline value is 0.05, sub-step irreversibility = 0.05. Sub-step 3: Execution status is completed, irreversibility baseline value is 0.3, sub-step irreversibility = 0.3. Sub-step 4: Execution status is in progress, completion progress is 0.4, irreversibility baseline value is 0.8, sub-step irreversibility = 0.8 × 0.4 = 0.32. Sub-steps 5 and 6: Execution status is not started, sub-step irreversibility = 0.0.
[0038] In this embodiment of the invention, the robot obtains the corresponding irreversibility baseline value based on the operation type of each sub-step, and performs calculations according to different rules based on the execution status and completion progress of the sub-step, thereby obtaining the sub-step irreversibility of each sub-step. This allows the robot to quantitatively distinguish which completed sub-steps have caused irreversible changes to the environment, the proportion of completed parts of ongoing sub-steps relative to all irreversible changes, and sub-steps that have not yet started have no irreversible constraints. The obtained sub-step irreversibility values provide key input for the subsequent calculation of the recovery reward, thereby ensuring that sub-steps that cause significant irreversible changes to the environment are given higher retention priority in recovery decisions, avoiding resource waste or environmental state conflicts caused by repeated execution.
[0039] S300: Calculate the task inertia retention rate based on the duration of the interruption, changes in the environmental state during the interruption, and changes in the task intent.
[0040] After a task is interrupted, the robot's inertia in executing the original task is not constant. The longer the interruption, the more blurred the robot's memory of the original task state becomes; the greater the environmental changes during the interruption, the more likely the original path and operating conditions are to become invalid; if the user or system changes the task intent midway, the original task logic may no longer be applicable. Therefore, it is necessary to comprehensively quantify three factors: the duration of the interruption, the degree of change in the environmental state, and whether the task intent has changed, to obtain a task inertia retention rate. The closer this value is to 1, the more complete the task memory and environmental state are retained before and after the interruption, and the less environmental reconfirmation is required during recovery; the closer it is to 0, the more severely the task memory has been lost, and more reset operations may be required during recovery.
[0041] Step S300 in the method provided in this embodiment of the invention includes: Obtain a pre-built task memory model; Obtain the timestamp of the interruption occurrence, retrieve the task state snapshot with the timestamp closest to the interruption occurrence from the task memory model, and use it as the interruption time snapshot; retrieve the task state snapshot with the timestamp closest to the current recovery attempt time from the task memory model, and use it as the recovery time snapshot. Obtain the Euclidean distance between the environmental perception feature vector in the recovery snapshot and the environmental perception feature vector in the interruption snapshot, and divide it by the maximum change amplitude of the environmental perception feature vector to obtain the environmental deviation. The task intent identifier in the recovery snapshot is compared with the task intent identifier in the interruption snapshot. If they match, the intent deviation is set to 0; otherwise, the intent deviation is set to 1. Obtain preset duration attenuation coefficient, environmental attenuation coefficient, and intent attenuation coefficient, wherein the sum of the duration attenuation coefficient, the environmental attenuation coefficient, and the intent attenuation coefficient is 1; The difference between the timestamp of the recovery snapshot and the timestamp of the interruption snapshot is calculated as the interruption duration. The interruption duration is then divided by the maximum allowed interruption duration of the task to obtain the duration deviation. Multiply the duration deviation by the duration attenuation coefficient, and the resulting product is recorded as the duration attenuation component. Multiply the environment deviation by the environment attenuation coefficient, and the resulting product is recorded as the environment attenuation component. Multiply the intention deviation by the intention attenuation coefficient, and the resulting product is recorded as the intention attenuation component. The task inertia retention degree is obtained based on the duration decay component, the environment decay component, and the intention decay component.
[0042] First, obtain a pre-built task memory model.
[0043] The construction of the task memory model includes: When the robot begins to perform a multi-step task, the task memory model is initialized, which includes a task state storage area, an environmental perception storage area, and a task intention storage area. During task execution, the following data at the current moment are acquired at a snapshot frequency and a snapshot is generated: the current sub-step number and execution status of each sub-step are acquired from the task management module as a task status snapshot; the environmental perception feature vector at the current moment is acquired from the sensor system as an environmental perception snapshot, the environmental perception feature vector including path obstacle distribution features and area illumination condition features; and the task intent identifier of the currently executing task is acquired from the task management module as a task intent snapshot. Each generated task state snapshot, environment awareness snapshot, and task intent snapshot is associated with the current time's timestamp, merged and stored into a single snapshot record, and written into the corresponding storage area of the task memory model, forming a snapshot sequence sorted by timestamp. The snapshot frequency is determined based on the operation type of the sub-step.
[0044] First, when the robot begins executing a multi-step task, a task memory model is initialized. This model includes a task state storage area, an environmental perception storage area, and a task intent storage area. The task memory model is a snapshot sequence-based storage model, with its core data structure consisting of three lists sorted by timestamps.
[0045] The task state storage area is a list of snapshots for storing task state information. Each snapshot includes a timestamp, the current sub-step number, and the execution status of each sub-step. The environment awareness storage area is a list of snapshots for storing environment awareness information. Each snapshot includes a timestamp and an environment awareness feature vector. The task intent storage area is a list of snapshots for storing task intent information. Each snapshot includes a timestamp and a task intent identifier.
[0046] Specifically, the robot declares three empty lists in the main control program. A maximum storage capacity is set, such as 1000 snapshots; when this capacity is exceeded, the oldest record is automatically overwritten. No external data is loaded during initialization. For example, when the robot starts a factory inspection task, it creates three empty lists: task_state_list=[], env_list=[], and intent_list=[].
[0047] Secondly, during task execution, the following data at the current moment are acquired at a snapshot frequency and a snapshot is generated: the current execution sub-step number and the execution status of each sub-step are acquired from the task management module as a task status snapshot; the current environmental perception feature vector is acquired from the sensor system as an environmental perception snapshot, the environmental perception feature vector including path obstacle distribution features and regional illumination condition features; and the current execution task intent identifier is acquired from the task management module as a task intent snapshot.
[0048] The snapshot frequency refers to the time interval between two consecutive snapshots. The snapshot frequency is determined based on the operation type of the sub-step: for physical movement sub-steps, a higher frequency, such as 10Hz, is set due to rapid environmental changes; for information acquisition or communication interaction sub-steps, a lower frequency, such as 1Hz, can be set.
[0049] First, the robot sets a timer with a timing period of 1 / snapshot frequency. At the end of each timing period, the robot reads the system clock as the current timestamp, calls the task management module's interface to obtain the current sub-step number and the execution status of each sub-step, and serializes this into a task status vector as a task status snapshot. Each element in this vector corresponds to the execution status code of a sub-step, with the encoding rule: 0 indicates not started, 1 indicates in progress, and 2 indicates completed.
[0050] Secondly, the sensor system's interface is called to obtain the current environmental perception feature vector, which is a sequence of multiple numerical components. For example, the path obstacle distribution feature can be encoded as an occupied grid vector, and the area illumination condition feature can be encoded as the readings of multiple illumination sensors. The above components are spliced together in a fixed order to form a numerical sequence, which serves as an environmental perception snapshot.
[0051] Next, the task management module's interface is called to obtain the current task intent identifier, which is used as a task intent snapshot. Then, the timestamp, task state snapshot, environment-aware snapshot, and task intent snapshot are combined into a structure, and the task state snapshot is stored in `task_state_list`, the environment-aware snapshot in `env_list`, and the task intent snapshot in `intent_list`, respectively. The three lists maintain the same timestamp order.
[0052] For example, during the execution of sub-step 4, since sub-step 4 involves changes to physical objects, the snapshot frequency is set to 10 Hz. The robot collects data every 0.1 seconds: timestamp 10:32:15.200, the currently executing sub-step number is 4, the execution status of each sub-step is encoded as a task state vector [2,2,2,1,0,0]; the environmental perception feature vector is [0.2,0.8], where the first component 0.2 represents the path obstacle density, the second component 0.8 represents the light intensity; the task intent identifier is TEMP_ABNORMAL_HANDLE. The robot stores the above three parts into the corresponding storage areas. Data is collected again at 10:32:15.300, and so on.
[0053] Next, the generated task state snapshot, environment awareness snapshot, and task intent snapshot are associated with the current time's timestamp, merged and stored into a single snapshot record, and written into the corresponding storage area of the task memory model, forming a snapshot sequence sorted by timestamp. The snapshot frequency is determined based on the operation type of the sub-step. A snapshot sequence refers to a set of snapshot records arranged in strictly ascending order of timestamps. Since the timer period is fixed and the robot executes sequentially, each time a new snapshot is added, its timestamp is always greater than the timestamp of the previous snapshot. Therefore, the order can be maintained directly using the list append operation. A binary search algorithm is used for retrieval. For example, after the above steps, the task_state_list stores approximately 500 snapshot records from the start of the task to the point of interruption, each record having a unique timestamp. During recovery, the robot can quickly locate the snapshot closest to any given time.
[0054] Based on this, the timestamp of the interruption occurrence is obtained, and the task state snapshot with the timestamp closest to the interruption occurrence is retrieved from the task memory model as the interruption time snapshot. Similarly, the task state snapshot with the timestamp closest to the current recovery attempt time is retrieved from the task memory model as the recovery time snapshot. The timestamp of the interruption occurrence refers to the system time when the robot pauses task execution due to an external interruption. The timestamp of the recovery attempt time refers to the system time when the robot prepares to resume the task.
[0055] The interruption snapshot refers to the complete snapshot record stored in the task memory model whose timestamp is closest to the timestamp of the interruption, including task state snapshot, environment awareness snapshot, and task intent snapshot. The recovery snapshot refers to the complete snapshot record stored in the task memory model whose timestamp is closest to the timestamp of the current recovery attempt.
[0056] Specifically, the robot records the system clock value at the moment of interruption, denoted as T_interrupt. During subsequent recovery attempts, it records the current system clock value, denoted as T_resume. The robot calls the retrieval method of the task memory model, passing in T_interrupt and T_resume as query targets. The task memory model uses binary search to find the snapshot record with the smallest absolute value of the timestamp difference in the snapshot sequence sorted by timestamp, and returns that record. If two records have the same absolute value of timestamp difference, the one with the smaller timestamp is selected.
[0057] For example, in a factory inspection task, the interruption occurs at time T_interrupt = 10:32:15.300. After the worker leaves, the robot prepares to resume at time T_resume = 10:35:20.450. The task memory model stores multiple snapshot records, including two snapshots close to the interruption time: 10:32:15.280 and 10:32:15.400. The difference between 10:32:15.280 and T_interrupt is 0.020 seconds, and the difference between 10:32:15.400 and T_interrupt is 0.100 seconds. Therefore, the robot selects the snapshot with timestamp 10:32:15.280 as the interruption time snapshot. For the resumption time, the task memory model has a snapshot at 10:35:20.500, which differs from T_resume by 0.050 seconds. There is no closer record, so this snapshot is selected as the resumption time snapshot.
[0058] Next, the Euclidean distance between the environmental perception feature vector in the recovery snapshot and the environmental perception feature vector in the interruption snapshot is obtained, and divided by the maximum change amplitude of the environmental perception feature vector to obtain the environmental deviation. The environmental perception feature vector is a fixed-dimensional numerical vector extracted by the robot sensor system and used to describe the key state of the current environment. In this embodiment of the invention, the vector includes path obstacle distribution characteristics and area illumination condition characteristics.
[0059] The maximum change amplitude of the environmental perception feature vector is a pre-calibrated constant, representing the maximum possible value of the Euclidean distance between any two possible states in the environment. For example, the maximum Euclidean distance obtained by sampling the entire environmental space is denoted as D. This value is used to normalize the Euclidean distance to the interval [0,1]. The environmental deviation is a real number ranging from [0,1], representing the overall degree of change in the environmental state before and after the interruption. 0 indicates that the environment has not changed at all, and 1 indicates that the environmental change has reached the maximum possible degree.
[0060] Specifically, the robot reads the environmental perception feature vector V_interrupt from the environmental perception snapshot taken at the interruption time, and reads the environmental perception feature vector V_resume from the environmental perception snapshot taken at the recovery time, and calculates the Euclidean distance d. The environmental deviation is calculated as d / D. If the calculated environmental deviation is greater than 1, it is truncated to 1.
[0061] For example, assume the environmental perception feature vector is 2-dimensional, with the first dimension being the density of obstacles along the path and the second dimension being the light intensity. The maximum change amplitude D is set to... In the snapshot at the time of interruption, V_interrupt = (0.2, 0.8); in the snapshot at the time of recovery, V_resume = (0.6, 0.3). The Euclidean distance is calculated. Environmental deviation = .
[0062] Then, the task intent identifier in the recovery snapshot is compared with the task intent identifier in the interruption snapshot. If they match, the intent deviation is set to 0; otherwise, the intent deviation is set to 1. The task intent identifier is a unique code or name that identifies the overall goal of the current task. It is set by the task management module at the start of the task and can be changed by the user or the upper-level system during an interruption. The intent deviation is a binary value of 0 or 1, where 0 indicates that the task intent has not changed before and after the interruption, and 1 indicates that the task intent has changed.
[0063] Specifically, the robot reads the intent identifier ID_interrupt from the task intent snapshot taken at the interruption point and the intent identifier ID_resume from the task intent snapshot taken at the recovery point. It compares the two strings or integers for equality. If they are equal, the intent deviation is set to 0; otherwise, the intent deviation is set to 1. For example, in the interruption snapshot, the task intent identifier is TEMP_ABNORMAL_HANDLE. In the recovery snapshot, since the user has not changed the task, the intent identifier is still TEMP_ABNORMAL_HANDLE, and the two are consistent; therefore, the intent deviation is 0.
[0064] Subsequently, preset duration decay coefficients, environment decay coefficients, and intent decay coefficients are obtained, wherein the sum of the duration decay coefficient, environment decay coefficient, and intent decay coefficient is 1. The duration decay coefficient represents the weight of the interruption duration's impact on task inertia retention. The larger the value, the more significant the impact of the interruption duration. The environment decay coefficient represents the weight of the environmental state change's impact on task inertia retention. The intent decay coefficient represents the weight of the task intent change's impact on task inertia retention. All three coefficients are positive real numbers, and their sum equals 1. Specific values can be optimized according to the application scenario.
[0065] Specifically, the robot's non-volatile memory stores a configuration file containing preset duration decay coefficients, environmental decay coefficients, and intent decay coefficients. For example, in a factory inspection scenario, because environmental changes have the greatest impact on the inspection task, while duration and intent have relatively small effects, the robot reads a duration decay coefficient of 0.2, an environmental decay coefficient of 0.6, and an intent decay coefficient of 0.2.
[0066] Further, the difference between the timestamp of the recovery snapshot and the timestamp of the interruption snapshot is calculated as the interruption duration. This interruption duration is then divided by the maximum allowed interruption duration of the task to obtain the duration deviation. The duration deviation is the proportion of the interruption duration to the maximum allowed interruption duration, and its value is truncated between [0,1]. If the interruption duration exceeds the maximum allowed interruption duration, the duration deviation is set to 1.
[0067] The maximum allowable interruption duration for a task is a pre-set threshold for the current task, indicating that the task memory is considered completely invalid after exceeding this duration. This value can be set according to the characteristics of the task. For example, for time-sensitive tasks such as thermal monitoring, the maximum allowable interruption duration is 30 seconds; for general inspection tasks, it can be set to 300 seconds.
[0068] Specifically, the robot reads the timestamp T_resume from the recovery snapshot and the timestamp T_interrupt from the interrupt snapshot. The interrupt duration is calculated as T_resume - T_interrupt. The maximum allowed interrupt duration for the task is then read. The duration deviation is calculated as interrupt duration / maximum allowed interrupt duration. If the duration deviation is greater than 1, it is set to 1. For example, if the interrupt duration is 180 seconds and the maximum allowed interrupt duration is set to 300 seconds, the duration deviation is 180 / 300 = 0.6.
[0069] Then, the duration deviation is multiplied by the duration attenuation coefficient, and the resulting product is recorded as the duration attenuation component. The environment deviation is multiplied by the environment attenuation coefficient, and the resulting product is recorded as the environment attenuation component. The intention deviation is multiplied by the intention attenuation coefficient, and the resulting product is recorded as the intention attenuation component. The duration attenuation component represents the attenuation contribution of the interruption duration to the task inertia retention. The environment attenuation component represents the attenuation contribution of the environmental state change to the task inertia retention. The intention attenuation component represents the attenuation contribution of the task intention change to the task inertia retention.
[0070] Specifically, three components are calculated: duration attenuation component = duration deviation × duration attenuation coefficient; environment attenuation component = environment deviation × environment attenuation coefficient; and intention attenuation component = intention deviation × intention attenuation coefficient. For example, if the duration deviation is 0.6 and the duration attenuation coefficient is 0.2, then the duration attenuation component = 0.6 × 0.2 = 0.12; if the environment deviation is 0.453 and the environment attenuation coefficient is 0.6, then the environment attenuation component = 0.453 × 0.6 = 0.2718; and if the intention deviation is 0 and the intention attenuation coefficient is 0.2, then the intention attenuation component = 0 × 0.2 = 0.
[0071] Finally, based on the duration decay component, the environment decay component, and the intent decay component, the task inertia retention degree is obtained. The task inertia retention degree is a real number ranging from [0,1], representing the degree to which the original task execution environment retains its inertia after an interruption. A higher value indicates less disruption to task continuity due to the interruption, making it more suitable to continue from the breakpoint; a lower value indicates severe task memory failure, requiring more resetting. Task inertia retention degree = 1 − (duration decay component + environment decay component + intent decay component), with the result limited to the [0,1] interval. For example, task inertia retention degree = 1 − (0.12 + 0.2718 + 0) = 0.6082. This value indicates that the interruption has some impact, but the task inertia remains at a moderate level.
[0072] In this embodiment of the invention, a pre-constructed task memory model is acquired, and snapshots of the interruption and recovery times are retrieved from it. Environmental perception feature vectors, task intent identifiers, and timestamps are extracted, and the robot calculates quantitative indicators across three dimensions: duration deviation, environmental deviation, and intent deviation, to obtain the task inertia retention rate. This allows the robot to comprehensively evaluate the combined impact of interruption duration, environmental state changes, and whether the task intent has changed on the continuity of the original task execution, thereby quantifying the effective retention of task memory before and after the interruption. The task inertia retention rate provides a key parameter reflecting the overall continuity of the task for subsequent calculations of the recovery reward, ensuring that tasks with shorter interruption times, smaller environmental changes, and consistent intent are given a higher tendency to continue execution in recovery decisions, while tasks with longer interruption times, smaller environmental changes, and longer intents are more likely to be reset.
[0073] S400: Based on the operation type of each sub-step, analyze and obtain the cost consumed by the first execution of the sub-step and the additional cost of re-entry, and calculate the sub-step re-entry impedance of each sub-step.
[0074] During task recovery, the resources and costs consumed by the first execution and re-execution of the same sub-step often differ. If a sub-step has already taken a long time, its invested time cost is high, and abandoning it would waste the existing investment. On the other hand, if certain types of sub-steps need to be redone, in addition to the time spent on the re-execution itself, it may also require undoing completed results, thus introducing additional re-entry costs. Therefore, it is necessary to quantify the resistance faced by each sub-step when it needs to be re-executed, i.e., the difficulty of redoing. This resistance consists of two factors: first, the time cost consumed by the first execution of the sub-step; and second, the additional re-entry costs due to the operation type and current execution state. By calculating the sub-step re-entry resistance, a quantitative basis for subsequent recovery decisions on whether redoing is worthwhile can be provided.
[0075] Step S400 in the method provided in this embodiment of the invention includes: Obtain the ratio of the execution time consumed by each sub-step to the standard execution time, as a time cost component; The corresponding re-entry coefficient is obtained by querying the operation type of each sub-step. For sub-steps whose execution status is completed, the re-entry coefficient is set to the preset maximum re-entry coefficient of 1. For sub-steps whose execution status is not started, the re-entry coefficient is set to 0. Based on the time cost component and the re-entry additional coefficient, the re-entry impedance of the sub-step is calculated.
[0076] First, the ratio of the execution time consumed by each sub-step to the standard execution time is obtained as the time cost component. The consumed execution time refers to the time elapsed from the start of the sub-step to the time of the interruption. The standard execution time refers to the estimated time required for the sub-step to complete under normal, uninterrupted conditions. The standard execution time is preset by the task designer based on experience or historical statistics and stored in the task description.
[0077] Specifically, the robot's task management module records the start and end timestamps for each sub-step. For completed sub-steps, the consumed execution time = end timestamp - start timestamp; for sub-steps in progress, the consumed execution time = interruption timestamp - start timestamp; for sub-steps not yet started, the consumed execution time = 0. The robot reads the standard execution time of the sub-step and calculates the ratio of the consumed execution time to the standard execution time. The time cost component = consumed execution time / standard execution time. If the consumed execution time is greater than the standard execution time, the ratio may be greater than 1. In this case, the time cost component is set to 1, indicating that the invested cost has reached its limit and will no longer increase. If the standard execution time is 0, the time cost component is set to 0. The value range of the time cost component is limited to the interval [0,1].
[0078] For example, in a factory inspection task, the standard execution time and consumed execution time for each sub-step are as follows: Sub-step 1: Standard execution time 30 seconds, consumed execution time 28 seconds, time cost component = 28 / 30 ≈ 0.933. Sub-step 2: Standard execution time 5 seconds, consumed execution time 5 seconds, time cost component = 1. Sub-step 3: Standard execution time 1 second, consumed execution time 1 second, time cost component = 1. Sub-step 4: Standard execution time 10 seconds, consumed execution time 4 seconds, time cost component = 4 / 10 = 0.4. Sub-step 5: Not started, consumed execution time 0, time cost component = 0. Sub-step 6: Not started, consumed execution time 0, time cost component = 0.
[0079] Secondly, the corresponding reentrancy additional coefficient is obtained according to the operation type of each sub-step. For sub-steps whose execution status is "completed," the reentrancy additional coefficient is set to the preset maximum reentrancy coefficient of 1. For sub-steps whose execution status is "not started," the reentrancy additional coefficient is set to 0. The reentrancy additional coefficient ranges from [0,1], representing the proportion of additional cost that must be incurred in addition to the standard execution time if the sub-step needs to be re-executed. The larger the reentrancy additional coefficient, the higher the additional cost of reentrancy. The maximum reentrancy coefficient is 1, indicating the maximum reentrancy cost, i.e., a complete redo and additional reverse operation are required.
[0080] Specifically, the robot reads the execution status of the sub-step. If the status is "completed," the reentrancy coefficient is directly set to 1. If the status is "not started," the reentrancy coefficient is set to 0. If the status is "in execution," the robot looks up the corresponding reentrancy coefficient in the mapping table based on the operation type. The mapping table is pre-stored in the robot's memory.
[0081] For sub-steps in execution, the reentrancy coefficient settings for different operation types are as follows: Physical movement: Re-moving does not require reverse operations, only path replanning, resulting in low additional cost; reentrancy coefficient is set to 0.1. Information collection: Re-collecting data requires no additional operations; data can be collected directly again; reentrancy coefficient is set to 0.0. Operation execution (no physical object change): Re-executing logical judgments does not require undoing previous states; additional cost is very low; reentrancy coefficient is set to 0.1. Operation execution (with physical object change): Before re-executing physical operations, it may be necessary to undo some of the effects already caused; additional cost is high; reentrancy coefficient is set to 0.6. Communication interaction: Resending data may require re-establishing connections or retransmission; additional cost is low; reentrancy coefficient is set to 0.1.
[0082] For example, Sub-step 1: Completed, reentrancy coefficient = 1. Sub-step 2: Completed, reentrancy coefficient = 1. Sub-step 3: Completed, reentrancy coefficient = 1. Sub-step 4: Executing, operation type is operation execution class (physical object changes), query the mapping table to get reentrancy coefficient = 0.6. Sub-step 5: Not started, reentrancy coefficient = 0. Sub-step 6: Not started, reentrancy coefficient = 0.
[0083] Next, based on the time cost component and the reentry factor, the sub-step reentry impedance is calculated. The sub-step reentry impedance represents the overall difficulty faced when the sub-step needs to be re-executed. A higher sub-step reentry impedance indicates a greater reentry cost, and redoing should be avoided as much as possible; a lower sub-step reentry impedance indicates a lower reentry cost, and redoing is acceptable. Sub-step reentry impedance = Time cost component × (1 + Reentry factor).
[0084] For example, the re-entry impedance of each sub-step is calculated as follows: Sub-step 1: Time cost component = 0.933, re-entry coefficient = 1, re-entry impedance = 0.933 × (1 + 1) = 1.866. Sub-step 2: Time cost component = 1, re-entry coefficient = 1, re-entry impedance = 1 × (1 + 1) = 2.0. Sub-step 3: Time cost component = 1, re-entry coefficient = 1, re-entry impedance = 1 × (1 + 1) = 2.0. Sub-step 4: Time cost component = 0.4, re-entry coefficient = 0.6, 1 + 0.6 = 1.6, re-entry impedance = 0.4 × (1 + 0.6) = 0.64. Sub-step 5: Time cost component = 0, re-entry coefficient = 0, re-entry impedance = 0. Sub-step 6: Time cost component = 0, re-entry coefficient = 0, re-entry impedance = 0.
[0085] In this embodiment of the invention, the ratio of the execution time consumed by each sub-step to the standard execution time is obtained as a time cost component. A reentry additional coefficient is obtained based on the operation type and execution status, and the robot calculates the sub-step reentry impedance for each sub-step. This allows the robot to quantitatively assess the overall cost faced by each sub-step when it needs to be re-executed, thus providing a key parameter for calculating the recovery reward to measure the cost of abandoning and redoing the current sub-step. This ensures that sub-steps with high initial costs and significant reentry additional costs are given higher retention priority in recovery decisions.
[0086] S500: Based on the irreversibility of the sub-step, the inertia retention of the task, and the reentry impedance of the sub-step, calculate and obtain the recovery reward of each sub-step.
[0087] In this embodiment of the invention, the robot has obtained three key quantitative indicators for each sub-step: sub-step irreversibility, task inertia retention, and sub-step reentry impedance. These three indicators influence the choice of recovery strategy from different perspectives: higher irreversibility means preserving completed work; higher inertia retention means continuing from the breakpoint is more suitable; and higher reentry impedance means avoiding redoing. However, a single indicator cannot directly determine the recovery strategy; all three need to be combined into a unified value, namely, the recovery reward. The sign and magnitude of this value directly indicate the advantage of continuing execution compared to resetting and redoing. Therefore, a weighted calculation is needed to integrate the above three indicators into a single recovery reward, providing a unique quantitative decision-making basis for subsequent strategy determination.
[0088] Step S500 in the method provided in this embodiment of the invention includes: For each sub-step, the sub-step irreversibility, the task inertia retention, and the sub-step reentry impedance are weighted and calculated to obtain the recovery reward, wherein the recovery reward is directly proportional to the sub-step irreversibility and the task inertia retention, and inversely proportional to the sub-step reentry impedance.
[0089] First, the robot reads three preset positive weight coefficients w1, w2, and w3 from the configuration parameters. These correspond to the importance of sub-step irreversibility, task inertia retention, and sub-step reentry impedance in the calculation of recovery reward, respectively. The sum of these coefficients must be equal to 1. For example, w1 = 0.4, w2 = 0.3, and w3 = 0.3. The specific values can be optimized according to the application scenario, but the sum of the three must always be 1.
[0090] Secondly, for each sub-step, the robot uses the sub-step irreversibility, task inertia retention, and sub-step reentry impedance of that sub-step to calculate the recovery reward using a weighted formula. The formula is: Recovery Reward = w1 × Sub-step Irreversibility + w2 × Task Inertia Retention - w3 × Sub-step Reentry Impedance. The recovery reward represents the net benefit of continuing execution directly from the interruption point relative to abandoning existing results and resetting. A positive recovery reward indicates that the benefit of continuing execution is greater than the reset cost, favoring continuing from the interruption point; a negative recovery reward indicates that the reset cost is greater than the benefit of continuing, favoring re-execution; the larger the absolute value of the recovery reward, the more significant the advantage of the selected strategy.
[0091] For example, the recovery reward for each sub-step is calculated as follows: Sub-step 1: Sub-step irreversibility = 0.1, re-entry impedance = 1.866, recovery reward = 0.4 × 0.1 + 0.3 × 0.6082 - 0.3 × 1.866 ≈ -0.337. Sub-step 2: Sub-step irreversibility = 0.05, re-entry impedance = 2.0, recovery reward = 0.4 × 0.05 + 0.3 × 0.6082 - 0.3 × 2.0 ≈ -0.398. Sub-step 3: Sub-step irreversibility = 0.3, re-entry impedance = 2.0, recovery reward = 0.4 × 0.3 + 0.3 × 0.6082 - 0.3 × 2.0 ≈ -0.298. Sub-step 4: Sub-step irreversibility = 0.32, re-entry impedance = 0.64, recovery reward = 0.4 × 0.32 + 0.3 × 0.6082 - 0.3 × 0.64 ≈ 0.118. Sub-step 5: Sub-step irreversibility = 0.0, re-entry impedance = 0, recovery reward = 0 + 0.3 × 0.6082 - 0 ≈ 0.182. Sub-step 6: Sub-step irreversibility = 0.0, re-entry impedance = 0, recovery reward = 0 + 0.3 × 0.6082 - 0 ≈ 0.182.
[0092] In this embodiment of the invention, by obtaining preset weighting coefficients and performing a weighted summation of the irreversibility of each sub-step, the global task inertia retention, and the reentry impedance of each sub-step, the robot obtains a recovery reward for each sub-step. This allows the robot to integrate three different quantitative indicators into a unified decision value. The sign of this value directly indicates the direction of the benefit of continuing execution relative to resetting and redoing, and its absolute value indicates the significance of the benefit. The obtained recovery reward provides a unique quantitative basis for subsequently determining the specific recovery strategy for each sub-step, ensuring that the recovery decision can comprehensively weigh the relationship between the invested costs, irreversible environmental changes, and the overall continuity of the task.
[0093] S600: Determine the recovery strategy for each sub-step based on the recovery reward of each sub-step.
[0094] In this embodiment of the invention, after obtaining the recovery reward for each sub-step, the robot needs to convert this value into a specific execution action. The recovery reward is a continuous value, whose sign and magnitude indicate the difference in benefit between continuing and resetting, but different value ranges correspond to different strategy options: when the reward is high, it can continue directly; when the reward is moderate but positive, manual confirmation may be required; when the reward is negative and the absolute value is not large, partial regression is possible; when the reward is very low, a complete reset is required. Furthermore, since the historical performance of different tasks and different robots varies, the threshold value used to divide the strategy range cannot be fixed but should be dynamically set based on the statistical distribution when the robot normally executes the task. Therefore, based on the comparison result between the recovery reward and the adaptive threshold, a specific recovery strategy needs to be determined for each sub-step, and an executable recovery plan needs to be formed according to the task sequence, while providing a dynamic update mechanism for the threshold value.
[0095] Step S600 in the method provided in this embodiment of the invention includes: Obtain a strong continuation threshold, a weak continuation threshold, and a strong reset threshold, wherein the strong continuation threshold is a positive value and is the largest, the weak continuation threshold is a positive value and is less than the strong continuation threshold, and the strong reset threshold is a negative value; For each sub-step, when the recovery reward is greater than or equal to the strong continuation threshold, the recovery strategy for the sub-step is determined to be to continue directly from the interruption point; When the recovery reward is greater than or equal to the weak continuation threshold and less than the strong continuation threshold, the recovery strategy for the sub-step is determined to be to continue after confirmation. When the recovery reward is greater than the strong reset threshold and less than the weak continuation threshold, the recovery strategy of the sub-step is determined to be partial reset; When the recovery reward is less than or equal to the strong reset threshold, the recovery strategy of the sub-step is determined to be a full reset; Based on the execution order of each sub-step in the task, the recovery strategy for each sub-step is determined sequentially to form the overall recovery execution plan for the task.
[0096] First, obtain the strong continuation threshold, the weak continuation threshold, and the strong reset threshold, wherein the strong continuation threshold is a positive value and is the largest, the weak continuation threshold is a positive value and is less than the strong continuation threshold, and the strong reset threshold is a negative value.
[0097] The acquisition of the strong continuation threshold, weak continuation threshold, and strong reset threshold includes: The recovery reward value of each sub-step is obtained when the robot completes the task under normal conditions without interruption during the historical normal task execution process, forming a normal recovery reward value sequence. The recovery reward value of each sub-step that has been completed normally under simulated interruption conditions is the recovery reward value calculated. Calculate the arithmetic mean of the normal recovery reward sequence as the baseline reward mean, and calculate the standard deviation of the normal recovery reward sequence as the baseline reward standard deviation; The sum of the average benchmark reward value and the standard deviation of the benchmark reward value by a first preset multiple is used as the strong continuation threshold. The average benchmark reward is added to the standard deviation of the benchmark reward by a second preset multiple, and the sum is used as the weak continuation threshold, wherein the second preset multiple is less than the first preset multiple; The difference between the mean of the benchmark reward and the standard deviation of the benchmark reward by a third preset multiple is used as the strong reset threshold. After the robot completes a task recovery, the recovery reward of each sub-step and the effectiveness evaluation result of the actual recovery strategy are added to the normal recovery reward sequence. The strong continuation threshold, the weak continuation threshold and the strong reset threshold are recalculated and the threshold values are dynamically updated.
[0098] First, the recovery reward value of each sub-step is obtained when the robot completes the task under normal conditions without interruption during the historical normal task execution process, forming a normal recovery reward value sequence. The recovery reward value of each sub-step that has been completed normally under simulated interruption conditions is the recovery reward value calculated.
[0099] The normal recovery reward sequence refers to a set of recovery reward values collected by the robot from the historical normal task execution process. Specifically, after the robot normally completes a multi-step task without interruption, an interruption is artificially simulated for each normally completed sub-step, and the theoretical recovery reward of that sub-step at this time is calculated according to the S500 method. The theoretical recovery reward values of all sub-steps constitute a sequence.
[0100] Next, the arithmetic mean of the normal recovery reward sequence is calculated as the baseline reward mean, and the standard deviation of the normal recovery reward sequence is calculated as the baseline reward standard deviation. For example, the original normal recovery reward sequence obtained by the robot from historical tasks is [-0.26, -0.28, -0.18, 0.02, -0.28, -0.28], with a calculated mean μ = -0.21 and a standard deviation σ ≈ 0.11. Therefore, the baseline reward mean is -0.21, and the baseline reward standard deviation is 0.11.
[0101] Next, the mean of the baseline reward is added to the standard deviation of the baseline reward by a first preset multiple, and the sum is used as the strong continuation threshold; the mean of the baseline reward is added to the standard deviation of the baseline reward by a second preset multiple, and the sum is used as the weak continuation threshold, wherein the second preset multiple is less than the first preset multiple; the mean of the baseline reward is subtracted from the standard deviation of the baseline reward by a third preset multiple, and the difference is used as the strong reset threshold.
[0102] The strong continue threshold is greater than the weak continue threshold. When the recovery reward is greater than or equal to the strong continue threshold, the strategy is to continue immediately. The weak continue threshold is less than the strong continue threshold. When the recovery reward is greater than or equal to the weak continue threshold but less than the strong continue threshold, the strategy is to continue after confirmation. The strong reset threshold is a negative value. When the recovery reward is less than or equal to the strong reset threshold, the strategy is to completely reset.
[0103] The first, second, and third preset multiples are pre-defined positive real numbers that satisfy the condition: first preset multiple > second preset multiple > 0, and third preset multiple > 0. For example, the first preset multiple can be set to 2, the second preset multiple to 0.5, and the third preset multiple to 1.5. These multiples are set based on engineering experience under the assumption of a normal distribution: the first preset multiple corresponds to a significantly high return threshold for strong continuation, the second preset multiple corresponds to a confirmation threshold for weak continuation, and the third preset multiple is used to identify significant negative deviations requiring a complete reset.
[0104] Specifically, the strong continuation threshold = mean of the baseline reward + (first preset multiple) × standard deviation of the baseline reward; the weak continuation threshold = mean of the baseline reward + (second preset multiple) × standard deviation of the baseline reward; the strong reset threshold = mean of the baseline reward - (third preset multiple) × standard deviation of the baseline reward. For example, the strong continuation threshold = -0.21 + 2 × 0.11 = 0.01; the weak continuation threshold = -0.21 + 0.5 × 0.11 = -0.155; the strong reset threshold = -0.21 - 1.5 × 0.11 = -0.375.
[0105] Based on this, for each sub-step, when the recovery reward is greater than or equal to the strong continue threshold, the recovery strategy for the sub-step is determined to be to continue directly from the interruption point; when the recovery reward is greater than or equal to the weak continue threshold and less than the strong continue threshold, the recovery strategy for the sub-step is determined to be to continue after confirmation; when the recovery reward is greater than the strong reset threshold and less than the weak continue threshold, the recovery strategy for the sub-step is determined to be a partial reset; when the recovery reward is less than or equal to the strong reset threshold, the recovery strategy for the sub-step is determined to be a complete reset.
[0106] Specifically, for each sub-step, its recovery reward is read. If the recovery reward is greater than or equal to the strong continue threshold, the strategy is to continue directly. If the weak continue threshold is less than or equal to the recovery reward and less than the strong continue threshold, the strategy is to continue after confirmation. If the strong reset threshold is less than the recovery reward and less than the weak continue threshold, the strategy is to partially reset. If the recovery reward is less than or equal to the strong reset threshold, the strategy is to completely reset.
[0107] "Direct continuation" means the robot resumes execution of the sub-step directly from the point of interruption, without any additional confirmation or reset operations. "Continue after confirmation" means the robot first reconfirms the environmental state of the object being operated on in the sub-step; if the confirmation result is consistent with the state before the interruption, execution continues from the point of interruption; if the confirmation result is inconsistent with the state before the interruption, the sub-step is downgraded to re-execution, which is equivalent to a further processing of partial or complete reset, determined by the robot based on the confirmation result. "Partial reset" means the robot rolls back the execution progress of the sub-step to the previously confirmed completed sub-step node and restarts execution from that node, rather than completely redoing the entire process from the beginning of the sub-step. "Complete reset" means the robot resets the execution state of the sub-step to "not started," clears the current progress to zero, and returns to the beginning of the sub-step to re-execute it from the start.
[0108] For example, given a strong continue threshold of 0.01, a weak continue threshold of -0.155, and a strong reset threshold of -0.375: Sub-step 1: Restore reward = -0.337. Since -0.375 < -0.337 < -0.155 (i.e., strong reset threshold < restore reward < weak continue threshold), the strategy is partial reset. Sub-step 2: Restore reward = -0.398. Since -0.398 ≤ -0.375 (i.e., restore reward ≤ strong reset threshold), the strategy is full reset. Sub-step 3: Restore reward = -0.298. Since -0.375 < -0.298 < -0.155, the strategy is partial reset. Sub-step 4: Restore reward = 0.118. Since 0.118 ≥ 0.01 (i.e., restore reward ≥ strong continue threshold), the strategy is direct continue. Sub-step 5: Restore reward = 0.182. Since 0.182 ≥ 0.01, the strategy is to continue directly. Sub-step 6: Restore reward = 0.182, the strategy is to continue directly.
[0109] Finally, according to the execution order of each sub-step in the task, the recovery strategy for each sub-step is determined sequentially, forming the overall recovery execution plan for the task. The robot executes the recovery action of each sub-step sequentially according to the recovery strategy of each sub-step. The specific execution method is as follows: If the strategy is to continue directly: the robot directly resumes the remaining operation of the sub-step from the interruption point. If the strategy is to continue after confirmation: the robot first reconfirms the environmental state of the operation object of the sub-step; if the confirmation result is consistent with that before the interruption, it continues execution from the interruption point; if the confirmation result is inconsistent with that before the interruption, the sub-step is downgraded to re-execution, that is, it starts again from the beginning position of the sub-step. If the strategy is to partially reset: the robot rolls back the execution progress of the sub-step to the previous confirmed completed sub-step node and restarts execution from that node, instead of completely redoing the steps from the beginning of the sub-step. If there is no previous confirmed completed node, it rolls back to the very beginning position of the task. If the strategy is a complete reset: the robot resets the execution status of the sub-step to "not started", clears the current progress to zero, and returns to the starting position of the sub-step to start execution again from the beginning.
[0110] During sequential execution, if a preceding sub-step is completely or partially reset, the strategy of the subsequent sub-step remains unchanged, but execution must be based on the new state after the preceding sub-step has been reset. The robot drives execution sequentially according to the strategy list until all sub-steps have been processed according to their respective strategies, and the task is restored.
[0111] For example, a partial reset is performed on sub-step 1: the execution progress is rolled back to the previous confirmed completed sub-step node. Since sub-step 1 is the first sub-step of the task and there is no earlier completed node, the robot rolls back to the beginning of the task and starts executing sub-step 1 from the beginning. A full reset is performed on sub-step 2: the execution state of sub-step 2 is reset to not started, the completion progress is cleared to zero, and the robot returns to the beginning of sub-step 2 and starts executing again from the beginning. However, since sub-step 1 was partially reset and then re-executed, the actual execution of sub-step 2 will be based on the result of sub-step 1 being re-executed. A partial reset is performed on sub-step 3: the execution progress is rolled back to the previous confirmed completed sub-step node. This node is the position where sub-step 2 was re-executed and completed, and then sub-step 3 is restarted from this node. A direct continuation is performed on sub-step 4: since sub-step 3 was partially reset and then re-executed, the starting conditions of sub-step 4 may have changed, and the robot still attempts to continue execution from the point of interruption. If the interruption point state does not match the current environment, the robot can adjust itself during execution, such as replanning minor actions, but without changing the direct continuation strategy. Sub-steps 5 and 6 are executed directly without interruption. Through this sequential execution, the robot completes the recovery of the entire task.
[0112] Furthermore, after the robot completes a task recovery, the recovery reward of each sub-step and the effectiveness evaluation result of the actual recovery strategy are added to the normal recovery reward sequence. The strong continuation threshold, the weak continuation threshold, and the strong reset threshold are recalculated, and the threshold values are dynamically updated. The effectiveness evaluation result refers to the robot's quantitative scoring of the rationality of the recovery strategy based on indicators such as whether the task was successfully completed after recovery, whether the completion time was within the expected range, and whether any abnormal interruptions occurred. This score will serve as the weight of the recovery reward of that sub-step in subsequent statistics.
[0113] Specifically, the robot records the recovery reward for each sub-step during the recovery process and the final recovery result. For successfully recovered sub-steps, their recovery reward value is added as a valid sample to the normal recovery reward sequence. For failed recovery sub-steps, the robot can choose not to add them or add them but assign them a lower weight. The arithmetic mean and standard deviation of the updated sequence are recalculated. The strong continuation threshold, weak continuation threshold, and strong reset threshold are recalculated using the same preset multiples. The new threshold values are stored and used for recovery decisions in subsequent tasks.
[0114] For example, in this recovery task, sub-steps 1, 2, and 3 were successfully executed after a complete reset, while sub-steps 4, 5, and 6 were successfully executed after a partial reset. The robot adds the recovery reward values of the sub-steps -0.337, -0.398, -0.298, 0.118, 0.182, and 0.182 to the original normal recovery reward value sequence, forming a new sequence. The mean and standard deviation are recalculated. Assuming the new mean μ_new ≈ -0.151 and the new standard deviation σ_new ≈ 0.23, the new threshold values are: strong continuation threshold = -0.151 + 2 × 0.23 = 0.309; weak continuation threshold = -0.151 + 0.5 × 0.23 = -0.036; strong reset threshold = -0.151 - 1.5 × 0.23 = -0.496. In this way, the robot feeds back the actual data from this recovery to the historical sequence, updates the threshold value, and uses the updated threshold to make policy decisions during the next task interruption recovery, forming a closed-loop adaptive mechanism of execution-feedback-update-re-execution.
[0115] In this embodiment of the invention, by acquiring an adaptive threshold based on historical statistics and comparing the recovery reward of each sub-step with the threshold, the robot obtains a specific recovery strategy for each sub-step, including direct continuation, continuation after confirmation, partial reset, and complete reset. After arranging the specific recovery strategies according to the original execution order of the sub-steps, the robot forms a complete task recovery execution plan. This invention also achieves dynamic updating of the threshold value by feeding back the reward and effectiveness evaluation results after each recovery to the historical sequence, enabling the strategy division criteria to adapt to the robot's actual operating performance. Therefore, the robot can automatically select the optimal recovery action for different sub-steps, minimizing the recovery cost while ensuring task completion.
[0116] Through the specific implementation methods described above, the embodiments of the present invention achieve the following technical effects: This invention provides a robot task recovery method and system, enabling intelligent recovery of interrupted robot tasks. First, the sub-step structure and execution progress are accurately collected, quantifying the irreversibility of sub-steps, task inertia retention, and reentry impedance. Then, the recovery reward is calculated. Finally, an adaptive threshold determines the strategy: direct continuation, continuation after confirmation, partial reset, or complete reset. This invention enables the robot to comprehensively weigh environmental changes, intent deviations, and invested costs, dynamically selecting the optimal recovery action, avoiding resource waste or task failure caused by traditional rigid recovery methods. Through historical data feedback and threshold updates, a closed-loop adaptive mechanism is formed, improving the accuracy, consistency, and execution efficiency of task recovery in complex dynamic environments.
[0117] Example 2, as Figure 4 As shown, the present invention provides a robot task recovery system, the system comprising: Interruption task progress acquisition module 11 is used to acquire sub-step information and execution progress of each sub-step of the interrupted task when the robot is interrupted during the execution of a multi-step task. The irreversibility analysis module 12 is used to analyze and obtain the irreversibility of each sub-step based on the operation type and completion progress of each sub-step. The inertia retention calculation module 13 is used to calculate the task inertia retention based on the duration of the interruption, changes in the environmental state during the interruption, and changes in the task intent. The reentry impedance calculation module 14 is used to analyze and obtain the cost consumed by the first execution of the sub-step and the additional cost of reentry based on the operation type of each sub-step, and calculate the sub-step reentry impedance of each sub-step. The recovery reward calculation module 15 is used to calculate and obtain the recovery reward of each sub-step based on the irreversibility of the sub-step, the inertia retention of the task, and the reentry impedance of the sub-step. The recovery strategy determination module 16 is used to determine the recovery strategy for each sub-step based on the recovery reward of each sub-step.
[0118] In one embodiment, the interrupted task progress acquisition module 11 is further configured to: When the robot is interrupted during the execution of a multi-step task, the task identifier and task description of the currently executing task are obtained from the robot's task management module. The task identifier is used to query and obtain the sub-step information of the task. The sub-step information includes the sub-step number, operation type, operation object and execution order of each sub-step in the task. The execution status of each sub-step when the interruption occurs is obtained, wherein the execution status includes three states: not started, in execution, and completed. For a sub-step with an execution status of in execution, the current completion progress of the sub-step is further obtained, wherein the current completion progress is the proportion of the amount of operations performed by the sub-step to the total amount of operations of the sub-step.
[0119] In one embodiment, the irreversibility analysis module 12 is further configured to: The corresponding irreversibility baseline value is obtained by querying the operation type of each sub-step, wherein the operation type includes physical movement, information collection, operation execution and communication interaction. For sub-steps whose execution status is completed, the irreversibility is directly taken as the irreversibility baseline value of the sub-step; For a sub-step that is in execution, the irreversibility baseline value of the sub-step is multiplied by the completion progress of the sub-step to obtain the sub-step irreversibility. For a sub-step whose execution state is "not started", the irreversibility of the sub-step is set to zero.
[0120] In one embodiment, the inertia retention calculation module 13 is further configured to: Obtain a pre-built task memory model; Obtain the timestamp of the interruption occurrence, retrieve the task state snapshot with the timestamp closest to the interruption occurrence from the task memory model, and use it as the interruption time snapshot; retrieve the task state snapshot with the timestamp closest to the current recovery attempt time from the task memory model, and use it as the recovery time snapshot. Obtain the Euclidean distance between the environmental perception feature vector in the recovery snapshot and the environmental perception feature vector in the interruption snapshot, and divide it by the maximum change amplitude of the environmental perception feature vector to obtain the environmental deviation. The task intent identifier in the recovery snapshot is compared with the task intent identifier in the interruption snapshot. If they match, the intent deviation is set to 0; otherwise, the intent deviation is set to 1. Obtain preset duration attenuation coefficient, environmental attenuation coefficient, and intent attenuation coefficient, wherein the sum of the duration attenuation coefficient, the environmental attenuation coefficient, and the intent attenuation coefficient is 1; The difference between the timestamp of the recovery snapshot and the timestamp of the interruption snapshot is calculated as the interruption duration. The interruption duration is then divided by the maximum allowed interruption duration of the task to obtain the duration deviation. Multiply the duration deviation by the duration attenuation coefficient, and the resulting product is recorded as the duration attenuation component. Multiply the environment deviation by the environment attenuation coefficient, and the resulting product is recorded as the environment attenuation component. Multiply the intention deviation by the intention attenuation coefficient, and the resulting product is recorded as the intention attenuation component. The task inertia retention degree is obtained based on the duration decay component, the environment decay component, and the intention decay component.
[0121] The construction of the task memory model includes: When the robot begins to perform a multi-step task, the task memory model is initialized, which includes a task state storage area, an environmental perception storage area, and a task intention storage area. During task execution, the following data at the current moment are acquired at a snapshot frequency and a snapshot is generated: the current sub-step number and execution status of each sub-step are acquired from the task management module as a task status snapshot; the environmental perception feature vector at the current moment is acquired from the sensor system as an environmental perception snapshot, the environmental perception feature vector including path obstacle distribution features and area illumination condition features; and the task intent identifier of the currently executing task is acquired from the task management module as a task intent snapshot. Each generated task state snapshot, environment awareness snapshot, and task intent snapshot is associated with the current time's timestamp, merged and stored into a single snapshot record, and written into the corresponding storage area of the task memory model, forming a snapshot sequence sorted by timestamp. The snapshot frequency is determined based on the operation type of the sub-step.
[0122] In one embodiment, the reentry impedance calculation module 14 is further configured to: Obtain the ratio of the execution time consumed by each sub-step to the standard execution time, as a time cost component; The corresponding re-entry coefficient is obtained by querying the operation type of each sub-step. For sub-steps whose execution status is completed, the re-entry coefficient is set to the preset maximum re-entry coefficient of 1. For sub-steps whose execution status is not started, the re-entry coefficient is set to 0. Based on the time cost component and the re-entry additional coefficient, the re-entry impedance of the sub-step is calculated.
[0123] In one embodiment, the recovery reward calculation module 15 is further configured to: For each sub-step, the sub-step irreversibility, the task inertia retention, and the sub-step reentry impedance are weighted and calculated to obtain the recovery reward, wherein the recovery reward is directly proportional to the sub-step irreversibility and the task inertia retention, and inversely proportional to the sub-step reentry impedance.
[0124] In one embodiment, the recovery strategy determination module 16 is further configured to: Obtain a strong continuation threshold, a weak continuation threshold, and a strong reset threshold, wherein the strong continuation threshold is a positive value and is the largest, the weak continuation threshold is a positive value and is less than the strong continuation threshold, and the strong reset threshold is a negative value; For each sub-step, when the recovery reward is greater than or equal to the strong continuation threshold, the recovery strategy for the sub-step is determined to be to continue directly from the interruption point; When the recovery reward is greater than or equal to the weak continuation threshold and less than the strong continuation threshold, the recovery strategy for the sub-step is determined to be to continue after confirmation. When the recovery reward is greater than the strong reset threshold and less than the weak continuation threshold, the recovery strategy of the sub-step is determined to be partial reset; When the recovery reward is less than or equal to the strong reset threshold, the recovery strategy of the sub-step is determined to be a full reset; Based on the execution order of each sub-step in the task, the recovery strategy for each sub-step is determined sequentially to form the overall recovery execution plan for the task.
[0125] The acquisition of the strong continuation threshold, weak continuation threshold, and strong reset threshold includes: The recovery reward value of each sub-step is obtained when the robot completes the task under normal conditions without interruption during the historical normal task execution process, forming a normal recovery reward value sequence. The recovery reward value of each sub-step that has been completed normally under simulated interruption conditions is the recovery reward value calculated. Calculate the arithmetic mean of the normal recovery reward sequence as the baseline reward mean, and calculate the standard deviation of the normal recovery reward sequence as the baseline reward standard deviation; The sum of the average benchmark reward value and the standard deviation of the benchmark reward value by a first preset multiple is used as the strong continuation threshold. The average benchmark reward is added to the standard deviation of the benchmark reward by a second preset multiple, and the sum is used as the weak continuation threshold, wherein the second preset multiple is less than the first preset multiple; The difference between the mean of the benchmark reward and the standard deviation of the benchmark reward by a third preset multiple is used as the strong reset threshold. After the robot completes a task recovery, the recovery reward of each sub-step and the effectiveness evaluation result of the actual recovery strategy are added to the normal recovery reward sequence. The strong continuation threshold, the weak continuation threshold and the strong reset threshold are recalculated and the threshold values are dynamically updated.
[0126] It should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A robot task recovery method, characterized in that, include: When the robot is interrupted during the execution of a multi-step task, it obtains information about the sub-steps of the interrupted task and the execution progress of each sub-step. Based on the operation type and completion progress of each sub-step, the irreversibility of each sub-step is analyzed and obtained; The task inertia retention rate is calculated based on the duration of the interruption, changes in the environmental state during the interruption, and changes in the task intent. Based on the operation type of each sub-step, analyze and obtain the cost consumed by the first execution of the sub-step and the additional cost of re-entry, and calculate the sub-step re-entry impedance of each sub-step; Based on the irreversibility of the sub-step, the inertia retention of the task, and the reentry impedance of the sub-step, the recovery reward of each sub-step is calculated and obtained. The recovery strategy for each sub-step is determined based on the recovery reward of each sub-step.
2. The robot task recovery method according to claim 1, characterized in that, When the robot is interrupted during the execution of a multi-step task, the process of obtaining information about the sub-steps of the interrupted task and the execution progress of each sub-step includes: When the robot is interrupted during the execution of a multi-step task, the task identifier and task description of the currently executing task are obtained from the robot's task management module. The task identifier is used to query and obtain the sub-step information of the task. The sub-step information includes the sub-step number, operation type, operation object and execution order of each sub-step in the task. The execution status of each sub-step when the interruption occurs is obtained, wherein the execution status includes three states: not started, in execution, and completed. For a sub-step with an execution status of in execution, the current completion progress of the sub-step is further obtained, wherein the current completion progress is the proportion of the amount of operations performed by the sub-step to the total amount of operations of the sub-step.
3. The robot task recovery method according to claim 1, characterized in that, The analysis of the irreversibility of each sub-step based on its operation type and completion progress includes: The corresponding irreversibility baseline value is obtained by querying the operation type of each sub-step, wherein the operation type includes physical movement, information collection, operation execution and communication interaction. For sub-steps whose execution status is completed, the irreversibility is directly taken as the irreversibility baseline value of the sub-step; For a sub-step that is in execution, the irreversibility baseline value of the sub-step is multiplied by the completion progress of the sub-step to obtain the sub-step irreversibility. For a sub-step whose execution state is "not started", the irreversibility of the sub-step is set to zero.
4. The robot task recovery method according to claim 1, characterized in that, The calculation of task inertia retention based on the interruption duration, changes in environmental state during the interruption, and changes in task intent includes: Obtain a pre-built task memory model; Obtain the timestamp of the interruption occurrence, retrieve the task state snapshot with the timestamp closest to the interruption occurrence from the task memory model, and use it as the interruption time snapshot; retrieve the task state snapshot with the timestamp closest to the current recovery attempt time from the task memory model, and use it as the recovery time snapshot. Obtain the Euclidean distance between the environmental perception feature vector in the recovery snapshot and the environmental perception feature vector in the interruption snapshot, and divide it by the maximum change amplitude of the environmental perception feature vector to obtain the environmental deviation. The task intent identifier in the recovery snapshot is compared with the task intent identifier in the interruption snapshot. If they match, the intent deviation is set to 0; otherwise, the intent deviation is set to 1. Obtain preset duration attenuation coefficient, environmental attenuation coefficient, and intent attenuation coefficient, wherein the sum of the duration attenuation coefficient, the environmental attenuation coefficient, and the intent attenuation coefficient is 1; The difference between the timestamp of the recovery snapshot and the timestamp of the interruption snapshot is calculated as the interruption duration. The interruption duration is then divided by the maximum allowed interruption duration of the task to obtain the duration deviation. Multiply the duration deviation by the duration attenuation coefficient, and the resulting product is recorded as the duration attenuation component. Multiply the environment deviation by the environment attenuation coefficient, and the resulting product is recorded as the environment attenuation component. Multiply the intention deviation by the intention attenuation coefficient, and the resulting product is recorded as the intention attenuation component. The task inertia retention degree is obtained based on the duration decay component, the environment decay component, and the intention decay component.
5. A robot task recovery method according to claim 4, characterized in that, The construction of the task memory model includes: When the robot begins to perform a multi-step task, the task memory model is initialized, which includes a task state storage area, an environmental perception storage area, and a task intention storage area. During task execution, the following data at the current moment are acquired at a snapshot frequency and a snapshot is generated: the current sub-step number and execution status of each sub-step are acquired from the task management module as a task status snapshot; the environmental perception feature vector at the current moment is acquired from the sensor system as an environmental perception snapshot, the environmental perception feature vector including path obstacle distribution features and area illumination condition features; and the task intent identifier of the currently executing task is acquired from the task management module as a task intent snapshot. Each generated task state snapshot, environment awareness snapshot, and task intent snapshot is associated with the current time's timestamp, merged and stored into a single snapshot record, and written into the corresponding storage area of the task memory model, forming a snapshot sequence sorted by timestamp. The snapshot frequency is determined based on the operation type of the sub-step.
6. The robot task recovery method according to claim 1, characterized in that, Based on the operation type of each sub-step, the analysis obtains the cost incurred in the first execution of the sub-step and the additional cost of re-entry, and calculates the sub-step re-entry impedance of each sub-step, including: Obtain the ratio of the execution time consumed by each sub-step to the standard execution time, as a time cost component; The corresponding re-entry coefficient is obtained by querying the operation type of each sub-step. For sub-steps whose execution status is completed, the re-entry coefficient is set to the preset maximum re-entry coefficient of 1. For sub-steps whose execution status is not started, the re-entry coefficient is set to 0. Based on the time cost component and the re-entry additional coefficient, the re-entry impedance of the sub-step is calculated.
7. The robot task recovery method according to claim 1, characterized in that, The calculation of the recovery reward for each sub-step, based on the irreversibility of the sub-step, the task inertia retention, and the reentry impedance of the sub-step, includes: For each sub-step, the sub-step irreversibility, the task inertia retention, and the sub-step reentry impedance are weighted and calculated to obtain the recovery reward, wherein the recovery reward is directly proportional to the sub-step irreversibility and the task inertia retention, and inversely proportional to the sub-step reentry impedance.
8. The robot task recovery method according to claim 1, characterized in that, The step of determining the recovery strategy for each sub-step based on the recovery reward of each sub-step includes: Obtain a strong continuation threshold, a weak continuation threshold, and a strong reset threshold, wherein the strong continuation threshold is a positive value and is the largest, the weak continuation threshold is a positive value and is less than the strong continuation threshold, and the strong reset threshold is a negative value; For each sub-step, when the recovery reward is greater than or equal to the strong continuation threshold, the recovery strategy for the sub-step is determined to be to continue directly from the interruption point; When the recovery reward is greater than or equal to the weak continuation threshold and less than the strong continuation threshold, the recovery strategy for the sub-step is determined to be to continue after confirmation. When the recovery reward is greater than the strong reset threshold and less than the weak continuation threshold, the recovery strategy of the sub-step is determined to be partial reset; When the recovery reward is less than or equal to the strong reset threshold, the recovery strategy of the sub-step is determined to be a full reset; Based on the execution order of each sub-step in the task, the recovery strategy for each sub-step is determined sequentially to form the overall recovery execution plan for the task.
9. A robot task recovery method according to claim 8, characterized in that, The acquisition of the strong continuation threshold, weak continuation threshold, and strong reset threshold includes: The recovery reward value of each sub-step is obtained when the robot completes the task under normal conditions without interruption during the historical normal task execution process, forming a normal recovery reward value sequence. The recovery reward value of each sub-step that has been completed normally under simulated interruption conditions is the recovery reward value calculated. Calculate the arithmetic mean of the normal recovery reward sequence as the baseline reward mean, and calculate the standard deviation of the normal recovery reward sequence as the baseline reward standard deviation; The sum of the average benchmark reward value and the standard deviation of the benchmark reward value by a first preset multiple is used as the strong continuation threshold. The average benchmark reward is added to the standard deviation of the benchmark reward by a second preset multiple, and the sum is used as the weak continuation threshold, wherein the second preset multiple is less than the first preset multiple; The difference between the mean of the benchmark reward and the standard deviation of the benchmark reward by a third preset multiple is used as the strong reset threshold. After the robot completes a task recovery, the recovery reward of each sub-step and the effectiveness evaluation result of the actual recovery strategy are added to the normal recovery reward sequence. The strong continuation threshold, the weak continuation threshold and the strong reset threshold are recalculated and the threshold values are dynamically updated.
10. A robot task recovery system, characterized in that, A robot task recovery method according to any one of claims 1-9 includes: The interrupted task progress acquisition module is used to acquire information about the sub-steps of the interrupted task and the execution progress of each sub-step when the robot is interrupted during the execution of a multi-step task. The irreversibility analysis module is used to analyze and obtain the irreversibility of each sub-step based on the operation type and completion progress of each sub-step. The inertia retention calculation module is used to calculate the task inertia retention based on the duration of the interruption, changes in the environmental state during the interruption, and changes in the task intent. The reentry impedance calculation module is used to analyze and obtain the cost consumed by the first execution of the sub-step and the additional cost of reentry based on the operation type of each sub-step, and to calculate the sub-step reentry impedance of each sub-step. The recovery reward calculation module is used to calculate and obtain the recovery reward of each sub-step based on the irreversibility of the sub-step, the inertia retention of the task, and the reentry impedance of the sub-step. The recovery strategy determination module is used to determine the recovery strategy for each sub-step based on the recovery reward of each sub-step.