CN103176890B - For method and the system of record and replay system action - Google Patents

For method and the system of record and replay system action Download PDF

Info

Publication number
CN103176890B
CN103176890B CN201310075209.XA CN201310075209A CN103176890B CN 103176890 B CN103176890 B CN 103176890B CN 201310075209 A CN201310075209 A CN 201310075209A CN 103176890 B CN103176890 B CN 103176890B
Authority
CN
China
Prior art keywords
record
mouse
keyboard
information
system action
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
Application number
CN201310075209.XA
Other languages
Chinese (zh)
Other versions
CN103176890A (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.)
Tsinghua University
Original Assignee
Tsinghua University
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 Tsinghua University filed Critical Tsinghua University
Priority to CN201310075209.XA priority Critical patent/CN103176890B/en
Publication of CN103176890A publication Critical patent/CN103176890A/en
Application granted granted Critical
Publication of CN103176890B publication Critical patent/CN103176890B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The present invention proposes a kind of method for record and replay system action and system, and wherein, method comprises the following steps: S1: obtains the start time of system action and terminates the moment; S2: record start time and the system action information terminated between the moment, and by system action information stored in self-defined record buffer district; And S3: the information in playback of recorded buffer zone. Method according to embodiments of the present invention, by automatically carrying out record and the playback of system action, thus ensures the consistence of each behavioral test, and whole process can save unnecessary human cost without the need to manually participating in simultaneously.

Description

For method and the system of record and replay system action
Technical field
The present invention relates to field of computer technology, in particular to a kind of method for record and replay system action and system.
Background technology
Operating system is the core of computer, and its stability and reliability directly affect the performance of computing power. In operating system kernel development process, not only need the well-designed of early stage, and require that the later stage fully tests, ensure the robustness of system.
In existing test, general employing standard testing collection carries out System Functional Test, but there are the following problems:
1, this is traveled far and wide owing to test set is generally order, therefore cannot the mutual behavior of user under resolution chart interface and system.
2, all need the artificial participation of whole process during the mutual behavior under each resolution chart interface, not only take time and effort, and be difficult to ensure that each behavioral test is all completely the same, cause the randomness of test result.
3, some business softwares, such as, although button spirit can repeat identical system action, but can only run under Windows, and the operating system kernel for new architecture is not suitable for.
Summary of the invention
The object of the present invention is intended at least solve one of above-mentioned technological deficiency.
For achieving the above object, the embodiment of one aspect of the present invention proposes a kind of method for record and replay system action, comprises the following steps: S1: obtains the start time of system action and terminates the moment; S2: record the system action information between described start time and described end moment, and by described system action information stored in self-defined record buffer district; And S3: the information in described record buffer district of resetting.
In an example of the present invention, described step S1 comprises further: S11: the shortcut support pattern creating Controlling System behavior record; And S12: graphic system, by shortcut support pattern described in keyboard information processing, obtains the start time of system action and terminates the moment.
In an example of the present invention, described step S2 also comprises: S21: the starting position recording the mouse of described start time; S22: intercept and capture all keyboards and mouse message, and stored in self-defined record buffer district; And S23: stop recording described keyboard and mouse message in the described end moment.
In an example of the present invention, described step S22 comprises further: in keyboard and the mouse-driven inside modules of operating system, clock ticktack number current for system and scanning code are added in keyboard and mouse message structure as structure member, wherein, described scanning code is keyboard scanning code and mouse scanning code; And for graphic system module, while process normal keyboard mouse message, by keyboard and mouse information stored in self-defined record buffer district.
In an example of the present invention, described step S3 comprises further: is opened by described shortcut support pattern and resets, and mouse is placed in described starting position; And the information temporally taken out in turn in a graphics system in described record buffer district.
The method for record and replay system action according to embodiments of the present invention, by the record of system action and playback, thus ensureing the consistence of each behavioral test, simultaneously omnidistance without the need to artificial participation, therefore save human cost.
For achieving the above object, the present invention's embodiment on the other hand also proposes a kind of system for record and replay system action, comprising: acquisition module, for obtaining the start time of system action and terminate the moment; Record memory module, for the system action information recorded between described start time and described end moment, and by described system action information stored in self-defined record buffer district; And playback module, for the information reset in described record buffer district.
In one embodiment of the invention, described acquisition module specifically comprises: shortcut unit, for creating the shortcut support pattern of Controlling System behavior record; And acquiring unit, for graphic system by shortcut support pattern described in keyboard information processing, obtain the start time of system action and terminate the moment.
In one embodiment of the invention, described record memory module specifically comprises: record sub module, for recording the starting position of the mouse of described start time; And intercepting and capturing sub module stored, for intercepting and capturing all keyboards and mouse message, and stored in self-defined record buffer district; Terminate submodule block, for stopping described in record and mouse message in the described end moment.
In one embodiment of the invention, described intercepting and capturing sub module stored comprises further: information process unit, for in the keyboard of operating system and mouse-driven inside modules, clock ticktack number current for system being added in keyboard and mouse message structure as structure member; And information memory cell, for for graphic system module, while process normal keyboard mouse message, by keyboard and mouse information stored in self-defined record buffer district.
In one embodiment of the invention, described playback module specifically comprises: resets and opens unit, resets for being opened by described shortcut support pattern, and mouse is placed in described starting position; And reading unit, for the information temporally taken out in turn in a graphics system in described record buffer district.
The system for record and replay system action according to embodiments of the present invention, by the record of system action and playback, thus ensureing the consistence of each behavioral test, simultaneously omnidistance without the need to artificial participation, therefore save human cost.
The aspect that the present invention adds and advantage will part provide in the following description, and part will become obvious from the following description, or be recognized by the practice of the present invention.
Accompanying drawing explanation
The present invention above-mentioned and/or additional aspect and advantage will become obviously with it should be readily understood that wherein from the following description of the accompanying drawings of embodiments:
Fig. 1 is the schema of the method for record and replay system action of the embodiment of the present invention;
Fig. 2 is the schematic diagram of the step S2 of the embodiment of the present invention;
Fig. 3 is the framework figure of the system for record and replay system action of the embodiment of the present invention; And
Fig. 4 is the framework figure of the record memory module of the embodiment of the present invention.
Embodiment
Being described below in detail embodiments of the invention, the example of embodiment is shown in the drawings, and wherein same or similar label represents same or similar element or has element that is identical or similar functions from start to finish. It is exemplary below by the embodiment being described with reference to the drawings, only for explaining the present invention, and limitation of the present invention can not be interpreted as.
Fig. 1 is the schema of the method for record and replay system action of the embodiment of the present invention. As shown in Figure 1, the method for record and replay system action according to embodiments of the present invention, comprises the following steps:
Step S101, obtains the start time of system action and terminates the moment.
Specifically, first, the shortcut support pattern of Controlling System behavior record is created. In a graphics system, with the addition of an overall variable sys_state, represent the state that system is current. System state comprises: normal operating condition, register system behavior state, playback system behavior state. When system state changes, all can revise sys_state overall situation variable. System is initially in normal operating condition. If pressing<Ctrl+1>shortcut, so will open system behavior record function, enter register system behavior state; Press<Ctrl+2>shortcut, will halt system behavior record, enter normal operating condition. Now press<Ctrl+3>shortcut again, just start system playback, enter playback system state; Pressing<Ctrl+4>shortcut, halt system is reset, and enters normal operating condition. In order to automatically reset, it is possible to press<Ctrl+7>, so just can the system action of loop play record always. In addition, owing to the message of record is all in internal memory, can cause losing due to shutdown. For this reason, the present invention with the addition of file support, preserves the message of record for file, specifically can pass through shortcut<Ctrl+5>, the realization of<Ctrl+6>shortcut. The particular content of shortcut support pattern is as shown in table 1 below.
Table 1
Shortcut Function
<Ctrl+0> The shortcut support pattern of indicating system behavior record helps
<Ctrl+1> Start register system behavior
<Ctrl+2> Ends with system behavior record
<Ctrl+3> System action is reset and is started
<Ctrl+4> System action is reset and is terminated
<Ctrl+5> System action is recorded in file
<Ctrl+6> From file loading system
<Ctrl+7> Playback cycle system action record
Then, graphic system, by keyboard information processing shortcut support pattern, obtains the start time of system action and terminates the moment. Such as, system normal course of operation is pressed<Ctrl+1>shortcut, this will be defined as the start time of system action record by system by the moment of lower keyboard, starts register system behavior, and obtains when carrying out ends with system behavior by shortcut<Ctrl+2>and terminate the moment.
The method for record and replay system action according to embodiments of the present invention, by setting up shortcut support pattern, facilitates operation and the use of user, and then improves efficiency.
Step S102, record start time and the system action information terminated between the moment, and by system action information stored in self-defined record buffer district.
Fig. 2 is the schematic diagram of the step S2 of the embodiment of the present invention. Graphic system is the important component part of operating system, such as the XWindow graphic system in Linux. Graphic system is responsible for the drafting of whole operating system graphical interfaces, the process etc. of keyboard and mouse message, is positioned at the lower floor of application program, it is possible to realize at operating system kernel, it is also possible to realize at User space, calls for upper strata as shared storehouse. Graphic system realizes management by message queue mechanism. There is a message buffer zone in graphic system inside, generally managed by queue data structure, there is the characteristic of first outer. In queue, each element represents one " message ", and these " message " have many types, as keyboard press with discharge, mouse click, graphic plotting etc.
In multiple Hardware drive module that operating system bottom comprises, Keyboard drive module and mouse-driven module are the most basic modules, are responsible for the response of keyboard and mouse. When starting register system behavior, first recording the starting position of the mouse of start time, when mouse is clicked, operating system kernel can produce to interrupt, and mouse control chip can produce mouse scanning code and clock ticktack number simultaneously. Keyboard is scanned code by mouse-driven module and clock ticktack number carries out inter-process, is packaged into mouse information, adds the message queue of graphic system structure, transfers to graphic system to be undertaken mouse message processing stored in self-defined record buffer district. Wherein, clock ticktack refers to the time of operating system inside, triggers by clock hardware interrupts, such as the jiffies variable etc. in Linux.
In one embodiment of the invention when there being keyboard to press, operating system kernel can produce to interrupt, and keyboard control chip can produce keyboard scanning code and clock ticktack number simultaneously. Keyboard is scanned code by Keyboard drive module and clock ticktack number carries out inter-process, is packaged into keyboard message, adds the message queue of graphic system structure, transfers to graphic system to be undertaken keyboard information processing stored in self-defined record buffer district. Wherein, clock ticktack refers to the time of operating system inside, triggers by clock hardware interrupts, such as the jiffies variable etc. in Linux.
In one embodiment of the invention, the system action terminating the moment can be arrived when system only records beginning, shortcut support pattern<Ctrl+5>and<Ctrl+6>after system action record end, can also be passed through, the system message of record is preserved as file.
The method for record and replay system action according to embodiments of the present invention, by the data of register system behavior being preserved with document form, avoids the data caused because of reasons such as unexpected shutdown to lose.
Step S103, the information in playback of recorded buffer zone.
Specifically, first, opened by shortcut support pattern<Ctrl+3>and reset, and mouse is placed in starting position. Then in graphic system message loop processing module, temporally take out the message in record buffer district in turn, give graphic system and process. If the non-sky in message buffer zone, graphic system is just taken out message from message buffer zone and is processed. Such as, when each keyboard information in record buffer district be followed successively by " A ", " data ", "+" time, graphic system can by " A ", " data " in each keyboard information, "+" process in order, finally screen output character " A ", " data ", "+".
Method according to embodiments of the present invention, by automatically carrying out record and the playback of system action, thus ensures the consistence of each behavioral test, and whole process can save unnecessary human cost without the need to manually participating in simultaneously.
In order to realize above-described embodiment, the present invention also proposes a kind of system for record and replay system action. Fig. 3 is the framework figure of the system for record and replay system action of the embodiment of the present invention, and as shown in Figure 3, the system for record and replay system action according to embodiments of the present invention comprises acquisition module 100, record memory module 200 and playback module 300.
Specifically, acquisition module 100 for obtaining the start time of system action and terminates the moment.
In one embodiment of the invention, acquisition module 100 comprises shortcut unit and acquiring unit.
Shortcut unit is for creating the shortcut support pattern of Controlling System behavior record. In a graphics system, with the addition of an overall variable sys_state, represent the state that system is current. System state comprises: normal operating condition, register system behavior state, playback system behavior state. When system state changes, all can revise sys_state overall situation variable. System is initially in normal operating condition. If pressing<Ctrl+1>shortcut, so will open system behavior record function, enter register system behavior state; Press<Ctrl+2>shortcut, will halt system behavior record, enter normal operating condition. Now press<Ctrl+3>shortcut again, just start system playback, enter playback system state; Pressing<Ctrl+4>shortcut, halt system is reset, and enters normal operating condition. In order to automatically reset, it is possible to press<Ctrl+7>, so just can the system action of loop play record always. In addition, owing to the message of record is all in internal memory, can cause losing due to shutdown. For this reason, the present invention with the addition of file support, preserves the message of record for file, specifically can pass through shortcut<Ctrl+5>, the realization of<Ctrl+6>shortcut.
Acquiring unit is used for graphic system by keyboard information processing shortcut support pattern, obtains the start time of system action and terminates the moment. Such as, system normal course of operation is pressed<Ctrl+1>shortcut, this will be defined as the start time of system action record by system by the moment of lower keyboard, starts register system behavior, and obtains when carrying out ends with system behavior by shortcut<Ctrl+2>and terminate the moment.
The system for record and replay system action according to embodiments of the present invention, by setting up shortcut support pattern, facilitates operation and the use of user, and then improves efficiency.
The system action information of record memory module 200 for recording between start time and end moment, and by system action information stored in self-defined record buffer district.
Figure is the framework figure of the record memory module of 4 embodiment of the present invention, and as shown in Figure 4, record memory module 200 comprises record sub module 210, intercepts and captures sub module stored 220 and terminate submodule block 230.
Record sub module 210 is for recording the starting position of the mouse of start time.
Intercept and capture sub module stored 220 for intercepting and capturing all keyboards and mouse message, and stored in self-defined record buffer district.
In one embodiment of the invention, intercept and capture sub module stored 220 and comprise information process unit and information memory cell.
Information process unit is used in the keyboard of operating system and mouse-driven inside modules, adds in keyboard and mouse message structure using clock ticktack number current for system and scanning code as structure member, and wherein, scanning code is keyboard scanning code and mouse scanning code.
In one embodiment of the invention, first recording the starting position of the mouse of start time when starting register system behavior, when mouse is clicked, operating system kernel can produce to interrupt, and mouse control chip can produce mouse scanning code and clock ticktack number simultaneously. Keyboard is scanned code by mouse-driven module and clock ticktack number carries out inter-process, is packaged into mouse information, adds in the message queue of graphic system structure. In one embodiment of the invention when there being keyboard to press, operating system kernel can produce to interrupt, and keyboard control chip can produce keyboard scanning code and clock ticktack number simultaneously. Keyboard is scanned code by Keyboard drive module and clock ticktack number carries out inter-process, is packaged into keyboard message, adds in the message queue of graphic system structure. Wherein, clock ticktack refers to the time of operating system inside, triggers by clock hardware interrupts, such as the jiffies variable etc. in Linux.
Information memory cell is used for for graphic system module, while process normal keyboard mouse message, by keyboard and mouse information stored in self-defined record buffer district. Mouse message and keyboard information are processed by graphic system, stored in self-defined record buffer district.
Terminate submodule block 230 for stopping record and mouse message in the end moment.
Playback module 300 is for the information in playback of recorded buffer zone.
In one embodiment of the invention, opened by shortcut support pattern<Ctrl+3>and reset, and mouse is placed in starting position. Then in graphic system message loop processing module, temporally take out the message in record buffer district in turn, give graphic system and process. If the non-sky in message buffer zone, graphic system is just taken out message from message buffer zone and is processed. Such as, when each keyboard information in record buffer district be followed successively by " A ", " data ", "+" time, graphic system can by " A ", " data " in each keyboard information, "+" process in order, finally screen output character " A ", " data ", "+".
It is to be understood that the specific operation process of each module in the device embodiment of the present invention and unit can be identical with the description in embodiment of the method, it is not described in detail herein.
Although it has been shown and described that embodiments of the invention, for the ordinary skill in the art, being appreciated that and these embodiments can be carried out multiple change, amendment, replacement and modification without departing from the principles and spirit of the present invention, the scope of the present invention is by claims and equivalent limits.

Claims (6)

1. the method for record and replay system action, it is characterised in that, comprise the following steps:
S1: obtain the start time of system action and terminate the moment;
S2: record the system action information between described start time and described end moment, and by described system action information stored in self-defined record buffer district; And
S3: the information in described record buffer district of resetting,
Described step S2 comprises further:
S21: the starting position recording the mouse of described start time; And
S22: intercept and capture all keyboards and mouse message, and stored in self-defined record buffer district;
S23: stop recording described keyboard and mouse message in the described end moment,
Described step S22 comprises further:
In keyboard and the mouse-driven inside modules of operating system, adding in keyboard and mouse message structure using clock ticktack number current for system and scanning code as structure member, wherein, described scanning code is keyboard scanning code and mouse scanning code; And
For graphic system module, while process normal keyboard mouse message, by keyboard and mouse information stored in self-defined record buffer district.
2. the method for record and replay system action according to claim 1, it is characterised in that, described step S1 comprises further:
S11: the shortcut support pattern creating Controlling System behavior record; And
S12: graphic system, by shortcut support pattern described in keyboard information processing, obtains the start time of system action and terminates the moment.
3. the method for record and replay system action according to claim 2, it is characterised in that, described step S3 comprises further:
Opened by described shortcut support pattern and reset, and mouse is placed in described starting position; And
Temporally take out the information in described record buffer district in a graphics system in turn.
4. the system for record and replay system action, it is characterised in that, comprising:
Acquisition module, for obtaining the start time of system action and terminate the moment;
Record memory module, for the system action information recorded between described start time and described end moment, and by described system action information stored in self-defined record buffer district; And
Playback module, for the information reset in described record buffer district,
Described record memory module specifically comprises:
Record sub module, for recording the starting position of the mouse of described start time; And
Intercept and capture sub module stored, for intercepting and capturing all keyboards and mouse message, and stored in self-defined record buffer district;
Terminate submodule block, for stopping recording described keyboard and mouse message in the described end moment,
Described intercepting and capturing sub module stored specifically comprises:
Information process unit, in the keyboard of operating system and mouse-driven inside modules, adding in keyboard and mouse message structure using clock ticktack number current for system and scanning code as structure member, wherein, described scanning code is keyboard scanning code and mouse scanning code; And
Information memory cell, for for graphic system module, while process normal keyboard mouse message, by keyboard and mouse information stored in self-defined record buffer district.
5. as claimed in claim 4 for the system of record and replay system action, it is characterised in that, described acquisition module specifically comprises:
Shortcut unit, for creating the shortcut support pattern of Controlling System behavior record; And
Acquiring unit, for graphic system by shortcut support pattern described in keyboard information processing, obtains the start time of system action and terminates the moment.
6. as claimed in claim 5 for the system of record and replay system action, it is characterised in that, described playback module specifically comprises:
Reset and open unit, reset for being opened by described shortcut support pattern, and mouse is placed in described starting position; And
Reading unit, for the information temporally taken out in turn in a graphics system in described record buffer district.
CN201310075209.XA 2013-03-08 2013-03-08 For method and the system of record and replay system action Active CN103176890B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310075209.XA CN103176890B (en) 2013-03-08 2013-03-08 For method and the system of record and replay system action

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310075209.XA CN103176890B (en) 2013-03-08 2013-03-08 For method and the system of record and replay system action

Publications (2)

Publication Number Publication Date
CN103176890A CN103176890A (en) 2013-06-26
CN103176890B true CN103176890B (en) 2016-06-01

Family

ID=48636785

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310075209.XA Active CN103176890B (en) 2013-03-08 2013-03-08 For method and the system of record and replay system action

Country Status (1)

Country Link
CN (1) CN103176890B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017034471A1 (en) * 2015-08-21 2017-03-02 Razer (Asia-Pacific) Pte. Ltd. Information distribution methods, computer readable media, and information distribution servers

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1294347A (en) * 1999-10-21 2001-05-09 神达电脑股份有限公司 Exception detecting method for keyboard input system
CN101493790A (en) * 2009-02-27 2009-07-29 北京中星微电子有限公司 Record playback system and record playback method
CN102508762A (en) * 2011-09-29 2012-06-20 用友软件股份有限公司 Data interaction control device and data interaction control method
CN102880482A (en) * 2012-08-06 2013-01-16 厦门市美亚柏科信息股份有限公司 System and technical method of automatically updating software in host batch control virtual machine

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1294347A (en) * 1999-10-21 2001-05-09 神达电脑股份有限公司 Exception detecting method for keyboard input system
CN101493790A (en) * 2009-02-27 2009-07-29 北京中星微电子有限公司 Record playback system and record playback method
CN102508762A (en) * 2011-09-29 2012-06-20 用友软件股份有限公司 Data interaction control device and data interaction control method
CN102880482A (en) * 2012-08-06 2013-01-16 厦门市美亚柏科信息股份有限公司 System and technical method of automatically updating software in host batch control virtual machine

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
网络游戏中外挂防御技术的研究与设计;王海军;《中国优秀硕士学位论文全文数据库 信息科技辑 》;20071115;全文 *

Also Published As

Publication number Publication date
CN103176890A (en) 2013-06-26

Similar Documents

Publication Publication Date Title
CN110297759B (en) Method, device, equipment and storage medium for manufacturing test page script
US6539500B1 (en) System and method for tracing
TWI510913B (en) Testing device and testing method thereof
CN101887393B (en) Equipment fault reproduction method and system based on para-virtualization technique
CN107239389B (en) Method and device for determining user operation record in hybrid APP
WO2016095554A1 (en) Test method, device and system for application
CN103914205B (en) A kind of file thumbnail methods of exhibiting of intelligent terminal and device
CN104063305A (en) Pressure testing method, device and system for intelligent terminal software
CN110362483A (en) Performance data acquisition method, device, equipment and storage medium
CN111143200A (en) Method and device for recording and playing back touch event, storage medium and equipment
US20230214243A1 (en) One-machine multi-control method, apparatus, system and electronic device
CN106598859A (en) Appium multi-thread implementation system and method
US20120151450A1 (en) Platform-Agnostic Diagnostic Data Collection and Display
CN115061837B (en) Method and device for scheduling, tracking and acquiring user space call stack
CN104115097A (en) Automated perceptual quality assessment of touch screen devices
CN103176890B (en) For method and the system of record and replay system action
CN117909160A (en) Firmware crash analysis method and device based on Internet of things
CN111708704B (en) Cloud real machine testing method, device, terminal and storage medium
CN111124519B (en) Method and system for optimizing starting speed of android application program based on input response
WO2019062412A1 (en) Method and apparatus for recording application information, storage medium, and electronic device
WO2019001320A1 (en) Tracking method, device, equipment and machine readable medium
CN115509913A (en) Software automation test method, device, machine readable medium and equipment
CN110334025B (en) AR application performance and user behavior monitoring method of Android system
CN113821424A (en) Operation recording and playback method and device of application software and electronic equipment
CN111026657B (en) Method, computing device and medium for testing application in mobile terminal

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