A method and system for cooperative processing of multi-end interfaces

By routing functions based on step sequence and device role identifiers during the automation process of multi-terminal user interfaces, establishing cross-role connections, and preparing pre-start execution instances for the next automation step after the current step is completed and before the result verification is finished, the problems of execution time accumulation and erroneous operations in multi-terminal interface automation are solved, achieving more efficient and reliable automated execution.

CN123177902APending Publication Date: 2026-11-27BEIJING XINTANG SICHUANG EDUCATIONAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611390379.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-08
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

In the process of automating multi-terminal user interfaces, strictly sequential execution causes the time for device connection, page preparation and interface data access between different terminals to accumulate sequentially, while direct parallel execution is prone to incorrect execution of subsequent interface operations when the verification of the preceding operation fails, the role execution position changes or the target interface state becomes invalid.

Method used

A collaborative processing method for multi-terminal interfaces is provided. By acquiring the sequence of automated steps on multiple terminals, role routing is performed according to the step order and device role identifier, and cross-role connection relationship is established. The method prepares a pre-start execution instance for the next automated step when the current step is completed and the result verification process is not finished. The target interface operation is allowed when the verification is passed and the execution preparation status is valid; otherwise, the pre-start execution instance is canceled and subsequent steps are blocked.

Benefits of technology

It reduces the execution waiting time between multiple terminals, avoids erroneous progress when the preceding operation verification fails or the execution preparation context fails, and improves the integrity and traceability of automated execution across multiple terminals.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123177902A_ABST
    Figure CN123177902A_ABST
Patent Text Reader

Abstract

The application provides a multi-end interface cooperative processing method and system. The method acquires a multi-end automation step sequence including multiple automation steps, performs role routing according to a step sequence and a device role identifier, and determines a cross-role connection relationship between adjacent automation steps; when a target interface operation of a current automation step is completed and a result verification process is not ended, a pre-start execution instance is established for a next automation step and an execution preparation state is formed; according to a verification result of the current automation step and the execution preparation state, a valid pre-start execution instance is released, or an invalid pre-start execution instance is cancelled and subsequent step promotion is blocked. The application can shorten the waiting time of cross-end step switching and avoid invalid pre-start instance execution of target interface operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of computer automated testing and multi-terminal collaborative control technology, and in particular to a collaborative processing method and system for multi-terminal interfaces. Background Technology

[0002] With the development of online education platforms and multi-role interactive services, the same business process often needs to be completed jointly by multiple terminals such as teacher terminals, student terminals, and parent terminals. For example, after the teacher terminal publishes a learning task, the student terminal receives and completes the corresponding task, and the parent terminal further views the task status or learning results. To verify whether the multi-role business process is operating as expected, automated processes such as clicking, inputting, switching pages, submitting content, and checking results can be sequentially executed on the user interfaces of different terminals according to pre-configured operation steps.

[0003] In the process of automating multi-terminal user interfaces, different operation steps depend on the corresponding terminal's device connection, page loading, interface object location, and interface data acquisition. If the execution result of the current operation is strictly verified before starting the preparation for the next terminal's operation, the waiting time generated by terminal switching, page loading, and interface data access will accumulate sequentially, leading to an increase in the overall execution time. If the interface operation of the next terminal is executed directly before the result of the current operation has been verified, subsequent operations that should not occur may continue to be executed if the current operation fails, the terminal role order changes, or the page state of the next terminal changes, resulting in disordered step order, misoperation of interface objects, and inconsistencies between the execution record and the actual state.

[0004] Therefore, it is necessary to improve the way steps are connected between different device roles in the process of automating multi-terminal user interfaces. While maintaining the step order and dependencies between operations for the same device role, it is necessary to reduce execution waiting between different terminals and avoid errors in subsequent interface operations caused by unconfirmed preceding operations or invalid interface states. Summary of the Invention

[0005] This application aims to solve the problem that in the process of automating multi-terminal user interfaces, strict serial execution leads to the accumulation of time for device connection, page preparation and interface data access between different terminals, while direct parallel execution is prone to incorrect execution of subsequent interface operations when the preceding operation verification fails, the role execution position changes or the target interface state becomes invalid.

[0006] To achieve the above objectives, this application provides a collaborative processing method for multiple interfaces, comprising: Obtain a multi-terminal automation step sequence, which includes multiple automation steps. Each automation step is configured with a step order, device role identifier, target interface operation, and result verification processing. The result verification processing is used to verify the execution result of the target interface operation in the same automation step. Role routing is performed based on the step sequence and device role identifier to enable automated steps for the same device role to be executed serially; based on the role routing results and the step sequence, the cross-role connection relationship between adjacent automated steps is determined. When the target interface operation of the current automation step is completed but the result verification process is not finished, a pre-start execution instance is established for the next automation step according to the cross-role connection relationship. The next automation step is prepared for execution. An execution preparation state is formed according to the execution preparation result. The pre-start execution instance is controlled in the pending release state before the target interface operation is executed. Based on the verification result of the current automation step and the execution preparation status, if the verification is successful and the execution preparation status is valid, the pre-start execution instance is allowed to execute the target interface operation of the next automation step; if the verification fails or the execution preparation status is invalid, the pre-start execution instance is canceled and the advancement of subsequent automation steps is blocked.

[0007] Optionally, the step of establishing a pre-launch execution instance for the next automation step based on the cross-role connection relationship includes: Obtain the target interface operation completion event and the result verification process that is currently running for the current automation step; extract the step identifier and device role identifier from the target interface operation completion event; and obtain the verification process identifier from the result verification process. The next automated step is determined based on the cross-role connection relationship, the expected verification status is determined based on the pass conditions of the result verification process, and a pre-start connection object is established that includes the current step identifier, the next step identifier, the role switching relationship, the verification process identifier, and the expected verification status. The pre-startup execution instance is created based on the pre-startup connection object, the pre-startup execution instance is associated with the result verification process, execution preparation qualification is configured for the pre-startup execution instance, and the target interface operation execution qualification of the pre-startup execution instance is locked.

[0008] Optionally, the step of routing roles according to the step sequence and device role identifier includes: Establish a role progress record for each device role. The role progress record includes the completed step position, the formal execution position, and the execution preparation position. According to the step sequence, each automated step is mapped to the corresponding role progress record, and the formal execution position and the execution preparation position are determined along the step sequence of the same device role. Match the step position of the next automation step with the execution preparation position in the corresponding role's progress record, and check whether there are any incomplete automation steps corresponding to the same device role before the next automation step; When the step position matches and there are no incomplete automated steps of the same role, the execution preparation qualification of the pre-start execution instance is granted, and the formal execution position remains unchanged; when the pre-start execution instance is allowed, the formal execution position is updated to the step position of the next automated step, and the execution preparation position is updated according to the subsequent steps to be executed; when the pre-start execution instance is canceled, the formal execution position remains unchanged, and the execution preparation position is adjusted to the next step to be executed that has not been canceled.

[0009] Optionally, the step of preparing for the execution of the next automation step includes: According to the pre-startup connection object, allocate terminal execution resources to the pre-startup execution instance and establish a device session with the terminal corresponding to the next automation step; Extract target interface features and target operation conditions from the target interface operation of the next automation step, enter the target interface that matches the target interface features through the device session, and obtain the interface structure of the target interface; Based on the correspondence between the target operation conditions and the interface structure, the target operation object and its positioning result are determined, an interface data subscription channel for the target interface is established, and the initial interface state of the target interface is obtained. The pre-start execution instance, device session, expected execution location of the corresponding device role, initial interface state, location result and interface data subscription channel are organized into an execution preparation context. The execution preparation state is formed according to the execution preparation context. A status version identifier is configured for the execution preparation state. An operation blocking flag is set in the target interface operation distribution node.

[0010] Optionally, the step of releasing the pre-startup execution instance based on the verification result and the execution preparation status includes: Obtain the verification result of the current automation step, extract the expected verification status from the pre-startup connection object, and extract the expected execution position, initial interface status, positioning result, interface data subscription channel identifier and status version identifier of the corresponding device role from the execution preparation context; Obtain the current execution position of the device role corresponding to the next automation step, the current interface state of the target interface, and the current access status of the interface data subscription channel, and organize the verification result, current execution position, current interface state, and current access status into a release verification object; Determine whether the verification result matches the expected verification status, whether the current execution location matches the expected execution location, whether the target interface status remains valid, whether the location result remains valid, and whether the interface data access status is ready. Based on each determination result, determine whether the release verification object meets the release conditions. When the release verification object meets the release conditions, a one-time release flag is generated that is bound to the pre-start execution instance and the status version identifier. The operation blocking flag is released according to the one-time release flag. After the pre-start execution instance performs the target interface operation through the device session and according to the positioning result, the one-time release flag is updated to the used state.

[0011] Optionally, the step of determining whether the target interface state remains valid includes: Extract the interface identifier, business object identifier, target operation object attribute, interface structure version and occlusion status from the initial interface state, and form the initial interface state features according to the correspondence of each item in the target interface. Before releasing the pre-start execution instance, the current interface identifier, current business object identifier, current target operation object attribute, current interface structure version and current occlusion state are extracted from the current interface state to form the current interface state features, and an interface state change set is formed based on the difference between the current interface state features and the initial interface state features. Based on the interaction between each change in the set of interface state changes and the structural path, operable attributes, and occlusion state of the target operation object, it is determined whether the positioning result remains valid; if the positioning result remains valid, the current interface state is determined to be valid; if the positioning result fails, the current interface state is determined to be invalid, the execution preparation context is updated, the target operation object is repositioned, and a new state version identifier is generated.

[0012] Optionally, the step of canceling the pre-startup execution instance and blocking the advancement of subsequent automation steps includes: When the verification result indicates that the verification failed or the release verification object does not meet the release conditions, the automated steps that depend on the current automated step to pass the verification, the pre-start execution instance and the interface data subscription channel are determined according to the cross-role connection relationship and the step sequence to form a cancellation impact set; According to the cancellation impact set, the execution preparation qualification and target interface operation execution qualification of the pre-start execution instance are revoked; it is then checked whether the pre-start execution instance has been associated with a one-time release flag; if it has been associated with a one-time release flag, the one-time release flag is updated to an invalid state; the interface data subscription channel is closed and the terminal execution resources are released. Based on the updated role progress record corresponding to the cancellation impact set, the affected automated steps are removed from the pending execution steps, and the execution record corresponding to the pre-start execution instance is updated to the cancellation status, so that the task instance, terminal execution resources, role progress and execution record form a consistent cancellation result.

[0013] Optionally, the step of establishing the interface data subscription channel for the target interface includes: Assign a data source identifier and a channel generation identifier to the interface data subscription channel, and associate the data source identifier and channel generation identifier with the device role identifier, the pre-startup execution instance identifier, and the target interface identifier; receive the first interface data frame carrying the data source identifier, channel generation identifier, device role identifier, pre-startup execution instance identifier, target interface identifier, and frame sequence number; The identifiers carried in the first interface data frame are matched with the corresponding identifiers associated with the interface data subscription channel. When all identifiers match, the first interface data frame is associated with the execution preparation context, and the interface data access status is updated to the ready state. When any identifier does not match, the first interface data frame is determined to be an invalid data frame and discarded.

[0014] Optionally, the step of receiving the first interface data frame includes: Start the first frame wait timer for the channel generation identifier and record the correspondence between the first frame wait state and the pre-start execution instance; If the first interface data frame with a matching identifier is not received within the preset waiting time, the current channel generation identifier will be updated to an invalid state, the interface data subscription channel will be re-established, and a new channel generation identifier will be generated. A second first-frame wait is performed based on the new channel generation identifier, and only interface data frames carrying the new channel generation identifier are received to isolate data frames that arrive late from the original interface data subscription channel. If the second first frame wait still times out, switch to single frame acquisition mode; if the acquired single frame data matches the target interface, update the interface data access status to downgrade ready state; if the acquired single frame data does not match the target interface, update the execution preparation state to invalid state.

[0015] Optionally, the step of receiving interface data frames through the interface data subscription channel includes: A single interface data production instance is established for the same device session and channel generation, and consumption location identifiers are established for multiple interface data consumer objects, so that each interface data consumer object can share the interface data frame output by the interface data production instance according to the corresponding consumption location identifier. Based on the difference between the latest frame sequence number of the interface data production instance and the identifier of each consumption location, determine the range of frames to be processed corresponding to each interface data consumption object; based on the correspondence between interface data frames and the execution status of automated steps, determine the interface data frames to be retained from the range of frames to be processed. When the range of frames to be processed exceeds the preset range, the interface data frames that need to be retained are transferred to the corresponding step execution record, the remaining historical intermediate data frames are discarded, the latest interface data frame is provided to the corresponding interface data consumer object, and after the provision is completed, the corresponding consumption position identifier is updated to the latest interface data frame, and the frame sequence number range of the discarded data frames is recorded.

[0016] Optionally, the step of updating the execution record corresponding to the pre-start execution instance to a canceled state includes: Obtain the generation and usage status of the one-time release flag; if the one-time release flag is not generated or has been generated but not used, determine that the target interface operation has not been released, and query whether the pre-startup execution instance has formed an execution preparation snapshot; When an execution preparation snapshot has been formed, the execution record is updated to a cancelled state that has not been released, the execution preparation snapshot is retained, and the cancellation reason, status version identifier, and resource release result are associated with the execution preparation snapshot; If no execution preparation snapshot is created, a placeholder data dump record is generated that includes the step sequence, device role, execution preparation status summary, cancellation reason, and resource release result. According to the sequence of steps and the role of the equipment, the execution results, execution preparation snapshots and placeholder data dump records of each automation step are associated with the corresponding automation steps; for automation steps with pre-start execution instances, the association between the corresponding records and the pre-start execution instances is further established to form a multi-terminal automation execution report that distinguishes between execution completion, execution failure and cancellation without release.

[0017] Optionally, the step of updating the character progress record includes: When the role progress record, pre-start execution instance, or execution preparation status changes, a progress event is generated that includes the step sequence, device role, instance identifier, status identifier, preceding event identifier, and event sequence. The progress events are pushed and cached in the order of the events, and the order of the last confirmation events by each progress receiver is recorded. When the progress receiving end re-establishes a connection, it determines the event gaps according to the order of the last confirmed events and continuously replays the corresponding progress events; when the progress events corresponding to the event gaps have been cleared, it sends the current role's progress record and boundary events used to mark the starting point of subsequent events.

[0018] To achieve the above objectives, this application also provides a multi-terminal user interface automated collaboration system, including a collaboration control server and teacher terminals, student terminals, and parent terminals that are respectively communicatively connected to the collaboration control server. Each teacher terminal, student terminal, and parent terminal has a device role identifier and runs a corresponding user interface. The collaborative control server is used to obtain a multi-terminal automation step sequence, which includes multiple automation steps. Each automation step is configured with a step order, device role identifier, target interface operation, and result verification processing. The result verification processing is used to verify the execution result of the target interface operation in the same automation step. The collaborative control server is also used to route each automation step to the corresponding teacher terminal, student terminal or parent terminal according to the step sequence and device role identifier, so that the automation steps of the same device role are executed serially; and to determine the cross-role connection relationship between adjacent automation steps based on the role routing result and the step sequence. When the target interface operation of the current automation step is completed on the teacher terminal, student terminal, or parent terminal and the result verification process is not yet finished, the collaborative control server is used to establish a pre-start execution instance for the next automation step according to the cross-role connection relationship; the terminal corresponding to the next automation step is used to perform execution preparation and return the execution preparation result; the collaborative control server is used to form an execution preparation state according to the execution preparation result and control the pre-start execution instance to the pending release state before the execution of the target interface operation; The collaborative control server is also used to, based on the verification result of the current automation step and the execution preparation status, allow the pre-start execution instance to proceed when the verification is successful and the execution preparation status is valid, so that the corresponding terminal can perform the target interface operation of the next automation step; and cancel the pre-start execution instance when the verification fails or the execution preparation status is invalid, so that the corresponding terminal can cancel the execution preparation and block the advancement of subsequent automation steps.

[0019] Compared with the prior art, this application has at least the following beneficial effects: This application establishes a pre-start execution instance for the next automation step when the target interface operation of the current automation step is completed but the result verification process is not yet finished. This pre-start execution instance completes terminal execution resource allocation, device session establishment, target interface entry, target operation object location, and interface data access in advance. This ensures that the execution preparation time of the next terminal overlaps with the result verification time of the current automation step, reducing the waiting time caused by sequential switching between multiple terminals. Simultaneously, this application separates execution preparation eligibility from target interface operation execution eligibility. After the pre-start execution instance completes execution preparation, it remains in a pending release state. The target interface operation of the next automation step is only executed when the current automation step verification is successful, and the role execution location, target interface state, location result, and interface data access status all meet the release conditions. This avoids incorrectly advancing subsequent operations when the preceding operation verification fails or the execution preparation context becomes invalid.

[0020] Before release, this application compares the initial interface state during pre-startup with the current interface state, and determines whether the positioning result remains valid based on the interaction between interface changes and the structural path, operable attributes, and occlusion status of the target operation object. This reduces erroneous operations caused by page jumps, changes in business objects, or interface structure updates. In the event of verification failure or invalid execution preparation status, this application determines the set of cancellation effects along cross-role connections and step sequences. Based on this, it collaboratively revokes the execution qualification of the pre-startup execution instance, closes the interface data subscription channel, releases terminal execution resources, adjusts role progress, and blocks affected steps, ensuring consistency between task instances, terminal resources, and step states. Furthermore, it distinguishes between the interface data subscription channels before and after re-establishment using channel generation identifiers, and combines a single data production instance, consumption location identifier, and historical intermediate data frame cleanup mechanism to reduce data backlog caused by the mixing of invalid data frames and inconsistent processing speeds of multiple consumer objects.

[0021] This application generates an execution preparation snapshot or placeholder data dump record for the cancellation step based on whether the target interface operation is allowed and whether an execution preparation snapshot is generated. It then associates the execution result, cancellation reason, status version, and resource release result with the corresponding automation step according to the step sequence and device role. This allows multi-terminal automation execution reports to distinguish between different final states such as execution completion, execution failure, and cancellation without permission. Simultaneously, when the role progress, pre-start execution instance, and execution preparation status change, progress events with prior associations and event sequence are generated. After connection restoration, continuous replay is performed based on event gaps, thereby maintaining the correspondence between the multi-terminal automation execution progress and the actual step status, improving the integrity and traceability of the execution process. Attached Figure Description

[0022] Figure 1 This is a flowchart illustrating the collaborative processing method for multi-terminal interfaces provided in this application embodiment.

[0023] Figure 2 This is a schematic diagram illustrating an application scenario of the automated collaboration method for multi-terminal user interfaces provided in this application embodiment.

[0024] Figure 3 This is a schematic diagram of the structure of a multi-terminal user interface automated collaborative system provided in an embodiment of this application. Detailed Implementation

[0025] The specific embodiments of this application are described below with reference to the accompanying drawings. These embodiments are used to illustrate the technical means employed in this application and their specific execution process, and are not intended to limit the scope of protection of this application. Where there is no technical conflict, the technical features described in different embodiments can be combined with each other.

[0026] In this application, "multiple terminals" refers to multiple terminals that jointly participate in a user interface automation task and assume different device roles within that task. These multiple terminals can be terminals of different hardware types, terminals running different operating environments, or terminals logged in with different user identities but using the same hardware type. For example, in educational applications, multiple terminals may include teacher terminals logged into teacher accounts, student terminals logged into student accounts, and parent terminals logged into parent accounts. A device role indicates the operational responsibility undertaken by the corresponding terminal in this automation task; the same physical terminal can correspond to different device roles in different automation tasks.

[0027] See Figure 1 The collaborative processing method for a multi-terminal interface provided in this embodiment includes steps S1 to S4.

[0028] S1, Obtain a multi-terminal automation step sequence, which includes multiple automation steps. Each automation step is configured with a step order, device role identifier, target interface operation, and result verification processing. The result verification processing is used to verify the execution result of the target interface operation in the same automation step.

[0029] In step S1, the collaborative control server acquires the automation task definition data to be executed, parses multiple automation steps from the automation task definition data, and arranges the parsed automation steps according to their execution order to form a multi-terminal automation step sequence. The collaborative control server can be a server deployed in a local test network or a remote server connected to multiple terminals via a communication network. The automation task definition data can be submitted by a task editing terminal, generated from a pre-saved task template, or sent by the business test platform through a task interface.

[0030] After receiving the automation task definition data, the collaborative control server generates a task identifier for the current task execution process. The task identifier is used to associate the step configurations, terminal sessions, operation events, verification events, pre-start execution instances, interface data, and execution records within this task. For cases where the same task definition is executed multiple times consecutively, the collaborative control server also generates an execution batch identifier for each execution, enabling the data generated by the same automation steps in different execution batches to be distinguished.

[0031] A multi-terminal automation step sequence is a data set that specifies the sequential relationship in which multiple terminals complete user interface operations. Each automation step in this sequence corresponds to a single interface processing procedure that needs to be completed by a defined device role. An automation step is not a single click instruction, but rather a single interface processing procedure with a verifiable result as its basic unit, including at least the step sequence, device role identifier, target interface operation, and result verification processing. The collaborative control server assigns a step identifier to each automation step and uses this step identifier, along with the task identifier and execution batch identifier, as the basis for identifying the current execution process of that automation step.

[0032] The step sequence is used to indicate the execution position of an automated step within a multi-terminal automated step sequence. The step sequence can be a consecutive integer, a sortable string, or a composite value consisting of a stage number and a sequence number within that stage. The collaborative control server is not limited by the specific data form of the step sequence, as long as the step sequence uniquely determines the sequential relationship between the multiple automated steps participating in this execution.

[0033] When the automation task definition data directly specifies the step order, the collaborative control server generates the step order according to the arrangement. When the automation task definition data consists of multiple interconnected step nodes, the collaborative control server reads the sequential connections between the step nodes, expands the step nodes sequentially, and then generates the step order. For tasks with conditional branches, after the branch conditions are determined, the collaborative control server adds the step nodes in the selected branch to the current execution sequence and marks the step nodes in the unselected branches as not participating in this execution. Subsequent processing only determines the adjacency relationships for the automation steps that actually participate in this execution.

[0034] Device role identifiers are used to determine which type of terminal should perform automated steps. Device role identifiers can be role names, role numbers, or identifiers formed by a combination of business type and role type. Taking education as an example, device role identifiers can represent teacher roles, student roles, and parent roles respectively. The collaborative control server pre-stores role registration records, which record the device role identifiers and the terminals that can assume those roles.

[0035] The role registration record includes at least the device role identifier, terminal identifier, terminal connection address, operating environment type, target application version, login account type, and terminal availability status. The terminal identifier uniquely identifies the actual terminal; the terminal connection address establishes a communication connection between the collaborative control server and the terminal's automated execution program; the operating environment type determines the method for obtaining interface structure data and the format of operation instructions; the target application version checks whether the step configuration is suitable for the current application; the login account type confirms that the terminal has the permission to execute the corresponding business operations; and the terminal availability status indicates whether the terminal is online, idle, and capable of accepting tasks.

[0036] When a device role corresponds to only one available terminal, the collaborative control server directly identifies that terminal as the execution terminal for the corresponding automation step. When a device role corresponds to multiple available terminals, the collaborative control server reads the terminal selection criteria configured in the automation step. Terminal selection criteria may include a specified terminal identifier, operating environment type, application version, screen size, or account identifier. If only one terminal meets the terminal selection criteria, that terminal is identified as the execution terminal; if multiple terminals meet the criteria, the execution terminal can be selected based on terminal idle time, current number of tasks, or preset priority. The selection result is written into the step execution configuration for that automation step, and subsequent device sessions, interface data channels, and pre-start execution instances established for this step all use the same terminal identifier.

[0037] A target interface operation refers to an operation performed by a terminal with a corresponding device role on a user interface, and the result of this automated step is verified by a result verification process. A target interface operation includes at least a target page description, a target operation object description, an operation method, and operation parameters. The target page description determines which page the target interface operation should occur on; the target operation object description determines which interface object on that page receives the operation; the operation method determines what interactive action is performed on the target operation object; and the operation parameters provide the specific data required to complete the interactive action.

[0038] The target page description may include one or more of the following: application identifier, page route identifier, page controller identifier, window identifier, page title feature, or page root node feature. For web pages, the page route identifier can be formed by the stable route portion of the page address; for mobile applications, the page controller identifier can be formed by the active page class name or page instance type; when the internal page identifier cannot be directly obtained, the target page can be determined by the page title, fixed controls, and page layout features.

[0039] The target operation object description is used to identify the object to be operated on from multiple interface objects contained in the target page. The target operation object description can include control identifier, control type, display text, attribute values, structural path, characteristics of adjacent objects, image characteristics, and expected display area. If the control identifier exists and remains stable across different page refreshes, the control identifier is used first; if the control identifier does not exist or changes dynamically, the control type, display text, and structural path can be combined as identification criteria. For example, for a button displaying "Submit," the control type can be specified as "Button," and the parent object as the bottom container of the answer area, thus avoiding misidentification of other "Submit" text at the top of the page as the target operation object.

[0040] The operation mode specifies the interactive actions that the terminal automation execution program should perform on the target operation object. These actions can include clicking, double-clicking, long-pressing, swiping, dragging, text input, option switching, page return, or confirmation submission. In different operating environments, the same operation mode can be converted into different terminal execution instructions. For example, a click operation on a webpage can be converted into a click event on a page element, while a click operation on a mobile terminal can be converted into a touch event injection instruction. This conversion only changes the terminal expression of the instruction and does not change the target interface operation specified by the automation steps.

[0041] Operation parameters correspond to operation methods. Click operation parameters may include the number of clicks, click location, and press duration; text input operation parameters may include the text to be entered, whether to clear the original text before input, and whether to close the soft keyboard after input; swipe operation parameters may include the swipe start point, swipe end point, swipe direction, and duration; option switching operation parameters may include the target option value. Before issuing operation commands, the collaborative control server checks whether the operation parameters meet the data requirements of the corresponding operation method. If necessary operation parameters are missing, the automated step is identified as a configuration error, rather than sending an incomplete command to the terminal.

[0042] The target interface operation can also be configured with operation acceptance conditions and operation completion conditions. Operation acceptance conditions are used to check whether the target terminal has received and allowed the execution of the operation command, such as a valid device session, the target page being loaded, and the target operation object being visible and not obscured. Operation completion conditions are used to confirm that the terminal has completed processing of the operation command, such as an automated execution interface returning a success status, an input event being injected, text being written into the input box, or a swipe gesture ending. Operation completion conditions are only used to determine whether the target interface operation itself has been completed, and are not used to determine whether the business result generated by the operation meets expectations.

[0043] Taking the assignment posting process on a teacher's terminal as an example, the target page description points to the assignment editing page, the target operation object description points to the post button on the page, the operation method is clicking, and the operation parameters include one click and the click position within the button's valid display area. Once the teacher's terminal completes the click event, the operation completion conditions of the target interface are met. However, after clicking, the process may still be in the stage of posting request transmission or server processing; therefore, it cannot be determined that the assignment has been successfully posted solely based on the click completion.

[0044] Result verification processing is the process of checking the execution result corresponding to the target interface operation in the same automation step. Result verification processing includes at least the verification object, verification data source, expected result conditions, failure result conditions, verification duration, and verification output rules. The verification object is the page object or business object whose state should change after the target interface operation is executed; the verification data source determines where to obtain the current state of the verification object; the expected result conditions determine whether the target interface operation achieved the expected result; the failure result conditions identify explicit failure results; the verification duration limits the maximum time to wait for the result; and the verification output rules generate the verification result based on the inspection process.

[0045] The verification object can be the target page, a prompt control, a business status control, a page data object, a network response object, or a business status already received by the terminal application. For example, after a teacher clicks the publish button, the verification object can include the publish result prompt and the corresponding assignment publish status; after a student clicks the submit button, the verification object can include the submission completion page and the answer record status. A result verification process can be configured with one verification object or multiple verification objects.

[0046] The source of verification data corresponds to the type of verification object. When the verification object is a UI object, the terminal's automated execution program obtains the current attributes of the UI object through the interface structure reading interface, or obtains the page display content through page image recognition. When the verification object is business data already received by the terminal, the current state can be obtained from the application test interface, page data model, or network response monitoring records. The result verification process reads the data already formed after the target UI operation is executed, and does not create a verification pass result by modifying business data.

[0047] The expected result conditions describe the state that the verification object should meet after correctly completing the operation on the target interface. Expected result conditions can be: the page identifier equals the target result page identifier, a prompt control exists and its displayed text equals the expected text, the business status field changes from the first state to the second state, or multiple verification objects each meet their respective conditions. When multiple conditions are configured simultaneously, the combination relationship between conditions can be further configured. For example, if a successful release prompt appears and the job status is "released," the verification is considered successful; if either the successful release prompt or the job status is not met, the process continues to wait until the verification period expires.

[0048] Failure result conditions are used to identify explicit failures without waiting for the verification period to expire. For example, if a "Publish Failed" message appears on the page, the business status returns a rejection status, the terminal redirects to an error page, or the network response contains a specific error code, the verification process immediately generates a verification failure result. If no explicit failure result conditions are configured, a verification timeout result can be generated after the verification period expires if the expected result conditions are not met within the verification period.

[0049] After the result verification process begins, verification data is repeatedly acquired according to the verification cycle. Each acquired data entry records the collection time, data source identifier, and the identifier of the corresponding step. If the acquired data meets the expected result conditions, acquisition stops and a verification pass result is generated; if the data meets the failure result conditions, acquisition stops and a verification failure result is generated; if the verification time expires without meeting any termination condition, a verification timeout result is generated. The task configuration can categorize verification timeouts as verification failures, or retain an independent verification result type to distinguish between explicit failures and waiting timeouts in the execution report.

[0050] Result verification processing is bound to the target interface operation through step identifiers and execution round identifiers. Target interface operation instructions, operation completion events, verification data, and verification results all carry the same task identifier, step identifier, and execution round identifier. The collaborative control server only accepts verification results consistent with the current execution round. When an automated step is retried, the collaborative control server generates a new execution round identifier; verification results arriving late before the retry are not used to control the automated step after the retry due to the different execution round identifier.

[0051] In a specific data structure, the automation steps include: task identifier, step identifier, step sequence, device role identifier, target terminal selection criteria, target interface operation configuration, result verification configuration, step timeout duration, and step retry rules. The target interface operation configuration further includes the target application identifier, target page description, target operation object description, operation method, operation parameters, operation acceptance criteria, and operation completion criteria. The result verification configuration further includes the verification object description, verification data source, expected result criteria, failure result criteria, verification cycle, verification duration, and verification output rules.

[0052] After the collaborative control server forms a multi-terminal automation step sequence, it performs configuration checks. These checks include at least: verifying whether the order of the steps involved in this execution is unique and sortable; checking if the device role identifier has a corresponding role registration record; verifying whether the target interface operation has a clearly defined target page, target operation object, and operation method; verifying whether the result verification processing corresponds to the target interface operation in the same automation step; verifying whether the verification object can be obtained from the configured data source; and verifying whether the expected result conditions have executable comparison rules.

[0053] If the configuration check fails, the collaborative control server records the non-compliant step identifier and configuration fields, terminates the task, and proceeds to the formal execution process. If the configuration check passes, the collaborative control server writes the multi-terminal automation step sequence into the execution context of the task and proceeds to step S2. Through the above processing, step S1 outputs not only sequentially arranged step names, but also step data that can be directly executed by the collaborative control server and each terminal, with each target interface operation having a corresponding verification process.

[0054] S2, perform role routing according to the step sequence and device role identifier, so that the automation steps of the same device role are executed serially; determine the cross-role connection relationship between adjacent automation steps based on the role routing result and the step sequence.

[0055] In step S2, the collaborative control server takes the multi-terminal automation step sequence formed in step S1 as input and determines the role execution path to which each automation step belongs based on the device role identifier. Role routing refers to assigning each automation step in the multi-terminal automation step sequence to the corresponding device role and execution terminal, and establishing the step execution order within each device role. The output of role routing includes a role execution queue, a step-to-terminal correspondence record, and a role execution status record.

[0056] The collaborative control server first categorizes multiple automation steps according to device role identifiers. Automation steps with the same device role identifier are written into the same role execution queue, and then arranged in step order within that queue. Each queue item in the role execution queue includes at least the step identifier, step order, target terminal identifier, queue position, step execution status, and the identifier of the previous role-related step. The identifier of the previous role-related step indicates the preceding automation step that this automation step directly depends on within the same role execution queue.

[0057] For example, the multi-terminal automation step sequence includes, in sequence: step 1 executed by the teacher role, step 2 executed by the student role, step 3 executed by the student role, step 4 executed by the teacher role, and step 5 executed by the parent role. After role routing, the teacher role execution queue includes steps 1 and 4 in sequence, the student role execution queue includes steps 2 and 3 in sequence, and the parent role execution queue includes step 5. The preceding role step for step 4 in the teacher role execution queue is step 1, and the preceding role step for step 3 in the student role execution queue is step 2.

[0058] The role execution queue is used to serially execute automated steps for the same device role. Serial execution means that at any given time, at most one automated step in the same role execution queue will be qualified to perform the target interface operation. A subsequent role step cannot execute its target interface operation until the previous role step has been completed. "Completion" here means that the previous role step has reached a definite execution final state, not just that the verification has passed; if the verification of the previous role step fails, causing subsequent steps to be blocked, the subsequent role step will obtain a blocked final state, not the qualification to perform the target interface operation.

[0059] The collaborative control server can configure role execution locks for each role's execution queue. A role execution lock includes at least the device role identifier, the currently occupied step identifier, the lock state, the lock version, and the occupation start time. Before an automated step is authorized to execute a target interface operation, the collaborative control server checks if the corresponding role execution lock is idle, writes the step identifier of that automated step to the currently occupied step identifier, and updates the lock state to occupied. After the automated step completes result verification and writes the execution final state, the collaborative control server releases the role execution lock.

[0060] If two operation commands belonging to the same device role are requested for execution almost simultaneously, the collaborative control server, based on the step order and the previous role step identifier, only allows the automated step that is earlier in the queue and meets the prerequisites to occupy the role execution lock. The other automated step remains in an ineligible state. The target terminal can also maintain the current formal step identifier in the terminal's automated execution program, only accepting target interface operation commands that match the current formal step identifier, thus preventing concurrent interface operations for the same device role from occurring from both the server and terminal sides.

[0061] To record the execution progress of each device role, the collaborative control server establishes a role execution status record for each role's execution queue. The role execution status record includes at least the task identifier, execution batch identifier, device role identifier, role queue version, completed step position, formal execution step position, execution preparation step position, role availability status, and status version number.

[0062] The "Completed Step" position indicates the most recent automated step that has reached its final execution state for this device role. The "Executable Step" position indicates an automated step that has currently obtained the qualification to execute operations on the target interface; this position is empty if no automated step is currently executing. The "Execution Preparation Step" position indicates an automated step that has undergone edge-side preparation but has not yet obtained the qualification to execute operations on the target interface; this position is empty if no pre-start execution instance exists. The "Executable Step" and "Execution Preparation Step" positions can point to different steps, but their updates are both constrained by the step order in the same role's execution queue.

[0063] The role availability status indicates whether the corresponding device role has the terminal conditions to continue accepting and executing tasks. The collaborative control server determines the role availability status based on the target terminal's connection status, terminal task occupancy status, automated execution program heartbeat status, screen unlock status, and manual pause status. The role availability status is set to available when the target terminal is online, not occupied by other mutually exclusive tasks, and the automated execution program's heartbeat is normal and not paused; if any of these necessary conditions are not met, the role availability status is set to unavailable, and the terminal state causing the unavailability is recorded.

[0064] The role queue version represents the current structural version of the role execution queue. When a task has not yet been executed, the role queue version can be initialized to the first version. If the role execution queue changes during execution due to branch selection, step retries, terminal migration, or manual adjustments, the collaboration control server generates a new role queue version and retains a record of the changes between the old and new versions. The role order state formed by the pre-start execution instance is bound to the role queue version at the time the instance was created. If a change in the role queue version is detected before subsequent execution, it is necessary to recheck whether the instance is still in the correct execution position.

[0065] The status version number is used to control concurrent updates of role execution status records. After reading the role execution status record, the collaborative control server includes the read status version number in the update request. During an update, only if the status version number in the update request matches the current record will the new step position be written and the status version number incremented; if they do not match, it indicates that other events have already updated the role status, and this update request is rejected. The collaborative control server rereads the latest status before making a judgment to avoid the operation completion event, verification result event, and terminal disconnection event arriving simultaneously and overwriting each other.

[0066] After completing the role execution queue and recording the role execution status, the collaborative control server determines the cross-role connection relationship based on the role routing results and step sequence. The cross-role connection relationship refers to the step transition relationship between two adjacent automation steps in a multi-terminal automation step sequence, executed by different device roles. This relationship is used to determine which different device role's next automation step can be prepared for execution after the target interface operation of the current automation step is completed.

[0067] The collaborative control server traverses the automated steps that actually participate in the current execution in sequence. Each time, it reads the current automated step and the next automated step, comparing their device role identifiers. When the two device role identifiers are the same, they maintain a serial relationship through the identifier of the previous automated step in the corresponding role's execution queue, without establishing a cross-role connection relationship; when the two device role identifiers are different, the collaborative control server establishes a cross-role connection relationship with the previous automated step as the preceding step and the next automated step as the succeeding step.

[0068] Cross-role connection relationships include at least the following: relationship identifier, preceding step identifier, succeeding step identifier, preceding device role identifier, succeeding device role identifier, connection order, relationship version, and connection status. The relationship identifier uniquely identifies this cross-role connection; the connection order indicates the relationship's position in the multi-terminal automation step sequence; the relationship version corresponds to the current step sequence version and the role queue version; and the connection status records whether the relationship has triggered pre-start, whether a pending release instance has been formed, and whether it has ultimately been released or canceled.

[0069] The connection status can include not triggered, in pre-start processing, pending release, released, canceled, and completed. When establishing a cross-role connection relationship, the connection status is initialized to not triggered; after a pre-start execution instance is established for the subsequent step, it is updated to in pre-start processing; after the execution preparation is completed, it is updated to pending release; after the subsequent step obtains the qualification to operate on the target interface, it is updated to released; if the preceding step fails to verify or the execution preparation status is invalid, it is updated to canceled; and if the subsequent step has reached the execution final state, it is updated to completed.

[0070] Adjacent automated steps refer to two steps in the current execution path that are not separated by other automated steps to be executed, and the numerical order of the two steps is not required to be consecutive. For example, in three steps with the order 1, 2, and 3, if the branch to which step 2 belongs is not selected, then steps 1 and 3 can constitute adjacent automated steps in the current execution path. After the branch result is determined, the collaborative control server reconnects the steps involved in the execution and determines whether to establish a cross-role connection relationship based on the reconnected step order.

[0071] For steps executed in a loop, the step instances generated in each loop can be configured with a loop iteration identifier, and their adjacency relationships can be determined within the same loop iteration. Before the start of the next loop iteration, the step instances in the previous loop iteration have already reached their final state. Cross-role connections are recorded simultaneously with the loop iteration identifier to prevent events delayed in the previous loop iteration from triggering pre-start execution instances in the next loop iteration.

[0072] When automated tasks allow retries after failure, step retries do not directly reuse the execution state of the original cross-role connection relationships. The collaborative control server generates new relationship execution records for the new execution round and marks any pre-startup processes that have not yet been released in the original execution round as invalid. Therefore, the target interface operation completion event after a retry can only trigger the cross-role connection processes corresponding to the new execution round.

[0073] Step S2 outputs the role routing results and cross-role connection relationships. The role routing results answer "which terminal executes each automation step, and in what order within the same device role?"; the cross-role connection relationships answer "after the current automation step completes the target interface operation, which different device role's automation step can enter the pre-start preparation?" The subsequent step S3 uses both as a basis to check not only the global step order, but also the position of the subsequent step in the corresponding role's execution queue.

[0074] For example, a first cross-role connection is established between step 1 on the teacher's terminal and step 2 on the student's terminal. Steps 2 and 3 on the student's terminal belong to the same device role and do not establish a cross-role connection. A second cross-role connection is established between step 3 on the student's terminal and step 4 on the teacher's terminal. When the teacher's terminal executes step 1, the second cross-role connection does not yet have the triggering conditions, and the collaborative control server will not skip steps 2 and 3 on the student's terminal to prepare step 4 on the teacher's terminal in advance. Therefore, cross-role pre-start is still constrained by the complete multi-terminal automation step sequence.

[0075] S3, when the target interface operation of the current automation step is completed but the result verification process is not finished, a pre-start execution instance is established for the next automation step according to the cross-role connection relationship, the next automation step is prepared for execution, an execution preparation state is formed, and the pre-start execution instance is kept in a pending release state before the target interface operation is executed.

[0076] In step S3, the collaborative control server detects whether the current automation step has entered a state interval where the target interface operation has been completed but the result verification process has not yet ended. The starting point of this state interval is the moment when the terminal completes the target interface operation, and the ending point is the moment when the result verification process outputs the verification result. This application utilizes this state interval to prepare for the execution of the next automation step with different device roles, so that the connection, page, and interface data preparation process of the next terminal overlaps with the result verification waiting process of the current automation step.

[0077] After the terminal performs an operation on the target interface, the terminal's automated execution program generates an operation completion event. In one implementation, the terminal's automated execution program sends the operation completion event to the collaborative control server through the onActionDone callback interface. The operation completion event includes at least the task identifier, execution batch identifier, current step identifier, execution round identifier, device role identifier, terminal identifier, operation instruction identifier, operation completion status, and operation completion time.

[0078] The operation instruction identifier is generated by the collaborative control server when issuing operations to the target interface. It is used to distinguish different operation instructions generated during retransmission or retries of the same automated step. After the terminal's automated execution program completes instruction processing, it writes the original operation instruction identifier into the operation completion event. The collaborative control server only updates the operation status of the current step to operation completion when the operation instruction identifier matches the valid operation instruction for this round. Late events generated by historical instructions are written to the exception event log but do not change the current step's status.

[0079] When the result verification process begins, the collaborative control server sets the verification status of the current step to "Verification in Progress". The verification status remains "Verification in Progress" until the result verification process has output any of the following results: verification passed, verification failed, or verification timed out. When the collaborative control server processes the operation completion event, it reads the verification status of the current step; if the operation status is "Operation Completed" and the verification status is "Verification in Progress", it determines that the triggering conditions specified in step S3 are met.

[0080] If the result verification process has already output the verification result before the operation completion event arrives, there is no waiting interval where execution preparation and result verification overlap. In this case, the collaborative control server directly processes subsequent steps based on the verification result, without establishing an execution instance for the sake of formal pre-startup. If the result verification process has not yet started when the operation completion event arrives, the collaborative control server starts the result verification process first, and performs the trigger judgment after entering the verification state.

[0081] After confirming that the triggering conditions are met, the collaborative control server queries the cross-role connection relationships established in step S2 using the current step identifier, execution round identifier, and current relationship version. The query conditions also include a connection status of "not triggered" to avoid duplicate instance creation for the same operation completion event. Subsequent steps in the retrieved cross-role connection relationships are determined as the next automation step. If no matching cross-role connection relationship exists, it means there are no adjacent automation steps with different device roles after the current step, and the cross-role pre-startup processing in this step is not executed.

[0082] The collaborative control server establishes a pre-launch execution instance for the next automation step. A pre-launch execution instance is an executable record of a preparatory process performed before the next automation step is officially qualified for execution. One pre-launch execution instance corresponds to only one task, one execution batch, one next automation step, one execution round, and one target terminal. The collaborative control server generates a unique instance identifier for each pre-launch execution instance and associates this instance identifier with the terminal resources, device sessions, page states, target operation object location results, interface data channels, and execution records generated during the preparation process.

[0083] A pre-startup execution instance includes at least the following: task identifier, execution batch identifier, instance identifier, next step identifier, execution round identifier, successor device role identifier, target terminal identifier, instance status, creation time, validity period, prerequisite step identifier, and prerequisite verification processing identifier. The validity period limits the maximum time a pre-startup execution instance can maintain resource preparation. If the release conditions are not met after the validity period expires, the collaborative control server will determine the instance as a failed instance and initiate cancellation processing.

[0084] Instance status indicates the current processing stage of the pre-startup execution instance. Instance status can include: instance established, terminal preparing, session preparing, page preparing, object preparing, data preparing, pending release, released, cancellation in progress, cancelled, and completed. Each status has defined entry and exit conditions. For example, after the target terminal is allocated, it transitions from terminal preparing to session preparing; after the device session is established, it transitions to page preparing; after all necessary execution preparation items are completed, it transitions to pending release; and after receiving valid release control, it transitions to released.

[0085] The collaborative control server employs state versioning for instance status updates. Each status update carries the current version number of the pre-startup execution instance. Only when the version number matches the stored record is a new status written and the version number incremented. When a verification result event and a terminal disconnection event trigger a status update simultaneously, only the process that completed version verification first can write based on the old status. The other process needs to reread the new status to decide whether to allow or cancel the update, preventing the same pre-startup execution instance from simultaneously entering both the allowed and canceled states.

[0086] While establishing the pre-startup execution instance, the collaborative control server establishes a pre-startup connection record. The pre-startup connection record is used to store the release dependencies between the current automation step and the next automation step, and includes at least the cross-role connection relationship identifier, the current step identifier, the current step operation completion event identifier, the pre-verification processing identifier, the expected verification result, the next step identifier, the pre-startup execution instance identifier, and the target interface operation qualification status.

[0087] The target interface operation eligibility status is set to "not acquired" when the pre-startup execution instance is established. This status is distinct from the instance status: the instance status indicates the stage of preparation on the client side, while the target interface operation eligibility status indicates whether the instance is authorized to execute the interface operation that will produce the corresponding execution result in the next automation step. Even if the pre-startup execution instance has completed all execution preparations and entered the pending release state, its target interface operation eligibility status remains "not acquired."

[0088] The collaborative control server then prepares for the execution of the next automation step. Execution preparation refers to pre-forming the terminal connection conditions, page conditions, operation object conditions, and interface data conditions required to execute the target interface operation, without actually executing the target interface operation of the next automation step. Execution preparation is not a complete execution of the next automation step, nor does it generate the business results verified by the result verification process of the next automation step.

[0089] To ensure the execution preparation has executable boundaries, the operations of the next automation step are divided into preparatory processing and target interface operations. Preparatory processing ensures the target terminal reaches the state before executing the target interface operation, including terminal allocation, establishing a device session, launching the target application, entering the target page, displaying and locating the target operation object, and establishing interface data channels. The target interface operation is the operation configured in step S1, whose execution result needs to be verified by the result verification processing within the same automation step. The pre-startup execution instance performs the preparatory processing and stops before the target interface operation instruction is generated or issued.

[0090] The collaborative control server can identify preparatory processes based on the operation attributes in the step configuration. When the step configuration explicitly marks the operation attributes, operations with the preparatory attribute are executed by the pre-startup execution instance, while operations with the result generation attribute are identified as target interface operations. When the step configuration does not mark operation attributes, it can be determined based on whether the operation will submit business data, change the state of a business object, create or delete a business object, generate business notifications to other device roles, and whether there is a corresponding result verification process.

[0091] For example, launching the target application, entering the job list page, scrolling the job list to display the target job, and closing the prompt layer that does not involve business status can be considered as preparatory processing; whether clicking the "Start Answering" button of the target job belongs to preparatory processing needs to be determined based on whether the click changes the job status; clicking the "Submit Answering" button will submit business data and the result verification process will check the submission result, so it belongs to the target interface operation and cannot be executed before release.

[0092] The preparation process begins with terminal resource preparation. The collaborative control server obtains the target terminal identifier for the next automation step based on the role routing results, and reads the target terminal's online status, task occupancy status, automation execution program status, screen status, and target application installation status from the role registration record and terminal status record. If all necessary states meet the step requirements, a target terminal is allocated to the pre-launch execution instance; otherwise, it waits for the status to recover within the instance's validity period or selects another compatible terminal under the same device role according to the task configuration.

[0093] After allocating a target terminal to the pre-launch execution instance, the collaborative control server establishes a terminal resource occupancy record. This record includes the instance identifier, target terminal identifier, device role identifier, occupancy type, occupancy start time, occupancy duration, and mutual exclusion scope. The occupancy type is set to "preparation occupancy" during the execution preparation phase. The mutual exclusion scope specifies which terminal resources cannot be used simultaneously by other tasks during the preparation occupancy period, such as the same automation control channel, the same user account, or the same application window.

[0094] Preparing to occupy and officially executing to occupy have different permissions. Preparing to occupy allows the pre-startup execution instance to maintain the device session, read the interface state, and perform preparatory processing, but does not allow the execution of target interface operations; officially executing to occupy allows the instance to execute target interface operations after obtaining permission control. When a pre-startup execution instance is granted permission to execute, the coordination control server updates the occupation type from preparing to occupy to officially executing to occupy; when the instance is canceled, the preparing to occupy is updated to released.

[0095] Execution preparation also includes device session preparation. A device session is a communication context established between the collaborative control server and the target terminal's automated execution program for this task. It is used to send preparation commands, status acquisition commands, release commands, and cancellation commands, and to receive execution events returned by the target terminal. A device session includes at least a session identifier, task identifier, execution batch identifier, target terminal identifier, device role identifier, authentication status, connection status, command sequence number, most recent heartbeat time, and session validity period.

[0096] If the target terminal already has a device session that matches the current task and is in a valid connection state, the collaborative control server associates the device session with the pre-start execution instance. If no valid device session exists, the collaborative control server sends a session establishment request to the target terminal. After verifying the task identifier, terminal identifier, and session authentication data, the target terminal returns a session confirmation response; the collaborative control server generates a session identifier based on the session confirmation response, initializes the command sequence number, and begins heartbeat detection.

[0097] Command sequence numbers are used to maintain the processing order of control commands within the same device session. The collaborative control server increments the command sequence number for each control command sent, and the target terminal processes the command according to the sequence number. If a duplicate command sequence number is received, the original processing result is returned without re-execution. If a command that spans an unprocessed command sequence number is received, processing is suspended and a resend is requested. This process prevents network retransmissions or out-of-order transmissions from reversing the order of preparatory processing and subsequent release processing.

[0098] When a device session fails to establish, the execution preparation status record shows the failure stage, failure time, and connection error type. If the failure is due to a short-term network interruption and the pre-startup execution instance is still within its validity period, the session can be re-established a preset number of times. If identity verification fails, the target terminal does not belong to the corresponding device role, or the session is still not established after retries, the device session preparation result is determined as a failure.

[0099] After the device session is prepared, target page preparation is performed. The collaborative control server reads the target application identifier and target page description from the target interface operation configuration for the next automation step, and obtains the currently running application identifier and current page characteristics of the target terminal through the device session. If the target application is not running, an application start command is sent to the target terminal; if the target application is running but the target page is not displayed, a preparation navigation command is sent according to the page preparation path; if the target terminal has already displayed the target page, page navigation is not executed again.

[0100] A page preparation path is an ordered set of preparatory processes from the current page on the target terminal to the target page. Page preparation paths can be pre-configured in automation steps or selected based on the page relationship records of the target application. For example, the page preparation path from the application's homepage to the assignment list page could sequentially include clicking the "Learning" entry and then clicking the "Assignments" tab. After each preparatory navigation instruction is executed, the target terminal returns to the current page characteristics, and the collaborative control server confirms that the corresponding intermediate page has been reached before sending the next navigation instruction.

[0101] When a login failure page, version upgrade page, or permission prompt page appears in the page preparation path, the collaborative control server determines whether recovery can be achieved through preparatory processing based on preset processing rules. If recovery is possible, it performs actions such as re-login, disabling the upgrade prompt, or re-acquiring permissions, and continues page preparation. If the recovery operation requires changing the business status outside of this automated task or lacks necessary authentication data, the page preparation result is determined to be a failure.

[0102] Upon reaching the target page, the collaborative control server generates a page preparation record. This record includes at least the instance identifier, target application identifier, target page identifier, actual page identifier, page arrival time, page structure version, business object identifier, and page loading status. The actual page identifier is generated based on the page route, page controller, or page characteristics returned by the target terminal; the business object identifier confirms that the target page displays the specific business object that needs to be processed in the next automation step.

[0103] Page loading status is used to distinguish between the page container appearing and the page's business content being ready. If only the page root node is detected but the target business content is still loading, the page loading status remains "loading". Once the target business object and the necessary page content for identifying the target operation object are detected, the page loading status is updated to "completed". If the page is still loading after the specified preparation time, the page preparation result is determined to have timed out.

[0104] Execution preparation also includes the preparation of the target operation object. The target operation object is the interface object that will actually receive the target interface operation in the next automation step. The target terminal obtains the interface structure data of the target page through the interface structure reading interface. The interface structure data includes the hierarchical relationship between interface objects, as well as the control identifier, control type, text attributes, visibility attributes, operable attributes, and display area of ​​each interface object.

[0105] The collaborative control server searches for the interface object in the interface structure data according to the identification conditions included in the target operation object description in step S1. The identification process can be configured with a matching order based on stability: first, match the unique control identifier; if no unique result is obtained, combine and match the control type and display text; if multiple objects still exist, further compare the structure path, the container of the business object to which it belongs, the characteristics of adjacent objects, and the expected display area. When only one interface object meets all the necessary conditions, it is identified as the target operation object.

[0106] After locating the target operation object, the collaborative control server generates a target operation object location result. The location result includes at least the instance identifier, target operation object identifier, location features, structural path, associated business object identifier, display area, visibility status, operable status, obstruction status, location time, and interface structure version. The location features are used to re-check whether the object is still the same target operation object before allowing access; the interface structure version is used to determine whether the location result still corresponds to the current page structure.

[0107] When the target object is outside the scrollable area, the pre-start execution instance can perform a scrolling operation that does not produce a business result, bringing the target object into the display area, and then re-acquiring the interface structure data. If the target object is obscured by a normal tooltip and closing the tooltip will not change the business state, it can be repositioned after closing the tooltip. If a unique and operable target object cannot be obtained after a preset number of attempts, the object preparation result is determined to be a failure, and the last interface structure data or page image is saved as the failure criterion.

[0108] After page and object preparation are completed, the collaborative control server performs interface data pre-subscription. Interface data pre-subscription refers to establishing a data channel in advance to obtain page display data from the target terminal before the next automation step is authorized to execute the target interface operation. Interface data may include screen frame data, application window frame data, page structure snapshots, or a combination of screen frame and page structure data. Pre-subscription ensures that the monitoring terminal has available interface data when the next automation step officially begins and provides a data source for pre-release page status checks.

[0109] The collaborative control server sends a subscription request to the target terminal. The subscription request includes at least the task identifier, pre-startup execution instance identifier, target terminal identifier, target page identifier, data type, data quality parameters, and subscription validity period. The target terminal determines the interface data source based on the subscription request, establishes or reuses a data production channel for the data source, and returns the data source identifier, channel identifier, and channel generation identifier.

[0110] The data source identifier uniquely identifies the screen, application window, or page instance that generates the UI data. The channel identifier indicates the current data transmission connection. The channel generation identifier distinguishes the data channels before and after the reconstruction of the same subscription relationship; the channel generation is incremented each time a data production channel is re-established. The collaborative control server only accepts data with the same channel generation as the current subscription record; late data from older channels is discarded.

[0111] The collaborative control server establishes interface data subscription records, which must at least record the subscription identifier, instance identifier, target terminal identifier, data source identifier, channel identifier, channel generation identifier, target page identifier, subscription start time, last received time, and subscription status. Subscription status can include: requesting, waiting for first data, receiving, rebuilding, cancelled, and ended.

[0112] After the target terminal begins sending interface data, each interface data unit carries the target terminal identifier, data source identifier, channel generation identifier, data sequence number, acquisition time, and page identifier. When the collaborative control server receives the first interface data unit, it compares each of these identifiers with the interface data subscription record. If the target terminal, data source, channel generation, and target page all match, it is identified as the first valid interface data unit; otherwise, the interface data readiness status is not updated, and the server continues to wait for valid data from the current data channel.

[0113] The collaborative control server centrally writes the data generated from terminal resource preparation, device session preparation, target page preparation, target operation object preparation, and interface data pre-subscription into the execution preparation context. The execution preparation context is a data object uniquely corresponding to a pre-start execution instance, used to store the preparation basis required for subsequent release of that instance. The execution preparation context includes at least the terminal resource record, device session identifier, page preparation record, target operation object location result, interface data subscription record, initial interface state, state version identifier, and operation blocking flag.

[0114] The initial interface state indicates the pre-execution state of the target terminal when the pre-startup execution instance has completed the preparation of the target page and the target operation object. The initial interface state includes at least the target application identifier, target page identifier, business object identifier, page structure version, target operation object identity characteristics, structure path, display area, visibility state, operable state, and obscured state. The initial interface state does not store all page content that is unrelated to the target interface operation and is constantly changing; instead, it stores the interface features that affect the correct execution of the operation.

[0115] The status version identifier is used to mark the preparation status version corresponding to the execution preparation context. A first status version identifier is generated upon initial completion of execution preparation. Subsequent updates to the execution preparation context and generation of a new status version identifier occur when the target operation object is relocated due to a partial page refresh, the channel generation is updated due to data channel reconstruction, or the device session is re-established due to terminal reconnection. The target object location results and release criteria from the old status version are no longer used in the new version.

[0116] Operation blocking flags are used to ensure that the pre-startup execution instance cannot execute the target interface operation for the next automation step before obtaining the permission condition. When the collaborative control server establishes a pre-startup execution instance, it writes operation blocking flags into both the server-side instance record and the target terminal-side device session. If an operation blocking flag exists on the server side, no target interface operation execution instruction will be generated; if an operation blocking flag exists on the target terminal side, target interface operation instructions without a valid permission flag will not be accepted.

[0117] The collaborative control server forms an execution preparation state based on the execution preparation context. The execution preparation state is not all the raw data generated during the execution preparation process, but rather a set of states summarized from the raw data and used for subsequent release judgments. The execution preparation state includes at least the role order state, target page state, and interface data ready state, and may also include terminal resource state, device session state, and instance expiration state.

[0118] The role sequence status is determined based on the role queue version of the execution queue of the role in which the next automation step is located, the final execution state of the previous role step, the current position of the formal execution step, and the position of the execution preparation step. If the next automation step is located at the currently allowed preparation position in the corresponding role's execution queue, and there is no preceding step of the same role currently executing the target interface operation, the role sequence status is set to sequence match; otherwise, it is set to sequence mismatch.

[0119] The target page state is determined based on the page preparation record, the target operation object location result, and the initial interface state. The target page state is set to "Ready and Valid" when the actual page identifier matches the target page identifier, the business object identifier matches, the target operation object is uniquely visible and operable, and there are no obstructing objects preventing operation. If any necessary condition is not met, the state is set to "Ready and Invalid," and the specific invalid item is recorded.

[0120] The interface data readiness status is determined based on the interface data subscription record and the first valid interface data unit. When the first valid interface data unit matching the target terminal, target page, and current channel generation has been received, and the data channel is still in the receiving state, the interface data readiness status is set to "Ready." If no valid data has been received, it is set to "Waiting." If the subscription fails, the channel is closed, or the instance expires, it is set to "Invalid."

[0121] Once all necessary preparation items are completed, the collaborative control server updates the instance status of the pre-start execution instance to "pending release," updates the connection status of the corresponding cross-role connection relationship to "pending release," and writes the next automation step into the execution preparation step position in the role execution status record. At this point, the pre-start execution instance has met the end-side conditions for waiting for release, but the target interface operation qualification status is still "not obtained," and the operation blocking flag remains valid.

[0122] During the waiting period, the collaborative control server checks the device session heartbeat, target page liveness status, and the most recent reception time of the interface data channel according to a preset cycle. The check results are used to update the execution preparation status, but do not automatically remove the operation blocking flag. Until the result verification process of the current automated step is completed, regardless of how long the execution preparation status remains valid, the pre-start execution instance remains before the target interface operation.

[0123] S4. Based on the verification result of the current automation step and the execution preparation status, if the verification is successful and the execution preparation status is valid, the pre-start execution instance is allowed; if the verification fails or the execution preparation status is invalid, the pre-start execution instance is canceled and the advancement of subsequent automation steps is blocked.

[0124] In step S4, the collaborative control server receives the verification result output from the result verification processing of the current automation step, and determines whether the pre-start execution instance obtains the qualification to perform the target interface operation of the next automation step based on the verification result and the execution preparation status formed in step S3. Both allowing and canceling are applied to pre-start execution instances that have a pre-start connection record with the current automation step, and do not control the instance based on the verification results of other automation steps.

[0125] A verification result event is generated upon completion of the result verification process. The verification result event includes at least the task identifier, execution batch identifier, current step identifier, execution round identifier, result verification process identifier, verification result type, verification basis, result generation time, and verification data version. Verification result types include verification passed, verification failed, and verification timed out. The verification basis refers to the page state, business object state, or terminal response data used to generate the verification result, so as to subsequently confirm why the current automated step obtained the corresponding result.

[0126] The collaborative control server first checks the correspondence between the verification result event and the current automation step. If the task identifier, execution batch identifier, step identifier, execution round identifier, and result verification processing identifier all match the currently valid record, the verification result event is accepted. If any identifier is inconsistent, it is identified as a verification event for another task, another step, or a historical execution round, without changing the state of the current pre-startup execution instance.

[0127] The collaborative control server queries the pre-startup connection record based on the current step identifier and execution round identifier, and reads the pre-startup execution instance identifier and expected verification result from the pre-startup connection record. If multiple records are found, the server further filters the currently valid records based on the cross-role connection relationship identifier and relationship version. If no pre-startup connection record exists, the verification result is processed according to the normal step progression method, and the pre-startup instance is either allowed or canceled.

[0128] When a pre-startup execution instance is in the terminal preparation, session preparation, page preparation, object preparation, or data preparation stage, it indicates that result verification processing is completed before execution preparation. If the verification result is a failure, there is no need to wait for the remaining execution preparations; the ongoing preparation actions are directly aborted and cancellation processing begins. If the verification result is a pass, the necessary preparation actions can be waited for to complete within the validity period of the pre-startup execution instance; if the instance has not entered the pending release state by the expiration of the validity period, the execution preparation state will be determined as invalid.

[0129] When a pre-startup execution instance is in a pending release state, the collaborative control server establishes a release verification record. This record is used to fix the verification results and various preparation states used in this release decision within the same verification version. The release verification record includes at least the current step identifier, next step identifier, pre-startup execution instance identifier, pre-verification result, expected verification result, role sequence verification data, target page verification data, interface data channel verification data, status version identifier, verification start time, and verification result.

[0130] The collaborative control server first compares the pre-verification result with the expected verification result. The expected verification result in the pre-startup connection record is usually verification passed. When the verification result type is verification passed, the pre-verification condition is met; when the verification result type is verification failed or verification timeout according to the task rules, the pre-verification condition is not met. When verification timeout allows the current automation step to retry, the instance executed in this round of pre-startup is not carried over to the retry round. Instead, the instance in this round is canceled first, and a new instance is created after the current automation step retryes and re-enters the trigger interval of step S3.

[0131] After the pre-verification conditions are met, the collaborative control server sequentially checks the necessary states in the execution preparation state. This check does not simply read the state value saved at the end of step S3, but rather uses that state value as a benchmark, combined with the role execution state, target page state, and interface data channel state re-acquired during release, to determine its current validity. This prevents the pre-start execution instance from continuing to use expired preparation results due to state changes while waiting for verification results.

[0132] The validity check of the role sequence status involves comparing the role queue version, expected queue position, and previous role step identifier saved during pre-startup execution instance creation with the role execution status record read during release. The role sequence status is valid if the role queue version remains consistent, the next automation step is still in the execution preparation step position, the previous role step has reached an execution final state that allows continued progress, and no other steps are holding the corresponding role execution lock.

[0133] When the role queue version changes, the collaborative control server reads the role queue change record to determine whether the next automation step will maintain the same role step and queue position as the previous one. If a step is canceled, inserted before it by another step, migrated to another device role, or its previous role step enters a retry state, the role order status of the original pre-start execution instance becomes invalid. If only record fields are updated that do not affect the execution position of the next automation step, the pre-start instance can be associated with the new role queue version, and the role order check can be re-executed.

[0134] The validity check of the target page state is based on the initial interface state formed in step S3, and the current interface state at the time of release is retrieved again. The collaborative control server sends an interface state read command to the target terminal, and the target terminal returns the application identifier, page identifier, business object identifier, interface structure version, current attributes of the target operation object, and page occlusion data through the current device session. The collaborative control server uses the same field extraction rules as the initial interface state to form the current interface state.

[0135] The comparison items between the initial interface state and the current interface state should include at least the page identity, business object identity, target operation object identity, target operation object structural path, visibility state, operable state, and obscured state. Page identity is used to confirm that the target terminal has not redirected to another page; business object identity is used to confirm that the page still displays the business object corresponding to the next automation step; target operation object identity is used to confirm that the business meaning of the object to be operated on has not been changed; structural path is used to confirm that the original location result still points to the target object; the remaining states are used to confirm the conditions under which the object actually accepts interface operations.

[0136] During comparison, the collaborative control server can assemble each comparison item into an interface state feature sequence according to a fixed field order, and then normalize the feature sequence. Normalization includes standardizing text encoding, removing whitespace characters that do not affect object identity, converting Boolean states to fixed values, and scaling the display area according to the terminal screen size. A summary value is calculated from the normalized feature sequence to obtain the interface state fingerprint. When the interface state fingerprints are consistent, it indicates that the key interface features included in the comparison are consistent; when the fingerprints are inconsistent, the fields that have changed are further identified item by item.

[0137] This application does not require that all displayed content of the page be exactly the same as during pre-startup. Changes to the current time, loading progress animation, non-target area carousel content, or other display content that does not affect the target interface operation do not directly invalidate the target page state. The collaborative control server determines the state validity based on whether the changed fields affect the target interface operation.

[0138] The target page state is valid when both the page identifier and the business object identifier are consistent, the target operation object still has the same stable identifier, remains visible and operable, and its effective operation area is not covered by other interface objects. The target page state is invalid when the page has been redirected, the business object has been switched from the first object to the second object, the target operation object has disappeared, the target operation object has been disabled, or a pop-up window obscures the target operation area.

[0139] When the target operation object's structural path changes but its stable identifier and business affiliation remain unchanged, the collaborative control server can perform relocation. Relocation uses the current interface structure data and the target operation object identification conditions saved in step S3 to re-search for the target operation object. After finding a unique object, its control type, displayed text, affiliated business object, and operation semantics are compared; if all match the original target operation object, the target operation object location result is updated.

[0140] When relocation causes a change in the location criteria, the collaborative control server generates a new status version identifier and writes the updated location result, the current interface status, and the status version identifier into the execution preparation context. Unused clearance flags generated based on the old status version are set to invalid. After relocation, the visibility, operability, and occlusion status are checked again; if all conditions are met, the target page status is restored to valid; if relocation fails or multiple objects cannot be uniquely selected, the target page status becomes invalid.

[0141] Occlusion status can be determined through interface hierarchy and hit tests. Occlusion is confirmed when the target terminal obtains an interface object that overlaps with the display area of ​​the target operation object and has a higher display hierarchy, or when a non-operational hit test is performed on the target operation location and the topmost object is not the target operation object. If the occluded object belongs to a local prompt layer that can be safely closed, preparatory closure processing can be performed and the current interface state can be re-acquired; if the occluded object involves business confirmation or a closure operation that may change the business state, it will not be automatically closed during the release check, and the target page state will be determined as invalid.

[0142] The validity check of the interface data readiness status is performed by querying the current status of the data channel using the target terminal identifier, data source identifier, channel identifier, and channel generation identifier in the execution preparation context. The interface data readiness status is valid if the data channel remains open, the difference between the most recent received time and the current time does not exceed the preset data interval, and the most recently received interface data unit corresponds to the same target terminal, the same data source, the same channel generation, and the same target page.

[0143] When the target terminal application window is rebuilt, the screen data source is switched, or the interface data production program is restarted, the original data channel may stop or a new channel generation may be generated. If the current channel generation is inconsistent with the channel generation in the execution preparation context, the new channel data will not be directly assigned to the old execution preparation state. The collaborative control server will set the interface data ready state to pending reconstruction, re-establish the subscription according to the interface data subscription record, and wait for the first valid interface data unit of the new channel.

[0144] If channel reconstruction is completed within the validity period of the pre-startup execution instance, and the first valid UI data unit of the new channel corresponds to the current target page, the collaborative control server updates the UI data subscription record, status version identifier, and UI data readiness status, and performs another target page status check. If channel reconstruction fails, the first data unit does not match the target page, or the instance validity period expires, the UI data readiness status becomes invalid.

[0145] When device sessions and terminal resources are configured to the necessary state, the collaborative control server simultaneously checks whether the device session heartbeat is valid, whether the terminal resource usage record still belongs to the current pre-startup execution instance, whether the target terminal maintains a connection, and whether the instance's validity period has expired. If a device session has been disconnected but can be restored within the validity period, the session is re-established and the current page state is re-acquired; if the displayed page does not match the initial interface state after the session is restored, it is still treated as an invalid target page state.

[0146] If the pre-verification conditions are met, and the role sequence status, target page status, interface data ready status, and other necessary configuration statuses are all valid, the collaborative control server will determine the execution preparation status as valid. If any necessary status is invalid, the execution preparation status will be determined as invalid, and the invalid status name, initial value, current value, comparison rule, and invalid reason will be written into the release verification record.

[0147] Once verification is successful and the execution preparation status is valid, the collaborative control server allows the pre-launch execution instance to proceed. This approval means updating the target interface operation qualification status of the pre-launch execution instance from "not obtained" to "obtained," removing the operation blockade corresponding to that instance, and enabling the target terminal to execute the target interface operation already configured in the next automation step. To avoid duplicate approvals due to network retransmissions or concurrent events, the collaborative control server generates a one-time approval marker for this approval.

[0148] A one-time release flag includes at least the task identifier, execution batch identifier, next step identifier, next step execution round identifier, pre-start execution instance identifier, role queue version, status version identifier, channel generation identifier, flag sequence number, generation time, and expiration time. The flag sequence number is unique within the same pre-start execution instance. The collaborative control server can generate integrity verification data based on the above fields and send the integrity verification data along with the one-time release flag to the target terminal.

[0149] The one-time release flag is bound to the status version used during release verification. Before sending the release flag, the collaborative control server checks again whether the pre-startup execution instance is still in the pending release state, and atomically updates the target interface operation qualification status to release in progress. If the instance has already entered cancellation processing or the status version has changed, the original release flag is not sent, and the status judgment is re-executed.

[0150] After receiving the clearance message, the target terminal checks whether the next step identifier matches the local waiting step based on the device session verification task identifier and the pre-start execution instance identifier. It also checks whether the role queue version, status version identifier, and channel generation identifier match the local preparation context, and whether the tag sequence number has already been used. If all checks pass and the current time has not exceeded the expiration time, the target terminal writes the tag sequence number to the used tag record, removes the operation blocking tag, and accepts the target interface operation command.

[0151] The writing of used marker records and the acceptance of target interface operation commands employ a non-repeatable state transition. The target terminal first updates the release marker from an unused state to a used state, and then writes the target interface operation into the local command execution queue. When the same release message arrives again, since the marker sequence number already exists in the used marker record, the target terminal returns a duplicate message response without writing the target interface operation again. This prevents the target button from being clicked repeatedly or the same business data from being submitted repeatedly.

[0152] After accepting the target interface operation, the target terminal sends a release acceptance event to the collaborative control server. The release acceptance event includes the instance identifier, next step identifier, tag number, acceptance time, and local instruction number. Upon receiving the release acceptance event, the collaborative control server updates the instance status of the pre-start execution instance to "released," updates the target interface operation qualification status to "used," updates the cross-role connection status to "released," and writes the next automation step into the formal execution step position of the corresponding role's execution status record.

[0153] The next automation step then executes its target interface operation and generates a verification result according to the result verification process configured in step S1. If the target interface operation of the next automation step is completed but its result verification process is not yet finished, and if there is a cross-role connection relationship that meets the conditions, then the next automation step becomes the new current automation step, and steps S3 and S4 continue to be executed. Thus, the multi-terminal automation step sequence advances step by step according to the same control method.

[0154] When the current automated step verification fails, the collaborative control server cancels the pre-start execution instance. Cancellation means revoking the target interface operation qualification that has not yet been obtained or used, stopping the pre-start execution instance from continuing to wait for release, and clearing the associated resources established by the instance during the execution preparation phase. Since the operation blocking flag remains valid until release, the cancellation process targets the preparation context where the target interface operation has not been performed, and does not require the reversal of already performed business operations.

[0155] If the current automated step verification passes but the execution preparation status is invalid, the pre-start execution instance will also be canceled. For recoverable states such as short-term refresh of the target page or short-term interruption of the interface data channel, a re-preparation can be performed according to the configuration; after the re-preparation forms a new state version, a validity check will be performed again. If the re-preparation fails, the instance validity period expires, or the invalidity reason does not allow recovery, the process will proceed to cancellation.

[0156] Before canceling, the collaborative control server checks the target interface operation eligibility status and one-time release flag status of the pre-start execution instance. If the target interface operation eligibility has not yet been obtained, or if a release flag has been generated but the target terminal has not yet accepted it, the release flag is set to invalid and a cancellation command is sent. If the target terminal has already recorded the release flag as used, it indicates that the target interface operation has entered the formal execution process. It will no longer be canceled as an unreleased instance, but will be terminated or recorded as a failure based on the actual execution status of the next automated step.

[0157] To determine the steps and resources that need to be synchronized for cancellation processing, the coordination control server establishes a cancellation impact set. The cancellation impact set includes at least the pre-startup execution instance to be cancelled, the next automated step corresponding to that instance, subsequent automated steps that depend on the execution result of the next automated step, interface data subscription records, terminal resource usage records, device session association records, unused release flags, and step execution records.

[0158] The scope of dependencies for subsequent automated steps is determined based on the sequence of multi-terminal automated steps and cross-role connections. The collaborative control server starts from the next automated step after the cancellation, searching sequentially for steps that require successful verification of the cancelled step, and adds these steps to the cancellation impact set. Automated steps that are independent branches and whose execution conditions do not depend on the cancelled step are not added to the cancellation impact set. Therefore, the blocking scope is consistent with the actual step dependencies.

[0159] After the cancellation impact set is formed, the collaborative control server atomically updates the instance status of the pre-start execution instance to "Cancellation in Progress," updates the target interface operation eligibility status to "Revoked," and invalidates any unused one-time allowance flags. Upon receiving the cancellation command, the target terminal retains the operation blocking flag, clears the local waiting queue of any commands corresponding to the pre-start execution instance that have not yet been executed, and returns a cancellation confirmation event. The cancellation confirmation event includes the instance identifier, the local last instance status, the allowance flag usage status, and the last processing time.

[0160] The collaborative control server revokes the UI data subscription based on the cancellation impact set. When the UI data channel is used only by the instance to be cancelled, a stop production request is sent to the target terminal, and the channel is closed upon receiving a stop confirmation. When the UI data channel also provides data to other data users, only the subscription consumer corresponding to that instance is deleted, and the shared production channel is not closed. UI data already received during the preparation phase is retained according to the execution record rules, and no new UI data is received.

[0161] The collaborative control server also releases pre-occupied resources based on terminal resource usage records. If a device session still needs to be used by other automated steps on the same terminal, the association between the instance and the device session is severed, but the device session is retained. If the device session only serves the canceled instance, a session close command is sent to the target terminal and the session is released. Temporary caches, page data buffers, and resource leases created during preparation are released when they are no longer referenced by other instances.

[0162] For subsequent automated steps in the cancellation impact set, the collaborative control server updates the step execution status to "progress blocked" and records the identifier of the preceding step that caused the blockage and the identifier of the pre-start execution instance. The role execution status records of each device role are updated synchronously: the cancelled instance is removed from the execution preparation step position, the corresponding role's execution lock remains idle, and subsequent dependent steps do not enter the formal execution step position.

[0163] Once the target terminal returns a cancellation confirmation, and all necessary subscriptions and resources have been revoked, the collaborative control server will update the instance status of the pre-start execution instance to "cancelled." Cancellation reasons may include pre-verification failure, pre-verification timeout, invalid role order status, invalid target page status, invalid target operation object, invalid interface data channel, invalid device session, unavailable target terminal, or expired instance validity period. The cancellation reason and its corresponding status comparison data are written to the instance execution record.

[0164] In step S4, the verification result of the current automated step is not only used to mark the current step as successful or unsuccessful, but also to control whether the pre-start execution instance connected to it obtains the qualification to operate the target interface of the next automated step. The execution preparation status does not only indicate that the preparation action has been completed, but also determines whether the preparation result is still applicable after review during release. When both are satisfied, the next automated step is executed; if either is not satisfied, the unreleased preparation is canceled and the corresponding subsequent steps are blocked.

[0165] Preferably, this embodiment further explains the binding method between the pre-start execution instance and the pre-verification process, as well as the role progress maintenance method. After receiving the operation completion event of the current automation step, the collaborative control server obtains the task identifier, current step identifier, execution round identifier, and operation completion event identifier from the event, and obtains the result verification processing identifier according to the step execution configuration of the current step. Subsequently, it obtains the next step identifier and the successor device role identifier according to the cross-role connection relationship, and combines the above data to form a pre-start associated object.

[0166] The pre-startup associated objects include a preceding event area and a subsequent control area. The preceding event area includes the current step identifier, operation completion event identifier, result verification processing identifier, expected verification result, and current verification status. The subsequent control area includes the next step identifier, subsequent device role identifier, pre-startup execution instance identifier, target interface operation qualification status, and association validity period. The preceding event area answers which verification process controls this pre-startup, and the subsequent control area answers which pre-startup execution instance is controlled by that verification process.

[0167] After the collaborative control server forms a pre-startup association object, it sets the target interface operation qualification status to locked. Locking means that even if the device session, target page, target operation object, and interface data preparation have been completed for the next automation step, the target interface operation cannot be executed. The locked state can only be released by a verification result that matches the result verification processing identifier in the pre-startup association object and belongs to the same execution round. Verification pass events from other steps cannot release this locked state.

[0168] When the current automation step includes multiple verification items, the pre-startup associated object also includes a set of verification items and verification combination relationships. Each item in the verification item set records the verification item identifier, verification object, expected value, current value, and verification item status. The verification combination relationship can specify that a verification pass result is formed after all necessary verification items pass, or it can specify that at least one of the first and second verification items must pass and the third verification item must pass. The collaborative control server first forms a unique verification result for the current step based on the verification combination relationship, and then processes subsequent control areas based on this unique verification result, avoiding multiple verification items from repeatedly releasing the same instance.

[0169] Operation completion events may arrive at the collaboration control server multiple times due to network retransmissions. To prevent duplicate creation of pre-startup associated objects, the collaboration control server uses an idempotent key consisting of the task identifier, current step identifier, execution round identifier, and operation completion event identifier. Before creating a pre-startup associated object, it checks if the same idempotent key already exists; if it does, it returns the original object identifier and continues to use the original pre-startup execution instance, without creating a second instance; only if it does not exist is a new object written.

[0170] After the verification process is completed, the collaborative control server writes the verification result to the pre-event area and checks whether the pre-startup associated object is still valid. If the verification passes and the object is valid, the subsequent control area is submitted to step S4 for execution preparation status verification; if the verification fails, the target interface operation qualification status is updated from locked to revoked; if the object has expired, even if the verification result is passed, the lock is not directly released, but the original pre-startup execution instance is determined to be expired.

[0171] To maintain the step progression position for the same device role, the role execution status record, in addition to the completed step position, the officially executed step position, and the execution preparation step position, may also include the most recently finalized step identifier, the next executable step identifier, the status update time, and the status update reason. The most recently finalized step identifier is used to locate the last completed, failed, or blocked step for this role; the next executable step identifier is calculated based on the role's execution queue and the global step progression position.

[0172] When a pre-startup execution instance is established, the collaborative control server does not modify the positions of completed steps or formally executed steps; it only writes the next step identifier to the execution preparation step position. This write indicates that the next automation step has occupied the preparation position for this role, but does not mean that it has started operating on the target interface. When the pre-startup execution instance enters the pending release state, the execution preparation step position remains unchanged, and the status update reason is written as execution preparation completed.

[0173] When a pre-startup execution instance is allowed, the coordination control server first checks that the role's execution lock is idle and that the execution preparation step position still points to the next step. Then, it moves the next step identifier from the execution preparation step position to the formal execution step position, and simultaneously updates the target terminal's preparation holding to the formal execution holding. This migration is completed using the same state update transaction, avoiding the step from existing in both the preparation and formal positions simultaneously.

[0174] After the next automated step passes verification, the collaborative control server moves it from the position of the formal execution step to the position of the completed step, and calculates whether the next step in the corresponding role's execution queue meets the execution conditions. If the next step is still constrained by other role steps in the global step sequence, only the next executable step identifier is updated, and the target interface operation is not executed immediately.

[0175] When a pre-startup execution instance is canceled, the coordination control server clears the execution preparation step position and writes the cancellation reason into the status update reason. When subsequent dependent steps of the canceled step are blocked, the canceled step is not written into the completed step position. Instead, the most recent final state step identifier is pointed to that step, and the final state type is recorded as "cancelled without permission". The role progress record is thus distinguished into four states: completed, in formal execution, only completed execution preparation, and canceled due to the failure of preconditions.

[0176] After the role execution status record is updated, the collaborative control server generates a role progress event. A role progress event includes at least the task identifier, device / role identifier, role queue version, step position before update, step position after update, triggering step identifier, triggering event identifier, and update time. Subsequent execution reports and task monitoring can reconstruct the progress of each device / role based on the role progress event, without having to infer intermediate changes solely from the final step status.

[0177] Preferably, this embodiment further explains how the data in the execution preparation context is formed, and how the release verification record uses the data to determine whether the execution preparation status is valid.

[0178] The execution preparation context uses the pre-startup execution instance identifier as the primary index and stores the execution preparation results using five types of fields: resource data, page data, object data, channel data, and control data. Resource data includes the target terminal identifier, terminal resource usage record, and device session identifier; page data includes the target application identifier, target page identifier, business object identifier, page structure version, and page loading status; object data includes the target operation object's identity characteristics, structure path, display area, visibility status, operable status, and obscured status; channel data includes the subscription identifier, data source identifier, channel identifier, channel generation identifier, and the first valid data sequence number; and control data includes the role queue version, status version identifier, operation blocking flag, and instance validity period.

[0179] All data written to the execution preparation context carries the generation time and the generation subject. For page identifiers, interface structures, and display areas directly obtained from the target terminal, the generation subject record is the target terminal; for business object identifiers, interface state fingerprints, and state version identifiers formed by the collaborative control server based on multiple raw fields, the generation subject record is the collaborative control server. The generation time is used to determine whether different data belong to the same page state, avoiding the use of page identifiers and target object coordinates obtained too far apart to form the preparation result.

[0180] The collaborative control server can set a maximum time difference for data preparation. If the time difference between the generation of page structure data and the target operation object location result does not exceed the maximum time difference, they are considered to belong to the same page state; if the time difference exceeds the maximum time difference, the page structure data is re-acquired and the target operation object is located. If the time difference between the generation of the first frame of the interface data and the page preparation record is too large, the page identifier in the first frame is further checked; only if it still corresponds to the target page is it written into the execution preparation context.

[0181] The execution preparation context is managed holistically using state versions. State version V1 is generated after all necessary fields are written initially. If the target page is reloaded, the target operation object is relocated, the device session is rebuilt, or the interface data channel is rebuilt, state version V2 is created, referencing still-valid resource fields and replacing changed fields. State version V1 is retained for execution records but is no longer used as the basis for release.

[0182] At the start of the release verification, the collaborative control server sets a short-term verification lock on the currently valid state version. This lock prevents other processing from simultaneously rewriting the execution preparation context during verification. After setting the lock, the server reads the role execution state, the current interface state, and the current channel state. Once read, each current state and its version identifier are written to the release verification record. If a terminal state change event is detected during verification, the event is first written to a waiting queue. After completing the verification, the server determines whether the verification result is still usable based on the event's occurrence time.

[0183] The role order verification data in the release verification record includes the expected role queue version, the current role queue version, the expected preparation step position, the current preparation step position, the final state of the previous role step, and the role execution lock state. The output role order is valid when all of the above fields meet the preset relationship; otherwise, the output role order is invalid, and the specific non-compliant field is recorded.

[0184] The target page validation data includes the initial interface state, the current interface state, and a set of interface changes. The collaborative control server compares the page identity, business object identity, target object identity, structural path, visibility status, operability status, display area, and occlusion status item by item, and writes the changed items into the interface change set. Each change item includes a field name, initial value, current value, change type, and operation impact result.

[0185] Change types can include non-impact changes, recoverable changes, and invalid changes. Updates to non-target text on the page are considered non-impact changes; changes to the target operation object's structural path due to a partial page refresh but still relocation are considered recoverable changes; changes to the business object identifier or replacement of the target operation object are considered invalid changes. The output target page state is valid only when there are no invalid changes in the set of interface changes and all recoverable changes have been restored.

[0186] Channel verification data includes the expected data source identifier, current data source identifier, expected channel generation, current channel generation, most recent data sequence number, most recent data reception time, and most recent data page identifier. The output interface is in a data-ready state when the channel is in receiving mode, the generation is consistent, the most recent data has not exceeded the maximum silence duration, and the page identifier is consistent. If the channel silence duration exceeds the threshold but the connection is not broken, a data probe request can be sent; upon receiving a probe response, the most recent reception time is recalculated.

[0187] After all verifications are completed, the collaborative control server generates a joint verification result. The joint verification result includes at least the results of the pre-verification conditions, the role order verification result, the target page verification result, the channel verification result, the joint result, and the joint result generation time. If all individual results configured as necessary conditions are valid, the joint result is "allow"; if any necessary condition is invalid, the joint result is "reject".

[0188] When the combined result indicates permission to pass, the collaborative control server generates a one-time release flag based on the version field in the release verification record. After the combined result is generated but before the one-time release flag is sent, if there is a status change event in the waiting queue that occurred before the combined result was generated, the status change event is processed first, and the current combined result is invalidated. If a status change event occurs after the release flag has been sent and accepted by the target terminal, the status processing rules for the next automated step are followed.

[0189] When the combined result is a rejection, the release verification record retains each verification data item and the reason for rejection. Rejection reasons that can be re-prepared trigger a new status version, and a new release verification record is created after re-preparation; rejection reasons that cannot be re-prepared directly trigger cancellation. Therefore, each release or cancellation has complete, unique, and verifiable verification evidence.

[0190] Preferably, this embodiment further explains the pre-subscription of interface data, confirmation of the first valid interface data, and channel anomaly recovery during execution preparation. The following description uses screen frame data as interface data; interface structure snapshots or other page state data can use the same identifier matching and generational control method.

[0191] The collaborative control server generates a frame stream pre-subscription request based on the target terminal identifier and target page identifier for the next automation step. The frame stream pre-subscription request includes the task identifier, pre-startup execution instance identifier, target terminal identifier, target screen or window identifier, target page identifier, frame format, expected frame rate, resolution parameters, subscription validity period, and first frame wait time. The target terminal determines the actual image data source based on the target screen or window identifier.

[0192] The target terminal assigns a producer identifier to the screen data source. The producer identifier distinguishes between the screen capture process or the window capture process that actually generates frame data. If the target terminal already has a producer that captures data from the same screen data source with compatible parameters, it can reuse the existing producer; otherwise, a new producer is started. Regardless of whether a new producer is created or a reused producer is used, the target terminal returns the channel identifier and channel generation identifier for this transmission relationship.

[0193] The channel generation identifier can be set to 1 when the channel is first established. The channel generation increments when the channel is re-established due to network interruption, producer restart, target window reconstruction, or subscription self-recovery. Each frame data unit contains the target terminal identifier, producer identifier, channel identifier, channel generation identifier, frame sequence number, acquisition time, page identifier, and data checksum in its frame header.

[0194] After receiving frame data, the collaborative control server first checks whether the target terminal identifier matches the target terminal of the pre-startup execution instance, and then checks whether the channel identifier and channel generation match the current frame stream subscription record. Frame data with inconsistent identifiers are not entered into the frame buffer of the current instance. If the data checksum is incorrect or the frame data cannot be parsed, the corrupted frame is recorded and the server continues to wait for subsequent valid frames.

[0195] After the identifier check passes, the collaborative control server confirms whether the frame data corresponds to the target page. The page identifier can be directly reported by the target terminal along with the frame data, or it can be generated by the collaborative control server after identifying fixed areas of the page and target page features from the frame data. If the frame data corresponds to the target page and the collection time is no earlier than the page preparation completion time, it is determined as the first valid frame. If only data is received but the page is still the application launch page or another page, the interface data readiness status is not updated to ready.

[0196] The first valid frame confirmation record includes at least the pre-startup execution instance identifier, producer identifier, channel generation identifier, first frame sequence number, first frame acquisition time, first frame reception time, target page identifier, and first frame storage location. After the first frame is confirmed, the interface data ready status in the execution preparation state is updated from waiting to ready. The first frame can also be written as an execution preparation snapshot into the step execution record.

[0197] The timer starts from the moment the target terminal returns the channel confirmation message. If the first valid frame is not confirmed within the first frame waiting time, a first frame timeout event is generated. The first frame timeout event includes the target terminal identifier, producer identifier, original channel generation, number of frames received but failing the check, last error type, and timeout duration. The collaborative control server performs a channel self-recovery based on the first frame timeout event.

[0198] When the channel resumes operation, the coordination control server first marks the original channel generation as invalid and sends a command to the target terminal to stop the original channel. If late frames still arrive on the original channel, the coordination control server does not write the late frames into the current frame buffer because its channel generation has already expired. After receiving the target terminal's confirmation of the original channel's termination or waiting for the termination confirmation for a limited time, the coordination control server sends a new pre-subscription request.

[0199] The target terminal checks if the image data source still exists based on the new pre-subscription request. If the image data source exists, the producer can be restarted or an already restored producer can be reused, but a new channel generation identifier must be generated. The coordination control server writes the new channel identifier and the new channel generation into the frame stream subscription record and restarts the first frame wait. Only frame data carrying the new channel generation participates in the second first frame confirmation.

[0200] This embodiment limits the number of automatic channel self-recovery attempts to one. If the second first frame wait still times out, the channel will not be rebuilt indefinitely to avoid the pre-startup execution instance occupying the target terminal and network resources for an extended period. The collaborative control server selects either single-frame degradation or directly invalidates the interface data ready state based on the task configuration.

[0201] When using single-frame degradation, the collaborative control server sends a one-time page snapshot request to the target terminal. The target terminal obtains a page image from the current screen or window and carries the target terminal identifier, page identifier, acquisition time, and status version identifier in the snapshot response. If the snapshot corresponds to the target page and the acquisition time is after the current status version is formed, the snapshot is used as the degradation interface data, and the interface data ready state is set to degradation ready.

[0202] When the release rule allows for a downgraded ready state, step S4 can perform a target page status check based on the single-frame snapshot, but mark this step as not having obtained a continuous frame stream in the execution record. When the release rule requires continuous frames, or when even a single-frame snapshot has not been obtained, the interface data ready state is set to invalid and the pre-start execution instance is canceled.

[0203] During channel operation, the collaborative control server also checks for frame loss based on the frame sequence numbers of consecutive frames. When the difference between the current frame sequence number and the previous frame sequence number is greater than 1, the range of lost frame sequence numbers is recorded. If a small number of intermediate frames are lost but the critical page status can still be determined from subsequent frames, the channel is not directly invalidated; if no data is received for more than the maximum allowed number of consecutive frames, data verification fails consecutively, or the page identifier of the most recent frame changes, the channel status is updated to abnormal, and a readiness status review is triggered.

[0204] Preferably, this embodiment illustrates how to reduce repeated data collection and process the differences in processing speed between different users when the interface data of the same target terminal is used by multiple data users.

[0205] The target terminal establishes an interface data producer for the same screen or application window. The interface data producer acquires continuous frame data according to the acquisition parameters, writes each frame into a shared frame buffer, and assigns a monotonically increasing frame sequence number to each frame. The shared frame buffer stores frame data within the most recent preset number or the most recent preset duration according to the frame sequence number.

[0206] Data users can include pre-startup execution instances, production execution instances, real-time monitoring endpoints, and execution log handlers. Each data user establishes a consumer record in a shared frame buffer. The consumer record includes at least a consumer identifier, a corresponding task identifier, a required data source identifier, a read cursor, an acknowledgment cursor, a consumption status, and an allowed backlog. The read cursor indicates the next frame number to be read, and the acknowledgment cursor indicates the maximum consecutive frame number that has been processed.

[0207] After the interface data producer generates a new frame, it does not copy the complete acquisition process for each data user separately. Instead, it notifies each consumer of the new frame sequence number. Consumers retrieve the required frame data from the shared frame buffer based on their own read cursors. Thus, the real-time monitoring terminal, the pre-startup instance, and the execution log processing program can share the same data producer while maintaining their own independent consumption progress.

[0208] When a consumer's processing speed is slower than its frame generation speed, a backlog forms between its read cursor and the latest frame sequence number. The collaborative control server subtracts the consumer's confirmation cursor number from the latest frame sequence number to obtain the number of backlogged frames. If the number of backlogged frames does not exceed the consumer's allowed backlog, data continues to be provided sequentially according to frame sequence number; if it exceeds the allowed backlog, backpressure processing is performed on the consumer without pausing the interface data producer.

[0209] Backpressure processing first identifies key frames from the backlog area. Key frames include frames corresponding to the start of an automated step, the completion of the target interface operation, the generation of verification results, the entry of a pre-start execution instance into the pending release state, and the change of release or cancellation status. The collaborative control server selects key frames from the frames with the closest acquisition time based on the occurrence time of the step event and writes the key frame sequence number into the step execution record.

[0210] For consecutive intermediate frames between keyframes where the page state has not substantially changed, the reference can be removed from the slow consumer's pending range. Deleting the reference does not immediately remove the frame data in the shared frame buffer; it remains if other consumers still need the frame. The cooperative control server moves the slow consumer's read cursor to the next reserved keyframe or the latest allowed read position and records the skipped frame sequence number range.

[0211] Page change frames can be determined based on image differences between adjacent frames, changes in page identifiers, or changes in interface structure versions. Even if the frame does not correspond to a step event, it can still be retained as a keyframe as long as it indicates a jump to the target page, the appearance of a pop-up window, or a change in the state of the target operation object. Thus, backpressure processing reduces intermediate duplicate frames while retaining page evidence that affects step execution and state judgment.

[0212] If a consumer remains unresponsive for an extended period, its consumption status is set to paused, and new frame notifications are stopped. Upon resumption, the recovery method is determined based on whether the data following its acknowledgment cursor still exists in the shared frame buffer. If the data still exists, it continues from the next retained keyframe; if the data has been evicted from the buffer, the latest keyframe and the data gap range are sent to the consumer, enabling it to resume from the current page state without requiring the interface data producer to roll back its data collection.

[0213] When a pre-startup execution instance is canceled, the consumer record corresponding to that instance is deleted. Frames in the shared frame buffer are retained if referenced by other consumers; they are released when no consumers reference them and the record retention period has expired. When no consumers exist on the target terminal, the interface data producer is shut down. Therefore, canceling a single pre-startup execution instance will not incorrectly interrupt interface data being used by other monitoring terminals or execution instances.

[0214] Preferably, this embodiment further illustrates how to implement consistent cancellation processing among steps, instances, terminal resources, interface data, and execution records when verification fails or the execution preparation state is invalid.

[0215] After the collaborative control server determines that the pre-startup execution instance needs to be cancelled, it generates a cancellation transaction identifier for this cancellation process. The cancellation transaction identifier is written to each object in the cancellation impact set and is used to identify whether terminal cancellation, subscription revocation, resource release, and record update belong to the same cancellation process. A cancellation transaction includes at least the following processing stages: cancellation initiation, qualification revocation, terminal confirmation, subscription revocation, resource release, step blocking, and record finalization.

[0216] The cancellation initiation phase records the direct cause and corresponding data that triggered the cancellation. If the direct cause is a failure of pre-verification, record the current step identifier, result verification processing identifier, verification result type, and verification basis. If the direct cause is an invalid execution preparation state, record the invalid state name, initial value, current value, and release verification record identifier. The cancellation reason data remains unchanged during subsequent processing to avoid resource release errors overwriting the initial technical reason that caused the cancellation.

[0217] During the qualification revocation phase, the qualification status of the target interface operation in the pre-startup associated object is set to revoked, and the unused release flag bound to the pre-startup execution instance is set to invalid. The collaborative control server sends the invalidation flag sequence number to the target terminal. The target terminal writes the invalidation status into its local release flag record, and even if the release message sent before the invalidation is late, the target interface operation will be rejected because the flag has become invalid.

[0218] When the target terminal processes a cancellation command, it checks the local instance status. If the instance is still in the preparation or pending release stage, it stops the ongoing preparation command, retains the operation blocking flag, deletes the unexecuted target interface operation command, and returns an unexecuted confirmation. If the instance has already accepted a valid release flag, it returns to a released status. The collaborative control server does not record the instance as a cancelled operation that has not been released, but instead proceeds to the formal steps to terminate processing and continue to determine whether the target interface operation actually occurred.

[0219] During the subscription cancellation phase, the consumer identifier, channel identifier, and producer identifier are located based on the subscription records in the interface data. If the consumer is the only consumer of the producer, data writing is stopped first, then the producer is closed and the frame buffer is released; if other consumers exist, only the consumer in this instance is removed and the reference count is updated. After the subscription cancellation is completed, the subscription status is updated from "Cancelling" to "Cancelled," and the sequence number of the last received frame is recorded.

[0220] The resource release phase processes resources according to their dependencies. First, ongoing page state reads and object location requests are stopped. Then, the association between the pre-startup execution instance and the device session is severed. Finally, the terminal's pre-occupancy and the instance's exclusive cache are released. If the device session is still being used by other instances in the same task, it is not closed; only the association count is reduced. The session is closed only when the association count is zero and no subsequent steps require the terminal.

[0221] Preparation-type processing may leave the target terminal stuck on a specific target page. Whether the original page is restored after cancellation is determined by the task configuration. If restoration is required, the preparation context saves the application identifier and page identifier before page preparation, and the target terminal restores to the original page according to the secure return path. If the restoration path involves business submission or security cannot be confirmed, restoration is not performed automatically; only resource occupation is released and the terminal's last page state is saved in the cancellation record. Whether the page is restored or not does not affect the final state of "target interface operation not executed" after cancellation.

[0222] The step blocking phase processes the next automated step and its dependent steps based on the set of cancellation impacts. The next automated step corresponding to the cancelled pre-start execution instance is marked as a cancellation that has not been allowed; subsequent automated steps that depend on this step and pass verification are marked as preceding step blocking. Each blocking step's record contains the direct blocking source step identifier and the root cancellation transaction identifier, allowing tracing back to the initial cancellation reason from any subsequent step.

[0223] When a single cancellation transaction involves multiple device roles, the coordination control server updates the execution status records for each role. Positions in the preparation stage are cleared, dependent steps that have not yet been executed are not moved to the formal execution stage, and role execution locks are not occupied by invalid steps. If a device role still has an independent execution branch that does not depend on the cancelled step, the decision to continue that branch is made based on the branch configuration, and all roles are not mechanically stopped due to the cancellation transaction.

[0224] The final state recording phase generates defined execution final states for pre-startup execution instances and related automated steps. The final states of pre-startup execution instances include released, cancelled due to lack of release, or cancelled due to preparation failure; the final states of automated steps include execution completed, verification failed, execution failed, cancelled due to lack of release, or blocked by the preceding step. Each final state name and final state code corresponds one-to-one, and execution reports are aggregated according to the final state codes, without inferring step states from natural language text.

[0225] The collaborative control server establishes a step execution record for each automation step. The step execution record includes at least the task identifier, execution batch identifier, step identifier, step sequence, device role identifier, target terminal identifier, step start time, target interface operation completion time, verification completion time, verification result, execution final state, and execution basis reference. When associated with a pre-start execution instance, it also includes the instance identifier, preparation start time, pending release time, release tag generation status, release tag usage status, and canceled transaction identifier.

[0226] The execution reference is used to associate interface data, interface structure snapshots, terminal responses, and verification data generated during the execution of a step. Interface data does not need to be fully embedded in the step execution record; it can save the data storage identifier, keyframe number, and acquisition time. Based on the execution reference, the original data can be retrieved from the corresponding storage location to verify the page state before and after the target interface operation and when the verification result is generated.

[0227] When a pre-startup execution instance has acquired its first valid UI data during the execution preparation phase, the collaborative control server writes that data or its storage reference as a preparation snapshot into the step execution record. If the pre-startup execution instance has not acquired any UI data before being canceled, the collaborative control server generates placeholder execution data. Placeholder execution data is not a forged page image, but a record object with a uniform data structure that explicitly indicates that no page snapshot was generated in this step.

[0228] Placeholder execution data must include at least the task identifier, step identifier, pre-start execution instance identifier, placeholder type, cancellation reason, cancellation time, and pre-verification result identifier. The placeholder type is set to "No execution snapshot generated." When the execution report reads this placeholder type, it displays that this step did not generate a screen because it was not allowed to proceed or preparation failed; blank data is not interpreted as a report generation error.

[0229] If a pre-startup execution instance has already generated process records such as "Preparing" or "Screen connected" before cancellation, the collaborative control server does not delete these process records. Instead, it appends the cancellation final state to the same instance record and rewrites the final state displayed in the report as "Cancelled." This preserves the fact that execution preparation actually occurred while clearly indicating that the target interface operation was ultimately not allowed.

[0230] After a multi-terminal automated task is completed, the collaborative control server merges the step execution records of each device role according to the step sequence. The merging process prioritizes step identifiers and step order, supplemented by device role identifiers and target terminal identifiers, and does not directly sort by the time each terminal's records arrive at the server. Even when there are clock discrepancies between different terminals, the business execution order specified in the automated step sequence is still maintained.

[0231] The generated multi-terminal automated execution report should at least display the step sequence, device role, target terminal, target interface operation, verification result, execution final state, key time, and execution basis for each automated step. Completed steps display the target interface operation and verification result; failed verification steps display the basis for the failed verification; canceled steps that were not approved display the result of the preceding verification or the reason for the invalid status; blocked preceding steps display the root canceled transaction and directly dependent steps.

[0232] Therefore, the cancellation status in the report clearly indicates that the automated step was not omitted, nor was it a normal failure after the target interface operation was performed; rather, its pre-start execution instance did not obtain permission to proceed before the target interface operation. Placeholder execution data keeps the report structure complete, and process and final status records together maintain the traceability of cancellation processing.

[0233] Preferably, this embodiment describes how the monitoring terminal continuously obtains the progress of multi-terminal automated tasks, and how to recover missing events after the monitoring connection is interrupted.

[0234] The collaborative control server generates task progress events when preset changes occur in the status of automated steps, pre-start execution instances, role execution status, or interface data channel status. A task progress event includes at least the event identifier, task identifier, event sequence number, preceding event identifier, event type, step identifier, device role identifier, status value, occurrence time, and event data summary.

[0235] Event identifiers are unique within the same task execution batch. Event sequence numbers are monotonically increased by the collaborative control server according to the order in which events are written. The preceding event identifier points to an event that was confirmed to have been written before the current event. The collaborative control server first writes task progress events to the event cache or event storage before pushing them to the monitoring end, avoiding the inability to resend events due to connection interruptions before they are persisted.

[0236] Event types can include step start, target interface operation completion, result verification start, verification passed, verification failed, pre-start setup, execution preparation completed, pending release, released, cancellation start, cancellation complete, role location update, interface data connection, and interface data interruption. The event data summary stores the key fields required for this type; for example, the cancellation completion event stores the cancellation reason and the number of affected steps.

[0237] The monitoring end can receive task progress events through an event connection sent by the server. When establishing a connection, the monitoring end sends the task identifier and the local last confirmation event identifier. If the last confirmation event identifier does not exist for the first connection, the collaborative control server sends the current task snapshot and new events after the snapshot; if the connection already has a historical confirmation position, it searches for events after the last confirmation event in the event storage and sends them sequentially according to the event sequence number.

[0238] Upon receiving an event, the monitoring terminal checks if the preceding event identifier matches the last local event. If they match, the event is applied and an acknowledgment is returned; if they do not match, it indicates an event gap. The monitoring terminal sends a gap request to the collaborative control server, which includes the last local event identifier and the currently received event identifier. The collaborative control server then retransmits the events in the missing interval according to their sequence numbers.

[0239] During connection interruptions, the collaborative control server continues to generate and save task progress events, ensuring that automated tasks are not paused due to the lack of a monitoring terminal. Upon reconnection, the monitoring terminal carries the identifier of the last acknowledgment event before the disconnection, and the collaborative control server resends subsequent events. Resendable events and real-time events use the same data structure, and the monitoring terminal processes them uniformly according to their event sequence numbers.

[0240] When the event cache exceeds its retention period and the last event requested by the monitoring end has been cleared, the collaborative control server sends state recovery data. State recovery data includes the current multi-device automation task status, the role execution status records of each device role, the current formal execution step, the current pre-start execution instance, the boundary event of the most recent step, and the event baseline sequence number. The monitoring end overwrites its local task status with the state recovery data and then continues to receive new events from the event baseline sequence number onwards.

[0241] Step boundary events refer to events that define a task stage, such as the start of a step, the completion of a step's execution state, or the release or cancellation of a pre-started instance. Selecting the most recent step boundary event as the basis for recovery avoids sending only an intermediate frame stream state without the corresponding step context. The monitoring end reconstructs the step positions of each role based on the recovery data and distinguishes between the formal execution, execution preparation, pending release, and cancelled states on the interface.

[0242] Preferably, this embodiment describes several abnormal situations that may occur during execution and their corresponding handling, so that the aforementioned technical solution remains executable in actual environments such as terminal connection, page refresh, step retry and task pause.

[0243] If the target terminal disconnects during the pre-startup execution, the collaborative control server determines the disconnection time based on the device session heartbeat and updates the device session status and interface data ready status to invalid. If there is still recovery time before the instance's validity period expires, the pre-startup execution instance remains in a recovery waiting state, and an attempt is made to re-establish the device session. After the target terminal reconnects, it reports the local application identifier, page identifier, current waiting instance identifier, and operation blocking flag status.

[0244] If the target terminal still retains the same pre-start execution instance and the operation blocking flag is valid, the collaborative control server reacquires the page state, relocates the target operation object, and rebuilds the interface data channel to form a new state version. If the target terminal has been restarted or no local instance record exists, the original device session, the original location result, and the original channel data are all invalid; the collaborative control server decides to re-execute from the terminal resource preparation stage or cancel the original pre-start execution instance based on the remaining validity period.

[0245] When the target page automatically refreshes during the pending release period, the target terminal can generate a page change event based on the page structure version change. The collaborative control server will mark the execution preparation state as pending review, but will not immediately cancel the instance. After the refresh is complete, if the page identifier and the business object identifier are consistent, the target operation object will be relocated and the status version updated; if the business object changes or the target operation object no longer exists, the target page status will be updated to invalid.

[0246] When configuring retries for the current automation step, a new execution round identifier is used for each retry. The pre-startup execution instance corresponding to the original execution round is first canceled, and its device session and page positioning results are not directly bound to the new execution round. A new instance is created after the new execution round meets the conditions of step S3. If the underlying resources such as device sessions are still valid, they can be reused after the ownership update is completed, but the execution preparation context and state version must be re-formed.

[0247] When a multi-terminal automated task is manually paused, the collaboration control server stops establishing pre-start execution instances for new cross-role connections. Instances already in the execution preparation phase stop navigation and object location and maintain the current security page; instances already in the pending release state retain the operation blocking flag. If the pause duration exceeds the resource retention period, the pre-start execution instance is canceled and resources are released according to the reason for task pause.

[0248] When a task resumes, the collaborative control server rereads the multi-terminal automation step sequence, role execution status records, and current terminal status. If the page or terminal status remains unchanged during the pause, the original execution preparation status can be re-verified; if the status has changed, preparation can be re-executed or canceled according to the task configuration. Task resumption itself does not constitute a successful pre-verification; the verification result of the corresponding current automation step is still required to determine whether to allow the task to proceed.

[0249] When the current automated step verification passes and the pre-startup instance status invalidation event arrives almost simultaneously, the collaborative control server processes the event according to its occurrence time and instance status version. If the status invalidation event occurs before the release verification data collection, the preparation status is invalidated; if it occurs after the one-time release tag has been accepted by the target terminal, the next automated step has already entered the formal execution phase, and the exception is handled according to the formal step. If the order of events cannot be determined, a conservative approach is adopted, which involves not executing the target interface operation, invalidating the original release tag, and re-verifying it.

[0250] When the same device role corresponds to multiple terminals and the original target terminal fails, the next automation step can be migrated to the backup terminal. Before migration, the pre-start execution instance and interface data subscription on the original terminal are canceled, a new pre-start execution instance is created for the backup terminal, and the device session, target page, target operation object, and interface data preparation are completed again. The location results, status version, and release flags of the original terminal are not transferred to the backup terminal.

[0251] The interface data in this application is not limited to continuous video frames. In scenarios with high network bandwidth requirements, differential images generated when the page changes can be used; in scenarios where the page state can be fully represented by the interface structure, interface structure snapshots can be used; in scenarios where it is necessary to check both visual display and control properties simultaneously, page images and interface structure data can be combined into the same interface data unit. Regardless of the data format used, the correspondence between the data and the pre-launch execution instance is confirmed through the target terminal identifier, data source identifier, channel generation, and page identifier.

[0252] Result verification is not limited to checking single-page controls. Combined verification results can be generated based on the interface status, the business responses received by the application, and the status of business objects in the test environment. However, each verification data must be associated with the same automation step and the same execution round. The combination rules are predetermined in the step configuration and the verification criteria cannot be changed temporarily after obtaining an unfavorable result.

[0253] In scenarios where real-time monitoring of the screen is not required, the execution preparation state can omit setting the continuous interface data channel as a necessary condition, and instead use the current page structure snapshot returned by the target terminal as the basis for interface data readiness. In this case, step S4 still checks the role sequence state and the target page state, and checks whether the page structure snapshot was obtained within the current state version. This alternative method does not change the control relationship where the pre-startup execution instance remains pending release before the target interface operation.

[0254] In scenarios where the target interface operation itself does not produce external business side effects but changes the local page state, it is still treated as a target interface operation requiring verification according to the configuration steps. Whether execution is allowed during pre-startup is not solely based on whether the operation can be undone, but rather on whether the operation belongs to the next automated step that is verified by the result verification process. This maintains the stability of step boundaries and avoids inconsistent judgments on "rollback capability" across different terminals.

[0255] The above implementation method uses a collaborative control server to centrally perform role routing and release judgment as an example. In other implementation methods, the task control node can be responsible for the step sequence and verification results, while the terminal control node can be responsible for device sessions and page status. The two exchange control data through instance identifiers, status version identifiers, and one-time release flags. As long as the pre-verification results and execution preparation status are jointly verified before release, and unreleased instances are revoked when conditions are not met, it still falls under the implementation method of the technical solution of this application.

[0256] Preferably, this embodiment further explains the configuration and usage of the time limits, retry counts, and data retention parameters involved in the aforementioned execution process. Each parameter can be pre-configured according to terminal performance, network status, and service application response time, and is not limited to a fixed value, but the parameter must be determined and written into the task execution context before the corresponding process begins.

[0257] The step timeout duration limits the maximum time an automated step can take from obtaining formal execution eligibility to reaching its final execution state. The step timeout duration can be further divided into target interface operation acceptance time, target interface operation completion time, and result verification time. If the target terminal does not confirm the acceptance instruction within the operation acceptance time, the collaborative control server checks the device session and command sequence number; if the target interface operation does not return an operation completion event within the completion time, an operation execution timeout is recorded; if no pass or fail result is generated within the result verification time after the operation is completed, a verification timeout result is generated.

[0258] The validity period of a pre-startup execution instance is calculated from the instance creation time and is used to limit the maximum time that resources are occupied by the combined execution preparation and pending release status. This period should not be shorter than the reasonable time to complete the necessary execution preparation, nor should it indefinitely cover the exception verification wait of the current automated step. When the instance validity period expires, the collaborative control server first obtains the current verification status and instance status: if the current step has failed verification, it is canceled according to the pre-verification failure; if the current step is still under verification, it is canceled according to the instance expiration; if the current step has passed verification but the execution preparation is not completed, it is canceled according to the execution preparation timeout.

[0259] The device session establishment retry count is used to handle short-term communication errors. After the first session establishment fails, the coordination control server records the failure time and error type, and sends the session establishment request again after waiting for the retry interval. If the error type is identity verification failure, terminal role mismatch, or target application missing, no meaningless retries are performed, and the device session preparation is directly determined to have failed. If the error type is connection timeout or short-term network disconnection, retries are performed within the maximum number of retries.

[0260] Page preparation time limits the time from application startup or the start of page navigation until the target page is fully loaded. When the target page is reached through multiple intermediate pages, a single-step timeout can be set for each page navigation, as well as the total timeout for the entire page preparation path. After a single-step timeout, the collaborative control server saves the current page identifier and page image, determines whether it is still on the previous page, has reached an error page, or the page is loading, and then performs a single-step retry or terminates page preparation based on the error type.

[0261] The target object locating count is used to prevent continuous scrolling or repeated reading of the interface structure when the target object does not exist. Each locating attempt saves the interface structure version and the used identification conditions. If multiple reads return the same interface structure version and the target object is not found, the locating attempt is not repeated using the same conditions. After the page structure changes or safe scrolling is completed, locating can be attempted again on the new interface structure version. When the maximum number of locating attempts is reached, an object preparation failure result is generated.

[0262] The initial valid interface data waiting time is calculated from the moment the target terminal confirms the establishment of the data channel. If a frame data that does not match the target page is received before this time expires, the system continues to wait but records the number of mismatches; if no data is received at all, the channel is recorded as silent; if corrupted data is received, data verification failure is recorded. Each of these three situations can trigger a channel self-recovery, but different failure types are retained in the self-recovery record to distinguish between page not switching, no network data, and data format errors.

[0263] The status check cycle is used to update the liveness status of the device session, target page, and interface data channel during the pending release period. The status check cycle should not be shorter than the time required for the target terminal to stably return a status. During the check, only lightweight fields that do not change the business status are read, such as session heartbeat, page identifier, business object identifier, and last frame time; the complete interface structure and target operation object attributes are obtained only when changes to lightweight fields are detected or the current step verification is passed.

[0264] The validity period of a one-time release tag is calculated from the time the release tag is generated and is shorter than the remaining validity period of the pre-startup execution instance. If the target terminal does not return a release acceptance event within the validity period of the release tag, the coordination control server queries the target terminal's tag usage status. If the terminal confirms that it is not used, the original tag is invalidated and the execution preparation status is rechecked; if the terminal confirms that it has been used but the acceptance event is lost, the pre-startup instance is restored to the released state according to the local instruction sequence number returned by the terminal, and the release tag is not regenerated.

[0265] The cancellation confirmation duration limits the waiting time for the target terminal to respond to the cancellation command. If the cancellation confirmation duration expires but the terminal does not respond, the collaborative control server still revokes the target interface operation qualification and interface data subscription on the server side, and records the terminal's confirmation status as unconfirmed. When the target terminal reconnects subsequently, the server first sends it a set of failed instances, causing the terminal to clear the corresponding local waiting commands, and then allows the terminal to accept new pre-startup instances.

[0266] The execution event retention period is used to save task progress events to support replaying disconnections on the monitoring end. While the execution event is still within the retention period, the missing range is reissued based on the last confirmed event identifier; after the retention period expires, it is restored using the current role's execution status record and the most recent step boundary event. The retention period for step execution records, cancellation reasons, and key execution evidence can be longer than that for general progress events to meet the needs of automated execution report generation and issue tracing.

[0267] The interface data retention strategy is set based on data type and step status. Keyframes corresponding to step start, target interface operation completion, verification result, pending release, release, and cancellation events are referenced during the step execution record retention period; non-critical consecutive frames can be evicted according to the buffer duration. When a pre-startup instance is cancelled but a preparation snapshot has been generated, at least one preparation snapshot sufficient to indicate the target page state before cancellation is retained; if no snapshot has been generated, placeholder execution data is saved.

[0268] All parameters are written into the task execution context or the corresponding step execution configuration, and the actual values ​​used are saved in the execution record. When parameters need to be adjusted during task execution, the collaborative control server generates a parameter version. Newly created pre-start execution instances use the new parameter version, while instances already in the pending release state continue to use the parameter version used when they were created, or are canceled and rebuilt according to the task control rules, to avoid the validity period and retry limit of the same instance being changed without record during execution.

[0269] By explicitly configuring the aforementioned time limits, retry, and retention parameters, each process—device session, page preparation, target object location, interface data access, approval, and cancellation—has definite termination conditions. The collaborative control server can generate a corresponding final state based on the specific failure stage, preventing the pre-startup execution instance from indefinitely retaining resources or continuing to issue target interface operations when the state cannot be confirmed.

[0270] See Figure 2 This application can be applied to automated testing of educational services involving teacher terminals, student terminals, and parent terminals. The following describes the configuration, pre-startup, release, and cancellation process across multiple terminals through a complete task.

[0271] The multi-terminal automation sequence in this embodiment includes the following steps in sequence: Step A, the teacher's terminal publishes the assignment; Step B, the student's terminal accesses the published assignment; Step C, the student's terminal submits the answer; Step D, the teacher's terminal views the student's answer; Step E, the parent's terminal views the learning report. The teacher's terminal, student's terminal, and parent's terminal each run the application corresponding to their role and log in to the test account.

[0272] In step A, the device role is identified as "Teacher," the target page is the assignment editing page, the target operation object is the "Publish" button, and the target interface operation is clicking the "Publish" button. Result verification processing includes two verification objects: the publication result prompt on the assignment editing page and the target assignment's status field. The expected result is that the publication result prompt shows "Published Successfully" and the target assignment's status is "Published"; a verification failure result is generated if a publication failure prompt appears or the assignment status shows "Publish Failed."

[0273] In step B, the device role is identified as a student, the target page is the student's assignment list page, the target operation object is the assignment list item corresponding to the target assignment number, and the target interface operation is clicking on the list item to enter the assignment details page. The result verification process checks the assignment details page identifier, the target assignment number, and the assignment content loading status.

[0274] Step C is also executed by the student role, with the target page being the assignment answer page, the target operation being the submit button, and the target interface operation being clicking the submit button. The result verification process checks the submission success page and the status of the answer record. Since steps B and C belong to the same device role, they enter the student role's execution queue and are executed sequentially; no cross-role connection is established between them.

[0275] Step D: The device role is identified as Teacher, the target page is the assignment results page, the target operation object is the target student's answer record, and the target interface operation is clicking on the answer record. The result verification process checks whether the student's answer details have been loaded. Step E: The device role is identified as Parent, the target page is the learning report list page, the target operation object is the report item corresponding to this assignment, the target interface operation is opening the learning report, and the result verification process checks the report content and the corresponding student identifier.

[0276] The collaborative control server creates execution queues for teacher, student, and parent roles based on device role identifiers. The teacher execution queue includes steps A and D, the student execution queue includes steps B and C, and the parent execution queue includes step E. A first cross-role connection is established between steps A and B, a second cross-role connection is established between steps C and D, and a third cross-role connection is established between steps D and E.

[0277] After the task begins, the teacher's terminal executes step A. After the teacher clicks the publish button and returns to the operation completion event, the result verification process for step A begins polling the published result prompts and the assignment status. At this point, the result verification process is not yet complete, and the collaborative control server establishes a first pre-start execution instance for step B based on the first cross-role connection relationship.

[0278] The first pre-launch execution instance establishes a device session for the student terminal, launches the student application, and enters the assignment list page. The student terminal locates the target assignment list item in the list based on the target assignment number and establishes a pre-subscription channel for the student terminal screen. The initial interface state obtained by this instance includes the assignment list page identifier, the target assignment number, the target list item structure path, the visibility status, the clickable status, and the unobstructed status.

[0279] After preparation is complete, the first pre-start execution instance enters the pending release state. At this time, the student terminal remains on the assignment list page and has not clicked on the target assignment list item. Even if the target list item is displayed and the screen is connected, the student terminal still retains the operation blocking flag, and step B has not started executing the target interface operation.

[0280] If the verification result of step A is passed, the collaborative control server rereads the current interface state of the student terminal. If the student terminal is still on the assignment list page, the current business object is still the target assignment, the target list item remains clickable, and the screen channel is valid, then the execution preparation state is valid. The collaborative control server generates a one-time release flag, and after the student terminal verifies, it clicks the target assignment list item to formally execute step B.

[0281] If the verification result of step A is a publication failure, the collaborative control server revokes the target interface operation qualification of the first pre-start execution instance, and the student terminal does not click on the target job list item. The student terminal's screen subscription is revoked, the preparation for occupation is released, and step B is recorded as cancelled due to lack of permission. Steps C, D, and E all depend on the successful publication and subsequent execution of the job, and are therefore marked as prerequisite steps blocked.

[0282] If step A passes verification, but the student terminal is manually switched to the course page during the waiting period, the current page identifier obtained during the release will differ from the initial page identifier, rendering the execution preparation state invalid. The collaborative control server does not use the original target list item to locate the result. If the task configuration allows recovery, the job list page will be re-entered, the target job will be relocated, and a new status version will be generated; re-verification will be performed when recovery is complete and the instance is still within its validity period. If recovery is not possible, the first pre-start execution instance will be canceled.

[0283] After step B verification is successful, step C is executed sequentially according to the student role execution queue. After the student terminal completes the answer and clicks the submit button, step C enters the result verification process. While the submitted result is not yet determined, the collaborative control server establishes a second pre-start execution instance for step D of the teacher terminal based on the second cross-role connection relationship.

[0284] The second pre-launch execution instance reuses or re-establishes the teacher terminal device session, enters the assignment results page, locates the target student's answer record, and pre-subscribes to the teacher terminal screen. When the student's terminal submits successfully, the teacher terminal refreshes the current status of the target student's answer record before allowing it to proceed. If the target record has appeared and matches the target student's identifier, the teacher terminal allows the student to click on the answer record; if the student's submission fails, the second pre-launch execution instance is canceled, and the teacher terminal does not enter the non-existent or incomplete answer details.

[0285] After the target interface operation in step D is completed, the teacher's terminal verifies whether the student's answer details have been loaded correctly. During this verification, the collaborative control server establishes a third pre-startup execution instance for step E on the parent's terminal based on the third cross-role connection relationship. The parent's terminal enters the learning report list page, locates the report item corresponding to the target student and this assignment, and waits for the verification result of step D.

[0286] If step D verification passes and the parent terminal's execution preparation status is valid, the third pre-launch execution instance is allowed, and the parent terminal opens the learning report. If step D verification fails or the student's identity displayed on the report list page has been changed, the third pre-launch execution instance is canceled to prevent the parent terminal from opening the report of the wrong student.

[0287] After the task is completed, the collaborative control server merges the execution records of the teacher terminal, student terminal, and parent terminal in the order of steps A to E. The report displays the device role, target interface operation, verification result, key interface data, and final execution state for each step. If any pre-startup instance is not approved, the report retains its execution preparation record and cancellation reason, and maintains the integrity of the step record through placeholder execution data.

[0288] In the above scenarios, the teacher terminal, student terminal, and parent terminal are merely specific examples of device roles. This application can also be applied to business testing scenarios involving collaborative operations of business initiation terminals, review terminals, and result confirmation terminals, simply by configuring the corresponding device role identifiers, target interface operations, and result verification processing in the multi-terminal automation step sequence.

[0289] See Figure 3 This embodiment provides a multi-terminal user interface automated collaboration system. This system is a product that actually runs multi-terminal applications and performs automated tasks. It includes a collaborative control server and teacher terminals, student terminals, and parent terminals that are respectively communicatively connected to the collaborative control server. Each teacher terminal, student terminal, and parent terminal has a device role identifier and runs a corresponding user interface. The collaborative control server is used to obtain a multi-terminal automation step sequence, which includes multiple automation steps. Each automation step is configured with a step order, device role identifier, target interface operation, and result verification processing. The result verification processing is used to verify the execution result of the target interface operation in the same automation step. The collaborative control server is also used to route each automation step to the corresponding teacher terminal, student terminal or parent terminal according to the step sequence and device role identifier, so that the automation steps of the same device role are executed serially; and to determine the cross-role connection relationship between adjacent automation steps based on the role routing result and the step sequence. When the target interface operation of the current automation step is completed on the teacher terminal, student terminal, or parent terminal and the result verification process is not yet finished, the collaborative control server is used to establish a pre-start execution instance for the next automation step according to the cross-role connection relationship; the terminal corresponding to the next automation step is used to perform execution preparation and return the execution preparation result; the collaborative control server is used to form an execution preparation state according to the execution preparation result and control the pre-start execution instance to the pending release state before the execution of the target interface operation; The collaborative control server is also used to, based on the verification result of the current automation step and the execution preparation status, allow the pre-start execution instance to proceed when the verification is successful and the execution preparation status is valid, so that the corresponding terminal can perform the target interface operation of the next automation step; and cancel the pre-start execution instance when the verification fails or the execution preparation status is invalid, so that the corresponding terminal can cancel the execution preparation and block the advancement of subsequent automation steps.

[0290] Through the coordination of the aforementioned physical devices and programs, teacher terminals, student terminals, and parent terminals run actual business applications respectively, while the collaborative control server establishes the step sequence and access control among multiple terminals. The system does not merely name the automated method steps; rather, it implements multi-terminal user interface automation collaboration through the server, terminals of various roles, device sessions, terminal automation execution programs, and interface data channels.

[0291] The above are merely specific embodiments of this application. For those skilled in the art, equivalent substitutions or adjustments can be made to the data structure, terminal type, interface data format, and communication method in the above embodiments without departing from the technical concept of this application, and all such equivalent substitutions or adjustments should fall within the protection scope of this application.

Claims

1. A collaborative processing method for multiple interfaces, characterized in that, include: Obtain a multi-terminal automation step sequence, which includes multiple automation steps. Each automation step is configured with a step order, device role identifier, target interface operation, and result verification processing. The result verification processing is used to verify the execution result of the target interface operation in the same automation step. Role routing is performed based on the step sequence and device role identifier, so that automated steps for the same device role are executed serially; Based on the role routing results and the order of the steps, determine the cross-role connection relationship between adjacent automation steps; When the target interface operation of the current automation step is completed but the result verification process is not finished, a pre-start execution instance is established for the next automation step according to the cross-role connection relationship. The next automation step is prepared for execution. An execution preparation state is formed according to the execution preparation result. The pre-start execution instance is controlled in the pending release state before the target interface operation is executed. Based on the verification result of the current automation step and the execution preparation status, if the verification is successful and the execution preparation status is valid, the pre-start execution instance is allowed to execute the target interface operation of the next automation step; if the verification fails or the execution preparation status is invalid, the pre-start execution instance is canceled and the advancement of subsequent automation steps is blocked.

2. The collaborative processing method for multi-terminal interfaces according to claim 1, characterized in that, The step of establishing a pre-launch execution instance for the next automation step based on the cross-role connection relationship includes: Obtain the target interface operation completion event and the result verification process that is currently running for the current automation step; extract the step identifier and device role identifier from the target interface operation completion event; and obtain the verification process identifier from the result verification process. The next automated step is determined based on the cross-role connection relationship, the expected verification status is determined based on the pass conditions of the result verification process, and a pre-start connection object is established that includes the current step identifier, the next step identifier, the role switching relationship, the verification process identifier, and the expected verification status. The pre-startup execution instance is created based on the pre-startup connection object, the pre-startup execution instance is associated with the result verification process, execution preparation qualification is configured for the pre-startup execution instance, and the target interface operation execution qualification of the pre-startup execution instance is locked.

3. The collaborative processing method for multi-terminal interfaces according to claim 2, characterized in that, The step of routing roles according to the sequence of steps and the device role identifier includes: Establish a role progress record for each device role. The role progress record includes the completed step position, the formal execution position, and the execution preparation position. According to the step sequence, each automated step is mapped to the corresponding role progress record, and the formal execution position and the execution preparation position are determined along the step sequence of the same device role. Match the step position of the next automation step with the execution preparation position in the corresponding role's progress record, and check whether there are any incomplete automation steps corresponding to the same device role before the next automation step; When the step position matches and there are no incomplete automated steps of the same role, the execution preparation qualification of the pre-start execution instance is granted, and the formal execution position remains unchanged; when the pre-start execution instance is allowed, the formal execution position is updated to the step position of the next automated step, and the execution preparation position is updated according to the subsequent steps to be executed; when the pre-start execution instance is canceled, the formal execution position remains unchanged, and the execution preparation position is adjusted to the next step to be executed that has not been canceled.

4. The collaborative processing method for multi-terminal interfaces according to claim 3, characterized in that, The step of preparing for the execution of the next automated step includes: According to the pre-startup connection object, allocate terminal execution resources to the pre-startup execution instance and establish a device session with the terminal corresponding to the next automation step; Extract target interface features and target operation conditions from the target interface operation of the next automation step, enter the target interface that matches the target interface features through the device session, and obtain the interface structure of the target interface; Based on the correspondence between the target operation conditions and the interface structure, the target operation object and its positioning result are determined, an interface data subscription channel for the target interface is established, and the initial interface state of the target interface is obtained. The pre-start execution instance, device session, expected execution location of the corresponding device role, initial interface state, location result and interface data subscription channel are organized into an execution preparation context. The execution preparation state is formed according to the execution preparation context. A status version identifier is configured for the execution preparation state. An operation blocking flag is set in the target interface operation distribution node.

5. The collaborative processing method for multi-terminal interfaces according to claim 4, characterized in that, The step of releasing the pre-startup execution instance based on the verification result and the execution preparation status includes: Obtain the verification result of the current automation step, extract the expected verification status from the pre-startup connection object, and extract the expected execution position, initial interface status, positioning result, interface data subscription channel identifier and status version identifier of the corresponding device role from the execution preparation context; Obtain the current execution position of the device role corresponding to the next automation step, the current interface state of the target interface, and the current access status of the interface data subscription channel, and organize the verification result, current execution position, current interface state, and current access status into a release verification object; Determine whether the verification result matches the expected verification status, whether the current execution location matches the expected execution location, whether the target interface status remains valid, whether the location result remains valid, and whether the interface data access status is ready. Based on each determination result, determine whether the release verification object meets the release conditions. When the release verification object meets the release conditions, a one-time release flag is generated that is bound to the pre-start execution instance and the status version identifier. The operation blocking flag is released according to the one-time release flag. After the pre-start execution instance performs the target interface operation through the device session and according to the positioning result, the one-time release flag is updated to the used state.

6. The collaborative processing method for multi-terminal interfaces according to claim 5, characterized in that, The step of determining whether the target interface state remains valid includes: Extract the interface identifier, business object identifier, target operation object attribute, interface structure version and occlusion status from the initial interface state, and form the initial interface state features according to the correspondence of each item in the target interface. Before releasing the pre-start execution instance, the current interface identifier, current business object identifier, current target operation object attribute, current interface structure version and current occlusion state are extracted from the current interface state to form the current interface state features, and an interface state change set is formed based on the difference between the current interface state features and the initial interface state features. Based on the interaction between each change in the set of interface state changes and the structural path, operable attributes, and occlusion state of the target operation object, it is determined whether the positioning result remains valid; if the positioning result remains valid, the current interface state is determined to be valid; if the positioning result fails, the current interface state is determined to be invalid, the execution preparation context is updated, the target operation object is repositioned, and a new state version identifier is generated.

7. The collaborative processing method for multi-terminal interfaces according to claim 5, characterized in that, The step of canceling the pre-startup execution instance and blocking the progress of subsequent automated steps includes: When the verification result indicates that the verification failed or the release verification object does not meet the release conditions, the automated steps that depend on the current automated step to pass the verification, the pre-start execution instance and the interface data subscription channel are determined according to the cross-role connection relationship and the step sequence to form a cancellation impact set; According to the cancellation impact set, the execution preparation qualification and target interface operation execution qualification of the pre-start execution instance are revoked; it is then checked whether the pre-start execution instance has been associated with a one-time release flag; if it has been associated with a one-time release flag, the one-time release flag is updated to an invalid state; the interface data subscription channel is closed and the terminal execution resources are released. Based on the updated role progress record corresponding to the cancellation impact set, the affected automated steps are removed from the pending execution steps, and the execution record corresponding to the pre-start execution instance is updated to the cancellation status, so that the task instance, terminal execution resources, role progress and execution record form a consistent cancellation result.

8. The collaborative processing method for multi-terminal interfaces according to claim 4, characterized in that, The step of establishing the interface data subscription channel for the target interface includes: Assign a data source identifier and a channel generation identifier to the interface data subscription channel, and associate the data source identifier and channel generation identifier with the device role identifier, the pre-startup execution instance identifier, and the target interface identifier; receive the first interface data frame carrying the data source identifier, channel generation identifier, device role identifier, pre-startup execution instance identifier, target interface identifier, and frame sequence number; The identifiers carried in the first interface data frame are matched with the corresponding identifiers associated with the interface data subscription channel. When all identifiers match, the first interface data frame is associated with the execution preparation context, and the interface data access status is updated to the ready state. When any identifier does not match, the first interface data frame is determined to be an invalid data frame and discarded.

9. The collaborative processing method for multi-terminal interfaces according to claim 8, characterized in that, The step of receiving the first interface data frame includes: Start the first frame wait timer for the channel generation identifier and record the correspondence between the first frame wait state and the pre-start execution instance; If the first interface data frame with a matching identifier is not received within the preset waiting time, the current channel generation identifier will be updated to an invalid state, the interface data subscription channel will be re-established, and a new channel generation identifier will be generated. A second first-frame wait is performed based on the new channel generation identifier, and only interface data frames carrying the new channel generation identifier are received to isolate data frames that arrive late from the original interface data subscription channel. If the second first frame wait still times out, switch to single frame acquisition mode; if the acquired single frame data matches the target interface, update the interface data access status to downgrade ready state; if the acquired single frame data does not match the target interface, update the execution preparation state to invalid state.

10. The collaborative processing method for multi-terminal interfaces according to claim 8, characterized in that, The step of receiving interface data frames through the interface data subscription channel includes: A single interface data production instance is established for the same device session and channel generation, and consumption location identifiers are established for multiple interface data consumer objects, so that each interface data consumer object can share the interface data frame output by the interface data production instance according to the corresponding consumption location identifier. Based on the difference between the latest frame sequence number of the interface data production instance and the identifier of each consumption location, determine the range of frames to be processed corresponding to each interface data consumption object; based on the correspondence between interface data frames and the execution status of automated steps, determine the interface data frames to be retained from the range of frames to be processed. When the range of frames to be processed exceeds the preset range, the interface data frames that need to be retained are transferred to the corresponding step execution record, the remaining historical intermediate data frames are discarded, the latest interface data frame is provided to the corresponding interface data consumer object, and after the provision is completed, the corresponding consumption position identifier is updated to the latest interface data frame, and the frame sequence number range of the discarded data frames is recorded.

11. The collaborative processing method for multi-terminal interfaces according to claim 7, characterized in that, The step of updating the execution record corresponding to the pre-start execution instance to a canceled state includes: Obtain the generation and usage status of the one-time release flag; if the one-time release flag is not generated or has been generated but not used, determine that the target interface operation has not been released, and query whether the pre-startup execution instance has formed an execution preparation snapshot; When an execution preparation snapshot has been formed, the execution record is updated to a cancelled state that has not been released, the execution preparation snapshot is retained, and the cancellation reason, status version identifier, and resource release result are associated with the execution preparation snapshot; If no execution preparation snapshot is created, a placeholder data dump record is generated that includes the step sequence, device role, execution preparation status summary, cancellation reason, and resource release result. According to the sequence of steps and the role of the equipment, the execution results, execution preparation snapshots and placeholder data dump records of each automation step are associated with the corresponding automation steps; for automation steps with pre-start execution instances, the association between the corresponding records and the pre-start execution instances is further established to form a multi-terminal automation execution report that distinguishes between execution completion, execution failure and cancellation without release.

12. The collaborative processing method for multi-terminal interfaces according to claim 3, characterized in that, The step of updating the character progress record includes: When the role progress record, pre-start execution instance, or execution preparation status changes, a progress event is generated that includes the step sequence, device role, instance identifier, status identifier, preceding event identifier, and event sequence. The progress events are pushed and cached in the order of the events, and the order of the last confirmation events by each progress receiver is recorded. When the progress receiving end re-establishes a connection, it determines the event gaps according to the order of the last confirmed events and continuously replays the corresponding progress events; when the progress events corresponding to the event gaps have been cleared, it sends the current role's progress record and boundary events used to mark the starting point of subsequent events.

13. A multi-terminal user interface automated collaborative system, characterized in that, It includes a collaborative control server and teacher terminals, student terminals, and parent terminals that are respectively connected to the collaborative control server. Each teacher terminal, student terminal, and parent terminal has a device role identifier and runs a corresponding user interface. The collaborative control server is used to obtain a multi-terminal automation step sequence, which includes multiple automation steps. Each automation step is configured with a step order, device role identifier, target interface operation, and result verification processing. The result verification processing is used to verify the execution result of the target interface operation in the same automation step. The collaborative control server is also used to route each automated step to the corresponding teacher terminal, student terminal or parent terminal according to the step sequence and device role identifier, so that the automated steps of the same device role are executed serially. Based on the role routing results and the order of the steps, determine the cross-role connection relationship between adjacent automation steps; When the target interface operation of the current automation step is completed on the teacher terminal, student terminal, or parent terminal and the result verification process is not yet finished, the collaborative control server is used to establish a pre-start execution instance for the next automation step based on the cross-role connection relationship. The terminal corresponding to the next automation step is used to prepare for execution and return the execution preparation result. The collaborative control server is used to form an execution preparation state based on the execution preparation result and control the pre-start execution instance to the pending release state before executing the target interface operation. The collaborative control server is also used to, based on the verification result of the current automation step and the execution preparation status, allow the pre-start execution instance to proceed when the verification is successful and the execution preparation status is valid, so that the corresponding terminal can perform the target interface operation of the next automation step; and cancel the pre-start execution instance when the verification fails or the execution preparation status is invalid, so that the corresponding terminal can cancel the execution preparation and block the advancement of subsequent automation steps.