Disclosure of Invention
In order to solve the defects in the prior art, the invention provides a robot flow automation method, a system, computer equipment and a storage medium, which have strong expansibility and are easy to realize.
In order to achieve the above purpose, the invention adopts the following specific scheme:
a robotic process automation method comprising the steps of:
Running a robot flow automatic main program with barrier-free operation authority in an operation system;
importing an automation script into a robot flow automation main program;
starting a target application program in an operating system;
the robot flow automation main program obtains user interface view information of a target application program and analyzes an operable item;
The robot flow automation main program executes an automation script to automatically operate the operable items of the target application program;
Acquiring dynamic response data of the target application program after automatic operation from an operating system, and comparing the dynamic response data with expected response data of the target application program to obtain response difference data;
The automation script is maintained or updated based on the response difference data.
Preferably, the robot flow automation main program is driven by using a Python language, a Python running environment and a plurality of Python standard libraries are integrated in the robot flow automation main program, and an automation script is encoded by using the Python language;
when an automation script is introduced into a robot flow automation main program, the automation script is introduced in the form of a Python standard library.
Preferably, before starting the target application program in the operating system, checking the running state of the robot flow automation main program, starting the target application program when the robot flow automation main program runs normally, and otherwise, stopping the operation and giving a warning through the operating system.
Preferably, after the robotic process automation main program analyzes the operable items, an automation script capable of performing an automation operation on the operable items is extracted based on the operable items, and a script execution plan for determining an execution order of the automation script is generated, and the robotic process automation main program executes the automation script based on the script execution plan when performing the automation operation on the operable items of the target application program.
Preferably, the script execution plan includes a plurality of script tags for tagging automated scripts, a script sequence number for ordering the script tags, and an operational item associated with the automated scripts.
Preferably, when comparing the dynamic response data and the expected response data, the automation script is maintained if the dynamic response data completely covers the expected response data, the automation script is increased if the expected response data completely covers the dynamic response data, and the automation script is updated if the expected response data and the dynamic response data have a difference.
Preferably, specific methods of updating the automation script include adding, deleting and/or modifying.
A robotic process automation system for implementing a robotic process automation method as described above, the system comprising:
the script creation module is used for creating or acquiring an automatic script;
The application activation module is used for running the robot flow automatic main program in the operating system and importing an automatic script into the robot flow automatic main program;
the data acquisition module is used for acquiring user interface view information of the target application program and acquiring dynamic response data;
and the data processing module is used for analyzing the operable items from the user interface view information and comparing the dynamic response data with expected response data of the target application program.
A computer device, comprising:
a memory storing a computer program;
a processor for reading the computer program from the memory and executing to implement a robotic process automation method as described above.
A storage medium storing a computer program which, when executed, implements a robot flow automation method as described above.
The invention has strong expansibility, can build and import Python libraries according to the requirement by internally arranging the Python operation environment in the RPA program to support a large number of Python standard libraries, realizes more automatic scripts, has high development efficiency, has low invasiveness, can be realized by using barrier-free service of an operating system, and does not need to acquire the bottom layer authority of equipment.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
As shown in fig. 1, the present invention first provides a robot flow automation method, which includes S1 to S7.
S1, running a robot flow automatic main program with barrier-free operation authority in an operation system. In order to facilitate development and improve development efficiency, in the invention, a robot flow automation main program is driven by a Python language, and a Python running environment and a plurality of Python standard libraries are integrated in the robot flow automation main program. The robot flow automation main program based on the Python language drive can utilize a huge number of Python standard libraries in the prior art, can greatly reduce development difficulty and cost, and shortens development period.
S2, importing an automation script into the robot flow automation main program. The automatic script is matched with the robot flow automatic main program, and when the automatic script is imported into the robot flow automatic main program by using Python language coding, the automatic script is imported in the form of a Python standard library.
S3, starting the target application program in the operating system. In order to ensure that the robot flow automatic operation can be smoothly realized, before the target application program is started in the operating system, the running state of the robot flow automatic main program is checked, the target application program is started when the robot flow automatic main program runs normally, and otherwise, the operation is terminated and a warning is sent out through the operating system. For different operating systems, the robot flow automation main program has different background running modes, and whether the robot flow automation main program is running or not can be determined by checking the process of the operating system. It should also be noted that, for different target applications, each target application needs to determine whether the robot flow automation main program is running or not before starting. If a target application program is closed after running for a period of time, it is also necessary to check whether the robot flow automation main program is running or not at the next restart, or when restart is required due to a program running error or the like. When the main robot flow automatic program is closed accidentally, the main robot flow automatic program can be started by itself, so that the main robot flow automatic program has a self-starting function and authority, the main robot flow automatic program is ensured to run in an operating system stably enough, and the robot flow automatic can be realized smoothly.
S4, the robot flow automation main program acquires user interface view information of the target application program and analyzes the operable items. Considering that the user interface view information of any one target application program may be different, when the robot flow automation main program obtains the user interface view information, the robot flow automation main program mainly obtains the operable items by checking the objects in the user interface view information, common objects comprise buttons, forms, input frames, carousel and the like, and the operation modes of the objects of the same type in different target application programs are mostly the same, so that the operable items and the operation modes corresponding to the operable items can be extracted by analyzing the objects.
Further, after the robot flow automation main program analyzes the operable items, an automation script capable of performing an automation operation on the operable items is extracted based on the operable items, and a script execution plan for determining an execution order of the automation script is generated, and the robot flow automation main program executes the automation script based on the script execution plan when performing the automation operation on the operable items of the target application program. For the same target application program, a plurality of automation scripts can commonly control the target application program, and the operable items required to be controlled by different automation scripts can be the same or different, so that after the operable items are acquired, the robot flow automation main program can firstly determine the automation script capable of automatically operating the operable items according to the operable items, and create a script execution plan. When the robot flow automatic main program starts to automatically operate the operable items in the target application program based on the automatic script, the operation can be performed quickly based on the script execution plan without repeatedly inquiring the available automatic script, so that the automatic operation efficiency of the robot flow automatic main program is greatly improved.
In actual implementation, the script execution plan may include a plurality of script tags for tagging automation scripts, script sequence numbers for ordering the script tags, and operational items associated with the automation scripts. The script mark is used for enabling each automation script to have a unique mark symbol, so that a robot process automation main program can conveniently and rapidly read and apply the automation scripts based on the mark symbol, when a plurality of automation scripts are needed to operate the same target application program, the script serial numbers are used for determining the execution sequence of the plurality of automation scripts, for example, after the automation script with the script serial number of 01 is executed, the automation script with the script serial number of 02 is started to be executed, the script serial numbers can also comprise the circulation times, the circulation times are used for determining the repeated circulation times of one automation script, the operable items are used for determining the corresponding relation between the automation script and the operable items in the target application program, for example, the automation script can be operated only on a button in one execution.
S5, the robot flow automation main program executes an automation script to automatically operate the operable items of the target application program.
S6, acquiring dynamic response data of the target application program after automatic operation from the operating system, and comparing the dynamic response data with expected response data of the target application program to obtain response difference data. The purpose of robot process automation is to replace manual operation to carry out some automatic operations on a target application program, but it is difficult to determine whether the target application program correctly responds to the automatic operation as fast as manual operation, when insufficient automatic script writing exists, the situation that the required operation cannot be realized easily occurs, and therefore, dynamic response data of the target application program needs to be obtained to judge whether the automatic script carries out correct operation on the target application program. The expected response data is a response expected to occur when automating the target application, for example, when an automation script is used to click a button, the expected response data is to jump to a new page. On the basis, when the dynamic response data and the expected response data are compared, the automation script is maintained if the dynamic response data completely cover the expected response data, the automation script is increased if the dynamic response data completely cover the dynamic response data, and the automation script is updated if the dynamic response data and the expected response data are different. Specifically, if the dynamic response data completely covers the expected response data, it indicates that the target program is fully operated, and the automation script is kept unchanged, and if the dynamic response data completely covers the dynamic response data, it indicates that some expected response data may not be successfully generated, that is, the automation script may not successfully perform some operations, and at this time, the automation script needs to be updated to realize adjustment. It should also be noted that if the dynamic response data and the expected response data are completely identical, the automation script is kept unchanged.
And S7, maintaining or updating the automation script based on the response difference data. Specific methods of updating automation scripts include adding, deleting, and/or modifying.
In one embodiment of the present invention, the robotic process automation method of the present invention is applied in an android system, and a software architecture at this time is shown in fig. 2.
The invention further provides a robot flow automation system for realizing the robot flow automation method, which comprises a script creation module, an application activation module, a data acquisition module and a data processing module.
And the script creation module is used for creating or acquiring an automation script.
And the application activation module is used for running the robot flow automation main program in the operating system and importing the automation script into the robot flow automation main program.
And the data acquisition module is used for acquiring the user interface view information of the target application program and acquiring dynamic response data.
And the data processing module is used for analyzing the operable items from the user interface view information and comparing the dynamic response data with expected response data of the target application program.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described system and apparatus may refer to corresponding procedures in the foregoing method embodiments, which are not described herein again. In the several embodiments provided in the present disclosure, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. The above-described apparatus embodiments are merely illustrative, and the division of the modules is merely a logical function division, and there may be additional divisions when actually implemented, and for example, multiple modules or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some communication interface, indirect coupling or communication connection of devices or modules, electrical, mechanical, or other form.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical modules, i.e., may be located in one place, or may be distributed over a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
The invention also provides a computer device comprising a memory and a processor.
And a memory storing a computer program.
A processor for reading the computer program from the memory and executing to implement a robotic process automation method as described above.
The present invention finally provides a storage medium storing a computer program which, when executed, implements a robot flow automation method as described above.
Based on this storage medium, the technical solution of the present disclosure, or a portion contributing to the prior art, or a portion of the technical solution, may be embodied in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in the embodiments of the present disclosure. The storage medium includes various media capable of storing program codes, such as a U disk, a removable hard disk, a read-only memory (Readom Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk.
In the present specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, and identical and similar parts between the embodiments are all enough to refer to each other.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.