CN104008040B - The long-time automatic testing method playing keyboard game on a kind of computer - Google Patents

The long-time automatic testing method playing keyboard game on a kind of computer Download PDF

Info

Publication number
CN104008040B
CN104008040B CN201410244270.7A CN201410244270A CN104008040B CN 104008040 B CN104008040 B CN 104008040B CN 201410244270 A CN201410244270 A CN 201410244270A CN 104008040 B CN104008040 B CN 104008040B
Authority
CN
China
Prior art keywords
button
hook
time
taps
game
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
CN201410244270.7A
Other languages
Chinese (zh)
Other versions
CN104008040A (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.)
Zhejiang Aerospace Changfeng Science & Technology Development Co Ltd
Original Assignee
Zhejiang University of Technology ZJUT
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 Zhejiang University of Technology ZJUT filed Critical Zhejiang University of Technology ZJUT
Priority to CN201410244270.7A priority Critical patent/CN104008040B/en
Publication of CN104008040A publication Critical patent/CN104008040A/en
Application granted granted Critical
Publication of CN104008040B publication Critical patent/CN104008040B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Input From Keyboards Or The Like (AREA)

Abstract

On a kind of computer, the long-time automatic testing method playing keyboard game, comprises the following steps: 1) create a DLL, the inside realizes the Hook Function of overall situation HOOK module, and derives this function interface;2) api function using Windows system installs hook;3) hook detection is carried out, process is as follows: 3.1) read, every the time interval set, the current record of keys table that overall situation HOOK module is safeguarded, two-dimensional state the exterior and the interior in the conversion of current record of keys table takes the time period arriving current time sometime, calculates the number of taps of each button in this time period;3.2) the state value sum in button number of taps is the section at this moment of every a line, forms rectangular histogram, calculates root variance d of this scattergram, when root variance d is more than predetermined threshold value, it is determined that current state is the object for appreciation game behavior of computer user.The scope of application of the present invention is wider, reliability is good.

Description

The long-time automatic testing method playing keyboard game on a kind of computer
Technical field
The invention belongs to computer screen monitoring technical field, long-time object for appreciation keyboard game on a kind of computer Automatic testing method.
Background technology
For a long time, unit, network computer game is the most prevailing, causes many teenager to indulge in computer Play, neglect one's studies, had a strong impact on teen-age physical and mental health.Especially in family, school and company Computer uses, the head of a family, teacher and enterprise operator be concerned about very much computer whether by the long period for playing game and unrestrained Take the time of study and work.In this, market has some computer screen monitoring software and systems, by suitable Time ground copy screen picture be used as the memorandum entry of computer user usage behavior.This class method cost is slightly higher, System runs certain C PU calculating resource and the network bandwidth having occupied computer, and checking process needs system to use Family is consulted video recording and is become complicated heavy, it is often more important that such system has the suspicion invading computer user privacy.
Computer game has very fraction only to use mouse not use keyboard, is referred to as meaning non-keyboard game, such as, " digs Rhizoma Anemones flaccidae " etc..Non-keyboard game has the composition of some Fructus Alpiniae Oxyphyllaes, or owing to the operation rhythm of player is unhappy, psychological tightly Zhang Chengdu is the highest, so the urgency of disabling is limited, this programme only considers the long-time operation row that keyboard is played For detection.
" software report " a technical article " utilize keyboard HOOK monitoring online play game " (refer to:http://www.360doc.com/content/12/0216/16/8484669_187115137.shtmlC# is used in) Hook (HOOK) function provided, arranges the hook to four direction key and space bar, adds up these buttons Percussion frequency, can assert that when this frequency is more than certain threshold value operator are playing game.This side The major defect of method is, the operated key of a lot of game be not directionkeys, such as WASD key and space bar, The most such as ASD key and JKL key etc. are also typically used to the operation button of game.And, a lot of game in order to Improve Consumer's Experience, it is allowed to user distributes oneself any button interested as behaviour in arranging of game keys Make key.Additionally, the frequency tapping certain key is the fuzzyyest higher than certain this standard of threshold value, because this frequency Relevant with the time window size opened when calculating, if number of taps is the highest, but the time window weighed is also The longest meeting causes frequency relatively low, thus causes missing inspection.
Summary of the invention
In order to the scope of application overcoming on existing computer the long-time automatic testing method playing keyboard game is narrower, can By the deficiency that property is poor, the present invention provides and plays for a long time on the computer that a kind of scope of application is wider, reliability is good The automatic testing method of keyboard game.
The technical solution adopted for the present invention to solve the technical problems is:
The long-time automatic testing method playing keyboard game on a kind of computer, described automatic testing method includes following Step:
1) creating a DLL, the inside realizes the Hook Function of overall situation HOOK module, and derives this function interface;
Described Hook Function safeguards a record of keys table, and this record of keys table is that each button of keyboard is opened up One storage line, row head is button ID, and each time value in every a line is different;Each button ID Distributing a numeral is button sequence number, is illustrated as two-dimensional state table by button sequence number, time sequencing, and each is adopted On sample moment Tn, the most at least a key-press event occurs, and occurs as 1, does not occur as 0;
2) api function using Windows system installs hook, and described hook can be intercepted and captured windows desktop and run Any keyboard operation of each process;
3) carrying out hook detection, process is as follows:
3.1) read, every the time interval set, the current record of keys table that overall situation HOOK module is safeguarded, currently The two-dimensional state the exterior and the interior that record of keys table converts takes the time period arriving current time sometime, calculates this time The number of taps of each button in Duan;
3.2) the state value sum in button number of taps is the section at this moment of every a line, forms rectangular histogram, and rectangular histogram is anti- Reflect each button distribution situation of number of taps within the given period, calculate root variance d of this scattergram, meter Calculation formula is as follows:
num = 1 NUM Σ i = 1 NUM Num ( i ) ;
( 1 NUM Σ i = 1 NUM ( Num ( i ) - num ) 2 ) 1 / 2
In formula, num represents distribution average, and Num (i) represents the button number of taps of serial number i, and NUM is total Number of keys;
When root variance d is more than predetermined threshold value, it is determined that current state is the object for appreciation game behavior of computer user.
Further, described step 3.2) in, number of taps occupy the operated key that the button of above several is game.
The technology of the present invention is contemplated that: from the point of view of the number of taps of full keyboard button is distributed, when user is for a long time When playing keyboard game, tapping number and relatively greatly and concentrate on several operated keys of this game, remaining button taps Number almost 0;And user uses computer in other situations, such as documents editing, surf the Net, do shopping or compile During program writing, the number of keys of non-zero percussion number is the most, gets comparison and dissipates, is not gathered in as game On a few button.The variance that this phenomenon statistical language describes the distribution being exactly the former correspondence is relatively big, after The variance of the distribution of person is less.
Beneficial effects of the present invention is mainly manifested in: 1, can identify intelligently possible as game operation key Arbitrarily button, the scope of application is wider;2, based on each button number of taps (rectangular histogram) within the given period Distribution situation judge, reliability is good.
Accompanying drawing explanation
Fig. 1 is the principle frame of the business application module of the long-time automatic checkout system playing keyboard game on computer Figure.
Fig. 2 is the scattergram of button number of taps.
Detailed description of the invention
The invention will be further described below in conjunction with the accompanying drawings.
See figures.1.and.2, the long-time automatic testing method playing keyboard game on a kind of computer, described automatically Detection method comprises the following steps:
1) creating a DLL, the inside realizes the Hook Function of overall situation HOOK module, and derives this function interface;
Described Hook Function safeguards a record of keys table, and this record of keys table is that each button of keyboard is opened up One storage line, row head is button ID, and each time value in every a line is different;Each button ID Distributing a numeral is button sequence number, is illustrated as two-dimensional state table by button sequence number, time sequencing, and each is adopted On sample moment Tn, the most at least a key-press event occurs, and occurs as 1, does not occur as 0;
2) api function using Windows system installs hook, and described hook can be intercepted and captured windows desktop and run Any keyboard operation of each process;
3) carrying out hook detection, process is as follows:
3.1) read, every the time interval set, the current record of keys table that overall situation HOOK module is safeguarded, currently The two-dimensional state the exterior and the interior that record of keys table converts takes the time period arriving current time sometime, calculates this time The number of taps of each button in Duan;
3.2) the state value sum in button number of taps is the section at this moment of every a line, forms rectangular histogram, and rectangular histogram is anti- Reflect each button distribution situation of number of taps within the given period, calculate root variance d of this scattergram, meter Calculation formula is as follows:
num = 1 NUM Σ i = 1 NUM Num ( i ) ;
( 1 NUM Σ i = 1 NUM ( Num ( i ) - num ) 2 ) 1 / 2
In formula, num represents distribution average, and Num (i) represents the button number of taps of serial number i, and NUM is total Number of keys;
When root variance d is more than predetermined threshold value, it is determined that current state is the object for appreciation game behavior of computer user.
Further, described step 3.2) in, number of taps occupy the operated key that the button of above several is game.
In the present embodiment, compile at win32 (win32, the generally abbreviation to 32 windows operating systems) The design keyboard overall situation is provided in journey API (Application Program Interface, application programming interface) collection The mechanism of hook, the hook of design can intercept and capture any keyboard behaviour of each process that windows desktop runs Making, carry out record of keys after intercepting and capturing Keyboard Message, the analysis method realizing this programme according to log detects object for appreciation Game behavior.
The HOOK hook step intercepting and capturing keyboard is as follows:
1) creating a DLL (dynamic link library, dynamic link library), the inside realizes Hook Function, and leads Go out this function interface;
2) api function (such as SetWindowsHookEx, the SetWindowsHookEx of Windows system are used It is the api function of a win32) hook is installed;
3) realize the service logic of hook, i.e. examinations and play the analysis method of game.
Wherein step 1 is that overall situation HOOK module realizes record of keys;Step 2,3 it is business application module, Realizing installing HOOK, the logic of detection business, the system that business uses, with reference to Fig. 1.
The Hook Function of overall situation HOOK module safeguards a record of keys table, with reference to table 1:
Button ID The percussion time
‘A’ A_time1,A_time2,A_time3,……
‘B’ B_time1,B_time2,B_time3,……
‘C’ C_time1,C_time2,C_time3,……
‘D’ D_time1,D_time2,D_time3,……
…… ……
‘Alt’ Alt_time1,Alt_time2,Alt_time3,……
……
‘F1’ F1_time1,F1_time2,F1_time3,……
……
‘Del’ Del_time1,Del_time2,Del_time3,……
Table 1
Table 1 is that each button of keyboard opens up a storage line (keyboard uses general version), Each time value in every a line is different;The time value of each button of file is the most identical, as long as There is to pin the situation of two or more key simultaneously.
Table 1 button sequence number (each button ID distributes a numeral), time sequencing are illustrated as two dimension State table, is shown in Table 2.On table 2 each sampling instant Tn, at least a key-press event occurs, and sends out Life is 1, does not occur as 0;T2 moment at least two keys are pressed simultaneously and are hit.
Table 2
Read, every certain time interval, the current button note that HOOK module is safeguarded in business application module Record table.Current record of keys table convert state table (such as table 2) inner take arrive sometime current time time Between section, calculate the number of taps of each button in this time period, might as well it is assumed that Tn+2 is current time, T4 Tn+2 is the time period chosen.Button number of taps be the state value in the section at this moment of every a line it With, form following rectangular histogram as shown in Figure 2.
This rectangular histogram reflects each button distribution situation of number of taps within the given period.Calculate this scattergram Root variance d, computing formula is as follows
num = 1 NUM Σ i = 1 NUM Num ( i ) ;
( 1 NUM Σ i = 1 NUM ( Num ( i ) - num ) 2 ) 1 / 2
In formula, num represents distribution average, and Num (i) represents the button number of taps of serial number i, NUM be total by Number of keys.The object for appreciation game behavior of computer user is can be determined that, and now when root variance d is more than a certain threshold value Number of taps occupy the operated key that the button of above several is exactly game.

Claims (2)

1. the long-time automatic testing method playing keyboard game on a computer, it is characterised in that: described automatic detection side Method comprises the following steps:
1) creating a DLL, there is the Hook Function realizing the overall situation HOOK module the inside, and derives function interface;
Described Hook Function safeguards a record of keys table, and this record of keys table is that each button of keyboard is opened up One storage line, row head is button ID, and each time value in every a line is different;Each button ID Distributing a numeral is button sequence number, is illustrated as two-dimensional state table by button sequence number, time sequencing, and each is adopted On sample moment Tn, the most at least a key-press event occurs, and occurs as 1, does not occur as 0;
2) api function using Windows system installs hook, and described hook can be intercepted and captured windows desktop and run Any keyboard operation of each process;
3) carrying out hook detection, process is as follows:
3.1) read, every the time interval set, the current record of keys table that overall situation HOOK module is safeguarded, currently The two-dimensional state the exterior and the interior that record of keys table converts takes the time period arriving current time sometime, calculates this time The number of taps of each button in Duan;
3.2) the state value sum in button number of taps is the section at this moment of every a line, forms rectangular histogram, and rectangular histogram is anti- Reflect each button distribution situation of number of taps within the given period, calculate root variance d of this scattergram, meter Calculation formula is as follows:
n u m = 1 N U M Σ i = 1 N U M N u m ( i ) ;
d = ( 1 N U M Σ i = 1 N U M ( N u m ( i ) - n u m ) 2 ) 1 / 2
In formula, num represents distribution average, and Num (i) represents the button number of taps of serial number i, and NUM is total Number of keys;
When root variance d is more than predetermined threshold value, it is determined that current state is the object for appreciation game behavior of computer user.
The long-time automatic testing method playing keyboard game on a kind of computer the most as claimed in claim 1, its feature exists In: described step 3.2) in, number of taps occupy the operated key that the button of above several is game.
CN201410244270.7A 2014-06-04 2014-06-04 The long-time automatic testing method playing keyboard game on a kind of computer Expired - Fee Related CN104008040B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410244270.7A CN104008040B (en) 2014-06-04 2014-06-04 The long-time automatic testing method playing keyboard game on a kind of computer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410244270.7A CN104008040B (en) 2014-06-04 2014-06-04 The long-time automatic testing method playing keyboard game on a kind of computer

Publications (2)

Publication Number Publication Date
CN104008040A CN104008040A (en) 2014-08-27
CN104008040B true CN104008040B (en) 2016-09-14

Family

ID=51368701

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410244270.7A Expired - Fee Related CN104008040B (en) 2014-06-04 2014-06-04 The long-time automatic testing method playing keyboard game on a kind of computer

Country Status (1)

Country Link
CN (1) CN104008040B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160100465A1 (en) * 2014-10-07 2016-04-07 Logitech Europe S.A. System and method for software and peripheral integration
CN104777914A (en) * 2015-03-26 2015-07-15 淮南东正电子科技有限公司 Anti-addiction keyboard
CN106155648B (en) * 2015-03-31 2019-07-26 北京奇虎科技有限公司 A kind of method and device that key mouse script is recorded
CN105407481A (en) * 2015-10-23 2016-03-16 上海斐讯数据通信技术有限公司 Internet access data acquisition method
CN110580211A (en) * 2019-08-23 2019-12-17 鹏城实验室 Monitoring method, device, keyboard and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101853390A (en) * 2008-12-29 2010-10-06 谢爱国 Method and apparatus for media viewer health care
CN102214285A (en) * 2010-04-09 2011-10-12 北京全天通信息咨询服务有限公司 Personal computer monitoring method, mobile communication terminal and system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101853390A (en) * 2008-12-29 2010-10-06 谢爱国 Method and apparatus for media viewer health care
CN102214285A (en) * 2010-04-09 2011-10-12 北京全天通信息咨询服务有限公司 Personal computer monitoring method, mobile communication terminal and system

Also Published As

Publication number Publication date
CN104008040A (en) 2014-08-27

Similar Documents

Publication Publication Date Title
CN104008040B (en) The long-time automatic testing method playing keyboard game on a kind of computer
Kim et al. An examination of class-based visibility bias in national child maltreatment reporting
Ferrarini et al. Unemployment insurance and deteriorating self-rated health in 23 European countries
Han et al. Twitter geolocation prediction shared task of the 2016 workshop on noisy user-generated text
Bernauer et al. National climate policies in international comparison: the climate change cooperation index
Dinnes et al. A methodological review of how heterogeneity has been examined in systematic reviews of diagnostic test accuracy.
Popham et al. Evidence from the 2001 English Census on the contribution of employment status to the social gradient in self-rated health
WO2007015990A3 (en) Techniques for analyzing and presenting information in an event-based data aggregation system
Chang et al. Mapping international collaboration in tuberculosis research from 1998 to 2017: a scientometric study
Alenezi et al. Empirical evaluation of a new coupling metric: Combining structural and semantic coupling
US10284572B2 (en) Management method, management device, and management program
Mohanty et al. Central transfer a curse or blessing? Evidence from the relative revenue effort of Indian states
Valkanas et al. A ui prototype for emotion-based event detection in the live web
Safarnejad et al. Event Periscope: a novel pipeline to analyze impact of real-world events on Twitter discussions
CN108198259A (en) For acquiring the modern education application intelligent management system of teaching data
Chen et al. EarthquakeAware: Visual Analytics for Understanding Human Impacts of Earthquakes from Social Media Data
Bishop et al. Spreadsheet End-User Behaviour Analysis
Noor et al. A metrics suite for measuring reusability of learning objects
Little Does Having a Professional Sports Team Impact the Crime Rate of a City?
JP2018028859A (en) Advertisement contact state analysis system and advertisement contact state analysis method
BASAULA Claim settlement practices of life insurance companies in Nepal
Gao et al. Measuring the Efficiency of Executive MBA Programs in China
Puthussery et al. Association of screen time and physical activity with central obesity among adolescent school children in Kerala
Gouhier et al. No evidence of fish biodiversity effects on coral reef ecosystem functioning across scales
JP2006260341A (en) Dialog activity evaluation device, and method

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20180427

Address after: 312000 Shaoxing, Zhejiang Province, 66 -9, three to 1 level.

Patentee after: ZHEJIANG AEROSPACE CHANGFENG SCIENCE & TECHNOLOGY DEVELOPMENT CO., LTD.

Address before: 310014 18 Chao Wang Road, Zhaohui six District, Hangzhou, Zhejiang

Patentee before: Zhejiang University of Technology

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

Granted publication date: 20160914

Termination date: 20210604