CN103135986B - A kind of operation acquisition method and system - Google Patents

A kind of operation acquisition method and system Download PDF

Info

Publication number
CN103135986B
CN103135986B CN201310031157.6A CN201310031157A CN103135986B CN 103135986 B CN103135986 B CN 103135986B CN 201310031157 A CN201310031157 A CN 201310031157A CN 103135986 B CN103135986 B CN 103135986B
Authority
CN
China
Prior art keywords
information
control
message
window
identity information
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.)
Expired - Fee Related
Application number
CN201310031157.6A
Other languages
Chinese (zh)
Other versions
CN103135986A (en
Inventor
杨朝红
王旭昌
张丽霞
毕学军
王维锋
刘海燕
崔培枝
苑建伟
王小振
肖庆
孙岩
张惠民
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Academy of Armored Forces Engineering of PLA
Original Assignee
Academy of Armored Forces Engineering of PLA
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Academy of Armored Forces Engineering of PLA filed Critical Academy of Armored Forces Engineering of PLA
Priority to CN201310031157.6A priority Critical patent/CN103135986B/en
Publication of CN103135986A publication Critical patent/CN103135986A/en
Application granted granted Critical
Publication of CN103135986B publication Critical patent/CN103135986B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Telephonic Communication Services (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明公开了一种操作采集方法及系统,其中,所述操作采集方法包括获取控件的身份信息和辅助描述信息,将所述控件的身份信息和辅助描述信息写入界面库;获取输入设备操作动作的引发消息,根据所述引发消息调用函数分析所述引发消息,获得所述引发消息的源控件的身份信息;将引发消息的源控件的身份信息与界面库中的身份信息匹配,若匹配成功,则获取界面库中与所述引发消息的源控件的身份信息关联的辅助描述信息,调用函数获得所述引发消息的操作信息,根据所述辅助描述信息和所述引发消息的操作信息生成操作记录。采用本发明的操作采集方法及系统,实现了对窗体控件和非窗体控件的操作采集,提升用户的体验。

The invention discloses an operation collection method and system, wherein, the operation collection method includes obtaining the identity information and auxiliary description information of the control, writing the identity information and auxiliary description information of the control into an interface library; obtaining the input device operation For the trigger message of the action, analyze the trigger message according to the trigger message call function, and obtain the identity information of the source control that triggers the message; match the identity information of the source control that triggers the message with the identity information in the interface library, if they match If successful, obtain the auxiliary description information associated with the identity information of the source control that triggered the message in the interface library, call a function to obtain the operation information of the triggered message, and generate Operation record. By adopting the operation collection method and system of the present invention, the operation collection of window controls and non-window controls is realized, and user experience is improved.

Description

一种操作采集方法及系统A kind of operation collection method and system

技术领域technical field

本发明涉及数据采集领域,具体涉及一种操作采集方法及系统。The invention relates to the field of data collection, in particular to an operation collection method and system.

背景技术Background technique

目前常见的操作采集工具主要将操作记录功能集成在测试自动化工具中,通过录制应用程序的运行并生成测试脚本,实现用户界面(UserInterface,UI)测试的自动执行。比较典型的工具有国际商业机器(InternationalBusinessMachines,IBM)公司的RationalFunctionalTester、惠普公司的QuickTestProfessional和TestQuest公司的TestQuestPro。At present, the common operation collection tools mainly integrate the operation recording function into the test automation tool, and realize the automatic execution of the user interface (UI) test by recording the running of the application program and generating test scripts. Typical tools include RationalFunctionalTester of International Business Machines (InternationalBusinessMachines, IBM), QuickTestProfessional of HP, and TestQuestPro of TestQuest.

其中,IBM公司的RationalFunctionalTester是一种自动化测试工具,用户可以使用该工具录制应用程序的运行并生成测试脚本。用户可以选择工具的脚本语言和开发环境,包括Eclipse框架中的Java或者MicrosoftVisualStudio.NET开发环境中的MicrosoftVisualBasic.NET。当记录脚本时,RationalFunctionalTester会为被测的应用程序、即测试对象自动创建测试对象地图。测试对象地图中包含了对每个测试对象的识别属性。当用户在测试对象地图中更新记录信息时,任何使用了该测试对象地图的脚本会共享更新的信息,减少了维护的成本及整个脚本开发的复杂度。测试对象地图还为用户提供快速向脚本中添加测试对象的方法。在记录过程中可以将验证点插入到脚本中以确定在被测应用程序建立过程中测试对象的状态。Among them, IBM's RationalFunctionalTester is an automated testing tool, users can use this tool to record the operation of the application and generate test scripts. Users can choose the tool's scripting language and development environment, including Java in the Eclipse framework or MicrosoftVisualBasic.NET in the MicrosoftVisualStudio.NET development environment. When recording scripts, RationalFunctionalTester automatically creates a test object map for the application under test, the test object. The test object map contains identifying attributes for each test object. When the user updates the record information in the test object map, any script that uses the test object map will share the updated information, reducing the maintenance cost and the complexity of the entire script development. The test object map also provides users with a quick way to add test objects to their scripts. Verification points can be inserted into the script during recording to determine the state of the test object during the build of the application under test.

QuickTestProfessional是惠普公司提供的功能回归测试工具,能够记录用户的操作,自动用VBScript语言编制为测试脚本,用户通过对测试脚本的修改、测试数据的参数化,可以回放测试脚本,模拟用户的输入和点击,达到自动化测试的目的。QuickTestProfessional is a functional regression testing tool provided by Hewlett-Packard, which can record the user's operation and automatically compile it into a test script in VBScript language. The user can play back the test script by modifying the test script and parameterizing the test data, simulating the user's input and Click to achieve the purpose of automated testing.

TestQuestPro是一个自动化测试工具,同样提供脚本录制功能。TestQuestPro包括三个主要模块,分别是脚本记录器、测试信息管理器和测试执行控制器,三者的整合可以创建测试工作,集成进入测试状态和执行测试。脚本记录器是TestQuestPro的核心,其通过记录按键情况来创建测试脚本和定义例证。TestQuestPro is an automated testing tool that also provides script recording capabilities. TestQuestPro includes three main modules, which are script recorder, test information manager and test execution controller. The integration of the three can create test work, integrate into test status and execute tests. The script recorder is the core of TestQuestPro, which creates test scripts and defines instances by recording keystrokes.

但是,上述三种操作采集工具虽然能在一定程度上实现对操作的记录,但是它们只能对窗体控件进行识别,不能识别非窗体控件,而目前军用指挥系统软件大量采用非窗体控件,导致目前现有的操作采集工具不能适用于军用指挥系统的操作采集。However, although the above-mentioned three kinds of operation acquisition tools can realize the recording of operations to a certain extent, they can only identify form controls and cannot identify non-form controls, and the current military command system software uses non-form controls in large quantities , leading to the fact that the existing operation collection tools cannot be applied to the operation collection of the military command system.

发明内容Contents of the invention

有鉴于此,本发明的主要目的在于提供一种操作采集方法及系统,实现了对窗体控件和非窗体控件的操作采集,提升用户的体验。In view of this, the main purpose of the present invention is to provide an operation collection method and system, which realizes the operation collection of window controls and non-window controls, and improves user experience.

为达到上述目的,本发明的技术方案是这样实现的:In order to achieve the above object, technical solution of the present invention is achieved in that way:

本发明提供了一种操作采集方法,该方法包括:The present invention provides a kind of operation collecting method, and this method comprises:

获取控件的身份信息和辅助描述信息,将所述控件的身份信息和辅助描述信息写入界面库;Obtaining the identity information and auxiliary description information of the control, and writing the identity information and auxiliary description information of the control into the interface library;

获取输入设备操作动作的引发消息,根据所述引发消息调用函数分析所述引发消息,获取所述引发消息的源控件的身份信息;Acquiring the trigger message of the operation action of the input device, analyzing the trigger message by calling a function according to the trigger message, and acquiring the identity information of the source control of the trigger message;

将引发消息的源控件的身份信息与界面库中的身份信息匹配,若匹配成功,则获取界面库中与所述引发消息的源控件的身份信息关联的辅助描述信息,调用函数获得所述引发消息的操作信息,根据所述辅助描述信息和所述引发消息的操作信息生成操作记录。Match the identity information of the source control that triggered the message with the identity information in the interface library. If the match is successful, obtain the auxiliary description information associated with the identity information of the source control that triggered the message in the interface library, and call a function to obtain the trigger For the operation information of the message, an operation record is generated according to the auxiliary description information and the operation information of the initiating message.

上述方案中,所述获取控件的身份信息和辅助描述信息包括:In the above solution, the acquisition of the control's identity information and auxiliary description information includes:

对于窗体控件,调用函数获取所述窗体控件的窗体句柄,利用窗体句柄获取所述窗体控件的身份信息,包括所述窗体控件隶属应用程序的应用程序信息和所述窗体控件的窗体信息;For the form control, call the function to obtain the form handle of the form control, use the form handle to obtain the identity information of the form control, including the application information of the application program to which the form control belongs and the form The form information of the control;

对于非窗体控件,调用函数获取所述非窗体控件隶属窗体的窗体句柄,利用所述非窗体控件隶属窗体的窗体句柄获取所述非窗体控件隶属窗体的身份信息,包括所述非窗体控件隶属窗体的隶属应用程序的应用程序信息和所述非窗体控件隶属窗体的窗体信息;通过控件标注工具标识所述非窗体控件在隶属窗体中的区域,获取所述非窗体控件在隶属窗体中的区域信息;将所述非窗体控件隶属窗体的身份信息和所述非窗体控件在隶属窗体中的区域信息组成所述非窗体控件的身份信息;For non-form controls, call the function to obtain the form handle of the form to which the non-form control belongs, and use the form handle of the form to which the non-form control belongs to obtain the identity information of the form to which the non-form control belongs , including the application information of the subordinate application of the subordinate form of the non-form control and the form information of the subordinate form of the non-form control; identify that the non-form control is in the subordinate form by using the control annotation tool The area information of the non-form control in the subordinate form is obtained; the identity information of the non-form control subordinate form and the area information of the non-form control in the subordinate form are combined into the Identity information of non-form controls;

设置所述控件的辅助描述信息,包括所述控件的类型和标题。Set the auxiliary description information of the control, including the type and title of the control.

上述方案中,所述将控件的身份信息和辅助描述信息写入界面库包括:In the above solution, writing the identity information and auxiliary description information of the control into the interface library includes:

将所述应用程序信息写入界面库中的应用程序表中;Write the application program information into the application program table in the interface library;

将所述窗体信息写入界面库中的识别控件表中;Writing the form information into the identification control table in the interface library;

对于非窗体控件,进一步地,将所述控件在隶属窗体中的区域信息写入界面库中的标注控件表中。For non-form controls, further, the area information of the control in the subordinate form is written into the label control table in the interface library.

上述方案中,所述根据所述引发消息调用函数分析所述引发消息,获取所述引发消息的源控件的身份信息包括:In the above solution, the calling function to analyze the triggering message according to the triggering message, and obtaining the identity information of the source control of the triggering message includes:

根据所述引发消息调用系统编程接口函数分析所述引发消息,若所述引发消息的源控件是窗体控件,则获取所述引发消息的源控件隶属应用程序的应用程序信息和所述引发消息的源控件的窗体信息作为所述引发消息的源控件的身份信息;Invoking the system programming interface function according to the triggering message to analyze the triggering message, if the source control of the triggering message is a form control, then obtain the application information of the application that the source control of the triggering message belongs to and the triggering message The form information of the source control is used as the identity information of the source control that triggers the message;

若所述引发消息的源控件是非窗体控件,则获取所述引发消息的源控件隶属窗体的隶属应用程序的应用程序信息和所述引发消息的源控件隶属窗体的窗体信息作为所述引发消息的源控件的身份信息。If the source control that triggers the message is a non-form control, the application information of the application that the source control that triggers the message belongs to the form and the form information of the form that the source control that triggers the message belongs to are acquired as the Describes the identity of the source control that caused the message.

上述方案中,所述将引发消息的源控件的身份信息与界面库中的身份信息匹配包括:In the above solution, the matching of the identity information of the source control that triggers the message with the identity information in the interface library includes:

将所述引发消息的源控件的身份信息中的应用程序信息与界面库中的应用程序表中的应用程序信息匹配;matching the application information in the identity information of the source control that triggered the message with the application information in the application table in the interface library;

若匹配成功,则将所述引发消息的源控件的身份信息中的窗体信息与界面库中的识别控件表匹配;If the matching is successful, matching the form information in the identity information of the source control that triggered the message with the identification control table in the interface library;

若所述引发消息的源控件的身份信息中的窗体信息与识别控件表中与所述应用程序信息对应的窗体信息匹配成功,则判断所述引发消息的源控件是否为非窗体控件,若判断的结果为否,则结束匹配进程;If the form information in the identity information of the source control that triggers the message matches the form information corresponding to the application program information in the identification control table, then determine whether the source control that triggers the message is a non-form control , if the result of the judgment is no, the matching process ends;

若判断的结果为是,则根据操作动作通过调用系统编程接口函数获取操作动作的位置信息,将所述位置信息与界面库中的标注控件表匹配,若所述位置信息在所述标注控件表中与所述窗体信息对应的区域信息中,则匹配成功,结束匹配进程。If the result of the judgment is yes, the position information of the operation action is obtained by calling the system programming interface function according to the operation action, and the position information is matched with the label control table in the interface library, if the position information is in the label control table In the area information corresponding to the form information, the matching is successful, and the matching process ends.

上述方案中,所述获取界面库中与所述引发消息的源控件的身份信息关联的辅助描述信息,调用函数获得所述引发消息的操作信息,根据所述辅助描述信息和所述引发消息的操作信息生成操作记录包括:In the above solution, the acquisition of the auxiliary description information associated with the identity information of the source control that triggered the message in the interface library, calling a function to obtain the operation information of the triggered message, and according to the auxiliary description information and the Operation information generation operation records include:

获取界面库中与所述引发消息的源控件的身份信息关联的辅助描述信息,其中,所述辅助描述信息包括所述引发消息的源控件的类型和标题;Acquiring auxiliary description information associated with the identity information of the source control that triggered the message in the interface library, where the auxiliary description information includes the type and title of the source control that triggered the message;

调用函数获得所述引发消息的操作信息,其中,所述引发消息的操作信息包括操作发生的时间、操作发生所在终端的网络互联协议(InternetProtocol,IP)地址、引发消息的控件操作、引发消息控件的操作内容、控件所属的软件信息;Calling a function to obtain the operation information of the trigger message, wherein the operation information of the trigger message includes the time when the operation occurs, the Internet Protocol (Internet Protocol, IP) address of the terminal where the operation occurs, the control operation that triggers the message, and the control that triggers the message The operation content of the control and the software information to which the control belongs;

根据所述辅助描述信息和所述引发消息的操作信息生成操作记录。An operation record is generated according to the auxiliary description information and the operation information of the initiating message.

本发明提供了一种操作采集系统,该系统包括信息采集端、界面库和操作采集端;其中,The invention provides an operation collection system, the system includes an information collection terminal, an interface library and an operation collection terminal; wherein,

所述信息采集端,用于获取控件的身份信息和辅助描述信息,将所述身份信息和辅助描述信息写入界面库;The information collection terminal is used to acquire the identity information and auxiliary description information of the control, and write the identity information and auxiliary description information into the interface library;

所述界面库,用于存储信息采集端发送的所述身份信息和辅助描述信息;The interface library is used to store the identity information and auxiliary description information sent by the information collection terminal;

所述操作采集端,获取输入设备操作动作的引发消息,根据所述引发消息调用函数分析所述引发消息,获得所述引发消息的源控件的身份信息;将引发消息的源控件的身份信息与界面库中的身份信息匹配,若匹配成功,则获取界面库中与所述引发消息的源控件的身份信息关联的辅助描述信息,调用函数获得所述引发消息的操作信息,根据所述辅助描述信息和所述引发消息的操作信息生成操作记录。The operation acquisition terminal obtains the trigger message of the operation action of the input device, analyzes the trigger message according to the trigger message call function, and obtains the identity information of the source control that triggers the message; The identity information in the interface library is matched. If the matching is successful, obtain the auxiliary description information associated with the identity information of the source control that triggered the message in the interface library, and call a function to obtain the operation information that caused the message. According to the auxiliary description information and the operation information that caused the message to generate an operation record.

上述方案中,所述信息采集端包括信息识别模块、信息标注模块和信息设置模块;其中,In the above solution, the information collection terminal includes an information identification module, an information labeling module and an information setting module; wherein,

所述信息识别模块,用于在所述控件类型为窗体控件时,调用函数获取所述窗体控件的窗体句柄,利用窗体句柄获取所述窗体控件的身份信息,将所述窗体控件的身份信息写入界面库;在所述控件类型为非窗体控件时,调用函数获取所述非窗体控件隶属窗体的窗体句柄,利用控件隶属窗体的句柄获取所述非窗体控件隶属窗体的身份信息,将所述非窗体控件隶属窗体的身份信息写入界面库;其中,所述窗体控件的身份信息包括窗体控件隶属应用程序的应用程序信息和窗体信息;The information identification module is used to call a function to obtain the form handle of the form control when the control type is a form control, use the form handle to obtain the identity information of the form control, and Write the identity information of the form control into the interface library; when the control type is a non-form control, call the function to obtain the form handle of the form that the non-form control belongs to, and use the handle of the form that the control belongs to to obtain the non-form control The identity information of the form control belonging to the form, and the identity information of the non-form control belonging to the form is written into the interface library; wherein, the identity information of the form control includes the application information of the form control belonging to the application program and Form information;

所述信息标注模块,用于在所述控件类型为非窗体控件时,标注所述非窗体控件在隶属窗体中的区域,获取所述非窗体控件在隶属窗体中的区域信息,将所述非窗体控件在隶属窗体中的区域信息写入界面库;The information labeling module is used to mark the area of the non-form control in the subordinate form when the control type is a non-form control, and obtain the area information of the non-form control in the subordinate form , writing the area information of the non-form control in the subordinate form into the interface library;

所述信息设置模块,用于设置所述控件的辅助描述信息,包括所述控件的类型和标题,将所述控件的辅助描述信息写入界面库。The information setting module is used to set the auxiliary description information of the control, including the type and title of the control, and write the auxiliary description information of the control into the interface library.

上述方案中,所述界面库,具体用于存储应用程序表、识别控件表、标注控件表和所述控件的辅助描述信息;其中,In the above solution, the interface library is specifically used to store the application program table, identification control table, annotation control table and auxiliary description information of the control; wherein,

所述应用程序表存储有所述应用程序信息;The application program table stores the application program information;

所述识别控件表存储有所述窗体信息;The identification control table stores the form information;

所述标注控件表存储有所述非窗体控件在隶属窗体中的区域信息。The label control table stores area information of the non-form control in the subordinate form.

上述方案中,所述操作采集端包括操作消息获取模块、操作消息分析模块、操作消息匹配模块和操作消息生成模块;其中,In the above solution, the operation collection terminal includes an operation message acquisition module, an operation message analysis module, an operation message matching module and an operation message generation module; wherein,

所述操作消息获取模块,用于获取输入设备操作动作的引发消息,将所述引发消息发送给操作消息分析模块;The operation message obtaining module is used to obtain the trigger message of the operation action of the input device, and send the trigger message to the operation message analysis module;

所述操作消息分析模块,用于根据操作消息获取模块发来的引发消息调用函数分析所述引发消息,获得所述引发消息的源控件的身份信息,并将所述源控件的身份信息发送给操作消息匹配模块;The operation message analysis module is configured to call a function to analyze the trigger message according to the trigger message sent by the operation message acquisition module, obtain the identity information of the source control that triggers the message, and send the identity information of the source control to Operation message matching module;

所述操作消息匹配模块,用于将操作消息分析模块发送的所述源控件的身份信息与界面库中的身份信息匹配,在匹配成功时,发送通知消息给操作消息分析模块,并获取界面库中与所述引发消息的源控件的身份信息关联的辅助描述信息,将所述辅助描述信息发送给操作消息生成模块;The operation message matching module is used to match the identity information of the source control sent by the operation message analysis module with the identity information in the interface library, and when the matching is successful, send a notification message to the operation message analysis module and obtain the interface library Auxiliary description information associated with the identity information of the source control that triggered the message, and sending the auxiliary description information to the operation message generation module;

相应的,所述操作消息分析模块,还用于接收操作消息匹配模块发送的匹配成功通知消息,调用函数获得所述引发消息的操作信息,包括操作发生的时间、操作发生所在终端的IP地址、引发消息的控件操作、引发消息控件的操作内容、控件所属的软件信息,发送给操作消息生成模块;Correspondingly, the operation message analysis module is also used to receive the matching success notification message sent by the operation message matching module, and call a function to obtain the operation information of the trigger message, including the time when the operation occurred, the IP address of the terminal where the operation occurred, The control operation that triggers the message, the operation content of the control that triggers the message, and the software information to which the control belongs are sent to the operation message generation module;

所述操作消息生成模块,用于根据操作消息匹配模块发送的所述引发消息的源控件的身份信息关联的辅助描述信息和操作消息分析模块发送的所述引发消息的操作信息生成操作记录。The operation message generation module is configured to generate an operation record according to the auxiliary description information associated with the identity information of the source control of the trigger message sent by the operation message matching module and the operation information of the trigger message sent by the operation message analysis module.

本发明提供的操作采集方法及系统,通过对窗体控件和非窗体控件的身份信息和辅助描述信息的采集,将所述身份信息和辅助描述信息写入界面库;获取输入设备操作动作的引发消息,根据所述引发消息调用函数分析所述引发消息得到所述引发消息的源控件的身份信息,将所述引发消息的源控件的身份信息与界面库中的身份信息匹配,匹配成功,则说明是需要采集的操作信息,生成操作记录,如此,实现了对窗体控件和非窗体控件的操作采集,适用于对所有控件的操作采集,尤其解决了无法对军用指挥系统中的非窗体控件的操作采集,大大提升了用户的体验。The operation collection method and system provided by the present invention, through the collection of the identity information and auxiliary description information of the window control and non-window control, write the identity information and auxiliary description information into the interface library; obtain the information of the operation action of the input device Triggering a message, analyzing the triggering message by calling a function according to the triggering message to obtain the identity information of the source control that triggered the message, matching the identity information of the source control that triggered the message with the identity information in the interface library, and the matching is successful, It shows that it is the operation information that needs to be collected, and the operation record is generated. In this way, the operation collection of form controls and non-form controls is realized, which is suitable for the operation collection of all controls, and especially solves the problem that the non-form controls in the military command system cannot be collected. The operation collection of form controls greatly improves the user experience.

附图说明Description of drawings

图1为本发明操作采集方法的流程示意图;Fig. 1 is the schematic flow sheet of operation acquisition method of the present invention;

图2为本发明中将引发消息的源控件的身份信息与界面库中的身份信息匹配的方法流程示意图;Fig. 2 is a schematic flowchart of a method for matching the identity information of the source control that triggers the message with the identity information in the interface library in the present invention;

图3为本发明中生成的操作记录的示意图;Fig. 3 is a schematic diagram of an operation record generated in the present invention;

图4为本发明操作采集系统的组成结构示意图。Fig. 4 is a schematic diagram of the composition and structure of the operation collection system of the present invention.

具体实施方式Detailed ways

本发明的基本思想是:将控件类型分为窗体控件和非窗体控件,所述非窗体控件隶属于某一窗体控件;获取窗体控件和非窗体控件的身份信息和辅助描述信息,将所述身份信息和辅助描述信息写入界面库;获取输入设备操作动作的引发消息,根据所述引发消息调用函数分析所述引发消息,将所述引发消息的源窗体的身份信息与界面库中的身份信息匹配,若匹配成功,则说明是需要采集的操作信息,生成操作记录。The basic idea of the present invention is: divide the control type into form control and non-form control, and the non-form control belongs to a certain form control; obtain the identity information and auxiliary description of form control and non-form control Information, write the identity information and auxiliary description information into the interface library; obtain the trigger message of the operation action of the input device, analyze the trigger message according to the trigger message call function, and write the identity information of the source window of the trigger message Match with the identity information in the interface library. If the match is successful, it means that it is the operation information that needs to be collected, and an operation record is generated.

下面结合附图及具体实施例对本发明作进一步详细的说明。The present invention will be described in further detail below in conjunction with the accompanying drawings and specific embodiments.

图1为本发明操作采集方法的流程示意图,如图1所示,包括以下步骤:Fig. 1 is the schematic flow sheet of operation collection method of the present invention, as shown in Fig. 1, comprises the following steps:

步骤101:获取控件的身份信息和辅助描述信息,将所述控件的身份信息和辅助描述信息写入界面库;Step 101: Obtain the identity information and auxiliary description information of the control, and write the identity information and auxiliary description information of the control into the interface library;

这里,所述获取控件的身份信息和辅助描述信息包括:Here, the identity information and auxiliary description information of the acquisition control include:

对于窗体控件,调用函数获取所述窗体控件的窗体句柄,利用窗体句柄获取所述窗体控件的身份信息,包括所述窗体控件隶属应用程序的应用程序信息和所述窗体控件的窗体信息,此时,窗体的身份信息即为控件的身份信息;For the form control, call the function to obtain the form handle of the form control, use the form handle to obtain the identity information of the form control, including the application information of the application program to which the form control belongs and the form The form information of the control, at this time, the identity information of the form is the identity information of the control;

对于非窗体控件,调用函数获取所述非窗体控件隶属窗体的窗体句柄,利用所述非窗体控件隶属窗体的窗体句柄获取所述非窗体控件隶属窗体的身份信息,包括所述非窗体控件隶属窗体的隶属应用程序的应用程序信息和所述非窗体控件隶属窗体的窗体信息;通过控件标注工具标识所述非窗体控件在隶属窗体中的区域,获取所述非窗体控件在隶属窗体中的区域信息;将所述非窗体控件隶属窗体的身份信息和所述非窗体控件在隶属窗体中的区域信息组成所述非窗体控件的身份信息;For non-form controls, call the function to obtain the form handle of the form to which the non-form control belongs, and use the form handle of the form to which the non-form control belongs to obtain the identity information of the form to which the non-form control belongs , including the application information of the subordinate application of the subordinate form of the non-form control and the form information of the subordinate form of the non-form control; identify that the non-form control is in the subordinate form by using the control annotation tool The area information of the non-form control in the subordinate form is obtained; the identity information of the non-form control subordinate form and the area information of the non-form control in the subordinate form are combined into the Identity information of non-form controls;

设置所述控件的辅助描述信息,包括所述控件的类型和标题。Set the auxiliary description information of the control, including the type and title of the control.

这里,所述控件类型是窗体控件或非窗体控件可通过系统编程接口函数识别;Here, the control type is a form control or a non-form control that can be identified through a system programming interface function;

其中,所述窗体控件可以是按钮、编辑框、复选框、工具条、列表框、组合框等Windows控件或VC等高级语言提供的控件。Wherein, the form control may be a Windows control such as a button, an edit box, a check box, a toolbar, a list box, a combo box, or a control provided by a high-level language such as VC.

进一步的,所述将控件的身份信息和辅助描述信息写入界面库包括:Further, writing the identity information and auxiliary description information of the control into the interface library includes:

将所述应用程序信息写入界面库中的应用程序表中;Write the application program information into the application program table in the interface library;

将所述窗体信息写入界面库中的识别控件表中;Writing the form information into the identification control table in the interface library;

对于非窗体控件,进一步地,还需要将所述控件在隶属窗体中的区域信息写入界面库中的标注控件表中。For non-form controls, it is further necessary to write the region information of the control in the subordinate form into the label control table in the interface library.

具体的,若控件类型为窗体,则利用窗体句柄(Hwnd)执行系统编程接口函数获取所述窗体控件的身份信息中隶属应用程序的应用程序信息;利用Hwnd执行系统编程接口函数获取所述窗体控件的身份信息中的窗体信息;Specifically, if the control type is a form, use the window handle (Hwnd) to execute the system programming interface function to obtain the application program information belonging to the application program in the identity information of the form control; use Hwnd to execute the system programming interface function to obtain all Form information in the identity information of the above-mentioned form control;

其中,所述隶属应用程序的应用程序信息包括应用程序的目录、应用程序的名称;Wherein, the application program information of the affiliated application program includes the directory of the application program and the name of the application program;

其中,所述窗体信息包括层次计数值、窗体层次标题、窗体层次类名、窗体前序、窗体后序;Wherein, the form information includes hierarchy count value, form hierarchy title, form hierarchy class name, form preorder, form postorder;

其中,所述窗体层次标题为窗体及其所有隶属窗体的标题按层次组合的标题;Wherein, the title of the form hierarchy is the title of the form and the titles of all the subordinate forms combined according to the hierarchy;

其中,所述窗体层次类名为窗体及其所有隶属窗体的类名按层次组合的类名;Wherein, the hierarchical class name of the form is the class name of the form and the class names of all the subordinate forms combined in a hierarchical manner;

其中,所述层次计数值为窗体在父窗体树中的层次信息。Wherein, the level count value is the level information of the form in the parent form tree.

若控件类型为非窗体,同样,利用所述非窗体控件隶属窗体的句柄(Hwnd)执行系统编程接口函数获取所述非窗体控件隶属窗体的身份信息中的隶属应用程序的应用程序信息;利用所述非窗体控件隶属窗体的Hwnd执行系统编程接口函数获取所述非窗体控件隶属窗体的身份信息中的窗体信息;If the control type is non-form, similarly, use the handle (Hwnd) of the non-form control's subordinate form to execute the system programming interface function to obtain the application of the subordinate application in the identity information of the non-form control's subordinate form Program information; use the Hwnd of the non-form control's subordinate form to execute the system programming interface function to obtain the form information in the identity information of the non-form control's subordinate form;

安装WH_MOUSE_LL钩子,获取鼠标的按下、抬起和移动消息的操作消息,所述WH_MOUSE_LL钩子将所述操作消息发送给控件标注工具处理得到鼠标输入的起始位置和结束位置,获取所述非窗体控件在隶属窗体中的区域信息;Install the WH_MOUSE_LL hook to obtain the operation message of pressing, lifting and moving the message of the mouse. The WH_MOUSE_LL hook sends the operation message to the control annotation tool for processing to obtain the start position and end position of the mouse input, and obtain the non-window The area information of the body control in the subordinate form;

其中,所述非窗体控件在隶属窗体中的区域信息包括左上方点X坐标、左上方点Y坐标、识别非窗体控件的长度、识别非窗体控件的宽度。Wherein, the area information of the non-form control in the subordinate form includes the X coordinate of the upper left point, the Y coordinate of the upper left point, the length for identifying the non-form control, and the width for identifying the non-form control.

步骤102:获取输入设备操作动作的引发消息,根据所述引发消息调用函数分析所述引发消息,获得所述引发消息的源控件的身份信息;Step 102: Obtain the trigger message of the operation action of the input device, analyze the trigger message according to the trigger message call function, and obtain the identity information of the source control of the trigger message;

这里,所述获取输入设备操作动作的引发消息,根据所述引发消息调用函数分析所述引发消息,获得所述引发消息的源控件的身份信息包括:Here, the acquisition of the triggering message of the operation action of the input device, analyzing the triggering message according to the calling function of the triggering message, and obtaining the identity information of the source control of the triggering message includes:

利用系统钩子机制获取输入设备操作动作的引发消息,根据所述引发消息获取源控件句柄,根据所述源控件句柄执行相应的钩子回调函数,分析所述引发消息并获得所述引发消息的源控件的身份信息;其中,Use the system hook mechanism to obtain the trigger message of the input device operation action, obtain the source control handle according to the trigger message, execute the corresponding hook callback function according to the source control handle, analyze the trigger message and obtain the source control of the trigger message identity information of ; among them,

所述引发消息的源控件类型包括窗体控件和非窗体控件;The source control types that trigger messages include form controls and non-form controls;

若所述引发消息的源控件为窗体控件,则获得所述引发消息的源控件的身份信息包括引发消息的源控件隶属应用程序的应用程序信息和引发消息的源控件的窗体信息作为所述引发消息的源控件的身份信息;其中,If the source control that triggers the message is a form control, obtaining the identity information of the source control that triggers the message includes application information that the source control that triggers the message belongs to the application and form information of the source control that triggers the message as the Describes the identity information of the source control that caused the message; where,

所述引发消息的源控件隶属应用程序的应用程序信息包括应用程序的目录、应用程序的名称;The application information of the source control that triggers the message belongs to the application program includes the directory of the application program and the name of the application program;

所述引发消息的源控件的窗体信息包括层次计数值、窗体层次标题、窗体层次类名、窗体前序、窗体后序;The form information of the source control that triggers the message includes a hierarchy count value, a form hierarchy title, a form hierarchy class name, a preorder of the form, and a postorder of the form;

若所述引发消息的源控件为非窗体控件,则获取所述引发消息的源控件的身份信息包括引发消息的源控件隶属窗体的隶属应用程序的应用程序信息和引发消息的源控件隶属窗体的窗体信息作为所述引发消息的源控件的身份信息;其中,If the source control that triggers the message is a non-form control, then obtaining the identity information of the source control that triggers the message includes the application information of the application that the source control that triggers the message belongs to the form and the source control that triggers the message belongs to The form information of the form is used as the identity information of the source control that triggers the message; wherein,

所述引发消息的源控件隶属窗体的隶属应用程序的应用程序信息包括所述源控件隶属窗体的隶属应用程序的应用程序目录、应用程序的名称;The application information of the subordinate application of the source control subordinate form that triggers the message includes the application directory and the name of the application program of the subordinate application of the source control subordinate form;

所述引发消息的源控件隶属窗体的窗体信息包括所述源控件隶属窗体的层次计数值、窗体层次标题、窗体层次类名、窗体前序、窗体后序。The form information of the form to which the source control that triggers the message includes the level count value of the form to which the source control belongs, the title of the form level, the class name of the form level, the preorder of the form, and the postorder of the form.

具体的,所述获取输入设备操作动作的引发消息通过Windows钩子(Hooks)实现对各种类型操作动作引发消息的获取;其中,钩子类型主要包括以下几种:Specifically, the acquisition of the trigger message of the operation action of the input device realizes the acquisition of the trigger message of various types of operation actions through Windows hooks (Hooks); wherein, the types of hooks mainly include the following types:

WH_CALLWNDPROC钩子,获取发送到目的窗口的消息;WH_CALLWNDPROC hook, get the message sent to the destination window;

WH_GETMESSAGE钩子,获取从GetMessage函数或PeekMessage函数返回的消息,即获取发送到消息队列中的消息;WH_GETMESSAGE hook, get the message returned from the GetMessage function or PeekMessage function, that is, get the message sent to the message queue;

WH_KEYBOARD钩子,获取通过GetMessage函数或PeekMessage函数返回的键盘操作的相关消息,即获取输入到消息队列中的键盘操作消息;The WH_KEYBOARD hook is used to obtain keyboard operation-related messages returned by the GetMessage function or PeekMessage function, that is, to obtain keyboard operation messages input into the message queue;

WH_MOUSE钩子,获取GetMessage函数或PeekMessage函数返回的鼠标输入的相关消息,即获取输入到消息队列中的鼠标输入消息;The WH_MOUSE hook is used to obtain the mouse input related messages returned by the GetMessage function or the PeekMessage function, that is, to obtain the mouse input messages entered into the message queue;

WH_SHELL钩子,获取当Windowsshell应用程序激活且顶层窗体建立或者关闭时所引发的消息;WH_SHELL hook, to obtain the message caused when the Windows shell application is activated and the top-level form is established or closed;

WH_SYSMSGFILTER钩子,获取对所有应用程序中的对话框、消息框、菜单条、滚动条的所有操作引发的消息。WH_SYSMSGFILTER hook, to get the messages caused by all operations on dialog boxes, message boxes, menu bars, and scroll bars in all applications.

其中,可通过系统控制选择安装全部或其中集中钩子类型,用于对所述钩子类型对应的操作动作的获取。Among them, all or one of the hook types can be selected and installed through system control, so as to obtain the operation actions corresponding to the hook types.

进一步的,与上述六种钩子类型对应的钩子回调函数包括:Further, the hook callback functions corresponding to the above six hook types include:

LRESULTCALLBACKCallWndProc(intnCode,WPARAMwParam,LPARAMlParam)函数,执行该回调函数,分析发送到目的控件的消息;LRESULTCALLBACKCallWndProc (intnCode, WPARAMwParam, LPARAMlParam) function, execute the callback function, and analyze the message sent to the destination control;

LRESULTCALLBACKGetMsgPro(intnCode,WPARAMwParam,LPARAMlParam)函数,执行该回调函数,分析从GetMessage函数或PeekMessage函数返回的消息,即分析发送到消息队列中的消息;LRESULTCALLBACKGetMsgPro (intnCode, WPARAMwParam, LPARAMlParam) function, execute the callback function, analyze the message returned from the GetMessage function or PeekMessage function, that is, analyze the message sent to the message queue;

LRESULTCALLBACKKeyboardProc(intncode,WPARAMwParam,LPARAMlParam)函数,执行该回调函数,分析通过GetMessage函数或PeekMessage函数返回的键盘操作的相关消息,即分析输入到消息队列中的键盘操作消息;LRESULTCALLBACKKeyboardProc (intncode, WPARAMwParam, LPARAMlParam) function executes the callback function and analyzes the keyboard operation-related messages returned by the GetMessage function or the PeekMessage function, that is, analyzes the keyboard operation messages input into the message queue;

LRESULTCALLBACKMouseProc(intnCode,WPARAMwParam,LPARAMlParam)函数,执行该回调函数,分析通过GetMessage函数或PeekMessage函数返回的鼠标操作的相关消息,即分析输入到消息队列中的鼠标操作引发的消息;LRESULTCALLBACKMouseProc (intnCode, WPARAMwParam, LPARAMlParam) function executes the callback function and analyzes the related messages of the mouse operation returned by the GetMessage function or the PeekMessage function, that is, analyzes the messages caused by the mouse operation input into the message queue;

LRESULTCALLBACKShellPro(intnCode,WPARAMwParam,LPARAMlParam)函数,执行该回调函数,分析Windowsshell应用程序激活且顶层窗体建立或者关闭所引发的消息;LRESULTCALLBACKShellPro (intnCode, WPARAMwParam, LPARAMlParam) function, execute the callback function, analyze the message caused by the activation of the Windows shell application and the establishment or closure of the top-level form;

LRESULTCALLBACKSysMsgProc(intnCode,WPARAMwParam,LPARAMlParam)函数,执行该回调函数,分析对所有应用程序中对话框、消息框、菜单条、滚动条的所有操作引发的消息。LRESULTCALLBACKSysMsgProc (intnCode, WPARAMwParam, LPARAMlParam) function executes this callback function and analyzes the messages caused by all operations on dialog boxes, message boxes, menu bars, and scroll bars in all applications.

进一步的,对于某些引发消息操作信息,需要向源控件窗口发送辅助消息才能获得。例如RichEdit控件的操作信息,需要向源控件窗口发送WM_GETTEXT消息,才能返回输入到RichEdit控件里的文本信息,获得引发消息控件的操作内容;Further, for some operation information that triggers a message, it is necessary to send an auxiliary message to the source control window to obtain it. For example, the operation information of the RichEdit control needs to send a WM_GETTEXT message to the source control window to return the text information input into the RichEdit control and obtain the operation content of the control that triggered the message;

再例如,为了获得树节点信息,需要向源控件窗口发送TVM_GETITEM消息,才能获得操作动作引发位置的树节点信息。For another example, in order to obtain the tree node information, it is necessary to send a TVM_GETITEM message to the source control window in order to obtain the tree node information at the position where the operation action is triggered.

步骤103~步骤104:将引发消息的源控件的身份信息与界面库中的身份信息匹配,若匹配成功,则获取界面库中与所述引发消息的源控件的身份信息关联的辅助描述信息,调用函数获得所述引发消息的操作信息,根据所述辅助描述信息和所述引发消息的操作信息生成操作记录;Step 103~Step 104: Match the identity information of the source control that triggered the message with the identity information in the interface library, and if the match is successful, obtain the auxiliary description information associated with the identity information of the source control that triggered the message in the interface library, calling a function to obtain the operation information of the trigger message, and generating an operation record according to the auxiliary description information and the operation information of the trigger message;

这里,所述将引发消息的源控件的身份信息与界面库中的身份信息匹配方法如图2所示,包括以下步骤:Here, the method for matching the identity information of the source control that will trigger the message with the identity information in the interface library is shown in Figure 2, including the following steps:

步骤103a:将引发消息的源控件的身份信息中的应用程序信息与界面库中的应用程序表中的应用程序信息匹配,若匹配成功,执行步骤103b;Step 103a: Match the application information in the identity information of the source control that triggered the message with the application information in the application table in the interface library, and if the matching is successful, execute step 103b;

这里,首先匹配身份信息中的应用程序信息,若界面库中的应用程序表中存在与引发消息的源控件的身份信息中的应用程序信息一致的信息,则说明匹配成功;Here, first match the application information in the identity information, if there is information consistent with the application information in the identity information of the source control that triggered the message in the application table in the interface library, it means that the matching is successful;

其中,所述匹配的应用程序信息包括:应用程序的目录、应用程序的名称。Wherein, the matched application program information includes: the directory of the application program and the name of the application program.

步骤103b:将所述引发消息的源控件的身份信息中的窗体信息与界面库中的识别控件表信息匹配,若所述引发消息的源控件的身份信息中的窗体信息与识别控件表中与所述应用程序信息对应的窗体信息匹配成功,执行步骤103c;Step 103b: Match the form information in the identity information of the source control that triggers the message with the identification control table information in the interface library, if the form information in the identity information of the source control that triggers the message matches the identification control table information The form information corresponding to the application program information in the above information is successfully matched, and step 103c is executed;

这里,若界面库中的识别控件表中与所述应用程序信息对应的窗体信息中存在与引发消息的源控件的身份信息中的窗体信息一致的信息,则说明匹配成功;Here, if there is information consistent with the form information in the identity information of the source control that triggers the message in the form information corresponding to the application program information in the identification control table in the interface library, it means that the matching is successful;

其中,所述窗体信息包括:层次计数值、窗体标题层次、窗体类名层次、窗体前序、窗体后序。Wherein, the form information includes: level count value, form title level, form class name level, form preorder, form postorder.

步骤103c:判断所述引发消息的源控件是否为非窗体控件,若判断的结果为是,执行步骤103d~步骤103e;否则,直接执行步骤103e:结束匹配进程,匹配成功;Step 103c: judging whether the source control that triggers the message is a non-window control, if the judgment result is yes, execute step 103d~step 103e; otherwise, directly execute step 103e: end the matching process, and the matching is successful;

步骤103d:根据操作动作通过调用系统编程接口函数获取操作动作的位置信息,将所述位置信息与界面库中的标注控件表信息匹配,若所述位置信息在所述标注控件表中与所述窗体信息对应的区域信息中,执行步骤103e:结束匹配进程,匹配成功;Step 103d: Obtain the location information of the operation action by calling the system programming interface function according to the operation action, and match the location information with the label control table information in the interface library. If the location information is in the label control table and the In the area information corresponding to the form information, execute step 103e: end the matching process, and the matching is successful;

这里,若所述引发消息的源控件为非窗体控件,需进一步匹配所述引发消息的源控件的区域信息。Here, if the source control that triggers the message is a non-form control, it needs to further match the region information of the source control that triggers the message.

具体的,根据操作动作点的位置,通过调用系统编程接口PtInRect函数验证该点是否在界面库中的标注控件表中与所述窗体信息对应的区域信息内,若该点在所述区域信息内说明匹配成功。Specifically, according to the position of the operation point, verify whether the point is in the area information corresponding to the form information in the label control table in the interface library by calling the system programming interface PtInRect function, if the point is in the area information Indicates that the match was successful.

进一步的,在所述引发消息的源控件的身份信息与界面库中的身份信息匹配成功后,获取界面库中与所述引发消息的源控件的身份信息关联的辅助描述信息,调用函数获得所述引发消息的操作信息,根据所述辅助描述信息和所述引发消息的操作信息生成操作记录包括:Further, after the identity information of the source control that triggers the message is successfully matched with the identity information in the interface library, obtain the auxiliary description information associated with the identity information of the source control that triggers the message in the interface library, and call a function to obtain the The operation information of the trigger message, and generating an operation record according to the auxiliary description information and the operation information of the trigger message includes:

获取界面库中与所述引发消息的源控件的身份信息关联的辅助描述信息,其中,所述辅助描述信息包括所述引发消息的源控件的类型和标题;Acquiring auxiliary description information associated with the identity information of the source control that triggered the message in the interface library, where the auxiliary description information includes the type and title of the source control that triggered the message;

调用函数获得所述引发消息的操作信息,其中,所述引发消息的操作信息包括操作发生的时间、操作发生所在终端的IP地址、引发消息的控件操作、引发消息控件的操作内容、控件所属的软件信息;Calling a function to obtain the operation information of the message that caused the message, wherein the operation information that caused the message includes the time when the operation occurred, the IP address of the terminal where the operation occurred, the operation of the control that caused the message, the operation content of the control that caused the message, and the location to which the control belongs. software information;

根据所述辅助描述信息和所述引发消息的操作信息生成操作记录。An operation record is generated according to the auxiliary description information and the operation information of the initiating message.

具体的,可采用如下数据格式形成操作记录获得相应的操作信息,生成操作记录:Specifically, the following data format can be used to form an operation record to obtain corresponding operation information and generate an operation record:

具体的操作记录可如图3所示。A specific operation record can be shown in FIG. 3 .

其中,不同的操作动作的引发消息所获得的属性值各有不同,例如,对于输入到消息队列中的键盘操作的操作记录的形成,通过相应的钩子回调函数获得的属性值,结合上述的数据个数具体赋值为:Among them, the attribute values obtained by triggering messages of different operation actions are different. For example, for the formation of operation records of keyboard operations input into the message queue, the attribute values obtained through the corresponding hook callback function, combined with the above data The specific assignment of the number is:

属性strIPAddr赋值为操作发生所在主机的IP地址;The attribute strIPAddr is assigned the IP address of the host where the operation occurs;

属性m_time赋值为操作发生的时间;The attribute m_time is assigned the time when the operation occurs;

属性strWndObject赋值为“Window(strClassName)”,其中,变量strClassName通过执行系统编程接口函数GetClassName获得;The attribute strWndObject is assigned the value "Window(strClassName)", wherein the variable strClassName is obtained by executing the system programming interface function GetClassName;

属性strEventID、strEventPara1、strObjectID和strObjPara1分别赋值为“键盘事件”、“键盘事件参数1”、“键盘目标”和“键盘目标参数1”。The attributes strEventID, strEventPara1, strObjectID and strObjPara1 are respectively assigned as "keyboard event", "keyboard event parameter 1", "keyboard target" and "keyboard target parameter 1".

图4为本发明操作采集系统的组成结构示意图,如图4所示,该系统包括信息采集端41、界面库42和操作采集端43;其中,Fig. 4 is a schematic diagram of the composition and structure of the operation collection system of the present invention, as shown in Fig. 4, the system includes an information collection terminal 41, an interface library 42 and an operation collection terminal 43; wherein,

所述信息采集端41,用于获取控件的身份信息和辅助描述信息,将所述身份信息和辅助描述信息写入界面库42;The information collection terminal 41 is used to acquire the identity information and auxiliary description information of the control, and write the identity information and auxiliary description information into the interface library 42;

所述界面库42,用于存储信息采集端41发送的所述身份信息和辅助描述信息;The interface library 42 is used to store the identity information and auxiliary description information sent by the information collection terminal 41;

所述操作采集端43,获取输入设备操作动作的引发消息,根据所述引发消息调用系统编程接口函数分析所述引发消息,获得所述引发消息的源控件的身份信息;将引发消息的源控件的身份信息与界面库42中的身份信息匹配,若匹配成功,则获取界面库42中与所述引发消息的源控件的身份信息关联的辅助描述信息,调用函数获得所述引发消息的操作信息,根据所述辅助描述信息和所述引发消息的操作信息生成操作记录。The operation collection terminal 43 obtains the trigger message of the operation action of the input device, analyzes the trigger message by calling the system programming interface function according to the trigger message, and obtains the identity information of the source control that triggers the message; the source control that triggers the message The identity information matches the identity information in the interface library 42, and if the match is successful, then obtain the auxiliary description information associated with the identity information of the source control that triggers the message in the interface library 42, and call a function to obtain the operation information that causes the message , generating an operation record according to the auxiliary description information and the operation information of the initiating message.

进一步的,所述信息采集端41包括信息识别模块411、信息标注模块412和信息设置模块413;其中,Further, the information collection terminal 41 includes an information identification module 411, an information labeling module 412 and an information setting module 413; wherein,

所述信息识别模块411,用于在所述控件类型为窗体控件时,调用函数获取所述窗体控件的窗体句柄,利用窗体句柄获取所述窗体控件的身份信息,将所述窗体控件的身份信息写入界面库42;在所述控件类型为非窗体控件时,调用函数获取所述非窗体控件隶属窗体的窗体句柄,利用控件隶属窗体的句柄获取所述非窗体控件隶属窗体的身份信息,将所述非窗体控件隶属窗体的身份信息写入界面库42;其中,所述窗体控件的身份信息包括窗体控件隶属应用程序的应用程序信息和窗体信息;The information identification module 411 is configured to call a function to obtain the form handle of the form control when the control type is a form control, use the form handle to obtain the identity information of the form control, and convert the The identity information of the form control is written into the interface library 42; when the control type is a non-form control, call a function to obtain the form handle of the form to which the non-form control belongs, and use the handle of the form to which the control belongs to obtain all Describe the identity information of the form that the non-form control belongs to, write the identity information of the form that the non-form control belongs to the interface library 42; wherein, the identity information of the form control includes the application of the form control to which the application program belongs program information and form information;

所述信息标注模块412,用于在所述控件类型为非窗体控件时,标注所述非窗体控件在隶属窗体中的区域,获取所述非窗体控件在隶属窗体中的区域信息,将所述非窗体控件在隶属窗体中的区域信息写入界面库42,由此,界面库42中写入的所述控件隶属窗体的身份信息和控件在隶属窗体中的区域信息组成非窗体控件的身份信息;The information labeling module 412 is configured to mark the area of the non-form control in the subordinate form when the control type is a non-form control, and obtain the area of the non-form control in the subordinate form information, write the area information of the non-form control in the subordinate form to the interface library 42, thus, the identity information of the control subordinate form written in the interface library 42 and the control’s status in the subordinate form The area information constitutes the identity information of the non-form control;

所述信息设置模块413,用于设置所述控件的辅助描述信息,包括所述控件的类型和标题,将所述控件的辅助描述信息写入界面库42。The information setting module 413 is configured to set the auxiliary description information of the control, including the type and title of the control, and write the auxiliary description information of the control into the interface library 42 .

进一步的,所述界面库42,具体用于存储应用程序表、识别控件表、标注控件表和所述控件的辅助描述信息;其中,Further, the interface library 42 is specifically used to store the application program table, identification control table, annotation control table and auxiliary description information of the control; wherein,

所述应用程序表存储有所述应用程序信息;The application program table stores the application program information;

所述识别控件表存储有所述窗体信息;The identification control table stores the form information;

所述标注控件表存储有所述非窗体控件在隶属窗体中的区域信息。The label control table stores area information of the non-form control in the subordinate form.

进一步的,所述操作采集端43包括操作消息获取模块431、操作消息分析模块432、操作消息匹配模块433和操作消息生成模块434;其中,Further, the operation collection terminal 43 includes an operation message acquisition module 431, an operation message analysis module 432, an operation message matching module 433 and an operation message generation module 434; wherein,

所述操作消息获取模块431,用于获取输入设备操作动作的引发消息,将所述引发消息发送给操作消息分析模块432;The operation message obtaining module 431 is used to obtain the trigger message of the operation action of the input device, and send the trigger message to the operation message analysis module 432;

所述操作消息分析模块432,用于根据操作消息获取模块431发来的引发消息调用函数分析所述引发消息,获得所述引发消息的源控件的身份信息,并将所述源控件的身份信息发送给操作消息匹配模块433;The operation message analysis module 432 is configured to call a function to analyze the trigger message according to the trigger message sent by the operation message acquisition module 431, obtain the identity information of the source control of the trigger message, and store the identity information of the source control Send to the operation message matching module 433;

所述操作消息匹配模块433,用于将操作消息分析模块432发送的所述源控件的身份信息与界面库42中的身份信息匹配,在匹配成功时,发送通知消息给操作消息分析模块432,并获取界面库42中与所述引发消息的源控件的身份信息关联的辅助描述信息,将所述辅助描述信息发送给操作消息生成模块434;The operation message matching module 433 is configured to match the identity information of the source control sent by the operation message analysis module 432 with the identity information in the interface library 42, and when the matching is successful, send a notification message to the operation message analysis module 432, And obtain the auxiliary description information associated with the identity information of the source control that triggered the message in the interface library 42, and send the auxiliary description information to the operation message generation module 434;

相应的,所述操作消息分析模块432,还用于接收操作消息匹配模块433发送的匹配成功通知消息时,调用函数获得所述引发消息的操作信息,包括操作发生的时间、操作发生所在终端的IP地址、引发消息的控件操作、引发消息控件的操作内容、控件所属的软件信息,发送给操作消息生成模块434;Correspondingly, the operation message analysis module 432 is also configured to call a function to obtain the operation information of the trigger message when receiving the matching success notification message sent by the operation message matching module 433, including the time when the operation occurred and the terminal where the operation occurred. The IP address, the control operation that causes the message, the operation content of the control that causes the message, and the software information to which the control belongs are sent to the operation message generating module 434;

所述操作消息生成模块434,用于根据操作消息匹配模块433发送的所述引发消息的源控件的身份信息关联的辅助描述信息和操作消息分析模块432发送的所述引发消息的操作信息生成操作记录。The operation message generation module 434 is configured to generate an operation according to the auxiliary description information associated with the identity information of the source control of the trigger message sent by the operation message matching module 433 and the operation information of the trigger message sent by the operation message analysis module 432 Record.

以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。凡在本发明的精神和范围之内所作的任何修改、等同替换和改进等,均包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Any modifications, equivalent replacements and improvements made within the spirit and scope of the present invention are included in the protection scope of the present invention.

Claims (2)

1. An operational acquisition method, the method comprising:
acquiring identity information and auxiliary description information of a control, and writing the identity information and the auxiliary description information of the control into an interface library;
acquiring an initiation message of an operation action of input equipment, calling a function according to the initiation message, analyzing the initiation message, and acquiring identity information of a source control of the initiation message;
matching the identity information of the source control of the initiation message with the identity information in an interface library, if the matching is successful, acquiring auxiliary description information associated with the identity information of the source control of the initiation message in the interface library, calling a function to acquire operation information of the initiation message, and generating an operation record according to the auxiliary description information and the operation information of the initiation message;
wherein, the acquiring the identity information and the auxiliary description information of the control comprises:
for a window control, calling a function to acquire a window handle of the window control, and acquiring identity information of the window control by using the window handle, wherein the identity information comprises application program information of an application program to which the window control belongs and window information of the window control;
for a non-window control, calling a function to acquire a window handle of a window to which the non-window control belongs, and acquiring identity information of the window to which the non-window control belongs by using the window handle of the window to which the non-window control belongs, wherein the identity information comprises application information of a subordinate application program of the window to which the non-window control belongs and window information of the window to which the non-window control belongs; identifying the region of the non-window control in the subordinate window through a control marking tool, and acquiring the region information of the non-window control in the subordinate window; forming the identity information of the non-window control by the identity information of the window to which the non-window control belongs and the area information of the non-window control in the subordinate window;
setting auxiliary description information of the control, including the type and the title of the control;
writing the identity information and the auxiliary description information of the control into an interface library comprises:
writing the application program information into an application program table in an interface library;
writing the form information into an identification control table in an interface library;
for the non-window control, further writing the area information of the control in the affiliated window into a labeling control table in an interface library;
wherein, the calling a function according to the triggering message to analyze the triggering message, and acquiring the identity information of the source control of the triggering message comprises:
calling a system programming interface function according to the triggering message to analyze the triggering message, and if the source control of the triggering message is a window control, acquiring application program information of an application program to which the source control of the triggering message belongs and the window information of the source control of the triggering message as identity information of the source control of the triggering message;
if the source control of the initiation message is a non-window control, acquiring application program information of a subordinate application program of a window to which the source control of the initiation message belongs and window information of a window to which the source control of the initiation message belongs as identity information of the source control of the initiation message;
wherein matching the identity information of the source control that caused the message with the identity information in the interface library comprises:
matching the application program information in the identity information of the source control which causes the message with the application program information in an application program table in an interface library;
if the matching is successful, matching the form information in the identity information of the source control of the triggering message with an identification control table in an interface library;
if the window information in the identity information of the source control initiating the message is successfully matched with the window information corresponding to the application program information in the identification control table, judging whether the source control initiating the message is a non-window control, and if the judgment result is negative, ending the matching process;
if the judgment result is yes, acquiring position information of the operation action by calling a system programming interface function according to the operation action, matching the position information with a labeling control table in an interface library, and if the position information is in the region information corresponding to the window information in the labeling control table, successfully matching, and ending a matching process;
the obtaining of the auxiliary description information associated with the identity information of the source control of the initiation message in the interface library, calling a function to obtain the operation information of the initiation message, and generating an operation record according to the auxiliary description information and the operation information of the initiation message includes:
acquiring auxiliary description information associated with identity information of a source control of the initiation message in an interface library, wherein the auxiliary description information comprises the type and the title of the source control of the initiation message;
calling a function to obtain operation information of the triggering message, wherein the operation information of the triggering message comprises operation occurrence time, an Internet Protocol (IP) address of a terminal where the operation occurs, control operation of the triggering message, operation content of a triggering message control and software information of the control;
and generating an operation record according to the auxiliary description information and the operation information of the triggering message.
2. An operation acquisition system is characterized by comprising an information acquisition end, an interface library and an operation acquisition end; wherein,
the information acquisition terminal is used for acquiring the identity information and the auxiliary description information of the control and writing the identity information and the auxiliary description information into an interface library;
the interface library is used for storing the identity information and the auxiliary description information sent by the information acquisition end;
the operation acquisition terminal acquires an initiation message of an operation action of the input equipment, calls a function according to the initiation message and analyzes the initiation message to acquire identity information of a source control of the initiation message; matching the identity information of the source control of the initiation message with the identity information in an interface library, if the matching is successful, acquiring auxiliary description information associated with the identity information of the source control of the initiation message in the interface library, calling a function to acquire operation information of the initiation message, and generating an operation record according to the auxiliary description information and the operation information of the initiation message;
the information acquisition terminal comprises an information identification module, an information labeling module and an information setting module; wherein,
the information identification module is used for calling a function to acquire a window handle of the window control when the control type is the window control, acquiring the identity information of the window control by using the window handle and writing the identity information of the window control into an interface library; when the control type is a non-window control, calling a function to acquire a window handle of a window to which the non-window control belongs, acquiring identity information of the window to which the non-window control belongs by using the handle of the window to which the control belongs, and writing the identity information of the window to which the non-window control belongs into an interface library; the identity information of the form control comprises application program information and form information of an application program to which the form control belongs;
the information marking module is used for marking the area of the non-window control in the subordinate window when the control type is the non-window control, acquiring the area information of the non-window control in the subordinate window, and writing the area information of the non-window control in the subordinate window into an interface library;
the information setting module is used for setting the auxiliary description information of the control, including the type and the title of the control, and writing the auxiliary description information of the control into an interface library;
the interface library is specifically used for storing an application program table, an identification control table, a labeling control table and auxiliary description information of the control; wherein the application table stores the application information; the identification control table stores the form information; the labeling control table stores the area information of the non-window control in the affiliated window;
the operation acquisition end comprises an operation message acquisition module, an operation message analysis module, an operation message matching module and an operation message generation module; wherein,
the operation message acquisition module is used for acquiring an initiation message of an operation action of the input equipment and sending the initiation message to the operation message analysis module;
the operation message analysis module is used for calling a function to analyze the triggering message according to the triggering message sent by the operation message acquisition module, acquiring the identity information of the source control of the triggering message and sending the identity information of the source control to the operation message matching module;
the operation message matching module is used for matching the identity information of the source control sent by the operation message analysis module with the identity information in the interface library, sending a notification message to the operation message analysis module when the matching is successful, acquiring auxiliary description information associated with the identity information of the source control initiating the message in the interface library, and sending the auxiliary description information to the operation message generation module;
correspondingly, the operation message analysis module is further configured to receive a matching success notification message sent by the operation message matching module, call a function to obtain operation information of the initiation message, where the operation information includes time when the operation occurs, an IP address of a terminal where the operation occurs, a control operation of the initiation message, operation content of the control of the initiation message, and software information to which the control belongs, and send the operation information to the operation message generation module;
the operation message generating module is used for generating an operation record according to the auxiliary description information associated with the identity information of the source control of the initiation message sent by the operation message matching module and the operation information of the initiation message sent by the operation message analyzing module.
CN201310031157.6A 2013-01-25 2013-01-25 A kind of operation acquisition method and system Expired - Fee Related CN103135986B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310031157.6A CN103135986B (en) 2013-01-25 2013-01-25 A kind of operation acquisition method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310031157.6A CN103135986B (en) 2013-01-25 2013-01-25 A kind of operation acquisition method and system

Publications (2)

Publication Number Publication Date
CN103135986A CN103135986A (en) 2013-06-05
CN103135986B true CN103135986B (en) 2015-11-25

Family

ID=48495858

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310031157.6A Expired - Fee Related CN103135986B (en) 2013-01-25 2013-01-25 A kind of operation acquisition method and system

Country Status (1)

Country Link
CN (1) CN103135986B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104881350B (en) * 2015-04-30 2019-03-19 百度在线网络技术(北京)有限公司 For determining user experience and assisting the method and apparatus for determining user experience

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101241466A (en) * 2007-02-08 2008-08-13 深圳迈瑞生物医疗电子股份有限公司 Embedded software test method and system
CN101930399A (en) * 2010-08-16 2010-12-29 于秀山 Method for recording software test
CN102664910A (en) * 2012-03-07 2012-09-12 深圳市深信服电子科技有限公司 Method, client and server for correction of remote application user operation
CN102830958A (en) * 2011-06-16 2012-12-19 奇智软件(北京)有限公司 Method and system for obtaining interface control information

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101241466A (en) * 2007-02-08 2008-08-13 深圳迈瑞生物医疗电子股份有限公司 Embedded software test method and system
CN101930399A (en) * 2010-08-16 2010-12-29 于秀山 Method for recording software test
CN102830958A (en) * 2011-06-16 2012-12-19 奇智软件(北京)有限公司 Method and system for obtaining interface control information
CN102664910A (en) * 2012-03-07 2012-09-12 深圳市深信服电子科技有限公司 Method, client and server for correction of remote application user operation

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
《基于模型的软件测试》;杨朝红 等;《北京化工大学学报》;20071231;第34卷(第S1期);第85-88页 *

Also Published As

Publication number Publication date
CN103135986A (en) 2013-06-05

Similar Documents

Publication Publication Date Title
US7979849B2 (en) Automatic model-based testing
CN102156673B (en) Test case description oriented GUI (Graphical User Interface) automatic test system and test method thereof
CN101930399A (en) Method for recording software test
US20140366005A1 (en) Abstract layer for automatic user interface testing
WO2018036342A1 (en) Csar-based template design visualization method and device
CN104809056B (en) A kind of generation method and device of interface testing code
US9459780B1 (en) Documenting interactive graphical designs
CN108845940A (en) A kind of enterprise information system automated function test method and system
US20200327043A1 (en) System and a method for automated script generation for application testing
US20090037801A1 (en) Method and apparatus for automatic user manual generation
CN100555219C (en) Atom manipulation encapsulation apparatus and method
CN107844331A (en) Generate the method, apparatus and equipment of boot configuration file
CN109857462B (en) Background Docker task mapping method for remote sensing image visual editor
CN115658529A (en) Automatic testing method for user page and related equipment
CN114185795A (en) Embedded point configuration method and device, electronic equipment and storage medium
CN113360379A (en) Program testing method and program testing device
CN110018866B (en) User interface theme updating method, device, system, vehicle and vehicle
CN109460268A (en) Application parameter configuration method, device and system
CN103135986B (en) A kind of operation acquisition method and system
CN115086261A (en) Management method, device, electronic equipment, medium and product of instant communication session
CN106815010B (en) Method and device for operating database
CN111459774B (en) Method, device, equipment and storage medium for acquiring flow of application program
CN111399972A (en) Virtual machine packet capturing method and device and computer readable storage medium
CN113326193A (en) Applet testing method and device
CN116383095B (en) Smoke testing method, system and readable storage medium based on RPA robot

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20151125

Termination date: 20200125

CF01 Termination of patent right due to non-payment of annual fee