Rpa node running method based on process tree snapshot pruning and related equipment
By performing deep copying and pruning of the process tree and deleting sibling activity nodes before or after the target node, the problems of poor flexibility and low efficiency in testing and running during RPA development are solved, achieving efficient and flexible process tree pruning and running tests.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NINETECH INFORMATION TECH (SHENZHEN) CO LTD
- Filing Date
- 2026-04-22
- Publication Date
- 2026-07-31
AI Technical Summary
During RPA development, testing and running suffer from poor flexibility, low efficiency, and limited scenarios. In particular, it takes a long time to start/stop running at a specified node and requires manual setting/clearing of breakpoints.
By receiving node pruning instructions, a deep copy of the process tree is made to obtain a snapshot. Based on the instructions, the sibling active nodes before or after the target node are deleted, and the sibling active nodes at the corresponding parent node level are recursively deleted upwards to obtain the target process tree. After verification and data processing, the tree is sent to the backend RPA assistant for execution.
It enables efficient and flexible process tree pruning and test execution at any node without modifying the backend code, solving the problems of poor flexibility and low efficiency in test execution during RPA development.
Smart Images

Figure CN122489491A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of robotic process automation (RPA) technology, and in particular to an RPA node operation method and related equipment based on process tree snapshot pruning. Background Technology
[0002] RPA: Robotic Process Automation.
[0003] In RPA process development and design, users need to perform frequent debugging and testing to ensure that each design node can execute normally. Related technologies, RPA development platforms provide the following testing methods during development: Full project execution: Runs the entire RPA project, executing all activity nodes from the entry point to completion; Single process execution: Runs a single currently opened process file, executing from the root Sequence node to completion; Selected activity execution: The user selects one or more consecutive activity nodes, the system creates a temporary process tree, and places the selected activities into a new Sequence container for execution; Breakpoint debugging: The user sets breakpoints on activity nodes, and execution pauses at the breakpoint. Additionally, some RPA platforms provide a "start from a specified node" execution method by modifying the backend code. However, the above execution methods have technical problems such as long execution time, inability to start / stop from a specified node, requirement to select consecutive activities at the same level, need to manually set / clear breakpoints, and need to modify the backend execution engine.
[0004] Therefore, how to solve the above-mentioned problems that need to be addressed during the RPA development process and when running tests is required has become a technical challenge that needs to be overcome by those skilled in the art. Summary of the Invention
[0005] This invention proposes an RPA node running method, device, and medium based on process tree snapshot pruning, to solve the technical problems of poor flexibility, low efficiency, and limited scenarios in RPA development testing and running in related technologies.
[0006] In a first aspect, one embodiment of the present invention provides an RPA node execution method based on process tree snapshot pruning, comprising: Receive node pruning commands triggered by users under the target node; In response to the node pruning command, a deep copy of the current process tree is performed to obtain a snapshot of the process tree; Based on the node pruning instruction, delete all sibling active nodes before the target node in the process tree snapshot, and recursively delete all preceding sibling active nodes at the level of the parent node corresponding to the target node to obtain the first target process tree. Alternatively, based on the node pruning instruction, delete all sibling active nodes after the target node in the process tree snapshot, and recursively delete all subsequent sibling active nodes at the level of the parent node corresponding to the target node, thereby obtaining the second target process tree; After verifying and processing the first or second target process tree, the data is sent to the backend RPA assistant for execution.
[0007] The RPA node execution method based on process tree snapshot pruning in this embodiment of the invention has at least the following beneficial effects: This invention provides an RPA node execution method based on process tree snapshot pruning. The method receives a node pruning instruction at the target node, responds by performing a deep copy of the current process tree to obtain a process tree snapshot, and then, based on the node pruning instruction, deletes all active nodes at the same level as the target node and recursively deletes all preceding active nodes at the same level as the target node's parent node, obtaining a first target process tree. Alternatively, based on the node pruning instruction, the method deletes subsequent active nodes at the same level as the target node in the process tree snapshot and recursively deletes all subsequent active nodes at the same level as the target node's parent node, obtaining a second target process tree. Finally, the first or second target process tree is verified and processed before being sent to the backend RPA assistant for execution. Furthermore, users can set node pruning instructions at any node, and based on these instructions, perform process tree pruning and test execution for any target node, either before or after it. This solves the technical problems of poor flexibility, low efficiency, and limited scenarios in RPA development testing and execution in related technologies. It provides an efficient, flexible RPA node execution method based on process tree snapshot pruning that does not require modification of the backend code.
[0008] According to other embodiments of the present invention, the RPA node running method based on process tree snapshot pruning includes obtaining a process tree snapshot by performing a deep copy of the current process tree. Obtain the FlowTree data object of the current process tree; Convert the FlowTree data object into a JSON string; Convert the JSON string back into a new FlowTree data object to obtain the process tree snapshot.
[0009] According to other embodiments of the RPA node operation method based on process tree snapshot pruning according to the present invention, the step of deleting all active sibling nodes before the target node in the process tree snapshot includes: Obtain a list of all branches of all activities of the corresponding parent node under the target node, and denote it as the first branch list; Traverse the first branch list to obtain the position of the target node; Based on the location of the target node, delete all active sibling nodes preceding the target node.
[0010] According to other embodiments of the RPA node execution method based on process tree snapshot pruning of the present invention, the recursive upward deletion of all preceding sibling active nodes at the level of the parent node corresponding to the target node includes: Determine whether the parent node corresponding to the target node is the root node; If so, then no further action will be taken; Otherwise, take the parent node corresponding to the target node as the current target node, and recursively delete all preceding active nodes in the level where the current target node is located, so that the parent node corresponding to the target node becomes the root node.
[0011] According to other embodiments of the RPA node execution method based on process tree snapshot pruning according to the present invention, the step of deleting all sibling active nodes after the target node in the target process tree includes: Obtain a list of all branches of all activities of the corresponding parent node under the target node, and denote it as the second branch list; Traverse the second branch list to obtain the position of the target node; Based on the location of the target node, delete all active sibling nodes following the target node.
[0012] According to other embodiments of the RPA node execution method based on process tree snapshot pruning according to the present invention, the recursive upward deletion of all subsequent sibling active nodes at the level of the parent node corresponding to the target node includes: Determine whether the parent node corresponding to the target node is the root node; If so, then no further action will be taken; Otherwise, take the parent node corresponding to the target node as the current target node, and recursively delete all subsequent active nodes at the level where the current target node is located, so that the parent node corresponding to the target node becomes the root node.
[0013] According to other embodiments of the RPA node operation method based on process tree snapshot pruning according to the present invention, the step of verifying and processing the first target process tree or the second target process tree includes: Verify whether the first target process tree or the second target process tree is empty; If so, terminate the operation and issue a prompt; otherwise, The external filenames referenced by the first or second target process tree are replaced with IDs and then serialized before being sent to the RPA assistant.
[0014] According to other embodiments of the present invention, the RPA node running method based on process tree snapshot pruning is used to determine whether a preset activation condition is met when receiving a node pruning instruction triggered by a user under the target node. The preset activation conditions include: only one active node is currently selected and the node is not in the state machine container editing view; If the preset activation conditions are met, proceed with the subsequent steps; Otherwise, an error message will be displayed.
[0015] Secondly, one embodiment of the present invention provides an RPA node running device based on process tree snapshot pruning, comprising: The instruction receiving module is used to receive node pruning instructions triggered by users under the target node; The process tree snapshot copy module is used to perform a deep copy of the current process tree in response to the node pruning command to obtain a process tree snapshot. The first trimming module is used to delete all sibling active nodes before the target node in the process tree snapshot based on the node trimming instruction, and to recursively delete all preceding sibling active nodes in the level where the parent node corresponding to the target node is located, so as to obtain the first target process tree. The second trimming module is used to delete all sibling active nodes after the target node in the process tree snapshot based on the node trimming instruction, and to recursively delete all subsequent sibling active nodes at the level of the parent node corresponding to the target node, thereby obtaining the second target process tree. The verification processing execution module is used to verify and process the first target process tree or the second target process tree before sending it to the backend RPA assistant for execution. The verification processing execution module is used to verify and process the first target process tree or the second target process tree before sending it to the backend RPA assistant for execution.
[0016] Thirdly, one embodiment of the present invention provides a computer-readable storage medium storing an executable program, which is executed by a processor to implement the RPA node running method based on process tree snapshot pruning as described above. Attached Figure Description
[0017] Figure 1 This is a schematic diagram illustrating the steps of a specific embodiment of an RPA node running method based on process tree snapshot pruning according to an embodiment of the present invention; Figure 2 This is a schematic diagram of a specific embodiment of step S100, which includes sub-steps, in an RPA node running method based on process tree snapshot pruning according to an embodiment of the present invention. Figure 3 This is a schematic diagram of a specific embodiment of step S200, which includes sub-steps, in an RPA node running method based on process tree snapshot pruning according to an embodiment of the present invention. Figure 4 This is a schematic diagram of a specific embodiment of step S300 of the present invention, which involves deleting all active nodes at the same level before the target node in the process tree snapshot, including sub-steps. Figure 5 This is a schematic diagram of a specific embodiment of step S300 of the present invention, which involves recursively deleting all preceding active nodes of the parent node corresponding to the target node at the same level, including sub-steps. Figure 6 This is a schematic diagram of a specific embodiment of step S400 of the present invention, which involves deleting all active nodes at the same level after the target node in the process tree snapshot, including sub-steps. Figure 7 This is a schematic diagram of a specific embodiment of step S400 of the present invention, which involves recursively deleting all subsequent active nodes of the same level as the parent node corresponding to the target node, including sub-steps. Figure 8 This is a schematic diagram of a specific embodiment of step S500, which includes sub-steps, in an RPA node running method based on process tree snapshot pruning according to an embodiment of the present invention. Figure 9 This is a schematic diagram of the module composition of a specific embodiment of an RPA node running device based on process tree snapshot pruning according to an embodiment of the present invention. Detailed Implementation
[0018] The following will describe the inventive concept and its resulting technical effects clearly and completely with reference to embodiments, so as to fully understand the purpose, features and effects of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of them. Other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are all within the scope of protection of the present invention.
[0019] In the description of the embodiments of the present invention, the term "several" means one or more, and the term "multiple" means two or more. The terms "greater than," "less than," and "exceeding" should be understood as excluding the stated number, while the terms "above," "below," and "within" should be understood as including the stated number. The terms "first" and "second" should be understood as distinguishing technical features, and not as indicating or implying relative importance, the number of indicated technical features, or the order of the indicated technical features.
[0020] Reference Figure 1 This invention provides an RPA node execution method based on process tree snapshot pruning, which is applied in RPA process design tools / platforms to provide users with an efficient and fast execution mode for target activity node ranges, in order to verify whether the designed RPA process meets the expected design requirements. Specifically, it includes the following steps: S100: Receive node pruning instructions triggered by users under the target node; When users design and test RPA processes on the process canvas provided by the RPA platform / designer, they can select the function "Start running from here" at the desired start node (target node) or select the function "Run to here" at the desired end node (target node), which triggers a node pruning command. Therefore, in actual operation, users can select a specific node and then choose to run the subsequent or preceding part of the current complete process tree, thus achieving fast, convenient, and flexible test execution.
[0021] S200: Response node pruning command performs a deep copy of the current process tree to obtain a process tree snapshot; The current process tree is the process tree corresponding to the visualized process in the current process canvas. In order to enable the process tree to be pruned and tested without affecting the data structure of the original complete process tree, a process tree snapshot is obtained by deep copying the current process tree, so that the process tree snapshot can be pruned later.
[0022] S300. Based on the pruning instruction, delete all sibling active nodes before the target node in the process tree snapshot, and recursively delete all preceding sibling active nodes at the level of the parent node corresponding to the target node, to obtain the first target process tree. In this step, the pruning action corresponds to selecting the function "Start running from here" in step S100. This action deletes all sibling active nodes before the target node and recursively deletes all preceding sibling active nodes at each parent node's level, thus obtaining the first target process tree. At this point, the starting running node of the first target process tree is the target node.
[0023] S400: Based on the node pruning instruction, delete all sibling active nodes after the target node in the process tree snapshot, and recursively delete all subsequent sibling active nodes in the level of the parent node corresponding to the target node to obtain the second target process tree. This step is at the same level as step S300, and the pruning action in this step corresponds to the function "Run to here" selected in step S100. That is, in the RPA node running method based on process tree snapshot pruning in this embodiment of the invention, whether step S300 or step S400 is executed depends on the function selected by the user on the process canvas. In this step, all active nodes at the same level as the target node are deleted, and all subsequent nodes at the same level as the parent node at each level are recursively deleted upwards to obtain the second target process tree. At this time, the termination node of the second target process tree is the target node.
[0024] S500 verifies and processes the data of the first or second target process tree and then sends it to the backend RPA assistant for execution.
[0025] After obtaining the process tree to be run (including the first target process tree or the second target process tree) through step S300 or S400, before sending it to the backend RPA assistant for execution, it is necessary to verify and process the data of the process tree to be run obtained through step S300 or S400. The purpose of verification is to ensure that the process tree can be executed, and the purpose of data processing is to convert the process tree to be run into a file format that can be executed by the RPA assistant.
[0026] This invention provides an RPA node execution method based on process tree snapshot pruning. After receiving a node pruning instruction triggered by a user-selected target node, a deep copy of the current process tree is performed to obtain a process tree snapshot. Based on the node pruning instruction, the process tree snapshot is pruned upwards to obtain a first target process tree, or downwards to obtain a second target process tree. The first or second target process tree is then validated and processed before being sent to a backend RPA assistant for execution. This achieves the purpose of starting the process tree from the target node or terminating the process tree after reaching the target node. It solves the technical problems of poor flexibility, low efficiency, and limited scenarios in the testing and execution of RPA development processes in related technologies.
[0027] Reference Figure 2In some embodiments, when step S100 in the above embodiments is executed, if the user selects "Start running from here" or "Run to here" on the process canvas, a preset enabling condition must be met before subsequent steps can be started. In this embodiment, the preset enabling condition includes: currently selecting an active node and that node is not in the state machine container editing view. The purpose of limiting the current selection to only one active node is that the RPA node running method based on process tree snapshot pruning provided by this invention is based on a clear target node. If two or more nodes are currently selected, the target node will be unclear. In addition, if the current state is in the state machine container editing view, it cannot be applied to the subsequent process tree pruning steps, so this situation needs to be eliminated. Specifically, step S100 in the above embodiments includes the following sub-steps: S110. After triggering the node trimming command, determine whether the preset activation conditions are met. If step S110 determines that it is yes, then the subsequent step S200 in the above embodiment is executed; Otherwise, proceed with the following steps: S120, Feedback on abnormal operation prompts.
[0028] In actual execution, the RPA platform / designer uses the condition `activeStepArray.length <= 1` to determine the number of currently selected active nodes. This indicates that the number of selected active nodes does not exceed one. Specifically, when `activeStepArray.length = 0`, it means the user has already left-clicked a node (the target node). When `activeStepArray.length = 1`, it means the user left-clicked a node and then right-clicked it. These preset activation conditions clearly define the specific single target node. When the user selects multiple active nodes (i.e., `activeStepArray.length > 1`), if the "Start from here" or "Run to here" function button is then activated, the system will report an error, indicating that this operation is abnormal.
[0029] Reference Figure 3 In some embodiments, when a preset activation condition is met, in response to a node pruning command, a deep copy is performed to obtain a process tree snapshot in order to avoid damaging the current process tree data. Subsequent pruning operations are then performed on the process tree snapshot to ensure the integrity of the original process tree data. Specifically, step S200 in the above embodiments includes the following sub-steps: S210. Obtain the FlowTree data object of the current process tree; When a user selects "Start running from here" or "Run to here" on the workflow canvas, the RPA platform / designer first checks if the user is in code editing mode. If so, it automatically calls `saveCodeAsGraph` to switch the code back to graphical editing mode. In graphical editing mode, the `getRunningXml` function is called to retrieve the FlowTree data object of the current workflow tree from the Vuex state repository.
[0030] S220. Convert the FlowTree data object into a JSON string; S230. Convert the JSON string into a new FlowTree data object to obtain a process tree snapshot.
[0031] In steps S220 and S230, a process tree snapshot, cloneTree, is obtained by performing a deep copy using the function JSON.parse(JSON.stringify(flowTree)). All subsequent pruning is performed on cloneTree, and the original flowTree is not affected.
[0032] In this embodiment, the getRunningXml function also retrieves the information of the currently selected activity node (activeStep) from the flow module in Vuex. This information includes: the activity object itself (activity), the node's index in the parent list (nodeIndex), the unique identifier of the parent activity (parentRandomId), and a reference to the parent activity list (parentActivityList).
[0033] Reference Figure 4 In some embodiments, if the node pruning instruction selected by the user in step S100 is the instruction "start running from here", then the RPA node running method based on process tree snapshot pruning provided in this embodiment of the invention enters step S300. While ensuring the pruning tree can be executed correctly, the active nodes at the same level before the target node are deleted. Simultaneously, the preceding active nodes at the parent node of each level are recursively deleted upwards to obtain the pruned process tree, so that the RPA assistant can achieve "start running from here" when executing the pruned process tree. Specifically, step S300, deleting all active nodes at the same level before the target node in the process tree snapshot, includes sub-steps; S310. Obtain a list of all branches of all activities of the parent node corresponding to the target node, and denote it as the first branch list; Specifically, by calling the getStepFromFlowTreeByRandomId function, the entire process tree snapshot is traversed through a depth-first search. The activity node is matched by the randomId of the parent node and its complete Step information is returned. Then, the first branch list is obtained, which is represented as an activities array of type ActivityScope[]. Each ActivityScope[] contains an activityList array, which stores all the child activities under that branch.
[0034] Furthermore, in the special case where the target node's parent node is the root node, the `getStepFromFlowTreeByRandomId` function is not called. Instead, `parentNode` is constructed using `cloneTree.activity`, and then the list of all branches of all activities under the root node, i.e., the first branch list, is obtained through `parentNode.activity.activities`. Specifically, whether the target node's parent node is the root node is determined by checking if `targetStep.parentRandomId` is equal to the current flow ID.
[0035] S320. Traverse the first branch list to obtain the position of the target node; In the above embodiments, the activities array may include multiple ActivityScope[]. The location index of the target node is found by traversing the activityList in each ActivityScope[] (matched by the randomId of the target node, which is obtained by targetStep.activity.randomId).
[0036] S330. Based on the location of the target node, delete all active sibling nodes preceding the target node.
[0037] In step S320, after obtaining the location index of the target node, activityList.splice(0, targetIndex) is called to delete all sibling active nodes before the target node, where targetIndex represents the location index of the target node.
[0038] Reference Figure 5In some embodiments, after deleting all active sibling nodes before the target node using the above embodiments, if the target node's parent node is not the root node, it is necessary to place the target node's corresponding parent node onto the root node to ensure that the RPA assistant executes "start running from here". Specifically, step S300 in the above embodiments, which recursively deletes all preceding active sibling nodes at the same level as the target node's parent node, includes the following sub-steps: S340. Determine whether the parent node corresponding to the target node is the root node; Specifically, the unique identifier (parentRandomId) of the parent node obtained through the above embodiments is used to determine whether the unique identifier (parentRandomId) of the parent node is equal to the current process ID. If they are the same, it means that the parent node is the root activity node of the FlowTree, and the previous sibling activity nodes at the same level as the parent node are no longer recursively deleted upwards; otherwise, the following steps are executed: S350. Taking the parent node corresponding to the target node as the current target node, recursively delete all preceding sibling active nodes at the same level as the current target node, so that the parent node corresponding to the target node becomes the root node.
[0039] Specifically, recursively deleting all preceding active nodes at the level of the current target node involves repeatedly executing steps S310 to S330 in the above embodiments, using the parent node of each level as the current target node, until a determination of "yes" is made in step S340. In practical applications, steps S310 to S330 in the above embodiments are encapsulated into the RunFrom function. By recursively calling the RunFrom function, all preceding sibling active nodes at the level of the parent node corresponding to the target node are recursively deleted upwards, so that the parent node corresponding to the target node becomes the root node. In this embodiment, by deleting the sibling active nodes before the target node in the process tree snapshot and recursively deleting all preceding sibling active nodes at the level of the parent node corresponding to the target node, the first target process tree is obtained.
[0040] Reference Figure 6 In some embodiments, if the node pruning instruction selected by the user in step S100 is a "run to here" instruction, then the RPA node running method based on process tree snapshot pruning provided in this embodiment of the invention proceeds to step S400. While ensuring the pruning tree can be executed correctly, the active nodes at the same level after the target node are deleted. Simultaneously, the subsequent active nodes at the parent node of each level are recursively deleted upwards to obtain the pruned process tree, so that the RPA assistant can achieve "run to here" when executing the pruned process tree. Specifically, deleting all active nodes at the same level after the target node in the process tree snapshot in step S400 includes sub-steps; S410. Obtain a list of all branches of all activities of the parent node corresponding to the target node, denoted as the second branch list; Specifically, by calling the getStepFromFlowTreeByRandomId function, the entire process tree snapshot is traversed through a depth-first search. The activity node is matched by the randomId of the parent node and its complete Step information is returned. Then, the second branch list is obtained, which is represented as an activities array of type ActivityScope[]. Each ActivityScope[] contains an activityList array, which stores all the child activities under that branch.
[0041] Furthermore, in the special case where the target node's parent node is the root node, the `getStepFromFlowTreeByRandomId` function is not called. Instead, `parentNode` is constructed using `cloneTree.activity`, and then the list of all branches of all activities under the root node, i.e., the second branch list, is obtained through `parentNode.activity.activities`. Specifically, whether the target node's parent node is the root node is determined by checking if `targetStep.parentRandomId` is equal to the current flow ID.
[0042] S420. Traverse the second branch list to obtain the position of the target node; In the above embodiments, the activities array may include multiple ActivityScope[]. The location index of the target node is found by traversing the activityList in each ActivityScope[] (matched by the randomId of the target node, which is obtained by targetStep.activity.randomId).
[0043] S430. Based on the location of the target node, delete all active sibling nodes after the target node.
[0044] In step S420, after obtaining the location index of the target node, activityList.splice(targetIndex + 1) is called to delete all sibling activity nodes after the target node, where targetIndex represents the location index of the target node.
[0045] Reference Figure 7In some embodiments, after deleting all sibling active nodes of the target node according to the above embodiments, if the parent node of the target node is not the root node, it is also necessary to place the parent node corresponding to the target node onto the root node to ensure that the RPA assistant achieves "running to this point" during execution. Specifically, the recursive deletion of all subsequent active nodes at the level of the parent node corresponding to the target node in step S400 of the above embodiments includes the following sub-steps: S440. Determine whether the parent node corresponding to the target node is the root node; Specifically, the unique identifier (parentRandomId) of the parent node obtained through the above embodiments is used to determine whether the unique identifier (parentRandomId) of the parent node is equal to the current process ID. If they are the same, it means that the parent node is the root activity node of the FlowTree, and the subsequent sibling activity nodes at the same level as the parent node are no longer recursively deleted upwards; otherwise, the following steps are executed: S450. Using the parent node corresponding to the target node as the current target node, recursively delete all subsequent active nodes at the same level as the current target node, so that the parent node corresponding to the target node becomes the root node.
[0046] Specifically, recursively deleting all subsequent active nodes at the same level as the current target node involves repeatedly executing steps S410 to S430 in the above embodiments, using the parent node of each level as the current target node, until a determination of "yes" is made in step S440. In practical applications, steps S410 to S430 in the above embodiments are encapsulated into a RunTo function. By recursively calling the RunTo function, all subsequent sibling active nodes at the same level as the parent node corresponding to the target node are recursively deleted upwards, so that the parent node corresponding to the target node becomes the root node. In this embodiment, by deleting the sibling active nodes after the target node in the process tree snapshot and recursively deleting all subsequent sibling active nodes at the same level as the parent node corresponding to the target node, the second target process tree is obtained.
[0047] Reference Figure 8 In some embodiments, after obtaining the first target process tree or the second target process tree by pruning the process tree snapshot through the above embodiments, in order to ensure the accuracy of the first target process tree or the second target process tree, and to convert it into an RPA executable file format, it is necessary to perform verification and data processing. Specifically, step S500 in the above embodiments includes the following sub-steps: S510. Verify whether the first target process tree or the second target process tree is empty; Specifically, checking whether the first or second target process tree is empty means checking whether the main activity list of the trimmed process tree has child nodes. Specifically, the trimmed process tree is checked by calling the `checkIfIsEmptyFlow` function. If no child nodes are found, the process terminates and an alarm is thrown to alert the user. If child nodes are found, the process proceeds to the next step: S520: Replace the ID of the external file name referenced by the first target process tree or the second target process tree, and send it to the RPA assistant after serialization.
[0048] The referenced external filenames include Python script filenames and text filenames. The `replaceIdInXml` function replaces these external filenames with their corresponding UUID identifiers to match the backend RPA file storage format. Simultaneously, the trimmed FlowTree is serialized into an XML string using `JSON.stringify` and sent to the backend RPA assistant via `replaySocket.send`, carrying the operation type (Debug), the process XML data, and a list of breakpoints for all process files in the current project. When users need to test specific parts of the current process during RPA process development, they can use the RPA node execution method based on process tree snapshot trimming provided in this embodiment to run any node, achieving an efficient and convenient testing process.
[0049] Reference Figure 9This invention also provides an RPA node execution device based on process tree snapshot pruning, comprising an instruction receiving module, a process tree snapshot copying module, a first pruning module, a second pruning module, and a verification processing execution module. The instruction receiving module receives node pruning instructions triggered by a user under the target node; the process tree snapshot copying module performs a deep copy of the current process tree in response to the node pruning instructions to obtain a process tree snapshot; the first pruning module deletes all active nodes at the same level before the target node in the process tree snapshot, and recursively deletes all preceding active nodes at the same level as the parent node corresponding to the target node, based on the pruning instructions, to obtain a first target process tree; the second pruning module deletes all active nodes at the same level after the target node in the process tree snapshot, and recursively deletes all subsequent active nodes at the same level as the parent node corresponding to the target node, based on the node pruning instructions, to obtain a second target process tree; the verification processing execution module verifies or processes the first or second target process tree and then sends it to the backend RPA assistant for execution. In this embodiment, each module in the device responds to the user's command to "start running from here" or "run to here" issued at the target node, thereby obtaining a process tree snapshot, and then pruning the process tree snapshot upwards / downwards to obtain the target process tree. After verifying and processing the target process tree, it is sent to the RPA assistant for execution, ultimately realizing the running test that starts from any node or terminates at any node. The working process and implementation principle of each module in the above process correspond to the RPA node running method based on process tree snapshot pruning described in the above embodiments, and will not be repeated here.
[0050] In practical applications, the RPA node running device based on process tree snapshot pruning in the embodiments of the present invention is embodied in the form of a computer with a specific program installed. The specific program installed on the computer enables it to implement the RPA node running method based on process tree snapshot pruning as described in any of the above embodiments.
[0051] This invention also provides a computer storage medium, wherein the computer-readable storage medium stores a computer-executable program, which, when executed by a processor, implements the RPA node running method based on process tree snapshot pruning described in any of the above embodiments.
[0052] The embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments, and various changes can be made within the scope of knowledge possessed by those skilled in the art without departing from the spirit of the present invention. Furthermore, the embodiments of the present invention and the features thereof can be combined with each other unless otherwise specified.
Claims
1. A method for RPA node running based on process tree snapshot pruning, characterized in that, include: Receive node pruning commands triggered by users under the target node; In response to the node pruning command, a deep copy of the current process tree is performed to obtain a snapshot of the process tree; Based on the node pruning instruction, delete all sibling active nodes before the target node in the process tree snapshot, and recursively delete all preceding sibling active nodes at the level of the parent node corresponding to the target node to obtain the first target process tree. Alternatively, based on the node pruning instruction, delete all sibling active nodes after the target node in the process tree snapshot, and recursively delete all subsequent sibling active nodes at the level of the parent node corresponding to the target node, thereby obtaining the second target process tree; After verifying and processing the first or second target process tree, the data is sent to the backend RPA assistant for execution.
2. The RPA node running method based on process tree snapshot pruning according to claim 1, characterized in that, The process tree snapshot obtained by performing a deep copy of the current process tree includes: Obtain the FlowTree data object of the current process tree; Convert the FlowTree data object into a JSON string; Convert the JSON string back into a new FlowTree data object to obtain the process tree snapshot.
3. The RPA node running method based on the process tree snapshot pruning according to claim 1 or 2, characterized in that, Deleting all active sibling nodes preceding the target node in the process tree snapshot includes: Obtain a list of all branches of all activities of the corresponding parent node under the target node, and denote it as the first branch list; Traverse the first branch list to obtain the position of the target node; Based on the location of the target node, delete all active sibling nodes preceding the target node.
4. The RPA node operation method based on process tree snapshot pruning according to claim 3, characterized in that, The recursive upward deletion of all preceding sibling active nodes at the same level as the parent node corresponding to the target node includes: Determine whether the parent node corresponding to the target node is the root node; If so, then no further action will be taken; Otherwise, take the parent node corresponding to the target node as the current target node, and recursively delete all preceding active nodes in the level where the current target node is located, so that the parent node corresponding to the target node becomes the root node.
5. The RPA node operation method based on process tree snapshot pruning according to claim 1 or 2, characterized in that, Deleting all sibling active nodes after the target node in the target process tree includes: Obtain a list of all branches of all activities of the corresponding parent node under the target node, and denote it as the second branch list; Traverse the second branch list to obtain the position of the target node; Based on the location of the target node, delete all active sibling nodes following the target node.
6. The RPA node operation method based on process tree snapshot pruning according to claim 5, characterized in that, The recursive upward deletion of all subsequent sibling active nodes at the same level as the parent node corresponding to the target node includes: Determine whether the parent node corresponding to the target node is the root node; If so, then no further action will be taken; Otherwise, take the parent node corresponding to the target node as the current target node, and recursively delete all subsequent active nodes at the level where the current target node is located, so that the parent node corresponding to the target node becomes the root node.
7. The RPA node operation method based on process tree snapshot pruning according to claim 1, 2, 4 or 6, characterized in that, The verification and data processing of the first target process tree or the second target process tree includes: Verify whether the first target process tree or the second target process tree is empty; If so, terminate the operation and issue a prompt; otherwise, The external filenames referenced by the first or second target process tree are replaced with IDs and then serialized before being sent to the RPA assistant.
8. The RPA node operation method based on process tree snapshot pruning according to claim 1, 2, 4 or 6, characterized in that, When receiving a node trimming command triggered by a user under the target node, it is determined whether the preset activation conditions are met; The preset activation conditions include: only one active node is currently selected and the node is not in the state machine container editing view; If the preset activation conditions are met, proceed with the subsequent steps; Otherwise, an error message will be displayed.
9. An RPA node operation device based on process tree snapshot pruning, characterized in that, include: The instruction receiving module is used to receive node pruning instructions triggered by users under the target node; The process tree snapshot copy module is used to perform a deep copy of the current process tree in response to the node pruning command to obtain a process tree snapshot. The first trimming module is used to delete all sibling active nodes before the target node in the process tree snapshot based on the node trimming instruction, and to recursively delete all preceding sibling active nodes in the level of the parent node corresponding to the target node, so as to obtain the first target process tree. The second trimming module is used to delete all sibling active nodes after the target node in the process tree snapshot based on the node trimming instruction, and to recursively delete all subsequent sibling active nodes at the level of the parent node corresponding to the target node, thereby obtaining the second target process tree. The verification processing execution module is used to verify and process the first target process tree or the second target process tree before sending it to the backend RPA assistant for execution.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores an executable program, which is executed by a processor to implement the RPA node running method based on process tree snapshot pruning as described in any one of claims 1-8.