A method for autonomous task acquisition, hierarchical filtering and safe execution of robots

CN122884618APending Publication Date: 2026-10-09得识科技(深圳)有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611043100.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-14
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

[0004]现有远程操控任务管理方案在指令执行缺乏强时效性管控,网络抖动或指令队列积压易造成指令传输延迟,过期指令到达后仍被无条件执行,易引发操控逻辑错位、数据采集错误甚至误操作风险;系统关键权限完整性等深层运行环境指标未纳入强制校验环节,形成了隐私泄露与任务静默失效的安全盲区;异常中断后的任务缺乏自主容错与故障自愈能力

Benefits of technology

1、多重准入校验保障安全:采用端到端时间差值校验与序列号滑动窗口抗重放双重机制,同步开展通信链路、隐私风险、权限完整性多维度准入探测,可剔除过期操控指令与重放攻击数据包,主动拦截录屏投屏、权限篡改等风险,保障远程操控环境安全合规。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122884618A_ABST
    Figure CN122884618A_ABST
Patent Text Reader

Abstract

The application discloses a kind of robot autonomous task acquisition, hierarchical filtering and safe execution method, it is related to mobile device remote control technical field field, the application completes global clock calibration, starts non-blocking cycle monitoring thread, parallel scanning time trigger, user instruction, logic self-generation, four kinds of task sources of historical retention, after initial priority matching and dynamic right calculation, aggregate rearrangement, generate ordered pending verification task queue.Subsequently, according to the task source, shunt treatment is carried out, and the execution of the strong preemption logic of the self-allocated protection task is suspended in the running task;External task is output three types of mutually exclusive execution decisions after negotiated resource evaluation. After the task passes through the four-dimensional access check of timeliness, communication link, privacy risk and authority integrity, it is allowed to issue, periodically recalibrates the access dimension in operation, saves breakpoint state when abnormal trigger, and is disposed according to fault attribute classification. Deploy watchdog daemon process, interrupt all tasks when process is abnormal, save state snapshot and automatically restart recovery.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of remote control technology for mobile devices, specifically a method for acquiring, filtering, and safely executing autonomous tasks for robots. Background Technology

[0002] With the rapid development of mobile internet and smart terminal technologies, cloud-based remote control-based mobile device automation services, namely cloud robot services, have been widely used in scenarios such as batch application testing, social account operation, e-commerce data collection, and advertising verification, becoming a technical support for improving the efficiency of batch operations on mobile devices and reducing human maintenance costs.

[0003] Currently, cloud-based remote control services generally adopt an architecture that combines a server-side control and scheduling system with a mobile phone control agent. The server uniformly receives real-time instructions and preset timed tasks from users, establishes remote control channels with multiple controlled mobile phones through a wireless network, and drives the mobile phones to automatically execute a sequence of control actions such as clicking, swiping, text input, and application switching. This enables real-time forwarding and distribution of instructions, verification of basic task parameters, automated operation of timed tasks, and online monitoring of device connectivity.

[0004] Existing remote control task management solutions lack strong timeliness control over command execution. Network jitter or command queue backlog can easily cause command transmission delays. Expired commands may still be executed unconditionally after they arrive, which can easily lead to control logic misalignment, data acquisition errors, or even misoperation risks. Deep-level operating environment indicators such as the integrity of critical system permissions are not included in the mandatory verification process, creating security blind spots such as privacy leaks and silent task failures. Tasks lack autonomous fault tolerance and fault self-healing capabilities after abnormal interruptions.

[0005] Therefore, there is an urgent need for a remote control task execution method with unified scheduling of multi-source tasks and multi-dimensional security matrix verification, to build a unified task gateway for robot proactive management, and to achieve full-dimensional access and continuous verification of timeliness, communication links, privacy risks, and permission integrity, thereby improving the scheduling rationality, operational security and environmental adaptability of cloud-based remote control services. Summary of the Invention

[0006] The purpose of this invention is to provide a method for acquiring, classifying, filtering, and safely executing autonomous tasks for robots, in order to solve the problems raised in the prior art.

[0007] To achieve the above objectives, the present invention provides the following technical solution: a method for acquiring, hierarchically filtering, and safely executing autonomous tasks for a robot, the method comprising the following steps: Step S1: After the robot starts, it connects to the NTP time to complete global clock calibration, starts the non-blocking loop monitoring thread driven by the local master timer, presets a single-round monitoring cycle, and concurrently enables multiple independent threads to scan four types of task sources in parallel during each single-round monitoring cycle; the single-round monitoring cycle is the execution cycle in which the non-blocking loop monitoring thread completes one complete task scan. The four types of task sources include time-triggered sources, user instruction sources, logic-generated sources, and historically retained task sources. The time trigger source reads the local timed task configuration to form a task package. Each task includes a unique task ID, a cron expression, a tolerance delay window, and an identifier for binding the controlled mobile phone. The tolerance delay window is a positive and negative bias parameter, indicating that the deviation between the actual trigger time and the theoretical trigger time is within ±D. The cron expression is a standardized time rule expression used to define the trigger time of the timed task. Get the current system time T current The theoretical trigger time T is calculated using a cron expression. theoretical When |T current -T theoretical When |≤D, it is determined that the current task should be triggered and extracted. After extraction, T is used. theoretical The original generation timestamp T of the current task generate ; The user instruction source pulls the instant task packets sent from the cloud in real time through a TCP long connection. The TCP long connection has a preset communication heartbeat interval. If no response is received for F consecutive heartbeat intervals, it is determined that the TCP long connection has been interrupted and the exponential backoff reconnection mechanism is started. The exponential backoff reconnection mechanism means that the waiting time for each reconnection increases exponentially to avoid impacting the server. F is the preset number of heartbeats. The logic-generated source continuously collects the operating metrics of the server and the controlled mobile phone. When the operating metrics trigger a preset protection threshold, it automatically generates a self-allocated protection task package. The controlled mobile phone is a mobile device that accepts remote control by the robot service. The operating metrics include CPU usage, memory balance, mobile phone battery level, and network status. The server refers to the cloud server where the robot scheduling service is deployed. The historical task source retrieval robot retrieves the retryable task packages and verification task packages from its local database, extracting the original source identifier and original generation timestamp T for each task. generate Bind the controlled mobile phone identifier and task parameters to form the original historical task set.

[0008] Step S2: Aggregate and rearrange the unsorted task sets generated by the four types of task sources. The aggregation and rearrangement includes the first step, the second step, and the third step. The first step is initial priority matching: matching a fixed initial priority P based on the task creation source. initialWhere the initial priority P initial It is divided into four levels: emergency, high, medium and low. Emergency corresponds to preset parameter X, high corresponds to preset parameter Y, medium corresponds to preset parameter Z and low corresponds to preset parameter W. Historical tasks retain their original task source and are matched with the initial priority of the corresponding level. The second step is to calculate the dynamic priority, using the formula P. dynamic =P initial +f loor ((T current -T generate ) / T step )×P delta T step P is the preset weighting step size factor. delta P is the preset fixed step value for a single weighting increase. dynamic The upper limit is a preset upper limit locking parameter with an upper limit constraint of 100, so that after a long period of waiting, the highest priority of ordinary tasks is only equivalent to that of newly generated emergency tasks, thus balancing the fairness of scheduling without exceeding the bottom line of emergency tasks. In the third step, when multiple tasks compete for the same controlled mobile phone, the dynamic priority P of the tasks is compared. dynamic P dynamic Tasks with higher numerical values ​​are sorted first; when P dynamic If they are equal, take the original generation timestamp T. generate Earlier tasks are sorted first, and after sorting, an ordered queue of tasks to be verified is generated. Step S3: Take tasks out sequentially from the generated ordered queue of tasks to be verified, query the current session status of the controlled mobile phone, and perform traffic splitting judgment. Specifically: when the controlled mobile phone has no running tasks, enter traffic splitting processing; when the controlled mobile phone is executing other tasks, and the dynamic priority of the current task to be verified is higher than the dynamic priority of the task currently running on the controlled mobile phone, determine that the current task to be verified has the qualification to preempt and enter traffic splitting processing. For tasks entering the routing process, they are distributed to preprocessors according to their source. The preprocessors include internal preprocessors and external preprocessors. When the source of the task is a self-allocated protection task, it is sent to the internal preprocessor. When the source of the task is an external user instant task or a timed business task, it is sent to the external preprocessor. The self-allocated protection task is a task type generated by a logically self-generated source. The external user instant task and the timed business task are task types generated by user instruction source and time-triggered source, respectively.

[0009] Step S4: Execute strong preemption logic on the task sent to the internal preprocessor in step S3. Specifically, issue a strong preemption command to the currently controlled mobile phone, and actively stop the operation being performed by the currently controlled mobile phone after reaching a safe interruptible node within a preset time to ensure that no incomplete input events remain and avoid abnormal interface state. Then, serialize and save the complete execution context of the interrupted task to form serialized data, and put the control session of the currently controlled mobile phone into a suspended state. Update the serialized data into the local history retention table in the server to complete persistent storage, then release the control resources of the controlled mobile phone, and send the current self-allocated protection task to the corresponding controlled mobile phone for execution.

[0010] Step S5: Execute negotiation-based resource evaluation logic on the task sent to the external preprocessor in step S3. Specifically, extract the real-time resource status of the current server and the controlled mobile phone, including server CPU, memory usage, controlled mobile phone battery level, network round-trip latency, and packet loss rate. Then, output three types of mutually exclusive execution decisions, namely decision one, decision two, and decision three. Decision 1 determines that resources are sufficient and allows the current task to proceed when the server's CPU and memory usage are both below the preset threshold, the controlled mobile phone's battery level is above the preset parameter P, and the network round-trip latency is below the preset parameter Q. In Decision 2, when the controlled mobile phone battery level is in the range of preset parameter R to parameter P, or the network round-trip delay is in the range of preset parameter Q to parameter S, the single-step interval of task control is extended to a preset time to reduce instantaneous resource consumption. When the controlled mobile phone battery level or network round-trip delay exceeds the lower limit of the preset range, it is determined that there is a resource bottleneck and the current task is suspended. Decision 3 determines that resources are insufficient to support secure execution when the server's CPU and memory usage exceed the preset parameter V, the controlled mobile phone's battery level is not higher than the preset parameter R, or the network round-trip latency exceeds the preset parameter S. The current task is then stored in the local historical retention table for subsequent retry or cleanup.

[0011] Step S6: For tasks that are deemed to have sufficient resources and are allowed to proceed as determined in Step S5, an access detection dimension verification is performed on the current task. When all access detection dimension verifications pass, the task is approved for execution. The access detection dimension verifications include timeliness verification, communication link verification, privacy risk verification, and permission integrity verification. The timeliness verification parses the hardware timestamp in the telemetry packet of the controlled mobile phone and calculates the difference T between the hardware timestamp and the server NTP time. delta When T deltaIf the time deviation exceeds the preset parameter S1, it is determined to be a time deviation failure; a fixed-size sliding window is maintained, and if the sequence number of the telemetry packet is less than the maximum sequence number recorded within the sliding window, it is determined to be a replay attack failure. If neither the replay attack failure nor the time deviation failure is satisfied, the current dimension is determined to pass. The communication link verification is considered successful if the network round-trip delay is lower than the preset parameter Q and the packet loss rate within the sliding window is lower than the preset parameter P1. The privacy risk verification detects whether the controlled mobile phone has any privacy risk items. The privacy risk items include screen recording, screen projection, and virtual display. When the privacy risk items do not exist, the current dimension is determined to pass. The permission integrity verification checks the permissions of the controlled mobile phone, including the accessibility service registration status, floating window global touch permission, and device manager permission. When none of the permissions have been tampered with, the current dimension is deemed to have passed.

[0012] Step S7: For each controlled mobile phone that is in the task control state, a fixed period T2 is preset, and the admission detection dimension verification is repeatedly performed on the target controlled mobile phone. When any dimension of the admission detection dimension verification fails, a task interruption command is sent to the corresponding controlled mobile phone to interrupt the robot task. After the interrupt command is issued, the current task status of the robot is marked as a safety interruption pending handling. When the access detection dimension verification is passed, the access detection dimension verification continues to be performed in a fixed cycle of T2 until the robot completes all the control steps on the currently controlled mobile phone.

[0013] Step S8: When the robot's current task status is marked as a safety interruption pending handling, the subsequent operation of the current task is not executed, and the breakpoint status data of the current task is saved synchronously. The breakpoint status data includes the index of completed steps, the completion percentage within the step, the name of the current interface activity, the key control identifier, and the screen status snapshot. After the status is saved, the corresponding handling is executed according to the fault attribute corresponding to the interruption. The fault attribute is divided into self-healing transient faults and non-self-healing normal safety violations. The self-healing transient faults include network jitter recovery time being lower than a preset threshold, short-term screen recording duration being lower than a preset threshold, and automatic recovery after instantaneous disconnection of system permissions. For the self-healing transient faults, the controlled mobile phone sends the breakpoint status data back to the server. The server marks the corresponding task as suspended and stores it in the local historical retention table along with the breakpoint status data. When the controlled mobile phone's operating environment completes self-healing, it continues to execute the current task from the recorded breakpoint without having to rerun all the control steps from the beginning. Among the non-healable routine security violations are continuous malicious remote screen projection transmission by the controlled mobile phone and tampering with accessibility service permissions. In response to the aforementioned non-healable routine security violations, the controlled mobile phone shall immediately terminate the current control session, clear the local cache, and push a security alert to the server.

[0014] Step S9: Deploy the watchdog daemon process. The watchdog daemon process and the server main process send heartbeat signals to each other at a fixed period T2. When the number of times the watchdog daemon process or the server main process does not receive a response from the other party reaches a preset parameter, the other party process is determined to be abnormal. After determining that the process is abnormal, a task interruption command is sent to all connected controlled mobile phones to interrupt the robot task. All controlled mobile phones immediately stop operation and enter standby mode. A snapshot of the complete running state of the server main process is stored, which includes the ordered queue of tasks to be verified and the contents of the local historical retention table. Then, the abnormal process is automatically restarted. If the restart is successful, the task scheduling is restored from the snapshot. If the automatic restart of the abnormal process fails, an alarm is pushed until manual intervention is required.

[0015] Compared with the prior art, the beneficial effects of the present invention are: 1. Multiple access verifications ensure security: The system employs a dual mechanism of end-to-end time difference verification and serial number sliding window anti-replay, simultaneously conducting multi-dimensional access detection of communication links, privacy risks, and permission integrity. It can eliminate expired control commands and replay attack data packets, proactively intercept risks such as screen recording and projection, and permission tampering, ensuring the security and compliance of the remote control environment.

[0016] 2. Hierarchical scheduling enables task control: It aggregates four types of task sources, generates an ordered task queue through initial priority matching and dynamic weighting algorithm, and executes tasks according to their source using strong preemption or negotiation-based resource evaluation logic. This ensures that self-allocated protection tasks can be preempted and executed first, automatically responds to equipment malfunctions, and improves the efficiency of scheduling resource utilization.

[0017] 3. Breakpoint self-healing mechanism improves operational efficiency: Complete breakpoint status data is retained for tasks that are interrupted due to security issues. Breakpoint resume or security alarms are executed according to the fault attributes. Combined with the watchdog daemon process, it realizes automatic restart and status recovery of abnormal processes, improving the continuity and stability of remote management and control. Attached Figure Description

[0018] Figure 1 This is a schematic diagram of the structure of a method for acquiring, filtering, and safely executing autonomous tasks for a robot, according to the present invention. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] Example: Figure 1 As shown, the present invention provides a technical solution: a method for acquiring, hierarchically filtering, and safely executing autonomous tasks for robots. The method includes the following steps: Step S1: After the robot starts, it connects to the NTP time to complete global clock calibration, starts the non-blocking loop monitoring thread driven by the local master timer, presets a single-round monitoring cycle, and concurrently enables multiple independent threads to scan four types of task sources in parallel during each single-round monitoring cycle; the single-round monitoring cycle is the execution cycle in which the non-blocking loop monitoring thread completes one complete task scan. The four types of task sources include time-triggered sources, user instruction sources, logic-generated sources, and historically retained task sources. The time trigger source reads the local timed task configuration to form a task package. Each task includes a unique task ID, a cron expression, a tolerance delay window, and an identifier for binding the controlled mobile phone. The tolerance delay window is a positive and negative bias parameter, indicating that the deviation between the actual trigger time and the theoretical trigger time is within ±D. The cron expression is a standardized time rule expression used to define the trigger time of the timed task. Get the current system time T current The theoretical trigger time T is calculated using a cron expression. theoretical When |T current -T theoretical When |≤D, it is determined that the current task should be triggered and extracted. After extraction, T is used. theoretical The original timestamp T of the current task generate ; The user instruction source pulls the instant task packets sent from the cloud in real time through a TCP long connection. The TCP long connection has a preset communication heartbeat interval. If no response is received for F consecutive heartbeat intervals, it is determined that the TCP long connection has been interrupted and the exponential backoff reconnection mechanism is started. The exponential backoff reconnection mechanism means that the waiting time for each reconnection increases exponentially to avoid impacting the server. F is the preset number of heartbeats. The logic-generated source continuously collects the operating metrics of the server and the controlled mobile phone. When the operating metrics trigger a preset protection threshold, it automatically generates a self-allocated protection task package. The controlled mobile phone is a mobile device that accepts remote control by the robot service. The operating metrics include CPU usage, memory balance, mobile phone battery level, and network status. The server refers to the cloud server where the robot scheduling service is deployed. The historical task source retrieval robot retrieves the retryable task packages and verification task packages from its local database, extracting the original source identifier and original generation timestamp T for each task. generate Bind the controlled mobile phone identifier and task parameters to form the original historical task set.

[0021] Step S2: Aggregate and rearrange the unsorted task sets generated by the four types of task sources. The aggregation and rearrangement includes the first step, the second step, and the third step. The first step is initial priority matching: matching a fixed initial priority P based on the task creation source. initial Where the initial priority P initial It is divided into four levels: emergency, high, medium and low. Emergency corresponds to preset parameter X, high corresponds to preset parameter Y, medium corresponds to preset parameter Z and low corresponds to preset parameter W. Historical tasks retain their original task source and are matched with the initial priority of the corresponding level. The second step is to calculate the dynamic priority, using the formula P. dynamic =P initial +f loor ((T current -T generate ) / T step )×P delta T step P is the preset weighting step size factor. delta P is the preset fixed step value for a single weighting increase. dynamic The upper limit is a preset upper limit locking parameter with an upper limit constraint of 100, so that after a long period of waiting, the highest priority of ordinary tasks is only equivalent to that of newly generated emergency tasks, thus balancing the fairness of scheduling without exceeding the bottom line of emergency tasks. In the third step, when multiple tasks compete for the same controlled mobile phone, the dynamic priorities P of the tasks are compared. dynamic P dynamic Tasks with higher numerical values ​​are sorted first; when P dynamic If they are equal, take the original generation timestamp T. generate Earlier tasks are sorted first, and after sorting, an ordered queue of tasks to be verified is generated. Step S3: Take tasks out sequentially from the generated ordered queue of tasks to be verified, query the current session status of the controlled mobile phone, and perform traffic splitting judgment. Specifically: when the controlled mobile phone has no running tasks, enter traffic splitting processing; when the controlled mobile phone is executing other tasks, and the dynamic priority of the current task to be verified is higher than the dynamic priority of the task currently running on the controlled mobile phone, determine that the current task to be verified has the qualification to preempt and enter traffic splitting processing. For tasks entering the routing process, they are distributed to preprocessors according to their source. The preprocessors include internal preprocessors and external preprocessors. When the source of the task is a self-allocated protection task, it is sent to the internal preprocessor. When the source of the task is an external user instant task or a timed business task, it is sent to the external preprocessor. The self-allocated protection task is a task type generated by a logically self-generated source. The external user instant task and the timed business task are task types generated by user instruction source and time-triggered source, respectively.

[0022] Step S4: Execute strong preemption logic on the task sent to the internal preprocessor in step S3. Specifically, issue a strong preemption command to the currently controlled mobile phone, and actively stop the operation being performed by the currently controlled mobile phone after reaching a safe interruptible node within a preset time to ensure that no incomplete input events remain and avoid abnormal interface state. Then, serialize and save the complete execution context of the interrupted task to form serialized data, and put the control session of the currently controlled mobile phone into a suspended state. Update the serialized data into the local history retention table in the server to complete persistent storage, then release the control resources of the controlled mobile phone, and send the current self-allocated protection task to the corresponding controlled mobile phone for execution.

[0023] Step S5: Execute negotiation-based resource evaluation logic on the task sent to the external preprocessor in step S3. Specifically, extract the real-time resource status of the current server and the controlled mobile phone, including server CPU, memory usage, controlled mobile phone battery level, network round-trip latency, and packet loss rate. Then, output three types of mutually exclusive execution decisions, namely decision one, decision two, and decision three. Decision 1 determines that resources are sufficient and allows the current task to proceed when the server's CPU and memory usage are both below the preset threshold, the controlled mobile phone's battery level is above the preset parameter P, and the network round-trip latency is below the preset parameter Q. In Decision 2, when the controlled mobile phone battery level is in the range of preset parameter R to parameter P, or the network round-trip delay is in the range of preset parameter Q to parameter S, the single-step interval of task control is extended to a preset time to reduce instantaneous resource consumption. When the controlled mobile phone battery level or network round-trip delay exceeds the lower limit of the preset range, it is determined that there is a resource bottleneck and the current task is suspended. Decision 3 determines that resources are insufficient to support secure execution when the server's CPU and memory usage exceed the preset parameter V, the controlled mobile phone's battery level is not higher than the preset parameter R, or the network round-trip latency exceeds the preset parameter S. The current task is then stored in the local historical retention table for subsequent retry or cleanup.

[0024] Step S6: For tasks that are deemed to have sufficient resources and are allowed to proceed as determined in Step S5, an access detection dimension verification is performed on the current task. When all access detection dimension verifications pass, the task is approved for execution. The access detection dimension verifications include timeliness verification, communication link verification, privacy risk verification, and permission integrity verification. The timeliness verification parses the hardware timestamp in the telemetry packet of the controlled mobile phone and calculates the difference T between the hardware timestamp and the server NTP time. delta When T delta If the time deviation exceeds the preset parameter S1, it is determined to be a time deviation failure; a fixed-size sliding window is maintained, and if the sequence number of the telemetry packet is less than the maximum sequence number recorded within the sliding window, it is determined to be a replay attack failure. If neither the replay attack failure nor the time deviation failure is satisfied, the current dimension is determined to pass. The communication link verification is considered successful if the network round-trip delay is lower than the preset parameter Q and the packet loss rate within the sliding window is lower than the preset parameter P1. The privacy risk verification detects whether the controlled mobile phone has any privacy risk items. The privacy risk items include screen recording, screen projection, and virtual display. When the privacy risk items do not exist, the current dimension is determined to pass. The permission integrity verification checks the permissions of the controlled mobile phone, including the accessibility service registration status, floating window global touch permission, and device manager permission. When none of the permissions have been tampered with, the current dimension is deemed to have passed.

[0025] Step S7: For each controlled mobile phone that is in the task control state, a fixed period T2 is preset, and the admission detection dimension verification is repeatedly performed on the target controlled mobile phone. When any dimension of the admission detection dimension verification fails, a task interruption command is sent to the corresponding controlled mobile phone to interrupt the robot task. After the interrupt command is issued, the current task status of the robot is marked as a safety interruption pending handling. When the access detection dimension verification is passed, the access detection dimension verification continues to be performed in a fixed cycle of T2 until the robot completes all the control steps on the currently controlled mobile phone.

[0026] Step S8: When the robot's current task status is marked as a safety interruption pending handling, the subsequent operation of the current task is not executed, and the breakpoint status data of the current task is saved synchronously. The breakpoint status data includes the index of completed steps, the completion percentage within the step, the name of the current interface activity, the key control identifier, and the screen status snapshot. After the status is saved, the corresponding handling is executed according to the fault attribute corresponding to the interruption. The fault attribute is divided into self-healing transient faults and non-self-healing normal safety violations. The self-healing transient faults include network jitter recovery time being lower than a preset threshold, short-term screen recording duration being lower than a preset threshold, and automatic recovery after instantaneous disconnection of system permissions. For the self-healing transient faults, the controlled mobile phone sends the breakpoint status data back to the server. The server marks the corresponding task as suspended and stores it in the local historical retention table along with the breakpoint status data. When the controlled mobile phone's operating environment completes self-healing, it continues to execute the current task from the recorded breakpoint without having to rerun all the control steps from the beginning. Among the non-healable routine security violations are continuous malicious remote screen projection transmission by the controlled mobile phone and tampering with accessibility service permissions. In response to the aforementioned non-healable routine security violations, the controlled mobile phone shall immediately terminate the current control session, clear the local cache, and push a security alert to the server.

[0027] Step S9: Deploy the watchdog daemon process. The watchdog daemon process and the server main process send heartbeat signals to each other at a fixed period T2. When the number of times the watchdog daemon process or the server main process does not receive a response from the other party reaches a preset parameter, the other party process is determined to be abnormal. After determining that the process is abnormal, a task interruption command is sent to all connected controlled mobile phones to interrupt the robot task. All controlled mobile phones immediately stop operation and enter standby mode. A snapshot of the complete running state of the server main process is stored, which includes the ordered queue of tasks to be verified and the contents of the local historical retention table. Then, the abnormal process is automatically restarted. If the restart is successful, the task scheduling is restored from the snapshot. If the automatic restart of the abnormal process fails, an alarm is pushed until manual intervention is required.

[0028] Example: The method of the present invention will be described below with reference to a specific example. Suppose that the robot service is deployed on a cloud server with 8 CPU cores and 16GB of memory; currently, 3 controlled mobile phones are connected, namely device_01, device_02 and device_03. The system has completed NTP time synchronization and the current system time is T=1718370000 Unix seconds. The non-blocking monitoring thread is driven at a frequency of 10Hz. During this monitoring period, the four scanning interfaces concurrently returned the following raw tasks; Time-triggered source: Detect scheduled task T1, which performs application check-in on device_02 daily at 14:00, with an initial priority P=50 and a theoretical trigger time T. generate =1718368800; The current time difference is 1200 seconds, and it is extracted within a tolerance window of ±1800 seconds; User instruction source: Detect user instant task T2, which executes on device_01 to open the e-commerce app, search for keywords, and collect a product list. Initial priority P=75, T generate=1718369990, the current ID is not in the extracted set and the timestamp is later than the end time of the previous period, so it is determined to be a valid new task extraction; Logical self-generated source: The self-checking and diagnostic thread detected that the average battery level of device_03 was 12% in the current cycle, which is lower than the 15% threshold. This triggers self-allocated protection task T3, which performs charging reminders and low battery protection on device_03, sends a system notification to remind the user to charge, and temporarily suspends non-urgent task scheduling on the phone. The initial priority is P=75. Meanwhile, the server CPU load is 45%, available memory is 9.2GB, other phones are in normal status, and no other self-allocated protection tasks are triggered.

[0029] After merging the extracted tasks T1, T2, and T3, calculate the current dynamic priority of each task; T1 is a scheduled task, P initial =50, waiting time = 1718370000 - 1718368800 = 1200 seconds, weighting value floor(1200 / 600) × 1 = 2, P dynamic =50+2=52; T2 is the user's immediate task: P initial =75, waiting time =1718370000-1718369990=10 seconds, weighted value floor(10 / 600)×1=0, P dynamic =75; T3 is a self-assigned protection task: P initial =75, waiting time=0, P dynamic =75.

[0030] Press P dynamic Arranged in descending order, T2 and T3 are tied for the highest, and their P values ​​are... dynamic If they are equal, proceed to the second level of comparison, T3's T. generate Later, T2's T generate =1718369990 earlier, T2 is placed before T3. In the final queue order, T2(75)>T3(75)>T1(52), T2 is placed at the head of the queue.

[0031] The query for the target mobile phone device_01 bound to T2 shows that its current control session status is idle, thus initiating traffic splitting. T2 is an external user's instant task, and it is redirected to the external instant task preprocessor. The resource manager collects the server's current resources: CPU 45%, available memory 9.2GB, and device_01's status: battery 68%, network RTT 80ms, screen unlocked and on. Based on this comprehensive assessment, sufficient resources are deemed sufficient to allow execution.

[0032] The verification gateway performs a four-dimensional verification on device_01 bound to T2: the server CPU is less than 80% (45%), the device_01 telemetry packet is 8 milliseconds in the timeliness dimension, the RTT is 80ms and the packet loss rate is 1.2% in the communication link dimension; there are no screen recording sessions and no screen projection in the privacy and security dimension; the accessibility service is normal, the floating window permission has been granted, the device manager has been activated, and T2 passes the access control and the control command is sent to device_01 to start execution.

[0033] T2 is executing step 15 on device_01, out of a total of 30 steps. While performing the sliding data collection on the product list page, an anomaly is detected in the communication link dimension of device_01, with the packet loss rate rising to 15%. An interrupt command is sent to device_01 through a dedicated control channel. The controlled mobile phone completes the safe termination of the current sliding action within 320 milliseconds and stops subsequent steps, saving the control progress and the current interface snapshot back to the server, along with the breakpoint information, and storing it in the retention table. 1.2 seconds later, the self-healing monitoring thread successfully completed 5 consecutive probes of device_01, determining that the environment had self-healed. The scheduler retrieved T2 from the retention table, resumed the control session, and completed seamless resume from step 14. Finally, T2 successfully executed all 30 control steps, completing the product list collection task.

[0034] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.

Claims

1. A method for acquiring, hierarchically filtering, and safely executing autonomous tasks for a robot, characterized in that: The method includes the following steps: Step S1: After the robot starts, it completes global clock calibration, starts a non-blocking loop monitoring thread, and scans four types of task sources in parallel within a single monitoring cycle to extract the corresponding tasks. Step S2: Aggregate and rearrange the unsorted tasks from the four types of task sources to generate an ordered queue of tasks to be verified; Step S3: Take out tasks sequentially from the generated ordered queue of tasks to be verified, query the current session status of the controlled mobile phone, perform traffic splitting judgment, and then distribute the tasks to the corresponding preprocessors according to their source. The preprocessors include internal preprocessors and external preprocessors. Step S4: Execute strong preemption logic on the task sent to the internal preprocessor, release the control resources of the controlled mobile phone, and then send the current self-allocated protection task to the corresponding controlled mobile phone for execution. Step S5: For the task sent to the external preprocessor, extract the real-time resource status of the current server and the controlled mobile phone, and then output the corresponding judgment according to the three types of mutual exclusion execution decisions; Step S6: Perform access detection dimension verification on tasks that are deemed to have sufficient resources for approval. When all access detection dimension verifications pass, the task is approved for execution. Step S7: For the controlled mobile phone in the task control state, repeatedly perform the access detection dimension verification at a fixed period. If any dimension fails, issue an interrupt command and mark the task as a security interruption pending handling. Step S8: Save the breakpoint status data for the security interruption pending tasks, and perform corresponding handling according to the fault attributes corresponding to the interruption; Step S9: Deploy the watchdog daemon process, and after determining that the process is abnormal, send a task interruption command to the controlled mobile phone, automatically restart the abnormal process and restore task scheduling. If the restart fails, push an alarm and wait for manual intervention.

2. The method for acquiring, hierarchically filtering, and safely executing autonomous tasks for a robot according to claim 1, characterized in that: The non-blocking loop monitoring thread described in step S1 has a preset single-round monitoring cycle. In each single-round monitoring cycle, multiple independent threads are concurrently activated to scan four types of task sources in parallel. The single-round monitoring cycle is the execution cycle in which the non-blocking loop monitoring thread completes one full task scan. The four types of task sources include time-triggered sources, user instruction sources, logically generated sources, and historically retained task sources. The time trigger source reads the local timed task configuration to form a task package. Each task includes a unique task ID, a cron expression, a tolerance delay window, and an identifier for the controlled mobile phone. The tolerance delay window is a positive and negative bias parameter, indicating that the allowable deviation between the actual trigger time and the theoretical trigger time is ±D. Get the current system time T current The theoretical trigger time T is calculated using a cron expression. theoretical When |T current -T theoretical When |≤D, it is determined that the current task should be triggered and extracted. After extraction, T is used. theoretical The original generation timestamp T of the current task generate ; The user instruction source pulls the instant task packets sent from the cloud in real time through a TCP long connection. The TCP long connection has a preset communication heartbeat interval. If no response is received for F consecutive heartbeat intervals, it is determined that the TCP long connection has been interrupted and the exponential backoff reconnection mechanism is started. The exponential backoff reconnection mechanism means that the waiting time for each reconnection increases exponentially, where F is the preset number of heartbeats. The logic-generated source continuously collects the operating indicators of the server and the controlled mobile phone. When the operating indicators trigger a preset protection threshold, it automatically generates a self-allocated protection task package. The historical task source retrieval robot retrieves the retry task packages and verification task packages in its local database, and extracts the original source identifier and original generation timestamp T for each task. generate Bind the controlled mobile phone identifier and task parameters to form the original historical task set.

3. The method for acquiring, hierarchically filtering, and safely executing autonomous tasks for a robot according to claim 1, characterized in that: The aggregation rearrangement described in step S2 includes a first step, a second step, and a third step; The first step is initial priority matching, which matches a fixed initial priority P based on the task creation source. initial Historical tasks retain their original source and are matched with the initial priority of the corresponding tier. The second step is to calculate the dynamic priority, using the formula P. dynamic =P initial +f loor ((T current -T generate ) / T step )×P delta T step P is the preset weighting step size factor. delta P is the preset fixed step value for a single weighting increase. dynamic The upper limit is a preset locking parameter, with an upper limit constraint of 100; In the third step, when multiple tasks compete for the same controlled mobile phone, the dynamic priority P of the tasks is compared. dynamic P dynamic Tasks with higher numerical values ​​are ranked first; when P dynamic If they are equal, take the original generation timestamp T. generate Earlier tasks are sorted first, and after sorting, an ordered queue of tasks to be verified is generated.

4. The method for acquiring, hierarchically filtering, and safely executing autonomous tasks for a robot according to claim 1, characterized in that: The traffic splitting determination in step S3 specifically refers to: when the currently controlled mobile phone has no running tasks, it enters the traffic splitting process; When the controlled mobile phone is performing other tasks, and the dynamic priority of the task to be verified is higher than the dynamic priority of the task currently being run by the controlled mobile phone, it is determined that the task to be verified has the qualification to preempt and enters the diversion process. For tasks entering the routing process, they are distributed to preprocessors according to their source. The preprocessors include internal preprocessors and external preprocessors. When the source of the task is a self-allocated protection task, it is sent to the internal preprocessor. When the source of the task is an external user instant task or a timed business task, it is sent to the external preprocessor. The self-allocated protection task is a task type generated by a logically self-generated source. The external user instant task and the timed business task are task types generated by user instruction source and time-triggered source, respectively.

5. The method for acquiring, hierarchically filtering, and safely executing autonomous tasks for a robot according to claim 1, characterized in that: When executing the strong preemption logic in step S4, a strong preemption command is sent to the currently controlled mobile phone. Within a preset time, the control action being performed by the currently controlled mobile phone is executed to a safe interruptible node and then actively stopped. Then, the complete execution context of the interrupted task is serialized and saved to form serialized data. The control session of the currently controlled mobile phone is put into a suspended state. The serialized data is updated and written to the local historical retention table in the server. The current self-assigned protection task is sent to the corresponding controlled mobile phone for execution.

6. The method for acquiring, hierarchically filtering, and safely executing autonomous tasks for a robot according to claim 1, characterized in that: The real-time resource status mentioned in step S5 includes server CPU, memory usage, controlled mobile phone battery level, network round-trip latency, and packet loss rate; among which, the three types of mutually exclusive execution decisions include decision one, decision two, and decision three; Decision 1 determines that resources are sufficient and allows the current task to proceed when the server's CPU and memory usage are both below the preset threshold, the controlled mobile phone's battery level is above the preset parameter P, and the network round-trip latency is below the preset parameter Q. Decision 2 extends the single-step interval of task control to a preset time when the controlled mobile phone battery is in the range of preset parameter R to parameter P, or the network round-trip delay is in the range of preset parameter Q to parameter S. When the controlled mobile phone battery or the network round-trip delay exceeds the lower limit of the preset range, it is determined that there is a bottleneck in resources and the current task is suspended. Decision 3 determines that resources are insufficient to support secure execution when the server's CPU and memory usage exceed the preset parameter V, the controlled mobile phone's battery level is not higher than the preset parameter R, or the network round-trip latency exceeds the preset parameter S. The current task is then stored in the local historical retention table.

7. The method for acquiring, hierarchically filtering, and safely executing autonomous tasks for a robot according to claim 1, characterized in that: The access detection dimension verification in step S6 includes timeliness verification, communication link verification, privacy risk verification, and permission integrity verification; The timeliness verification parses the hardware timestamp in the telemetry packet of the controlled mobile phone and calculates the difference T between the hardware timestamp and the server NTP time. delta When T delta When the preset parameter S1 is exceeded, it is determined to be a time deviation failure; a fixed-size sliding window is maintained. When the sequence number of the telemetry packet is less than the maximum sequence number recorded in the sliding window, it is determined to be a replay attack failure. When neither replay attack failure nor time deviation failure is satisfied, the current dimension is determined to pass. The communication link verification is considered successful if the network round-trip delay is lower than the preset parameter Q and the packet loss rate within the sliding window is lower than the preset parameter P1. The privacy risk verification detects whether the controlled mobile phone has any privacy risk items. The privacy risk items include screen recording, screen projection, and virtual display. When the privacy risk items do not exist, the current dimension is determined to pass. The permission integrity verification checks the permissions of the controlled mobile phone, including the accessibility service registration status, floating window global touch permission, and device manager permission. When none of the permissions have been tampered with, the current dimension is deemed to have passed.

8. The method for acquiring, hierarchically filtering, and safely executing autonomous tasks for a robot according to claim 1, characterized in that: After the interrupt command is issued in step S7, the current task status of the robot is marked as a safety interruption pending handling. When the access detection dimension verification is passed, the access detection dimension verification continues to be performed in a cycle of a preset fixed period T2 until the robot completes all the control steps on the currently controlled mobile phone.

9. The method for acquiring, hierarchically filtering, and safely executing autonomous tasks for a robot according to claim 1, characterized in that: The fault attributes mentioned in step S8 are divided into self-healing transient faults and non-self-healing normal safety violations; The self-healing transient faults include network jitter recovery time being lower than a preset threshold, short-term screen recording duration being lower than a preset threshold, and automatic recovery after instantaneous disconnection of system permissions. For the self-healing transient faults, the controlled mobile phone sends the breakpoint status data back to the server. The server marks the corresponding task as suspended and stores it in the local historical retention table along with the breakpoint status data. When the controlled mobile phone's operating environment completes self-healing, it continues to execute the current task from the recorded breakpoint. Among the non-healable routine security violations are continuous malicious remote screen projection transmission by the controlled mobile phone and tampering with accessibility service permissions. In response to the aforementioned non-healable routine security violations, the controlled mobile phone shall immediately terminate the current control session, clear the local cache, and push a security alert to the server.

10. The method for acquiring, hierarchically filtering, and safely executing autonomous tasks for a robot according to claim 1, characterized in that: In step S9, the watchdog daemon process and the server main process send heartbeat signals to each other at a fixed period T2. When the number of times the watchdog daemon process or the server main process fails to receive a response from the other party reaches a preset parameter, the other party process is determined to be abnormal.