A concurrent operation system and method in a WeChat RPA scenario

By optimizing WeChat RPA tasks through concurrent operating systems and the SendMessage interface, the performance bottleneck caused by single-threaded operations has been resolved, achieving high-efficiency concurrency and compatibility, and improving the overall efficiency of WeChat RPA tasks.

CN117194022BActive Publication Date: 2026-11-24广州市申迪计算机系统有限公司
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311143461.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-05
Publication Date
2026-11-24
Estimated Expiration
2043-09-05

AI Technical Summary

Technical Problem

In WeChat RPA scenarios, the performance bottleneck caused by single-threaded keyboard and mouse operations, especially in large-scale automated tasks, affects efficiency.

Method used

A concurrent operating system is adopted, and the concurrency of tasks is reasonably allocated through the task allocation and scheduling module. The SendMessage interface is used to replace unnecessary focus grabbing operations, the task execution module is optimized, and a result verification module is introduced to ensure the success of the operation.

Benefits of technology

It improves the concurrency of WeChat RPA tasks, reduces focus contention, increases multitasking efficiency, is compatible with WeChat operations in obscured states, and enhances overall automation efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117194022B_ABST
    Figure CN117194022B_ABST
Patent Text Reader

Abstract

This invention provides a concurrent operating system and method for WeChat RPA scenarios. The system receives and parses the robot's RPA operation instructions and parameters through a task execution module; it determines whether the target operation software is WeChat; if so, it executes the WeChat automated operation; otherwise, it executes a general RPA operation. This invention treats focus grabbing and the WeChat main window as critical resources, and replaces unnecessary focus grabbing operations in WeChat with the SendMessage interface, allowing WeChat to continue execution even when it is obscured (not grabbing focus), reducing WeChat's focus grabbing rate and achieving the effect of simultaneously operating WeChat and other software, thus improving concurrency. This invention can operate WeChat while it is obscured (not grabbing focus), solving the problem of focus grabbing with other software. The SendMessage interface of this invention can be called by multiple threads.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of RPA technology, and in particular to a concurrent operating system and method for WeChat RPA scenarios. Background Technology

[0002] RPA (Robotic Process Automation) is a technology that allows businesses to deploy RPA tools to help employees handle a large number of rule-based, repetitive workflow tasks, reducing human error and improving operational efficiency.

[0003] With the widespread use of WeChat, more and more enterprises are using WeChat to stay in touch with customers, which has also given rise to various use cases for WeChat in RPA automation, such as intelligent responses and personalized recommendations for target groups in customer service, technical support, and after-sales service. WeChat automation accounts for a significant proportion of RPA processes.

[0004] Current RPA primarily simulates keyboard and mouse operations to perform actions in applications with a user interface. Its underlying technology includes calls to the SendInput interface of the User32 library, which manifests in the Windows user interface as visible mouse movement and clicks.

[0005] However, when the volume of automated tasks is large, the performance bottleneck may be concentrated in single-threaded keyboard and mouse operations and UI response. Therefore, improving the utilization of keyboard and mouse can improve the efficiency of automation. Summary of the Invention

[0006] To address the shortcomings of existing technologies, this invention provides a concurrent operating system and method for WeChat RPA scenarios.

[0007] The technical solution of the present invention is: a concurrent operating system for WeChat RPA scenarios, including a task allocation and scheduling module, a task execution module, and a result verification module;

[0008] The task allocation and scheduling module is used to adjust the concurrency of tasks appropriately based on the computer resource usage; and to perform reasonable concurrency allocation of tasks based on the proportion of non-focus preemption instructions in the computer tasks.

[0009] The task execution module treats focus grabbing and the WeChat main window as critical resources, and replaces unnecessary focus grabbing operations in WeChat with the SendMessage interface, allowing WeChat to continue to perform operations even when it is obscured. The module parses the instructions and parameters of the received task and determines whether the task is the execution target. If it is, it performs automated operations on the execution target; otherwise, it performs general robot RPA operations.

[0010] The result verification module is used to verify whether the robot has successfully executed each operation instruction. If successful, the next operation instruction is executed. If it fails, the failed operation is recorded in the log or an alarm is issued, and the robot is retried three times. If it still fails, the current task is terminated or the operation instruction is skipped and the robot continues to execute according to the instruction requirements.

[0011] Preferably, the task allocation and scheduling module allocates and schedules tasks based on computer resources. Specifically, when the computer resource utilization rate is low, it adds new tasks to be executed so that the robot can process them concurrently, or it allows the robot to continue executing tasks that are currently paused.

[0012] When computer resource usage is high, stop adding new tasks to the robot, and pause some tasks that are in progress if necessary.

[0013] Preferably, if the proportion of non-focus preemption instructions in the overall tasks being executed is low, when adding new tasks or executing paused tasks, tasks with a high proportion of non-focus preemption instructions should be assigned first, or tasks with a low proportion of non-focus preemption instructions should be paused first.

[0014] This invention also provides a method for concurrent operations in a WeChat RPA scenario, comprising the following steps:

[0015] S1) Receive and parse the robot's RPA operation instructions and parameters through the task execution module;

[0016] S2) Determine whether the target software is WeChat. If it is, proceed to step S3); otherwise, proceed to step S4.

[0017] S3) Perform automated WeChat operations;

[0018] S4) Perform general RPA operations.

[0019] Preferably, step S3) specifically includes the following steps for performing the WeChat automated operation:

[0020] S31) Lock the WeChat window;

[0021] S32) Determine whether the process is a focus grabbing. If yes, proceed to step S33); otherwise, proceed to step S37.

[0022] S33) Lock the focus capture operation;

[0023] S34) Execute the original RPA process.

[0024] S35) Unlock the focus capture operation;

[0025] S36) Unlock the WeChat window to complete the operation.

[0026] Preferably, step S37) specifically involves: obtaining the WeChat window handle and element coordinate information, calling the SendMessage interface, and unlocking the WeChat window.

[0027] Preferably, step S4) specifically includes the following steps for performing the general RPA operation:

[0028] S41) Lock the focus capture operation;

[0029] S42) Invoke the original RPA implementation process;

[0030] S43) Unlock the focus capture operation.

[0031] Preferably, the locking operation refers to establishing a global static variable for the object that needs to be locked, that is, the lifecycle of the variable is consistent with that of the robot, and then acquiring the mutex lock of the variable.

[0032] Preferably, the unlocking operation refers to releasing the mutex lock of the variable.

[0033] The beneficial effects of this invention are as follows:

[0034] 1. This invention treats focus grabbing and the WeChat main window as critical resources, and replaces unnecessary focus grabbing operations in WeChat with the SendMessage interface, allowing WeChat to continue performing operations in an obscured (non-focus grabbing) state, reducing WeChat's focus grabbing occupancy rate, achieving the effect of operating WeChat and other software simultaneously, and improving concurrency.

[0035] 2. This invention can operate WeChat while it is in a state where WeChat is obscured (not competing for focus), thus solving the problem of competing for focus with other software;

[0036] 3. The SendMessage interface of this invention can be called by multiple threads, which is more concurrent than the single-threaded operation of keyboard and mouse in general RPA processes. Attached Figure Description

[0037] Figure 1 This is a structural framework diagram of the system of the present invention;

[0038] Figure 2 This is a flowchart of the method of the present invention;

[0039] Figure 3 This is a flowchart illustrating the automated WeChat operation process of the present invention.

[0040] Figure 4This is a flowchart illustrating the general RPA operation of this invention. Detailed Implementation

[0041] The specific embodiments of the present invention will be further described below with reference to the accompanying drawings:

[0042] Example 1

[0043] like Figure 1 As shown, this embodiment provides a concurrent operating system for WeChat RPA scenarios, including a task allocation and scheduling module, a task execution module, and a result verification module;

[0044] The task allocation and scheduling module is used to adjust the concurrency of tasks appropriately based on the computer resource usage; and to perform reasonable concurrency allocation of tasks based on the proportion of non-focus preemption instructions in the computer tasks.

[0045] The task execution module treats focus grabbing and the WeChat main window as critical resources, and replaces unnecessary focus grabbing operations in WeChat with the SendMessage interface, allowing WeChat to continue to perform operations even when it is obscured. The module parses the instructions and parameters of the received task and determines whether the task is the execution target. If it is, it performs automated operations on the execution target; otherwise, it performs general robot RPA operations.

[0046] The result verification module is used to verify whether the robot has successfully executed each operation instruction. If successful, the next operation instruction is executed. If it fails, the failed operation is recorded in the log or an alarm is issued, and the robot is retried three times. If it still fails, the current task is terminated or the operation instruction is skipped and the robot continues to execute according to the instruction requirements.

[0047] Preferably, the task allocation and scheduling module allocates and schedules tasks based on computer resources. Specifically, when the computer resource utilization rate is low, it adds new tasks to be executed so that the robot can process them concurrently, or it allows the robot to continue executing tasks that are currently paused.

[0048] When computer resource usage is high, stop adding new tasks to the robot, and pause some tasks that are in progress if necessary.

[0049] Preferably, if the proportion of non-focus preemption instructions in the overall tasks being executed is low, when adding new tasks or executing paused tasks, tasks with a high proportion of non-focus preemption instructions should be assigned first, or tasks with a low proportion of non-focus preemption instructions should be paused first.

[0050] Example 2

[0051] like Figure 2As shown, this embodiment provides a concurrent operation method in a WeChat RPA scenario, including the following steps:

[0052] S1) Receive and parse the robot's RPA operation instructions and parameters through the task execution module;

[0053] S2) Determine whether the target software is WeChat. If it is, proceed to step S3); otherwise, proceed to step S4.

[0054] S3) Perform automated WeChat operations;

[0055] S4) Perform general RPA operations.

[0056] As a preferred option, such as Figure 3 As shown, step S3) specifically includes the following steps for performing automated WeChat operations:

[0057] S31) Lock the WeChat window;

[0058] S32) Determine whether the process is a focus grabbing. If yes, proceed to step S33); otherwise, proceed to step S37.

[0059] S33) Lock the focus capture operation;

[0060] S34) Execute the original RPA process.

[0061] S35) Unlock the focus capture operation;

[0062] S36) Unlock the WeChat window to complete the operation.

[0063] Preferably, step S37) specifically involves: obtaining the WeChat window handle and element coordinate information, calling the SendMessage interface, and unlocking the WeChat window.

[0064] As a preferred option, such as Figure 4 As shown, step S4) specifically includes the following steps in performing the general RPA operation:

[0065] S41) Lock the focus capture operation;

[0066] S42) Invoke the original RPA implementation process;

[0067] S43) Unlock the focus capture operation.

[0068] In this preferred embodiment, the locking operation refers to establishing a global static variable for the object that needs to be locked, that is, the lifecycle of the variable is consistent with that of the robot, and then acquiring the mutex lock of the variable.

[0069] In this preferred embodiment, the unlocking operation refers to releasing the mutex lock of the variable.

[0070] The embodiments and descriptions above are merely illustrative of the principles and preferred embodiments of the present invention. Various changes and modifications may be made to the present invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed.

Claims

1. A concurrent operating system for WeChat RPA scenarios, characterized in that: It includes a task allocation and scheduling module, a task execution module, and a result verification module; The task allocation and scheduling module is used to adjust the concurrency of tasks appropriately based on the computer resource usage; and to perform reasonable concurrency allocation of tasks based on the proportion of non-focus preemption instructions in the computer tasks. The task execution module treats focus grabbing and the WeChat main window as critical resources, and replaces unnecessary focus grabbing operations in WeChat with the Send Message interface, allowing WeChat to continue to perform operations even when it is obscured. The module parses the instructions and parameters of the received task and determines whether the task is the execution target. If it is, it performs automated operations on the execution target; otherwise, it performs general robot RPA operations. The result verification module is used to verify whether the robot has successfully executed each operation instruction. If successful, the next operation instruction is executed. If it fails, the failed operation is recorded in the log or an alarm is issued, and the robot is retried three times. If it still fails, the current task is terminated or the operation instruction is skipped and continued to be executed according to the instruction requirements.

2. The concurrent operating system for WeChat RPA scenarios according to claim 1, characterized in that: The task allocation and scheduling module allocates and schedules tasks based on computer resources. Specifically, when the computer resource utilization rate is low, it adds new tasks to be executed so that the robot can process them concurrently, or it allows the robot to continue executing tasks that are currently paused. When computer resource usage is high, stop adding new tasks to the robot, or pause some tasks that are in progress.

3. A concurrent operating system for WeChat RPA scenarios according to claim 1, characterized in that: If the proportion of non-focus preemption instructions in the overall tasks being executed is low, when adding new tasks or executing paused tasks, tasks with a high proportion of non-focus preemption instructions will be prioritized for allocation, or tasks with a low proportion of non-focus preemption instructions will be prioritized for suspension.

4. A concurrent operation method in a WeChat RPA scenario, characterized in that, Based on the concurrent operating system implementation in the WeChat RPA scenario as described in any one of claims 1-3, the implementation includes the following steps: S1) Receive and parse the robot's RPA operation instructions and parameters through the task execution module; S2) Determine whether the target software is WeChat. If it is, proceed to step S3); otherwise, proceed to step S4. S3) Perform automated WeChat operations, specifically including the following steps: S31) Lock the WeChat window; S32) Determine if the process is to seize focus. If yes, proceed to step S33); otherwise, proceed to step S37. S33) Lock the focus capture operation; S34) Execute the original RPA process. S35) Unlock the focus capture operation; S36) Unlock the WeChat window to complete the operation; S37) Obtain the WeChat window handle and element coordinate information, call the SendMessage interface, and unlock the WeChat window; S4) Perform general RPA operations, which include the following steps: S41) Lock the focus capture operation; S42) Invoke the original RPA implementation process; S43) Unlock the focus capture operation.

5. The concurrent operation method in a WeChat RPA scenario according to claim 4, characterized in that: The locking operation refers to creating a global static variable for the object that needs to be locked, meaning that the lifecycle of the variable is consistent with that of the robot, and then acquiring the mutex lock of the variable.

6. The concurrent operation method in a WeChat RPA scenario according to claim 4, characterized in that: The unlocking operation refers to releasing the mutex lock on the variable.

Citation Information

Patent Citations

  • Data acquisition method, device and equipment based on RPA robot and storage medium

    CN114201629A