RPA task execution method and device, equipment and medium
The parallel execution mechanism handles network requests of independent controls, which solves the problem of low execution efficiency of existing RPA tasks and achieves faster and more accurate web operation processing.
Patent Information
- Application Number
- CN202411275295.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-12
- Publication Date
- 2024-12-31
AI Technical Summary
Existing RPA tasks are less efficient in execution, resulting in longer and less efficient in performing complex web page operations.
Through the parallel execution mechanism, click on multiple independent controls in the current web page, send a network request to the server, and match after receiving the response message, determining the subtask execution result of each control.
It improves the execution efficiency of RPA tasks, shortens the execution time, enhances execution accuracy, and avoids the impact of waiting time threshold settings and page element changes.
Smart Images

Figure CN119225591A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of Robotic Process Automation (RPA) technology, and in particular to a method, device, equipment, and medium for executing an RPA task. Background Art
[0002] By simulating the behavior of human operators, RPA technology can automatically perform a series of predefined computer tasks, especially repetitive tasks performed on the user interface (UI), greatly improving work efficiency and accelerating the digital transformation of business processes.
[0003] At present, when executing RPA tasks, you usually click on the pending control in the first-level web page of the browser, and display the second-level web page corresponding to the control through the browser. If there are still pending controls in the second-level web page, repeat the above operation, that is, click on the pending control in the second-level web page again, and display the third-level web page corresponding to the control through the browser. If there are no pending controls in the second-level web page, return to the first-level web page and continue to click the next pending control.
[0004] However, the existing technology has the problem of low execution efficiency of RPA tasks. Summary of the invention
[0005] In view of the above problems, embodiments of the present invention provide an RPA task execution method, apparatus, device and medium, which are used to solve the problem of low RPA task execution efficiency in the prior art.
[0006] According to one aspect of an embodiment of the present invention, a method for executing an RPA task is provided, the method comprising:
[0007] According to the RPA task, click multiple first controls in the current webpage, where the first controls are independent of each other;
[0008] Sending a network request corresponding to each first control to the server;
[0009] Receiving a response message returned by the server;
[0010] Matching the response message with the network request corresponding to each first control, and determining the first control corresponding to the successfully matched network request as the second control;
[0011] According to the response message, an execution result of the subtask corresponding to the second control in the RPA task is determined.
[0012] According to another aspect of an embodiment of the present invention, there is provided an RPA task execution device, including:
[0013] A click module, for clicking a plurality of first controls in a current web page according to a Robotic Process Automation (RPA) task, wherein the first controls are independent of each other;
[0014] A sending module, used for sending a network request corresponding to each first control to the server;
[0015] A receiving module, used for receiving a response message returned by the server;
[0016] A matching module, used to match the response message with the network request corresponding to each first control, and determine the first control corresponding to the successfully matched network request as the second control;
[0017] A determination module is used to determine an execution result of the subtask corresponding to the second control in the RPA task according to the response message.
[0018] According to another aspect of an embodiment of the present invention, there is provided an electronic device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;
[0019] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute the RPA task execution method as described above.
[0020] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, wherein at least one executable instruction is stored in the storage medium. When the executable instruction is executed on an execution device of an electronic device / RPA task, the execution device of the electronic device / RPA task performs the following operations:
[0021] According to the RPA task, click multiple first controls in the current webpage, where the first controls are independent of each other;
[0022] Sending a network request corresponding to each first control to the server;
[0023] Receiving a response message returned by the server;
[0024] Matching the response message with the network request corresponding to each first control, and determining the first control corresponding to the successfully matched network request as the second control;
[0025] According to the response message, an execution result of the subtask corresponding to the second control in the RPA task is determined.
[0026] The embodiment of the present invention opens the first controls in sequence through a parallel execution mechanism, and associates the response message with the first control after receiving the response message, thereby determining the execution result of the subtask corresponding to each first control. By controlling the mutually independent first controls in parallel, the execution efficiency of the RPA task is effectively improved and the execution time is shortened.
[0027] The above description is only an overview of the technical solution of the embodiment of the present invention. In order to more clearly understand the technical means of the embodiment of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the embodiment of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The accompanying drawings are only used to illustrate the embodiments and are not to be considered as limiting the present invention. In addition, the same reference symbols are used to represent the same components throughout the accompanying drawings. In the accompanying drawings:
[0029] Figure 1 A flowchart of an RPA task execution method provided by the prior art is shown;
[0030] Figure 2 A flowchart of a first embodiment of a method for executing an RPA task provided by the present invention is shown;
[0031] Figure 3 A schematic diagram of a browser window provided by the present invention is shown;
[0032] Figure 4 A flowchart of a second embodiment of the method for executing an RPA task provided by the present invention is shown;
[0033] Figure 5 A flowchart of a third embodiment of the method for executing an RPA task provided by the present invention is shown;
[0034] Figure 6 A schematic diagram showing the structure of an embodiment of an RPA task execution device provided by the present invention;
[0035] Figure 7 A schematic structural diagram of an embodiment of an electronic device provided by the present invention is shown. DETAILED DESCRIPTION
[0036] Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited to the embodiments set forth herein.
[0037] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the present invention are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards, and corresponding operation entrances shall be provided for users to choose to authorize or refuse.
[0038] Before introducing the present invention, the technical terms involved in the present invention are explained:
[0039] RPA: It can simulate the operations performed by humans on computers to automate repetitive and tedious tasks. Different from traditional computer automation, RPA can automate operations such as mouse clicks, keyboard input, and reading information on any application because it can handle more complex tasks such as understanding context and processing unstructured data.
[0040] Domain Socket: Provides a reliable, high-performance inter-process communication method. Both parties can create a Domain Socket by creating a special type of file in the file system. Two processes can communicate by opening this file and using standard Socket read and write operations. It avoids some of the overhead in network sockets (network protocol stack packaging, unpacking, checksum calculation, sorting, etc.), and can use the kernel buffer of the operating system to achieve efficient data transmission.
[0041] Next, the background technology to which the present invention relates is explained.
[0042] In the wave of digital transformation, enterprises are constantly seeking ways to improve efficiency and reduce costs. Against this background, RPA technology came into being. By simulating the behavior of human operators, RPA technology can automatically perform a series of predefined computer tasks, especially repetitive work on the UI.
[0043] As an important platform for information exchange and business processing, web pages have naturally become a hot area for RPA technology applications. Various interactions on web pages, such as data input, form submission, information retrieval, etc., can be automated through RPA technology. RPA technology can browse web pages like human users, identify page elements, and perform operations such as clicking, inputting, and scrolling to complete complex task processes.
[0044] In web applications, the potential of RPA technology has been fully utilized. For example, in the field of e-commerce, RPA technology can automate the processing of orders, from receiving orders to inventory checks, to order confirmation and shipping notifications, without human intervention in the entire process. In the financial services industry, RPA technology can monitor market trends, automatically execute trading instructions, or handle customer service requests, such as account inquiries and transaction record updates. In addition, RPA technology can also be used for data analysis, collecting data from multiple sources, cleaning and integrating it, and providing high-quality data input for decision support systems.
[0045] In short, the application of RPA technology on the web not only improves work efficiency and reduces human errors, but also frees up human resources, allowing employees to focus on more creative and strategic tasks. With the growing demand for web automation in enterprises, RPA technology has greatly improved work efficiency and accelerated the digital transformation of business processes.
[0046] At present, the existing RPA technology is mainly used Figure 1 The method implementation of the illustrated embodiment. Figure 1 The flowchart of the method for executing an RPA task provided by the prior art is shown, and the method is executed by an electronic device. Figure 1 As shown, the method comprises the following steps:
[0047] Step 101: Open a browser deployed in an electronic device according to an RPA task.
[0048] Step 102: Open the login page in the browser according to the RPA task, and log in the user through the login page.
[0049] Step 103: Open the list page in the browser according to the RPA task.
[0050] Step 104: Process the data table control to be processed in the list page, and open the details page corresponding to the data table control to be processed.
[0051] Step 105: Wait for the page data of the details page to load.
[0052] Step 106: After detecting that the page data of the details page has been loaded, process the pending controls in the details page.
[0053] Step 107: Wait for page elements of the details page to change.
[0054] Step 108: If the waiting time exceeds the preset time and the page elements of the details page do not change during the waiting time, the staff is notified.
[0055] Step 109: If the waiting time does not exceed the preset time and the page elements of the details page change during the waiting time, the details page is closed.
[0056] Step 110: If all the data table controls to be processed in the list page have been processed, the list page is closed to determine that the RPA task is completed.
[0057] In summary, when executing RPA tasks, you usually click on the data table control to be processed in the first-level web page (list page) to open the second-level web page (details page) corresponding to the data table control. After that, after the page data in the second-level web page is loaded, the control to be processed in the second-level web page is further processed to open the third-level web page corresponding to the control to be processed. According to the above process, the web pages are processed level by level until the newly opened web page no longer has the control to be processed. At this time, return to the first-level web page and continue to process the next data table control to be processed.
[0058] However, if there are multiple data table controls on a list page, the prior art can only process the next data table control in the list page after performing the corresponding operation on one data table control in the list page, resulting in a long execution time and low efficiency for the RPA task.
[0059] Based on the above technical problems, the technical concept of the present invention is as follows: Considering that when executing the subtask corresponding to each control in the RPA task, the electronic device needs to send a network request to the server through the browser. After the subtask is successfully executed, the server will return a response message to the electronic device, and the network request corresponds to the response message. Therefore, when there are multiple controls that need to be operated on the current web page, and these controls do not affect each other and are independent of each other, these controls can be operated in parallel, and these controls can be clicked in turn, thereby triggering the sending of network requests corresponding to each control to the server. Afterwards, after the server returns the response message, these response messages are matched one-to-one with the network request, so that the execution results of the subtasks corresponding to each control that needs to be operated in the RPA task can be determined. Compared with the serial processing of different controls in the prior art, this technical solution effectively improves the efficiency of executing RPA tasks.
[0060] The technical solution of the present invention is described in detail below in conjunction with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0061] Figure 2The flowchart of the first embodiment of the method for executing an RPA task provided by the present invention is shown, and the method is executed by an electronic device. The electronic device can be a terminal device, such as a laptop, a desktop computer, a smart phone, etc., and can also be a server. In practical applications, whether the electronic device is specifically implemented as a terminal device or a server can be determined according to actual conditions, and the embodiment of the present invention does not specifically limit this. Figure 2 As shown, the method comprises the following steps:
[0062] Step 210: According to the RPA task, click multiple first controls in the current web page.
[0063] The RPA task includes multiple subtasks and the execution order of the subtasks, and each subtask includes a corresponding control. For example, the subtask may be: clicking on control A in web page A.
[0064] Optionally, an RPA task may be generated by an electronic device in response to a user's operation, may be obtained from a data storage device storing the RPA task, or may be sent by other devices. The embodiment of the present invention does not impose specific restrictions on the method of obtaining the RPA task, which may be determined based on actual conditions.
[0065] It should be understood that a browser can open one or more web pages (also referred to as tabs). When a browser opens multiple web pages, only one of the web pages (e.g., web page 1) will be displayed in the browser window. When a user wants to view another web page (web page 2), the user can click on the web page 2 that he wants to view, and the electronic device will switch the web page displayed in the browser window from web page 1 to web page 2 in response to the user's click operation.
[0066] Optionally, different web pages can be processed by different threads. Exemplarily, one thread can be used to process one web page.
[0067] The web page currently being displayed in the browser window is the current web page.
[0068] The first control is a control in the current webpage corresponding to the RPA task, and different first controls are independent of each other. In other words, the execution of any first control does not depend on the execution results of other first controls.
[0069] For example, assuming that there is a first control 1 in the current web page, after clicking the first control 1, the browser will respond to the user's click operation and display the first control 2 in the current web page. At this time, the first control 2 depends on the first control 1, and the first control 1 and the first control 2 are not independent. Assuming that there are first controls 3 and 4 in the current web page, clicking the first control 3 will open web page B, and clicking the first control 4 will open web page C, it means that the first control 3 and the first control 4 are independent of each other.
[0070] Exemplarily, the first control may be a data table control.
[0071] Figure 3 Schematic diagram of the browser window provided by the present invention is shown. Figure 3 As shown, three web pages are opened in the browser window, namely web page 1, web page 2 and web page 3. Among them, the current web page is web page 1. Specifically, a table is displayed in web page 1, which is used to display the order information, including: order number, order time, order amount and status. There are three records in the table. Among them, a data table control (i.e., number 1, number 2, number 3) is set at the order number of each record. When the user clicks the data table control, the electronic device will respond to the user's click operation, open a new web page in the browser window, and display the order details page corresponding to the clicked data table control in the new web page.
[0072] The first controls in the current web page may be clicked in sequence according to a certain order, or may be clicked randomly. The embodiment of the present invention does not limit the order of clicking the first controls.
[0073] Step 220: Send a network request corresponding to each first control to the server.
[0074] In the embodiment of the present invention, the electronic device has established a communication connection with the server in advance. After clicking the first control, the electronic device can send a network request corresponding to the first control to the server through the communication connection.
[0075] Optionally, the electronic device may also monitor all network requests sent by the electronic device to the server.
[0076] Correspondingly, the server receives the network request sent by the electronic device, processes the network request, generates and returns a response message to the electronic device.
[0077] Step 230: Receive a response message returned by the server.
[0078] The electronic device receives the response message returned by the server through the communication connection shown in step 220 .
[0079] Step 240: Match the response message with the network request corresponding to each first control, and determine the first control corresponding to the successfully matched network request as the second control.
[0080] Since the electronic device sends multiple network requests to the server, after receiving the response message returned by the server, it is necessary to determine which network request the response message corresponds to. That is, it is necessary to determine which first control (i.e., second control) the response message is the processing result generated after clicking, so as to load the page data in the response message into the current web page or the web page opened by clicking the second control.
[0081] In one possible implementation, the uniform resource locator (URL) of the response message is matched with the URL of the network request corresponding to each first control, and the first control corresponding to the network request with the same URL as the response message is determined as the second control.
[0082] In the implementation, considering that the URL of the network request and the URL of the response message are in one-to-one correspondence, the URL of the response message can be compared with the URL of the monitored network request. If a network request with the same URL as the response message is found, the first control corresponding to the network request is determined as the second control. Through this method, the purpose of quickly matching the response message with the second control can be achieved, further improving the execution efficiency of the RPA task.
[0083] Optionally, communication interaction between different processes can be achieved through Domain Socket.
[0084] Step 250: Determine the execution result of the subtask corresponding to the second control in the RPA task according to the response message.
[0085] The execution result can be used to indicate whether the subtask corresponding to the second control is executed successfully. For example, if the subtask corresponding to the second control is a data update task, the execution result is used to indicate whether the update is successful; if the subtask corresponding to the second control is a test task, the execution result is used to indicate whether the second control passes the test.
[0086] Furthermore, if the subtask corresponding to the second control is an acquisition task, the execution result may also include the acquired data.
[0087] Optionally, page data may be loaded for the current web page or the web page corresponding to the second control according to the response message.
[0088] The execution method of the RPA task provided in an embodiment of the present invention, according to the RPA task, clicks on multiple first controls in the current web page. After that, a network request corresponding to each first control is sent to the server, and a response message returned by the server is received. Then, the response message is matched with the network request corresponding to each first control, and the first control corresponding to the successfully matched network request is determined as the second control. Finally, according to the response message, the execution result of the subtask corresponding to the second control in the RPA task is determined. Among them, the first controls are independent of each other. In this technical solution, the first controls are opened in sequence through a parallel execution mechanism, and the response message is associated with the first control after receiving the response message, so as to determine the execution result of the subtask corresponding to each first control. By controlling the independent first controls in parallel, the execution efficiency of the RPA task is effectively improved and the execution time is shortened.
[0089] At the same time, the prior art can only wait for the page element to change or a pop-up window to appear after clicking the first control on the web page. For example, since a pop-up window will appear in the specified area of the current web page after clicking the first control, the specified area can be frequently screenshoted to determine whether a pop-up window appears in the specified area based on the captured images; or a certain changed element of the UI can be directly analyzed to determine whether there is a response change after clicking the first control.
[0090] However, in the process of waiting for page elements to change or for a pop-up window to appear, the existing technology may have the following problems:
[0091] a) Web pages may get stuck (page rendering becomes slow), resulting in a long waiting time. However, the RPA task needs to set a waiting time threshold in advance. If the waiting time threshold is set very short, the subtask corresponding to the first control will be executed successfully, but due to the long processing time, the electronic device will think that the subtask execution has failed. If the waiting time threshold is set too long, it will take a long time to get the execution result of the subtask each time. In summary, the existing technology has the problem of low RPA task execution accuracy.
[0092] b) The change of this page element may be instantaneous (for example, the pop-up box will disappear automatically after 1 to 3 seconds), resulting in the inability to accurately identify that the subtask corresponding to the first control has been successfully executed, and there is also the problem of low RPA task execution accuracy.
[0093] The embodiment of the present invention utilizes the fact that when an electronic device interacts with a server, the electronic device needs to send a network request to the server, and after the subtask corresponding to the first control is successfully executed, the server also needs to return a response message to the electronic device. The response message corresponds to the network request one-to-one. By monitoring the network request sent by the electronic device to the server, the response message returned by the server is matched with the monitored network request, so as to accurately determine which subtask corresponding to the first control has been successfully executed and which subtask corresponding to the first control has not been successfully executed. In this solution, there is no need to pre-set the waiting time threshold, and it is not affected by changes in page elements, thereby ensuring the execution accuracy of the RPA task.
[0094] In some scenarios, after receiving the response message, the page data in the response message needs to be loaded into the web page corresponding to the second control, so as to continue to execute the RPA task based on the web page corresponding to the second control.
[0095] based on Figure 2 The embodiment shown in the following will be Figure 4 The implementation process of the RPA task execution method in the above scenario is explained in detail.
[0096] Figure 4 The flowchart of the second embodiment of the method for executing an RPA task provided by the present invention is shown, and the method is executed by an electronic device. Figure 4 As shown, the method comprises the following steps:
[0097] Step 210: According to the RPA task, click multiple first controls in the current web page.
[0098] Step 410: Open the web page corresponding to each first control.
[0099] The web page corresponding to the first control is a web page that is triggered to open after clicking the first control, and the web page is used to display the result corresponding to clicking the first control.
[0100] Step 420: Generate page information corresponding to each first control according to the web page corresponding to each first control.
[0101] The page information corresponding to the first control includes the identifier and title of the web page corresponding to the first control.
[0102] After opening the web page corresponding to the first control, the page information corresponding to the first control is generated so that after the second control is determined from the first control, the target web page corresponding to the second control can be accurately located according to the page information corresponding to the second control.
[0103] Step 220: Send a network request corresponding to each first control to the server.
[0104] Step 230: Receive a response message returned by the server.
[0105] Step 240: Match the response message with the network request corresponding to each first control, and determine the first control corresponding to the successfully matched network request as the second control.
[0106] Optionally, the processing status of the corresponding page information of the second control is updated to completed.
[0107] By recording the status of the page information, the execution status of the subtask corresponding to each first control is determined, so that when any subtask is not successfully executed, the staff can be notified in time for processing.
[0108] Step 430: Determine the target webpage corresponding to the second control according to the page information corresponding to the second control.
[0109] Step 440: Set the target web page as the new current web page.
[0110] In a possible implementation, the target web page identifier is stored in a queue, which is used to queue multiple web pages. When the target web page identifier is at the top of the queue, the target web page is set as the new current web page.
[0111] Specifically, the queue stores the identifiers of multiple web pages, and the web pages are arranged in a first-to-last order according to the time of arrival at the queue. The electronic device obtains the identifier of the web page at the top of the queue, sets the web page corresponding to the identifier as the new current web page, performs subsequent processing in the new current web page (loading page data for the new current web page according to the corresponding response message, and clicking the new first control in the new current web page), and deletes the identifier of the web page from the queue.
[0112] In this implementation, considering that the embodiment of the present invention clicks multiple first controls at one time according to the parallel execution mechanism, multiple response messages will be received in a short time. However, the RPA task can only process the current web page, so it is necessary to process the corresponding web page in turn according to the response message according to the queue, thus ensuring the orderliness of the RPA task execution.
[0113] Optionally, after the target web page is set as the new current web page, web page data may be loaded into the new current web page according to the response message, so that the click result generated after clicking the second control is displayed on the new current web page.
[0114] Step 250: Determine the execution result of the subtask corresponding to the second control in the RPA task according to the response message.
[0115] In the above embodiment, after opening the web page corresponding to the first control, by recording the page information of each web page, the target web page corresponding to the second control can be quickly located after the second control is determined, thereby further improving the efficiency of RPA task execution.
[0116] Optionally, in some embodiments, after setting the target web page as the new current web page, it can be further determined whether the new current web page has a new first control. If so, the above steps 210 to 440 can be repeated until the new current web page does not have a new first control, at which point the RPA task is completed. If not, it is determined that the RPA task is completed.
[0117] Optionally, in some embodiments, according to the processing status of all page information, unprocessed page information whose processing status is waiting for processing can be determined from all page information, and the third control corresponding to the unprocessed page information can be determined. If the waiting processing time of the unprocessed page information exceeds the preset time, execution failure information is generated, and the execution failure information is used to indicate that the subtask corresponding to the third control in the RPA task has failed to execute.
[0118] Specifically, after the page information corresponding to the first control is generated, the timer can be started to start timing, and the waiting processing time obtained by timing can be obtained. When the response message corresponding to the first control is not received for a long time, that is, the processing status is waiting for processing and the waiting processing time exceeds the preset time, the first control is determined as the third control, and the execution failure message is generated and output. Among them, the method of outputting the execution failure message can be at least one of the following: pushing messages to the terminal device used by the staff through the communication software, sending text messages to the mobile phones of the staff, sending emails to the mailboxes of the staff, etc.
[0119] In the above embodiment, by determining whether the subtask corresponding to the first control has timed out, if so, the relevant staff is notified, and if not, the waiting continues, thereby avoiding meaningless long waiting due to network reasons or other interference factors.
[0120] Figure 5 FIG. 1 is a flowchart of a third embodiment of a method for executing an RPA task provided by the present invention, wherein the method is executed by an electronic device. Figure 5 As shown, the method comprises the following steps:
[0121] Step 501: Open a browser deployed in an electronic device according to an RPA task.
[0122] Step 502: Open the login page in the browser according to the RPA task, and log in the user through the login page.
[0123] Step 503: Open the list page in the browser according to the RPA task.
[0124] Step 504: Start the network monitoring component.
[0125] Step 505: cyclically open the first controls in the list page, and generate page information corresponding to each first control.
[0126] Step 506: The network proxy tool monitors all network requests sent by the electronic device.
[0127] Step 507: After monitoring the network request, execute the customized script.
[0128] Step 508: If the Domain Socket is not started, start the Domain Socket immediately.
[0129] Step 509: Match the response message returned by the server with the monitored network request, and determine the second control corresponding to the successfully matched network request;
[0130] Step 510: The network proxy tool notifies the list page according to the second control.
[0131] Step 511: Update the status of the page information corresponding to the second control to processed, and update the web page corresponding to the second control.
[0132] Step 512: If the web page corresponding to the second control needs to continue to execute the RPA task, the identifier of the web page corresponding to the second control is stored in a queue and queued for subsequent processing.
[0133] Step 513: If there is a timed-out subtask, the relevant staff will be notified.
[0134] Step 514: close the network monitoring component and clear the web page information corresponding to each control.
[0135] It should be understood that this technical solution effectively reduces network overhead and improves execution efficiency. At the same time, this solution solves the problem that traditional RPA technology does not recognize the results of button operations (only analyzes the changed UI), and improves the accuracy of executing RPA technology.
[0136] Figure 6 FIG. 1 is a schematic diagram showing a structure of an embodiment of an RPA task execution device provided by the present invention. Figure 6As shown, the RPA task execution device 600 includes: a click module 610, a sending module 620, a receiving module 630, a matching module 640 and a determination module 650.
[0137] The click module 610 is used to click multiple first controls in the current web page according to the RPA task, and the first controls are independent of each other.
[0138] The sending module 620 is used to send the network request corresponding to each first control to the server.
[0139] The receiving module 630 is used to receive a response message returned by the server.
[0140] The matching module 640 is used to match the response message with the network request corresponding to each first control, and determine the first control corresponding to the successfully matched network request as the second control.
[0141] The determination module 650 is used to determine the execution result of the subtask corresponding to the second control in the RPA task according to the response message.
[0142] In an optional manner, the matching module 640 is specifically configured to:
[0143] The URL of the response message is matched with the URL of the network request corresponding to each first control, and the first control corresponding to the network request having the same URL as the response message is determined as the second control.
[0144] In an optional manner, after clicking a plurality of first controls in the current webpage according to the RPA task, the RPA task execution device 600 further includes:
[0145] The opening module is used to open the web page corresponding to each first control.
[0146] The generating module is used to generate page information corresponding to the first control according to the web page corresponding to each first control.
[0147] Correspondingly, after matching the response message with the network request corresponding to each first control and determining the first control corresponding to the successfully matched network request as the second control, the RPA task execution device 600 further includes:
[0148] The determination module 650 is further configured to determine a target web page corresponding to the second control according to the page information corresponding to the second control.
[0149] The setting module is used to set the target web page as the new current web page.
[0150] In an optional manner, a module is provided, specifically for:
[0151] The identifier of the target web page is stored in a queue, and the queue is used to implement queue processing for multiple web pages.
[0152] When the identifier of the target web page is at the first position in the queue, the target web page is set as a new current web page.
[0153] In an optional manner, after matching the response message with the network request corresponding to each first control and determining the first control corresponding to the successfully matched network request as the second control, the RPA task execution device 600 further includes:
[0154] The updating module is used to update the processing status of the corresponding page information of the second control to completed.
[0155] In an optional manner, the determination module 650 is further used to determine, according to the processing status of all the page information, unprocessed page information whose processing status is waiting for processing from all the page information, and determine a third control corresponding to the unprocessed page information.
[0156] The generation module is also used to generate execution failure information if the waiting processing time of the unprocessed page information exceeds a preset time. The execution failure information is used to indicate that the subtask corresponding to the third control in the RPA task has failed to execute.
[0157] In an optional manner, the page information corresponding to the first control includes the identifier and title of the web page corresponding to the first control.
[0158] The execution device of the RPA task opens mutually independent first controls in sequence through a parallel execution mechanism, and associates the response message with the first control after receiving the response message, so as to determine the execution result of the subtask corresponding to each first control, replacing the method of serially executing the subtasks corresponding to each first control in the prior art, effectively improving the execution efficiency of the RPA task and shortening the execution time.
[0159] Figure 7 The schematic diagram of the structure of an embodiment of the electronic device provided by the present invention is shown, and the specific embodiment of the present invention does not limit the specific implementation of the electronic device.
[0160] like Figure 7 As shown, the electronic device may include: a processor (processor) 702 , a communication interface (Communications Interface) 704 , a memory (memory) 706 , and a communication bus 708 .
[0161] The processor 702, the communication interface 704, and the memory 706 communicate with each other through the communication bus 708. The communication interface 704 is used to communicate with other devices such as a client or other server network elements. The processor 702 is used to execute the program 710, which can specifically execute the relevant steps in the above-mentioned execution method embodiment for RPA tasks.
[0162] Specifically, the program 710 may include program code including computer executable instructions.
[0163] The processor 702 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiment of the present invention. The one or more processors included in the electronic device may be processors of the same type, such as one or more CPUs. They may also be processors of different types, such as one or more CPUs and one or more ASICs.
[0164] The memory 706 is used to store the program 710. The memory 706 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0165] Program 710 can be specifically called by processor 702 to enable the electronic device to perform the following operations:
[0166] According to the RPA task, multiple first controls in the current web page are clicked, and the first controls are independent of each other.
[0167] A network request corresponding to each first control is sent to the server.
[0168] Receive the response message returned by the server.
[0169] The response message is matched with the network request corresponding to each first control, and the first control corresponding to the successfully matched network request is determined as the second control.
[0170] According to the response message, the execution result of the subtask corresponding to the second control in the RPA task is determined.
[0171] In an optional manner, matching the response message with the network request corresponding to each first control, and determining the first control corresponding to the successfully matched network request as the second control includes:
[0172] The URL of the response message is matched with the URL of the network request corresponding to each first control, and the first control corresponding to the network request having the same URL as the response message is determined as the second control.
[0173] In an optional manner, after clicking on a plurality of first controls in the current webpage according to the RPA task, the program 710 may be specifically called by the processor 702 to enable the electronic device to perform the following operations:
[0174] Open the web page corresponding to each first control.
[0175] According to the web page corresponding to each first control, page information corresponding to the first control is generated.
[0176] Accordingly, after matching the response message with the network request corresponding to each first control and determining the first control corresponding to the successfully matched network request as the second control, the program 710 may be specifically called by the processor 702 to enable the electronic device to perform the following operations:
[0177] According to the page information corresponding to the second control, a target webpage page corresponding to the second control is determined.
[0178] Set the target web page as the new current web page.
[0179] In an optional manner, setting the target web page as the new current web page includes:
[0180] The identifier of the target web page is stored in a queue, and the queue is used to implement queue processing for multiple web pages.
[0181] When the identifier of the target web page is at the first position in the queue, the target web page is set as a new current web page.
[0182] In an optional manner, after matching the response message with the network request corresponding to each first control and determining the first control corresponding to the successfully matched network request as the second control, the program 710 may be specifically called by the processor 702 to enable the electronic device to perform the following operations:
[0183] The processing status of the page information corresponding to the second control is updated to completed.
[0184] In an optional manner, the page information corresponding to the first control includes the identifier and title of the web page corresponding to the first control.
[0185] The electronic device controls the mutually independent first controls in parallel, associates the response message with the first control after receiving the response message, and thus determines the execution result of the subtask corresponding to each first control, thereby effectively improving the execution efficiency of the RPA task and shortening the execution time.
[0186] An embodiment of the present invention provides a computer-readable storage medium, which stores at least one executable instruction. When the executable instruction runs on an electronic device / RPA task execution device, the electronic device / device executes the RPA task execution method in any of the above method embodiments.
[0187] The executable instructions may be specifically used to enable the electronic device / RPA task execution device 600 to perform the following operations:
[0188] According to the RPA task, multiple first controls in the current web page are clicked, and the first controls are independent of each other.
[0189] A network request corresponding to each first control is sent to the server.
[0190] Receive the response message returned by the server.
[0191] The response message is matched with the network request corresponding to each first control, and the first control corresponding to the successfully matched network request is determined as the second control.
[0192] According to the response message, the execution result of the subtask corresponding to the second control in the RPA task is determined.
[0193] In an optional manner, matching the response message with the network request corresponding to each first control, and determining the first control corresponding to the successfully matched network request as the second control includes:
[0194] The URL of the response message is matched with the URL of the network request corresponding to each first control, and the first control corresponding to the network request having the same URL as the response message is determined as the second control.
[0195] In an optional manner, after clicking multiple first controls in the current web page according to the RPA task, the executable instruction can be specifically used to enable the electronic device / RPA task execution device 600 to perform the following operations:
[0196] Open the web page corresponding to each first control.
[0197] According to the web page corresponding to each first control, page information corresponding to the first control is generated.
[0198] Correspondingly, after matching the response message with the network request corresponding to each first control and determining the first control corresponding to the successfully matched network request as the second control, the executable instruction can be specifically used to enable the electronic device / RPA task execution device 600 to perform the following operations:
[0199] According to the page information corresponding to the second control, a target webpage page corresponding to the second control is determined.
[0200] Set the target web page as the new current web page.
[0201] In an optional manner, setting the target web page as the new current web page includes:
[0202] The identifier of the target web page is stored in a queue, and the queue is used to implement queue processing for multiple web pages.
[0203] When the identifier of the target web page is at the first position in the queue, the target web page is set as a new current web page.
[0204] In an optional manner, after matching the response message with the network request corresponding to each first control and determining the first control corresponding to the successfully matched network request as the second control, the executable instruction can be specifically used to enable the electronic device / RPA task execution device 600 to perform the following operations:
[0205] The processing status of the page information corresponding to the second control is updated to completed.
[0206] In an optional manner, the page information corresponding to the first control includes the identifier and title of the web page corresponding to the first control.
[0207] The executable instructions stored in the computer-readable storage medium perform parallel control on mutually independent first controls, and after receiving a response message, associate the response message with the first control, thereby determining the execution result of the subtask corresponding to each first control. This effectively improves the execution efficiency of the RPA task and shortens the execution time.
[0208] The algorithms or displays provided herein are not inherently related to any particular computer, virtual system or other device. In addition, the embodiments of the present invention are not directed to any particular programming language.
[0209] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. Similarly, in order to simplify the present invention and help understand one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, the various features of the embodiments of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. Wherein, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, wherein each claim itself is a separate embodiment of the present invention.
[0210] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and further may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive.
[0211] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be understood as limitations on the order of execution.
Claims
1. A method for executing an RPA task, characterized in that: The method comprises: According to a Robotic Process Automation (RPA) task, click a plurality of first controls in a current web page, wherein the first controls are independent of each other; Sending a network request corresponding to each first control to the server; Receiving a response message returned by the server; Matching the response message with the network request corresponding to each first control, and determining the first control corresponding to the successfully matched network request as the second control; According to the response message, an execution result of the subtask corresponding to the second control in the RPA task is determined.
2. The method according to claim 1, characterized in that The matching of the response message with the network request corresponding to each first control, and determining the first control corresponding to the successfully matched network request as the second control, includes: The uniform resource locator system URL of the response message is matched with the URL of the network request corresponding to each first control, and the first control corresponding to the network request having the same URL as the response message is determined as the second control.
3. The method according to claim 1 or 2, characterized in that: After clicking the plurality of first controls in the current webpage according to the RPA task, the method further includes: Open the web page corresponding to each first control; According to the web page corresponding to each first control, generating page information corresponding to the first control; Correspondingly, after matching the response message with the network request corresponding to each first control and determining the first control corresponding to the successfully matched network request as the second control, the method further includes: Determining a target web page corresponding to the second control according to the page information corresponding to the second control; The target web page is set as the new current web page.
4. The method according to claim 3, characterized in that The step of setting the target web page as a new current web page includes: The identification of the target web page is stored in a queue, wherein the queue is used to implement queue processing for multiple web pages; When the identifier of the target web page is at the first position in the queue, the target web page is set as the new current web page.
5. The method according to claim 3, characterized in that: After matching the response message with the network request corresponding to each first control and determining the first control corresponding to the successfully matched network request as the second control, the method further includes: The processing status of the page information corresponding to the second control is updated to completed.
6. The method according to claim 5, characterized in that The method further comprises: According to the processing status of all page information, unprocessed page information whose processing status is waiting to be processed is determined from all page information, and a third control corresponding to the unprocessed page information is determined If the waiting processing time of the unprocessed page information exceeds the preset time, execution failure information is generated, and the execution failure information is used to indicate that the subtask corresponding to the third control in the RPA task has failed to execute.
7. The method according to claim 3, characterized in that The page information corresponding to the first control includes an identifier and a title of the web page corresponding to the first control.
8. An RPA task execution device, characterized in that: The device comprises: A click module, for clicking a plurality of first controls in a current web page according to a Robotic Process Automation (RPA) task, wherein the first controls are independent of each other; A sending module, used for sending a network request corresponding to each first control to the server; A receiving module, used for receiving a response message returned by the server; A matching module, used to match the response message with the network request corresponding to each first control, and determine the first control corresponding to the successfully matched network request as the second control; A determination module is used to determine an execution result of the subtask corresponding to the second control in the RPA task according to the response message.
9. An electronic device, characterized in that: include: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform the operation of the RPA task execution method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The storage medium stores at least one executable instruction. When the executable instruction is executed on the electronic device / RPA task execution device, the electronic device / RPA task execution device executes the operation of the RPA task execution method as described in any one of claims 1 to 7.
