CN111736837B - Method, device, device, readable storage medium, and system for restoring web page operations - Google Patents
Method, device, device, readable storage medium, and system for restoring web page operations Download PDFInfo
- Publication number
- CN111736837B CN111736837B CN202010860222.6A CN202010860222A CN111736837B CN 111736837 B CN111736837 B CN 111736837B CN 202010860222 A CN202010860222 A CN 202010860222A CN 111736837 B CN111736837 B CN 111736837B
- Authority
- CN
- China
- Prior art keywords
- information
- target element
- restored
- path
- webpage
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/38—Creation or generation of source code for implementing user interfaces
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Human Computer Interaction (AREA)
- Data Mining & Analysis (AREA)
- Computer Security & Cryptography (AREA)
- Information Transfer Between Computers (AREA)
Abstract
本申请实施例提供了一种网页操作的还原方法、系统、装置、设备及可读存储介质,机器人响应于查询到待还原信息中的元素标识,对网页中的具有元素标识的目标元素,进行目标元素的操作信息指示的操作。响应于查询到待还原信息中的递归路径,对网页中的具有递归路径的目标元素,进行目标元素的操作信息指示的操作。相对于现有技术中,从根节点遍历查找目标元素的方法,本方法依据目标元素的元素标识可以直接定位到目标元素,依据目标元素的递归路径,从叶子节点开始,向根节点扩展定位目标元素。本方法避免了现有技术在复杂页面的场景下,定位目标元素耗时长、效率低以及无法获取全部目标元素的缺点。
Embodiments of the present application provide a method, system, device, device, and readable storage medium for restoring web page operations. In response to querying the element identifier in the information to be restored, the robot performs the operation on the target element with the element identifier in the web page. The operation indicated by the operation information of the target element. In response to finding the recursive path in the information to be restored, the operation indicated by the operation information of the target element is performed on the target element with the recursive path in the webpage. Compared with the method of searching for the target element by traversing from the root node in the prior art, the method can directly locate the target element according to the element identifier of the target element, and according to the recursive path of the target element, start from the leaf node and expand the positioning target to the root node. element. The method avoids the disadvantages of the prior art, such as long time consuming, low efficiency, and inability to obtain all the target elements in the complex page scene.
Description
技术领域technical field
本申请涉及电子信息领域,尤其涉及一种网页操作的还原方法、装置、设备、可读存储介质及系统。The present application relates to the field of electronic information, and in particular, to a method, apparatus, device, readable storage medium and system for restoring web page operations.
背景技术Background technique
AI(Artificial Intelligence,人工智能)技术的落地和人力成本的提高作为流程自动化发展的催化剂,流程自动化不仅在发展速度上越来越快,在应用场景方面也越来越广,随之兴起流程自动化产品的狂潮。RPA(Robotic Process Automation),译为流程自动化机器人,是一种智能化软件,通过模拟并增强人类与计算机的交互过程,实现工作流程中的自动化。The implementation of AI (Artificial Intelligence, artificial intelligence) technology and the increase in labor costs are the catalysts for the development of process automation. Process automation is not only developing faster and faster, but also has more and more application scenarios, and process automation products are emerging. frenzy. RPA (Robotic Process Automation), translated as process automation robot, is a kind of intelligent software that realizes the automation of workflow by simulating and enhancing the interaction process between humans and computers.
现有的RPA在还原人对网页的操作过程时,不仅在网页上有大量元素的情况下时延长,而且,对于存在较多嵌套的HTML的复杂网页,由于无法获取嵌套的HTML的元素,所以,不能对人在网页的操作进行准确的还原。When the existing RPA restores the operation process of the web page, it is not only prolonged when there are a large number of elements on the web page, but also for complex web pages with many nested HTML, because the elements of the nested HTML cannot be obtained. , therefore, it is impossible to accurately restore the operation of people on the web page.
可见,如何降低还原网页操作的时延,并且提高准确性,成为目前亟待解决的问题。It can be seen that how to reduce the delay of restoring the webpage operation and improve the accuracy has become an urgent problem to be solved at present.
发明内容SUMMARY OF THE INVENTION
本申请提供了一种网页操作的还原方法、装置、设备、可读存储介质及系统,目的在于降低还原网页操作的时延,并且提高准确性。The present application provides a method, device, device, readable storage medium and system for restoring a webpage operation, which aim to reduce the delay of restoring a webpage operation and improve the accuracy.
为了实现上述目的,本申请提供了以下技术方案:In order to achieve the above purpose, the application provides the following technical solutions:
一种网页操作的还原方法,包括:A method for restoring web page operations, comprising:
获取待还原信息,所述待还原信息包括目标元素的属性信息和操作信息,所述目标元素为人在网页中操作的元素,所述属性信息用于指示所述目标元素的属性,所述操作信息用于指示所述人对所述目标元素执行的操作,所述属性信息包括元素标识、递归路径和遍历路径中的至少一项,所述递归路径为从叶子节点开始,向根节点扩展的路径,所述遍历路径为从所述根节点开始,向所述叶子节点扩展的路径;Obtain information to be restored, the information to be restored includes attribute information and operation information of a target element, the target element is an element operated by a person in a web page, the attribute information is used to indicate the attribute of the target element, and the operation information Used to indicate the operation performed by the person on the target element, the attribute information includes at least one of an element identifier, a recursive path and a traversal path, where the recursive path is a path that starts from a leaf node and extends to a root node , the traversal path is a path extending from the root node to the leaf node;
响应于查询到所述待还原信息中的所述元素标识,对所述网页中的第一目标元素,进行所述第一目标元素的操作信息指示的操作;所述第一目标元素为具有所述元素标识的所述目标元素;In response to querying the element identifier in the information to be restored, perform the operation indicated by the operation information of the first target element on the first target element in the webpage; the target element identified by the element;
响应于查询到所述待还原信息中的所述递归路径,对所述网页中的第二目标元素,进行所述第二目标元素的操作信息指示的操作;所述第二目标元素为,所述递归路径中的所述叶子节点指示的所述目标元素。In response to querying the recursive path in the information to be restored, perform the operation indicated by the operation information of the second target element on the second target element in the webpage; the second target element is, the target element indicated by the leaf node in the recursive path.
可选地,还包括:Optionally, also include:
响应于未查询到所述待还原信息中的所述元素标识和所述递归路径,对所述网页中的第三目标元素,进行所述第三目标元素的操作信息指示的操作;所述第三目标元素为,所述遍历路径中的最后一个预设字符串指示的所述目标元素。In response to not finding the element identifier and the recursive path in the information to be restored, perform the operation indicated by the operation information of the third target element on the third target element in the webpage; The three target elements are the target elements indicated by the last preset character string in the traversal path.
可选地,进行所述操作信息指示的操作,包括以下至少一项:Optionally, performing the operation indicated by the operation information includes at least one of the following:
通过调用FIaUI库中,鼠标接口和/或键盘接口的封装函数,进行所述操作信息指示的操作。The operation indicated by the operation information is performed by calling the encapsulation function of the mouse interface and/or the keyboard interface in the FIaUI library.
可选地,获取待还原信息,包括:Optionally, obtain the information to be restored, including:
接收所述待还原信息,其中,所述目标元素的属性信息和操作信息,通过自动和/或人机交互方式获取。The information to be restored is received, wherein the attribute information and operation information of the target element are acquired automatically and/or through human-computer interaction.
可选地,响应于查询到所述待还原信息中的所述元素标识,对所述网页中的第一目标元素,进行所述第一目标元素的操作信息指示的操作,包括:Optionally, in response to querying the element identifier in the information to be restored, for the first target element in the webpage, performing the operation indicated by the operation information of the first target element, including:
在不存在自定义还原规则的情况下,响应于查询到所述待还原信息中的所述元素标识,对所述网页中的第一目标元素,进行所述第一目标元素的操作信息指示的操作;In the absence of a custom restoration rule, in response to querying the element identifier in the to-be-restored information, for the first target element in the webpage, perform the operation indicated by the operation information of the first target element. operate;
所述响应于查询到所述待还原信息中的所述递归路径,对所述网页中的第二目标元素,进行所述第二目标元素的操作信息指示的操作,包括:In response to querying the recursive path in the information to be restored, performing the operation indicated by the operation information of the second target element on the second target element in the webpage, including:
在不存在所述自定义还原规则的情况下,响应于查询到所述待还原信息中的所述递归路径,对所述网页中的第二目标元素,进行所述第二目标元素的操作信息指示的操作;In the case where the custom restoration rule does not exist, in response to querying the recursive path in the information to be restored, for the second target element in the webpage, perform operation information on the second target element the indicated operation;
所述方法还包括:The method also includes:
在存在所述自定义还原规则的情况下,按照所述自定义还原规则,对所述目标元素进行操作。In the presence of the custom restoration rule, the target element is operated according to the custom restoration rule.
一种网页操作的还原装置,包括:A restoration device for webpage operation, comprising:
信息获取单元,用于获取待还原信息,所述待还原信息包括目标元素的属性信息和操作信息,所述目标元素为人在网页中操作的元素,所述属性信息用于指示所述目标元素的属性,所述操作信息用于指示所述人对所述目标元素执行的操作,所述属性信息包括元素标识、递归路径和遍历路径中的至少一项,所述递归路径为从叶子节点开始,向根节点扩展的路径,所述遍历路径为从所述根节点开始,向所述叶子节点扩展的路径;An information acquisition unit is used to acquire information to be restored, the information to be restored includes attribute information and operation information of a target element, the target element is an element operated by a person in a web page, and the attribute information is used to indicate the attribute information of the target element. attribute, the operation information is used to indicate the operation performed by the person on the target element, the attribute information includes at least one of an element identifier, a recursive path and a traversal path, and the recursive path starts from a leaf node, a path extending to the root node, the traversal path is a path extending from the root node to the leaf node;
第一操作单元,用于响应于查询到所述待还原信息中的所述元素标识,对所述网页中的第一目标元素,进行所述第一目标元素的操作信息指示的操作;所述第一目标元素为具有所述元素标识的所述目标元素;a first operation unit, configured to perform the operation indicated by the operation information of the first target element on the first target element in the webpage in response to the element identifier in the information to be restored; the The first target element is the target element with the element identifier;
第二操作单元,用于响应于查询到所述待还原信息中的所述递归路径,对所述网页中的第二目标元素,进行所述第二目标元素的操作信息指示的操作;所述第二目标元素为,所述递归路径中的所述叶子节点指示的所述目标元素。a second operation unit, configured to perform the operation indicated by the operation information of the second target element on the second target element in the webpage in response to the recursive path in the information to be restored being queried; the The second target element is the target element indicated by the leaf node in the recursive path.
一种网页操作的还原设备,包括:存储器和处理器;A restoration device for webpage operation, comprising: a memory and a processor;
所述存储器,用于存储程序;the memory for storing programs;
所述处理器,用于执行所述程序,实现如上所述的网页操作的还原方法的各个步骤。The processor is configured to execute the program to implement each step of the above-mentioned method for restoring a webpage operation.
一种可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时,实现如上所述的网页操作的还原方法的各个步骤。A readable storage medium on which a computer program is stored, characterized in that, when the computer program is executed by a processor, each step of the method for restoring a web page operation as described above is implemented.
一种网页操作的还原系统,包括:A restoration system for webpage operations, comprising:
设计器、机器人和管理控制平台;Designers, robots and management control platforms;
所述设计器用于获取待还原信息,并将所述待还原信息发给所述管理控制平台;所述待还原信息包括目标元素的属性信息和操作信息,所述目标元素为人在网页中操作的元素,所述属性信息用于指示所述目标元素的属性,所述操作信息用于指示所述人对所述目标元素执行的操作,所述属性信息包括元素标识、递归路径和遍历路径中的至少一项,所述递归路径为从叶子节点开始,向根节点扩展的路径,所述遍历路径为从所述根节点开始,向所述叶子节点扩展的路径;The designer is used to obtain the information to be restored, and send the information to be restored to the management control platform; the information to be restored includes attribute information and operation information of a target element, and the target element is operated by a person on a webpage element, the attribute information is used to indicate the attribute of the target element, the operation information is used to indicate the operation performed by the person on the target element, and the attribute information includes an element identifier, a recursive path and a traversal path. At least one item, the recursive path is a path that starts from a leaf node and extends to a root node, and the traversal path is a path that starts from the root node and extends to the leaf node;
所述管理控制平台用于,将所述待还原信息发给所述机器人;The management control platform is used for sending the information to be restored to the robot;
所述机器人用于,响应于查询到所述待还原信息中的所述元素标识,对所述网页中的第一目标元素,进行所述第一目标元素的操作信息指示的操作;所述第一目标元素为具有所述元素标识的所述目标元素;The robot is configured to, in response to querying the element identifier in the information to be restored, perform the operation indicated by the operation information of the first target element on the first target element in the webpage; A target element is the target element with the element identifier;
响应于查询到所述待还原信息中的所述递归路径,对所述网页中的第二目标元素,进行所述第二目标元素的操作信息指示的操作;所述第二目标元素为,所述递归路径中的所述叶子节点指示的所述目标元素。In response to querying the recursive path in the information to be restored, perform the operation indicated by the operation information of the second target element on the second target element in the webpage; the second target element is, the target element indicated by the leaf node in the recursive path.
可选地,管理控制平台还用于以下至少一项:Optionally, the management control platform is also used for at least one of the following:
向所述机器人发送心跳消息,所述心跳消息用于所述机器人保持与所述管理控制平台一致的心跳;Sending a heartbeat message to the robot, the heartbeat message is used for the robot to maintain a heartbeat consistent with the management control platform;
监控所述机器人的状态。Monitor the status of the robot.
本申请所述的一种网页操作的还原方法、装置、设备、可读存储介质及系统,获取待还原信息,待还原信息包括目标元素的属性信息和操作信息,其中,目标元素为人在网页中操作的元素,属性信息用于指示目标元素的属性,操作信息用于指示人对所述目标元素执行的操作,属性信息包括元素标识、递归路径和遍历路径中的至少一项。响应于查询到待还原信息中的元素标识,对网页中的具有元素标识的目标元素,进行目标元素的操作信息指示的操作。响应于查询到待还原信息中的递归路径,对网页中的具有递归路径的目标元素,进行目标元素的操作信息指示的操作。相对于现有技术中,从根节点遍历查找目标元素的方法,依据目标元素的元素标识可以直接定位到目标元素,从而降低还原网页操作的时延。并且,依据目标元素的递归路径,从叶子节点开始,向根节点扩展定位目标元素,避免了现有技术在较多嵌套的HTML的复杂页面的场景下,无法获取全部目标元素的缺点。综上,本方法降低还原网页操作的时延、提高网页操作的还原的准确度。A method, device, device, readable storage medium and system for restoring a webpage operation described in the present application obtains information to be restored, and the information to be restored includes attribute information and operation information of a target element, wherein the target element is a person in the webpage The element of the operation, the attribute information is used to indicate the attribute of the target element, the operation information is used to indicate the operation performed by a person on the target element, and the attribute information includes at least one of an element identifier, a recursive path and a traversal path. In response to querying the element identifier in the information to be restored, the operation indicated by the operation information of the target element is performed on the target element with the element identifier in the web page. In response to querying the recursive path in the information to be restored, the operation indicated by the operation information of the target element is performed on the target element with the recursive path in the webpage. Compared with the method of searching for the target element by traversing from the root node in the prior art, the target element can be directly located according to the element identifier of the target element, thereby reducing the time delay of restoring the webpage. Moreover, according to the recursive path of the target element, starting from the leaf node and extending the positioning target element to the root node, the disadvantage of the prior art that all target elements cannot be obtained in the scenario of complex HTML pages with many nests is avoided. To sum up, the method reduces the time delay of restoring the web page operation and improves the restoration accuracy of the web page operation.
附图说明Description of drawings
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only These are some embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without any creative effort.
图1为本申请实施例提供的一种网页操作的还原系统的结构示意图;FIG. 1 is a schematic structural diagram of a system for restoring web page operations according to an embodiment of the present application;
图2为本申请实施例提供的一种网页操作的还原方法的具体实现方式的流程示意图;2 is a schematic flowchart of a specific implementation of a method for restoring web page operations provided by an embodiment of the present application;
图3为本申请实施例提供的一种流程自动化平台的服务系统架构图;3 is a service system architecture diagram of a process automation platform provided by an embodiment of the present application;
图4为本申请实施例提供的一种网页操作的还原方法的流程示意图;4 is a schematic flowchart of a method for restoring a webpage operation provided by an embodiment of the present application;
图5为本申请实施例提供的一种网页操作的还原装置的结构示意图;FIG. 5 is a schematic structural diagram of an apparatus for restoring web page operations provided by an embodiment of the present application;
图6为本申请实施例提供的一种网页操作的还原设备的结构示意图。FIG. 6 is a schematic structural diagram of a device for restoring web page operations according to an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
本申请实施例提供的一种网页操作的还原方法基于网页操作的还原系统实现对人在网页的操作进行准确的还原。图1为本申请实施例提供的一种网页操作的还原系统,如图1所示,网页操作的还原系统包括设计器、机器人和管理控制平台。A method for restoring a webpage operation provided by an embodiment of the present application implements an accurate restoration of a person's operation on a webpage based on a webpage operation restoring system. FIG. 1 is a system for restoring a webpage operation provided by an embodiment of the present application. As shown in FIG. 1 , the restoring system for a webpage operation includes a designer, a robot, and a management control platform.
图2为本申请实施例提供的一种网页操作系统中的各组件之间通过交互,实现的网页操作的还原方法的具体实现过程,如图2所示,具体包括下述步骤:FIG. 2 is a specific implementation process of a method for restoring a web page operation through interaction between components in a web page operating system provided by an embodiment of the present application, as shown in FIG. 2 , and specifically includes the following steps:
S201、设计器获取待还原信息。S201, the designer obtains the information to be restored.
本实施例中,待还原信息包括目标元素的属性信息和操作信息,目标元素为人在网页中操作的元素。In this embodiment, the information to be restored includes attribute information and operation information of the target element, and the target element is an element operated by a person in the webpage.
本实施例中,设计器中设置有人机交互模块即元素选择器,实际应用中,人(即用户,可以为预先注册的账户)触发元素选择器的选择指令,元素选择器获取并保存待还原信息。需要说明的是,元素选择器保存待还原信息的方式是保存包括目标元素的json数组,元素选择器保存json数组的方式为:从网页的HTML的根节点开始,一层层保存,直到叶子节点,每一层都是一个json字符串。以选择百度输入框为例,第一个json数组是网页的url等信息,本实施例在元素匹配的时候跳过第一个json数组,从HTML根节点开始匹配。In this embodiment, a human-computer interaction module, that is, an element selector, is set in the designer. In practical applications, a person (that is, a user, which can be a pre-registered account) triggers the selection instruction of the element selector, and the element selector obtains and saves it to be restored. information. It should be noted that the way the element selector saves the information to be restored is to save the json array including the target element, and the way the element selector saves the json array is: starting from the root node of the HTML of the web page, and saving it layer by layer until the leaf node , each layer is a json string. Taking the Baidu input box as an example, the first json array is information such as the url of the web page. In this embodiment, when elements are matched, the first json array is skipped, and the matching starts from the HTML root node.
本实施例中,元素选择器包括两种可选的选择待还原信息的模式,第一种模式为自动模式,第二种模式为人机交互模式。本实施例对两种模式的触发条件以及选择过程进行介绍,如下:In this embodiment, the element selector includes two optional modes for selecting information to be restored, the first mode is an automatic mode, and the second mode is a human-computer interaction mode. This embodiment introduces the trigger conditions and selection process of the two modes, as follows:
第一种、在自动模式下,设计器通过元素选择器自动获取待还原信息。First, in automatic mode, the designer automatically obtains the information to be restored through the element selector.
具体地,设计器响应于用户的打开元素选择器的指令,弹出元素选择器的选择窗口,选择窗口预设选择按钮,当用户点击选择按钮,隐藏选择器的选择窗口,进一步,当用户在网页点击需要操作的元素时,元素选择器自动获取用户在网页中操作的元素(记为目标元素),并且自动将网页的信息解析为json数组并保存,由此完成一次目标元素的获取,之后再次弹出选择器的点选窗口,循环上述操作直至自动获取到用户在网页中操作的所有元素。Specifically, in response to the user's instruction to open the element selector, the designer pops up the selection window of the element selector, selects the preset selection button of the window, and hides the selection window of the selector when the user clicks the selection button. When the element that needs to be operated is clicked, the element selector automatically obtains the element operated by the user in the web page (recorded as the target element), and automatically parses the information of the web page into a json array and saves it, thus completing the acquisition of the target element once, and then again The click window of the selector pops up, and the above operations are repeated until all elements operated by the user in the web page are automatically obtained.
需要说明的是,点击操作一般指的是鼠标点击,在第一种模式下,用户只需要简单的点击操作,元素选择器即可自动获取用户在网页中操作的元素,即目标元素。It should be noted that the click operation generally refers to a mouse click. In the first mode, the user only needs a simple click operation, and the element selector can automatically obtain the element operated by the user in the web page, that is, the target element.
进一步需要说明的是,设计器自动获取待还原信息后,以json数组保存并显示,其中,以树形图结构显示,并且,目标元素为高亮。It should be further noted that after the designer automatically obtains the information to be restored, it is saved and displayed in a json array, which is displayed in a tree diagram structure, and the target element is highlighted.
第二种、在人机交互模式下,设计器通过元素选择器与用户的交互获取待还原信息。Second, in the human-computer interaction mode, the designer obtains the information to be restored through the interaction between the element selector and the user.
设计器响应于用户的打开元素选择器的指令,弹出元素选择器的选择窗口,选择窗口中以树形图结构显示网页中的各元素。当用户在树形图中逐层查询,并点击选择人为在网页上操作的元素后,元素选择器获取被点击的元素作为目标元素,并以高亮进行标识。In response to the user's instruction to open the element selector, the designer pops up a selection window of the element selector, and the selection window displays each element in the web page in a tree structure. When the user queries layer by layer in the tree diagram and clicks to select an element that is manually operated on the web page, the element selector obtains the clicked element as the target element and identifies it with a highlight.
需要说明的是,Web框架种类多,网页复杂,本实施例中通过人机交互模式获取待还原信息,能够提高待还原信息的准确性。It should be noted that there are many types of web frameworks and complex web pages. In this embodiment, the information to be restored is obtained through the human-computer interaction mode, which can improve the accuracy of the information to be restored.
需要说明的是,上述两种模式获取的待还原信息中,目标元素的属性信息用于指示目标元素的属性,操作信息用于指示人对目标元素执行的操作,属性信息包括元素标识、递归路径和遍历路径。It should be noted that, in the information to be restored obtained in the above two modes, the attribute information of the target element is used to indicate the attribute of the target element, the operation information is used to indicate the operation performed by a person on the target element, and the attribute information includes the element identifier, the recursive path. and traverse the path.
其中,当目标元素的属性信息包括元素标识时,元素选择器获取目标元素的元素标识,并作为待还原信息保存到json数组。Wherein, when the attribute information of the target element includes the element identifier, the element selector obtains the element identifier of the target element, and saves it in the json array as the information to be restored.
递归路径为从叶子节点开始,向根节点扩展的路径。当目标元素的属性信息包括递归路径时,元素选择器获取目标元素的递归路径,并将目标元素的递归路径作为待还原信息保存到json数组,此时,元素选择器不需要保存目标元素全路径的信息。A recursive path starts from a leaf node and extends to the root node. When the attribute information of the target element includes the recursive path, the element selector obtains the recursive path of the target element, and saves the recursive path of the target element as the information to be restored to the json array. At this time, the element selector does not need to save the full path of the target element Information.
遍历路径为从根节点开始,向叶子节点扩展的路径(即全路径),当目标元素的属性信息包括遍历路径时,元素选择器获取目标元素的遍历路径,并将目标元素的遍历路径作为待还原信息保存到json数组。The traversal path is the path that starts from the root node and extends to the leaf nodes (that is, the full path). When the attribute information of the target element includes the traversal path, the element selector obtains the traversal path of the target element, and uses the traversal path of the target element as the waiting path. The restore information is saved to a json array.
需要说明的是,目标元素的属性信息包括元素标识、递归路径和遍历路径中的至少一项。It should be noted that the attribute information of the target element includes at least one of an element identifier, a recursive path, and a traversal path.
S202、设计器将待还原信息发送至管理控制平台。S202, the designer sends the information to be restored to the management control platform.
S203、管理控制平台将待还原信息发送至机器人。S203, the management control platform sends the information to be restored to the robot.
S204、机器人查询是否存在自定义还原规则,在不存在自定义还原规则的情况下,执行S205~ S207,在存在自定义还原规则的情况下,执行S208。S204 , the robot queries whether there is a custom restoration rule, and if there is no custom restoration rule, execute S205 to S207 , and if there is a custom restoration rule, execute S208 .
本实施例中,自定义还原规则为预先设置的个性化还原规则,由用户根据实际需求定制,并集成到元素选择器中。In this embodiment, the custom restoration rule is a preset personalized restoration rule, which is customized by the user according to actual needs and integrated into the element selector.
S205、机器人查询获取的待还原信息中,是否包括目标元素的元素标识。S205. Whether the information to be restored obtained by the robot query includes the element identifier of the target element.
若是,则机器人响应于查询到待还原信息中的元素标识,对网页中的具有元素标识的目标元素(记为第一目标元素),进行第一目标元素的操作信息指示的操作。If so, in response to querying the element identifier in the information to be restored, the robot performs the operation indicated by the operation information of the first target element on the target element with the element identifier (referred to as the first target element) in the webpage.
需要说明的是,MSHTML提供了七种HTML文档接口,并且将document的多种方法封装到HTMLDocument中。当目标元素的属性信息包括元素标识时,元素选择器会获取目标元素的元素标识,并作为待还原信息保存到json数组,并通过管理控制平台将待还原信息发送至机器人。本步骤中,机器人接收待还原信息,并从待还原信息中查询到目标元素的元素标识,依据目标元素的操作信息,执行操作信息指示的操作,可选地,机器人调用HTMLDocument接口中getElementById()方法,执行操作信息指示的操作。It should be noted that MSHTML provides seven HTML document interfaces, and encapsulates various methods of document into HTMLDocument. When the attribute information of the target element includes the element identifier, the element selector will obtain the element identifier of the target element, save it in the json array as the information to be restored, and send the information to be restored to the robot through the management control platform. In this step, the robot receives the information to be restored, queries the element identifier of the target element from the information to be restored, and executes the operation indicated by the operation information according to the operation information of the target element. Optionally, the robot calls getElementById() in the HTMLDocument interface. method to perform the operation indicated by the operation information.
本实施例中,机器人在进行第一目标元素的操作信息指示的操作可能包括通用操作,例如赋值操作、点击操作以及选择操作。其中,赋值使用的是第一目标元素的value(赋值)属性,点击是触发click(点击)事件,选择是触发select(选择)事件。通常,对通用操作可以进行封装,通过调取封装函数,满足机器人对第一目标元素的操作需求。本实施例中,为了更好的模拟人机交互,还原人对第一目标元素的操作,预先对鼠标接口以及键盘接口进行封装,并保存封装函数。In this embodiment, the operation indicated by the operation information of the first target element by the robot may include general operations, such as an assignment operation, a click operation, and a selection operation. Among them, the assignment uses the value (assignment) attribute of the first target element, the click is to trigger the click (click) event, and the selection is to trigger the select (selection) event. Generally, the general operation can be encapsulated, and the operation requirement of the robot on the first target element can be satisfied by calling the encapsulation function. In this embodiment, in order to better simulate human-computer interaction and restore human operations on the first target element, the mouse interface and the keyboard interface are encapsulated in advance, and the encapsulation function is saved.
本实施例中,将鼠标接口进行封装,使得鼠标点击操作可以触发click事件,也可以触发mousedown事件、mouseup事件、左键点击事件、以及右键点击事件。In this embodiment, the mouse interface is encapsulated, so that a mouse click operation can trigger a click event, and also trigger a mousedown event, a mouseup event, a left-click event, and a right-click event.
针对于赋值操作,大部分的输入框可以对第一目标元素的属性直接赋值,但是,至少存在下述问题(1)~问题(3)中的至少一项。For the assignment operation, most of the input boxes can directly assign values to the attributes of the first target element, but at least one of the following problems (1) to (3) exists.
(1)输入框(例如登陆框)中的密码输入无法直接赋值。(1) The password input in the input box (such as the login box) cannot be directly assigned.
(2)输入框可以赋值,但是输入正确密码,登录时显示密码错误。(2) The input box can be assigned a value, but if the correct password is entered, the password error will be displayed when logging in.
(3)输入框赋值无法触发模糊查询。(3) The assignment of the input box cannot trigger the fuzzy query.
本实施例中,将键盘接口进行封装,使得键盘输入操作可以触发赋值后相关事件。以解决上述问题(1)~问题(3)。例如,将键盘接口进行封装,使得预设类型的输入框(例如下拉框)赋值触发模糊查询,使得键盘输入操作可以触发赋值操作。In this embodiment, the keyboard interface is encapsulated, so that the keyboard input operation can trigger the related events after assignment. To solve the above problem (1) ~ problem (3). For example, the keyboard interface is encapsulated so that the assignment of a preset type of input box (such as a drop-down box) triggers a fuzzy query, so that a keyboard input operation can trigger an assignment operation.
需要说明的是,FlaUI是一个UI自动化库,调用其中鼠标接口和键盘接口的封装函数,可以模拟键盘和鼠标的操作。因此本实施例中,机器人通过调用FIaUI库中,鼠标接口和/或键盘接口的封装函数,进行第一目标元素的操作信息指示的操作。It should be noted that FlaUI is a UI automation library, which calls the encapsulation functions of the mouse interface and the keyboard interface, and can simulate the operation of the keyboard and mouse. Therefore, in this embodiment, the robot performs the operation indicated by the operation information of the first target element by calling the encapsulation function of the mouse interface and/or the keyboard interface in the FIaUI library.
S206、若未查询到目标元素的元素标识,机器人查询获取的待还原信息中,是否包括目标元素的递归路径。S206 , if the element identifier of the target element is not queried, the robot queries whether the information to be restored that is acquired includes the recursive path of the target element.
若是,则机器人响应于查询到待还原信息中的递归路径,对网页中的第二目标元素,进行第二目标元素的操作信息指示的操作。其中,第二目标元素为,递归路径中的叶子节点指示的目标元素。If so, the robot performs the operation indicated by the operation information of the second target element on the second target element in the webpage in response to the recursive path in the information to be restored in response to the query. The second target element is the target element indicated by the leaf node in the recursive path.
本实施例中,递归路径为从叶子节点开始,向根节点扩展的路径。当机器人响应第二目标元素的递归路径时,先递归到叶子节点,如果叶子节点匹配,再匹配叶子节点的父节点,此时,json数组的index减1,对于不匹配的节点进行剪枝,直至匹配到递归路径中的叶子节点指示的目标元素,此时,信息核对全部通过,最终的叶子节点就是需要操作的第二目标元素。In this embodiment, the recursive path is a path that starts from a leaf node and extends to the root node. When the robot responds to the recursive path of the second target element, it first recurses to the leaf node. If the leaf node matches, then matches the parent node of the leaf node. At this time, the index of the json array is reduced by 1, and the unmatched nodes are pruned. Until the target element indicated by the leaf node in the recursive path is matched, at this time, the information check is all passed, and the final leaf node is the second target element that needs to be operated.
需要说明的是,机器人通过调用FIaUI库中,鼠标接口和/或键盘接口的封装函数,进行第二目标元素的操作信息指示的操作。具体实现过程可以参照上述S205。It should be noted that the robot performs the operation indicated by the operation information of the second target element by calling the encapsulation function of the mouse interface and/or the keyboard interface in the FIaUI library. For a specific implementation process, reference may be made to the above S205.
S207、若未查询到目标元素的递归路径,机器人对网页中的第三目标元素,进行第三目标元素的操作信息指示的操作。S207. If the recursive path of the target element is not queried, the robot performs the operation indicated by the operation information of the third target element on the third target element in the webpage.
具体地,由于待还原信息中至少包括目标元素的元素标识、递归路径、或遍历路径中的至少一项,所以,当上述机器人查询获取的待还原信息中,未查询到待还原信息中的元素标识和递归路径时,机器人响应于未查询到待还原信息中的元素标识和递归路径,对网页中的第三目标元素,进行第三目标元素的操作信息指示的操作。本实施例中,遍历路径为从根节点开始,向叶子节点扩展的路径,第三目标元素为,遍历路径中的最后一个预设字符串指示的目标元素。Specifically, since the information to be restored includes at least one of the element identifier of the target element, the recursive path, or the traversal path, when the above-mentioned robot queries the information to be restored, the element in the information to be restored is not queried. When identifying and recursive path, the robot performs the operation indicated by the operation information of the third target element on the third target element in the webpage in response to not finding the element identifier and recursive path in the information to be restored. In this embodiment, the traversal path is a path extending from the root node to the leaf nodes, and the third target element is the target element indicated by the last preset character string in the traversal path.
例如,机器人从根节点开始,通过第三目标元素的遍历路径筛选孩子节点,通过tagName、className、id、IndexInParent等属性找到匹配的孩子节点,此时,json数组的index加1,再继续匹配孩子节点的孩子节点,以此类推,直到匹配到遍历路径中的最后一个预设字符串指示的目标元素。此时,信息核对全部通过,最终的孩子节点即叶子节点就是需要操作的第三目标元素。For example, the robot starts from the root node, filters the child nodes through the traversal path of the third target element, and finds the matching child node through attributes such as tagName, className, id, IndexInParent, etc. At this time, the index of the json array is increased by 1, and then continues to match the child The child nodes of the node, and so on, until the target element indicated by the last preset string in the traversal path is matched. At this time, all the information checking is passed, and the final child node, that is, the leaf node, is the third target element that needs to be operated.
需要说明的是,机器人通过调用FIaUI库中,鼠标接口和/或键盘接口的封装函数,进行第三目标元素的操作信息指示的操作。具体实现过程可以参照上述S205。It should be noted that the robot performs the operation indicated by the operation information of the third target element by calling the encapsulation function of the mouse interface and/or the keyboard interface in the FIaUI library. For a specific implementation process, reference may be made to the above S205.
S208、在存在自定义还原规则的情况下,按照自定义还原规则,对目标元素进行操作。S208 , in the presence of a custom restoration rule, operate on the target element according to the custom restoration rule.
因为Web系统的框架繁多并且更新迭代频繁,版本更新可能带来使用问题。例如Ext.js框架,对于封装的组件里面的元素是有Id属性的,且Id动态随机分配的,在窗口或网页关闭重新打开时,Id会再次动态分配,前后两次Id不同,于是在元素属性核对时,会人为的去掉Id属性匹配,但由于网页元素众多,导致效率太低,因此需要定制化开发。Because the web system has many frameworks and frequent update iterations, version updates may cause usage problems. For example, the Ext.js framework has an Id attribute for the elements in the encapsulated component, and the Id is dynamically and randomly assigned. When the window or web page is closed and reopened, the Id will be dynamically assigned again. The two Ids are different before and after, so in the element During attribute verification, the Id attribute match will be removed artificially, but due to the large number of web page elements, the efficiency is too low, so customized development is required.
为避免定制化开发导致的增加沟通成本或效率低的问题。本实施例将定制化开发的方法作为自定义还原规则,集成到元素选择器。当元素选择器中设置有自定义还原规则,用户将在网页中操作的元素和对元素的操作转化为JavaScript并作为元素选择器中的一个传入参数,在流程执行的时候,RPA会将这段JavaScript直接嵌入到浏览器中执行。In order to avoid the problem of increased communication cost or low efficiency caused by customized development. In this embodiment, the method of customized development is integrated into the element selector as a customized restoration rule. When a custom restoration rule is set in the element selector, the user converts the elements operated on the web page and the operations on the elements into JavaScript and uses them as an incoming parameter in the element selector. When the process is executed, RPA will A segment of JavaScript is embedded directly into the browser for execution.
基于自定义还原规则,当目标元素的邻近元素有固定的元素标识,机器人可以通过ParentNode或Children的方法快速定位到人在网页中操作的目标元素,并且按照自定义还原规则,对目标元素进行操作。本实施例中,机器人可以通过Chrome浏览器查看目标元素的监听事件,用嵌入到浏览器中的JavaScript直接调用。Based on the custom restoration rules, when the adjacent elements of the target element have fixed element identifiers, the robot can quickly locate the target element that people operate in the web page through the ParentNode or Children method, and operate the target element according to the custom restoration rules. . In this embodiment, the robot can view the listening event of the target element through the Chrome browser, and directly call it with JavaScript embedded in the browser.
由上述技术方案可以看出本申请实施例提供的网页操作的还原方法,设计器获取并保存待还原信息,其中,待还原信息包括目标元素的属性信息和操作信息,并通过管理控制平台将待还原信息发送至机器人,机器人依据查询到的待还原信息中目标元素的属性信息,对目标元素进行操作信息指示的操作。It can be seen from the above technical solutions that in the method for restoring web page operations provided by the embodiments of the present application, the designer obtains and saves the information to be restored, wherein the information to be restored includes the attribute information and operation information of the target element, and the to-be-restored information is restored through the management control platform. The restoration information is sent to the robot, and the robot performs the operation indicated by the operation information on the target element according to the attribute information of the target element in the queried information to be restored.
针对于现有技术,本申请实施例提供的网页操作的还原方法的有益效果分析如下:For the prior art, the analysis of the beneficial effects of the method for restoring web page operations provided by the embodiments of the present application is as follows:
第一、本申请实施例提供的网页操作的还原方法中,直接对网页中的具有元素标识的目标元素,进行目标元素的操作信息指示的操作。无需遍历所有节点,提高了还原的效率。First, in the method for restoring a webpage operation provided by the embodiment of the present application, the operation indicated by the operation information of the target element is directly performed on the target element with the element identifier in the webpage. There is no need to traverse all nodes, which improves the efficiency of restoration.
例如,当网站中的HTML元素较多时,现有技术在遍历节点时,使用IHTMLElement接口Children属性会耗时严重,每次调用Children属性时,需要几百毫秒,若元素层数为50层,则导致找到该元素需要半分钟。本方法在目标元素的属性信息包括元素标识时,直接调用HTMLDocument接口中getElementById()方法,执行操作信息指示的操作即可,大大提升对复杂网页元素的操作的还原效率。For example, when there are many HTML elements in a website, it takes a lot of time to use the Children property of the IHTMLElement interface when traversing nodes in the prior art. Each time the Children property is called, it takes hundreds of milliseconds. If the number of element layers is 50, then Causes it to take half a minute to find the element. When the attribute information of the target element includes the element identifier, the method directly calls the getElementById() method in the HTMLDocument interface and executes the operation indicated by the operation information, which greatly improves the restoration efficiency of the operation of complex webpage elements.
第二、本申请实施例提供的网页操作的还原方法中,对网页中的具有递归路径的目标元素,进行目标元素的操作信息指示的操作。无需遍历所有节点,提高了还原的效率。Second, in the method for restoring a webpage operation provided by the embodiment of the present application, an operation indicated by the operation information of the target element is performed on a target element with a recursive path in the webpage. There is no need to traverse all nodes, which improves the efficiency of restoration.
例如,实际应用中存在嵌套的HTML,现有技术直接从根节点遍历,嵌套的HTML中的元素就无法获得。通过本实施例提供的按照递归路径进行匹配的方法,从叶子节点向根节点递归匹配,解决了根节点遍历方法无法获取全部元素的缺点。For example, there is nested HTML in practical applications, and the existing technology directly traverses from the root node, and the elements in the nested HTML cannot be obtained. With the method for matching according to the recursive path provided in this embodiment, recursive matching is performed from the leaf node to the root node, which solves the disadvantage that the root node traversal method cannot obtain all elements.
第三、本申请实施例提供的网页操作的还原方法中,支持定制自定义还原规则,将在网页中操作的元素和对元素的操作转化为JavaScript并作为元素选择器中的一个传入参数,避免现有技术中定制化开发导致的增加沟通成本或效率低的问题。Third, in the method for restoring web page operations provided by the embodiments of the present application, customizing custom restoration rules is supported, and elements operated in web pages and operations on elements are converted into JavaScript and used as an incoming parameter in the element selector, Avoid the problems of increased communication costs or low efficiency caused by customized development in the existing technology.
第四、本申请实施例提供的网页操作的还原方法中,通过FlaUI框架中的Mouse接口,实现鼠标的移动和点击,模拟人的真实操作。克服了现有技术中,点击事件的场景只能触发click,对于mousedown、mouseup等操作事件是无法触发的缺点。Fourth, in the method for restoring a webpage operation provided by the embodiment of the present application, the mouse interface in the FlaUI framework is used to realize the movement and click of the mouse, simulating the real operation of a person. It overcomes the disadvantage that in the prior art, the scene of the click event can only trigger the click, and the operation events such as mousedown and mouseup cannot be triggered.
第五、本申请实施例提供的网页操作的还原方法中,通过FlaUI框架中Keyboard接口,实现模拟人通过键盘输入的操作,在Keyboard接口基础上,对其进行了封装,新增了组合按键的功能。克服了现有技术中,元素赋值操作无法直接对元素赋值的缺点。Fifth, in the method for restoring web page operations provided by the embodiments of the present application, the Keyboard interface in the FlaUI framework is used to simulate the operation of human input through the keyboard. Function. It overcomes the disadvantage that the element assignment operation cannot directly assign an element in the prior art.
综上,本实施例提供的一种网页操作的还原方法有效解决了浏览器操作Web元素不精准、速度慢、无法触发事件、定制化设计导致的效率低的问题。To sum up, the method for restoring web page operations provided in this embodiment effectively solves the problems of inaccuracy, slow speed, inability to trigger events, and low efficiency caused by customized design of web elements by browsers.
需要说明的是,本申请实施例提供的网页操作的还原系统基于MSHTML组件开发,需要说明的是,MSHTML是微软的Windows搭载的浏览器(IE)的排版引擎,具体地,MSHTML封装了HTML语言中所有元素及其属性,通过MSHTML提供的接口可以对HTML语言中的元素进行操作。It should be noted that the restoration system for webpage operations provided by the embodiments of the present application is developed based on MSHTML components. It should be noted that MSHTML is a typesetting engine of a browser (IE) carried by Microsoft Windows. Specifically, MSHTML encapsulates the HTML language All elements and their attributes in the HTML language can be manipulated through the interface provided by MSHTML.
图1所示的网页操作的还原系统,还可以具有以下功能进行说明。如下:The restoration system for webpage operation shown in FIG. 1 may also have the following functions for description. as follows:
管理控制平台还用于向机器人发送心跳消息,心跳消息用于机器人保持与管理控制平台一致的心跳,并接收机器人反馈的操作日志,监控机器人自身状态,以及流程的执行状态。本实施例中,管理控制平台还用于反馈状态信息至用户端(预先注册的账户)。The management control platform is also used to send a heartbeat message to the robot. The heartbeat message is used for the robot to maintain a heartbeat consistent with the management and control platform, and to receive operation logs fed back by the robot, to monitor the robot's own state and the execution state of the process. In this embodiment, the management control platform is also used to feed back status information to the client (pre-registered account).
需要说明的是,网页操作的还原系统,还可以进行鉴权或验证过程。It should be noted that the restoration system for web page operations can also perform an authentication or verification process.
具体地,设计器接收响应于用户的登录请求,提供登录窗口,并接收用户输入的用户信息,例如账号信息和密码信息,设计器将用户信息发送至管理控制平台,管理控制平台基于注册信息,对用户信息进行验证,并将验证信息反馈至设计器。Specifically, the designer receives a login request in response to the user, provides a login window, and receives user information input by the user, such as account information and password information, the designer sends the user information to the management control platform, and the management control platform is based on the registration information, Validate user information and feed back the validation information to the designer.
本实施例中,设计器和机器人的证书管理由管理控制平台中预设的证书管理服务负责,如图3所示,图3示出了一种流程自动化平台的架构,其中,图3右侧示出了RPA证书管理服务的服务系统架构图。In this embodiment, the certificate management service of the designer and the robot is responsible for the preset certificate management service in the management control platform, as shown in FIG. 3 , which shows the architecture of a process automation platform, wherein the right side of FIG. 3 A service system architecture diagram of the RPA certificate management service is shown.
需要说明的是,图2示例的网页操作的还原方法的具体实现过程仅为实现网页操作的还原的一种可选的方法。本实施例还可以有其他的实现网页操作的还原的具体实施方式。例如,本实施例中通过调用FIaUI库中,鼠标接口和/或键盘接口的封装函数,进行操作信息指示的操作,仅为进行操作信息指示的操作的一种方式,还可以使用现有的其它方式实现。It should be noted that, the specific implementation process of the method for restoring a webpage operation in the example of FIG. 2 is only an optional method for restoring a webpage operation. This embodiment may also have other specific implementation manners for realizing the restoration of web page operations. For example, in this embodiment, by calling the encapsulation function of the mouse interface and/or the keyboard interface in the FIaUI library to perform the operation indicated by the operation information, it is only a way to perform the operation indicated by the operation information, and other existing ones can also be used. way to achieve.
综上,本实施例将机器人还原网页操作总结概括为图4所示的方法,如图4所示,机器人网页操作的还原方法包括以下步骤。To sum up, in this embodiment, the operation of restoring a webpage by a robot is summarized as the method shown in FIG. 4 . As shown in FIG. 4 , the method for restoring a webpage operation of a robot includes the following steps.
S401、获取待还原信息。S401. Obtain information to be restored.
其中,待还原信息包括目标元素的属性信息和操作信息,目标元素为人在网页中操作的元素,属性信息用于指示目标元素的属性,操作信息用于指示人对目标元素执行的操作。The information to be restored includes attribute information and operation information of the target element. The target element is an element operated by a person on the webpage. The attribute information is used to indicate the attribute of the target element, and the operation information is used to indicate the operation performed by the person on the target element.
属性信息包括元素标识、递归路径和遍历路径中的至少一项,递归路径为从叶子节点开始,向根节点扩展的路径,遍历路径为从根节点开始,向叶子节点扩展的路径。The attribute information includes at least one of an element identifier, a recursive path and a traversal path. The recursive path is a path that starts from a leaf node and extends to the root node, and the traversal path is a path that starts from the root node and extends to the leaf node.
需要说明的是,待还原信息由设计器获取并通过管理控制平台发送至机器人。具体可以参照上述实施例。It should be noted that the information to be restored is obtained by the designer and sent to the robot through the management control platform. For details, refer to the above-mentioned embodiments.
S402、响应于查询到待还原信息中的元素标识,对网页中的第一目标元素,进行第一目标元素的操作信息指示的操作。S402. In response to querying the element identifier in the information to be restored, perform the operation indicated by the operation information of the first target element on the first target element in the webpage.
本实施例中,第一目标元素为具有元素标识的目标元素。具体可以参照上述S205,在此不做赘述。In this embodiment, the first target element is a target element with an element identifier. For details, reference may be made to the above S205, which is not repeated here.
S403、响应于查询到待还原信息中的递归路径,对网页中的第二目标元素,进行第二目标元素的操作信息指示的操作。S403. In response to querying the recursive path in the information to be restored, perform the operation indicated by the operation information of the second target element on the second target element in the webpage.
本实施例中,第二目标元素为,递归路径中的叶子节点指示的目标元素。具体可以参照上述S206,在此不做赘述。In this embodiment, the second target element is the target element indicated by the leaf node in the recursive path. For details, reference may be made to the above S206, which is not repeated here.
由上述技术方案可以看出,本申请实施例提供的网页操作的还原方法,机器人响应于查询到待还原信息中的元素标识,对网页中的具有元素标识的目标元素,进行目标元素的操作信息指示的操作。响应于查询到待还原信息中的递归路径,对网页中的具有递归路径的目标元素,进行目标元素的操作信息指示的操作。相对于现有技术中,从根节点遍历查找目标元素的方法,本方法依据目标元素的元素标识可以直接定位到目标元素,降低还原网页操作的时延。并且,本方法依据目标元素的递归路径,从叶子节点开始,向根节点扩展定位目标元素,避免了现有技术在复杂页面的场景下,无法获取全部目标元素的缺点。综上,本方法降低还原网页操作的时延、提高网页操作的还原的准确度和效率。It can be seen from the above technical solutions that in the method for restoring web page operations provided by the embodiments of the present application, the robot, in response to querying the element identifier in the information to be restored, performs the operation information of the target element on the target element with the element identifier in the web page. the indicated action. In response to querying the recursive path in the information to be restored, the operation indicated by the operation information of the target element is performed on the target element with the recursive path in the webpage. Compared with the method of searching for the target element by traversing from the root node in the prior art, the method can directly locate the target element according to the element identifier of the target element, thereby reducing the time delay of restoring the webpage. Moreover, according to the recursive path of the target element, the method starts from the leaf node and extends to the root node to locate the target element, thereby avoiding the disadvantage that all the target elements cannot be obtained in the complex page scene in the prior art. To sum up, the method reduces the time delay of restoring the webpage operation, and improves the accuracy and efficiency of restoring the webpage operation.
图5为本申请实施例提供的一种网页操作的还原装置的结构示意图,如图5所示,本装置包括:FIG. 5 is a schematic structural diagram of an apparatus for restoring web page operations provided by an embodiment of the present application. As shown in FIG. 5 , the apparatus includes:
信息获取单元501,用于获取待还原信息,所述待还原信息包括目标元素的属性信息和操作信息,所述目标元素为人在网页中操作的元素,所述属性信息用于指示所述目标元素的属性,所述操作信息用于指示所述人对所述目标元素执行的操作,所述属性信息包括元素标识、递归路径和遍历路径中的至少一项,所述递归路径为从叶子节点开始,向根节点扩展的路径,所述遍历路径为从所述根节点开始,向所述叶子节点扩展的路径;The
第一操作单元502,用于响应于查询到所述待还原信息中的所述元素标识,对所述网页中的第一目标元素,进行所述第一目标元素的操作信息指示的操作;所述第一目标元素为具有所述元素标识的所述目标元素;The
第二操作单元503,用于响应于查询到所述待还原信息中的所述递归路径,对所述网页中的第二目标元素,进行所述第二目标元素的操作信息指示的操作;所述第二目标元素为,所述递归路径中的所述叶子节点指示的所述目标元素。The
可选地,本装置还包括第三操作单元,第三操作单元用于:Optionally, the device further includes a third operation unit, and the third operation unit is used for:
响应于未查询到所述待还原信息中的所述元素标识和所述递归路径,对所述网页中的第三目标元素,进行所述第三目标元素的操作信息指示的操作;所述第三目标元素为,所述遍历路径中的最后一个预设字符串指示的所述目标元素。In response to not finding the element identifier and the recursive path in the information to be restored, perform the operation indicated by the operation information of the third target element on the third target element in the webpage; The three target elements are the target elements indicated by the last preset character string in the traversal path.
可选地,第一操作单元或第二操作单元进行所述操作信息指示的操作,包括以下至少一项:Optionally, the first operation unit or the second operation unit performs the operation indicated by the operation information, including at least one of the following:
第一操作单元或第二操作单元具体用于:The first operating unit or the second operating unit is specifically used for:
通过调用FIaUI库中,鼠标接口和/或键盘接口的封装函数,进行所述操作信息指示的操作。The operation indicated by the operation information is performed by calling the encapsulation function of the mouse interface and/or the keyboard interface in the FIaUI library.
信息获取单元用于获取待还原信息,包括:The information acquisition unit is used to acquire the information to be restored, including:
信息获取单元具体用于:接收所述待还原信息,其中,所述目标元素的属性信息和操作信息,通过自动和/或人机交互方式获取。The information acquisition unit is specifically configured to: receive the information to be restored, wherein the attribute information and operation information of the target element are acquired automatically and/or through human-computer interaction.
可选地,第一操作单元用于响应于查询到所述待还原信息中的所述元素标识,对所述网页中的第一目标元素,进行所述第一目标元素的操作信息指示的操作,包括:第一操作单元具体用于:Optionally, the first operation unit is configured to, in response to querying the element identifier in the information to be restored, perform an operation indicated by the operation information of the first target element on the first target element in the webpage. , including: the first operation unit is specifically used for:
在不存在自定义还原规则的情况下,响应于查询到所述待还原信息中的所述元素标识,对所述网页中的第一目标元素,进行所述第一目标元素的操作信息指示的操作;In the absence of a custom restoration rule, in response to querying the element identifier in the to-be-restored information, for the first target element in the webpage, perform the operation indicated by the operation information of the first target element. operate;
可选地,第二操作单元用于响应于查询到所述待还原信息中的所述递归路径,对所述网页中的第二目标元素,进行所述第二目标元素的操作信息指示的操作,包括:第二操作单元具体用于:Optionally, the second operation unit is configured to, in response to querying the recursive path in the information to be restored, perform the operation indicated by the operation information of the second target element on the second target element in the webpage. , including: the second operation unit is specifically used for:
在不存在所述自定义还原规则的情况下,响应于查询到所述待还原信息中的所述递归路径,对所述网页中的第二目标元素,进行所述第二目标元素的操作信息指示的操作;In the case where the custom restoration rule does not exist, in response to querying the recursive path in the information to be restored, for the second target element in the webpage, perform operation information on the second target element the indicated operation;
可选地,本装置还包括第四操作单元,第四操作单元用于:Optionally, the device further includes a fourth operation unit, and the fourth operation unit is used for:
在存在所述自定义还原规则的情况下,按照所述自定义还原规则,对所述目标元素进行操作。In the presence of the custom restoration rule, the target element is operated according to the custom restoration rule.
本申请实施例还提供了一种网页操作的还原设备,请参阅图6,示出了该网页操作的还原设备的结构示意图,该设备可以包括:至少一个处理器601,至少一个通信接口602,至少一个存储器603和至少一个通信总线604;The embodiment of the present application also provides a restoration device for webpage operation. Please refer to FIG. 6, which shows a schematic structural diagram of the restoration device for webpage operation. The device may include: at least one
在本申请实施例中,处理器601、通信接口602、存储器603、通信总线604的数量为至少一个,且处理器601、通信接口602、存储器603通过通信总线604完成相互间的通信;In this embodiment of the present application, the number of the
处理器601可能是一个中央处理器CPU,或者是特定集成电路ASIC(ApplicationSpecific Integrated Circuit),或者是被配置成实施本发明实施例的一个或多个集成电路等;The
存储器603可能包含高速RAM存储器,也可能还包括非易失性存储器(non-volatile memory)等,例如至少一个磁盘存储器;The
其中,存储器存储有程序,处理器可执行存储器存储的程序,实现如上项所述的网页操作的还原方法。The memory stores a program, and the processor can execute the program stored in the memory to implement the method for restoring a webpage operation as described in the above item.
本申请实施例还提供一种可读存储介质,该可读存储介质可存储有适于处理器执行的计算机程序,计算机程序被处理器执行时,实现如上所述的网页操作的还原方法。Embodiments of the present application further provide a readable storage medium, where the readable storage medium can store a computer program suitable for execution by a processor, and when the computer program is executed by the processor, implements the foregoing method for restoring a webpage operation.
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。Finally, it should also be noted that in this document, relational terms such as first and second are used only to distinguish one entity or operation from another, and do not necessarily require or imply these entities or that there is any such actual relationship or sequence between operations. Moreover, the terms "comprising", "comprising" or any other variation thereof are intended to encompass a non-exclusive inclusion such that a process, method, article or device that includes a list of elements includes not only those elements, but also includes not explicitly listed or other elements inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.
本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the various embodiments can be referred to each other.
对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本申请。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本申请的精神或范围的情况下,在其它实施例中实现。因此,本申请将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。The above description of the disclosed embodiments enables any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, this application 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.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010860222.6A CN111736837B (en) | 2020-08-25 | 2020-08-25 | Method, device, device, readable storage medium, and system for restoring web page operations |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010860222.6A CN111736837B (en) | 2020-08-25 | 2020-08-25 | Method, device, device, readable storage medium, and system for restoring web page operations |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN111736837A CN111736837A (en) | 2020-10-02 |
| CN111736837B true CN111736837B (en) | 2020-11-24 |
Family
ID=72658760
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202010860222.6A Active CN111736837B (en) | 2020-08-25 | 2020-08-25 | Method, device, device, readable storage medium, and system for restoring web page operations |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN111736837B (en) |
Families Citing this family (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112882665A (en) * | 2021-02-20 | 2021-06-01 | 厦门熵基科技有限公司 | Method and device for generating printing template, electronic equipment and storage medium |
| CN113176920B (en) * | 2021-04-29 | 2024-05-31 | 上海云扩信息科技有限公司 | Universal RPA element selector management system |
| CN113176922B (en) * | 2021-04-30 | 2024-05-24 | 上海云扩信息科技有限公司 | Universal interface element automatic detection system |
| CN113885937B (en) * | 2021-09-29 | 2024-08-13 | 杭州分叉智能科技有限公司 | RPA element repairing method based on universality |
| CN114153530A (en) * | 2022-02-08 | 2022-03-08 | 广州庚亿信息科技有限公司 | Element data information capturing method and device, storage medium and intelligent terminal |
| CN118509311A (en) * | 2024-04-25 | 2024-08-16 | 山东浪潮科学研究院有限公司 | WeChat automatic early warning system and method |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107085519A (en) * | 2017-05-04 | 2017-08-22 | 网易(杭州)网络有限公司 | Behavior tree debugging processing method, device, system, storage medium and processor |
| CN108958612A (en) * | 2018-06-14 | 2018-12-07 | 北京字节跳动网络技术有限公司 | Control method, control page method, system, equipment and the computer readable storage medium of page sliding |
| CN111045678A (en) * | 2019-11-06 | 2020-04-21 | 北京奇艺世纪科技有限公司 | Method, device and equipment for executing dynamic code on page and storage medium |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| RU2662636C2 (en) * | 2012-09-25 | 2018-07-26 | Опера Софтвэар Ас | Information management and display in web browsers |
-
2020
- 2020-08-25 CN CN202010860222.6A patent/CN111736837B/en active Active
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107085519A (en) * | 2017-05-04 | 2017-08-22 | 网易(杭州)网络有限公司 | Behavior tree debugging processing method, device, system, storage medium and processor |
| CN108958612A (en) * | 2018-06-14 | 2018-12-07 | 北京字节跳动网络技术有限公司 | Control method, control page method, system, equipment and the computer readable storage medium of page sliding |
| CN111045678A (en) * | 2019-11-06 | 2020-04-21 | 北京奇艺世纪科技有限公司 | Method, device and equipment for executing dynamic code on page and storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| CN111736837A (en) | 2020-10-02 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN111736837B (en) | Method, device, device, readable storage medium, and system for restoring web page operations | |
| JP6580664B2 (en) | Cloud-connected automated testing | |
| EP3265883B1 (en) | Software robots for programmatically controlling computer programs to perform tasks | |
| US9696972B2 (en) | Method and apparatus for updating a web-based user interface | |
| KR102243793B1 (en) | Method and apparatus for code virtualization and remote process call generation | |
| US9384005B2 (en) | Systems and methods for dynamic configuration of client-side development environments through use of application servers | |
| US9953639B2 (en) | Voice recognition system and construction method thereof | |
| CN111552633A (en) | Interface exception call testing method, device, computer equipment and storage medium | |
| CN111026470A (en) | System and method for verification and conversion of input data | |
| US20130042219A1 (en) | Automated Support for Distributed Platform Development | |
| CN110659349A (en) | Log query method, apparatus, device, and computer-readable storage medium | |
| CN111581920A (en) | Document conversion method, device, equipment and computer storage medium | |
| JP6085897B2 (en) | Method and system for causing a web application to acquire database changes | |
| CN113360300B (en) | Interface call link generation method, device, equipment and readable storage medium | |
| JP2017504129A (en) | Construction of a state expression represented in a web browser | |
| CN111679976A (en) | Method and device for searching page object | |
| WO2023109074A1 (en) | Method and apparatus for implementing linkage function, device, storage medium, and program | |
| CN116523457A (en) | Workflow processing method, device, equipment and storage medium based on business process | |
| CN114816400A (en) | Method, system, intelligent terminal and storage medium for building pages based on JSON configuration | |
| CN110874278A (en) | Embedding method, workflow system, device and storage medium of external system | |
| CN117908876A (en) | Method, device and equipment for generating system page under complex authority scene in government or enterprise informatization field based on model driving | |
| CN115202711B (en) | Data publishing method and system | |
| CN115618319B (en) | Single sign-on method and system based on Micro SaaS form filling | |
| CN110058849A (en) | Generation method, device, computer equipment and the storage medium of flow chart | |
| CN113762671A (en) | Risk assessment method, device and system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant | ||
| CP03 | Change of name, title or address | ||
| CP03 | Change of name, title or address |
Address after: 1006 and 1008 zhangheng Road, China (Shanghai) pilot Free Trade Zone, Pudong New Area, Shanghai, 201203 Patentee after: UnionPay Business Payment Co.,Ltd. Country or region after: China Address before: No. 1006 and 1008 Zhangheng Road, China (Shanghai) Pilot Free Trade Zone, Pudong New Area, Shanghai Patentee before: CHINA UMS CO.,LTD. Country or region before: China |