Content of the invention
It is an object of the invention to provide interruption processing method is it is intended to solve existing movement during a kind of game of mobile terminal
If interrupt event can force the problem of Exit Game during terminal game when arriving.
The present invention is achieved in that interruption processing method during a kind of game of mobile terminal, including:
When interrupt event is detected, obtain the first screen picture in preset time period for the mobile terminal and the second screen
Image;
Judge whether described first screen picture and the second screen picture are identical;
If described first screen picture and the second screen picture are incomplete same, compare the first screen picture and the second screen
The pixel point value of curtain image, extracts the first screen picture and the according to the pixel point value of the first screen picture and the second screen picture
Same area in two screen pictures;
In the described same area in described first screen picture, identify whether there is pause button;
If having pause button in the described same area in described first screen picture, record the first of described pause button
Edge coordinate;
Described first edge coordinate corresponding region execution key-press event on the current screen of described mobile terminal;
Respond described interrupt event.
Further, described judge whether described first screen picture and the second screen picture identical, including:
Described first screen picture and the second screen picture are entered with every trade picture element scan or row picture element scan, judges corresponding row
Whether pixel or row pixel are identical.
Further, the described pixel point value according to the first screen picture and the second screen picture extracts the first screen picture
With same area in the second screen picture, also include afterwards:
Record the second edge coordinate of described same area.
Further, described identify whether there is pause button in the described same area in described first screen picture,
Including:
Described same area in described first screen picture carries out pixel column scan, searches in described same area
With the presence or absence of two identical subregions;
If described state two identical subregions of presence in same area, and described two identical subregion meets following bar
Part:First, described two identical subregions are parallel;Second, described two identical subregion distances are less than or equal to first threshold;
3rd, the corresponding pixel value of the respective apex coordinate of described two identical subregion with described apex coordinate adjacent area and does not belong to
The pixel value of the pixel in described identical subregion differs, then judge described two identical subregions as pause button.
Further, described identify whether there is pause button in the described same area in described first screen picture,
Also include:
When described same area has multiple, whether identification same area has pause button, if having recognized time-out successively
Button, then stop identifying remaining remaining same area.
Present invention also offers interrupt processing device when a kind of game of mobile terminal is provided, including:
Acquisition module, the first judge module, compare extraction module, the first logging modle, identification module, performing module and
Respond module;
Described acquisition module, for when interrupt event is detected, obtaining mobile terminal in preset time period first
Screen picture and the second screen picture;
Described first judge module, whether identical for judging described first screen picture and the second screen picture;
Described compare extraction module, for when described first screen picture and the second screen picture are incomplete same, than
Compared with the pixel point value of the first screen picture and the second screen picture, according to the pixel of the first screen picture and the second screen picture
Value extracts same area in the first screen picture and the second screen picture;
Described identification module, for, in the described same area in described first screen picture, identifying whether there is time-out
Button;
Described first logging modle, for when having pause button in the described same area in described first screen picture,
Record the first edge coordinate of described pause button;
Described performing module, for the corresponding area of described first edge coordinate on the current screen of described mobile terminal
Domain executes key-press event;
Described respond module, for responding described interrupt event.
Further, described first judge module, specifically for:
Described first screen picture and the second screen picture are entered with every trade picture element scan or row picture element scan, judges corresponding row
Whether pixel or row pixel are identical.
Further, described device also includes:Second logging modle, the second edge for recording described same area is sat
Mark.
Further, described identification module also includes:
Scanning search module and determination module;
Described scanning search module, carries out pixel point range for the described same area in described first screen picture and sweeps
Retouch, search and in described same area, whether there is two identical subregions;
Described determination module, for two identical subregions of presence in same area described ought be stated and described two identical
Subregion meets following condition:First, described two identical subregions are parallel;Second, described two identical subregion distances
Less than or equal to first threshold;3rd, the corresponding pixel values of the respective apex coordinate of described two identical subregion and described summit
The pixel value of coordinate adjacent area and the pixel being not belonging in described identical subregion differs, then judge described two identical
Subregion is pause button.
Further, described identification module, is additionally operable to:When described same area has multiple, identify same area successively
Whether there is pause button, if having recognized pause button, stopping identifying remaining remaining same area.
Whether identical by judging the first screen picture in preset time period and the second screen picture in the present invention, if
Differing explanation interface image is change, plays, because position in screen picture for the pause button is fixing
And constant, so same area is extracted by the pixel point value comparing two width images, in same area, search pause button,
If same area has pause button, in current screen respective coordinates positions, execution key-press event is suspended, then responds
Disconnected event, thus when interrupt event arrives, will not force Exit Game, improves Consumer's Experience sense.
Specific embodiment
In order that the objects, technical solutions and advantages of the present invention become more apparent, below in conjunction with drawings and Examples, right
The present invention is further elaborated.It should be appreciated that specific embodiment described herein is only in order to explain the present invention, and
It is not used in the restriction present invention.
What Fig. 1 showed interruption processing method during a kind of game of mobile terminal provided in an embodiment of the present invention realizes flow process,
Details are as follows:
Step 101, when interrupt event is detected, obtain the first screen picture in preset time period for the mobile terminal and
Second screen picture.
When user utilizes mobile terminal (such as mobile phone) when playing game, screen picture is all change with game
, in order to determine that user is to play, it is preferred that when interrupt event is detected, obtaining and move in the embodiment of the present invention
Two width screen pictures in terminal (such as 100ms) in preset time period, i.e. the first screen picture and the second screen picture.
Step 102, judge whether the first screen picture and the second screen picture are identical, if it is not, then execution step
103, if so, then directly in response to interrupt event.
Preferably, after obtaining the first screen picture and the second screen picture, the first screen picture and the second screen are judged
Whether image is identical, if identical, account for screen image is static, then illustrate that user not in game or suspends trip
Play, can be directly in response to interrupt event;If it is not the same, account for screen image is change, illustrate that user is possible to playing
Game, then continue executing with step 103.Specifically, judge whether the first screen picture and the second screen picture are identical, bag
Include:First screen picture and the second screen picture are entered with every trade picture element scan or row picture element scan, judges corresponding row pixel or row
Whether pixel is identical, that is, judge whether the value of corresponding row pixel or the corresponding pixel of row pixel is identical.If identical explanation two
Width screen picture is identical, if differ explanation two width screen pictures differing.
Step 103, compare the first screen picture and the pixel point value of the second screen picture, according to the first screen picture and
The pixel point value of two screen pictures extracts same area in the first screen picture and the second screen picture.
General, interface all can automatically occur being similar to " | | " pause button although during game screen picture be
Change, but pause button position and shape are constant.Therefore, the present invention is in example, can compare the first screen
Curtain image and the second screen picture, extract identical region, thus identifying pause button again.Preferably, compare the first screen map
Picture and the pixel point value of the second screen picture, the pixel point value according to the first screen picture and the second screen picture extracts the first screen
Same area in curtain image and the second screen picture.Certainly, corresponding same zone in the first screen picture and the second screen picture
Domain may more than one.
Step 104, in the above-mentioned same area in the first screen picture, identify whether there is pause button.
In the embodiment of the present invention, in the above-mentioned same area in the first screen picture, identify whether there is pause button.One
As, suspension of game play button is similar to as " | | ".Preferably, in the above-mentioned same area in the first screen picture, identify whether
There is pause button, including:Above-mentioned same area in the first screen picture carries out pixel column scan, searches above-mentioned same zone
Whether there is two identical subregions in domain.If there are two identical subregions in same area, and the identical sub-district of above-mentioned two
Domain meets three below condition, then judge two identical subregions as pause button.First, two identical subregions are parallel;
Second, two identical subregion distances are less than or equal to first threshold (such as 2mm);3rd, the respective top of two identical subregions
The corresponding pixel value of point coordinates with apex coordinate adjacent area and is not belonging to the pixel value not phase of the pixel in identical subregion
With.Specifically, two identical subregions whether parallel can by during column scan, x y-axis coordinate be determined, two identical sons
If it is identical that region x-axis coordinate differs y-axis coordinate, this two identical subregions are parallel.Thirdly allow for two
The edge of individual identical subregion is smooth so that pause button " | | " make a distinction with some similar buttons, such as suspend
Button " | | " make a distinction with " 11 ".Because corresponding same area in the first screen picture and the second screen picture may be not only
One it is preferred that when above-mentioned same area has multiple, whether identification same area has pause button, if having recognized successively
Pause button, then stop identifying remaining remaining same area.I.e. in the said one same area in the first screen picture,
Do not find pause button, then continue to be identified in other same area.If it is found, then not needing to carry out other identical
The identification of the pause button in region.
If having pause button in the above-mentioned same area in step 105 first screen picture, record the of this pause button
One edge coordinate.
Step 106, the above-mentioned first edge coordinate corresponding region execution button thing on the current screen of mobile terminal
Part.
If having pause button, on the current screen of mobile terminal in the above-mentioned same area in the first screen picture
Described first edge coordinate corresponding region execution key-press event, i.e. the corresponding region of the pause button on current screen
Execution key-press event, suspends game.
Step 107, response interrupt event.
Execution key-press event, after suspending game, then responds the interrupt event of arrival.
Preferably, in above-mentioned steps 103, after extracting same area, the second edge coordinate of record same area.Record
The edge coordinate of all same area, conveniently when there being multiple same area, the identification of follow-up pause button, such as at first
Same area does not recognize pause button, in the corresponding edge coordinate model of corresponding second same area of the first screen picture
Enclose whether interior Direct Recognition has pause button.
In the embodiment of the present invention, by judging the first screen picture in preset time period and the second screen picture whether phase
Same, if differing explanation interface image is change, play, because position in screen picture for the pause button is
Fixing and constant, so same area being extracted by the pixel point value comparing two width images and recording same area summit seat
Mark, searches pause button in same area, if same area has pause button, holds in current screen respective coordinates position
Row key-press event is suspended, then responds interrupt event, thus when interrupt event arrives, will not force Exit Game.
It should be noted that for aforesaid embodiment of the method, in order to be briefly described, therefore it is all expressed as a series of
Combination of actions, but those skilled in the art should know, and the present invention is not limited by described sequence of movement, because according to
According to the present invention, some steps can be carried out using other orders or simultaneously.
Fig. 2 shows the structured flowchart of interrupt processing device during a kind of game of mobile terminal provided in an embodiment of the present invention,
This device can run on various intelligent mobile terminals, including but not limited to intelligent mobile phone, personal digital assistant
(Personal Digital Assistant, PDA) etc..This device can realize the method described by preceding method embodiment.
For convenience of description, illustrate only part related to the present embodiment.With reference to Fig. 2, interrupt processing dress during this game of mobile terminal
Put, including:
Acquisition module 21, the first judge module 22, compare extraction module 23, identification module 24, the first logging modle 25, hold
Row module 26 and respond module 27.
Acquisition module 21, for when interrupt event is detected, obtaining the first screen in preset time period for the mobile terminal
Curtain image and the second screen picture.Can be within 100ms in preset time period.
First judge module 22, whether identical for judging the first screen picture and the second screen picture.Further
, the first judge module 22, specifically for:Every trade picture element scan or row are entered to described first screen picture and the second screen picture
Picture element scan, judges whether corresponding row pixel or row pixel are identical.
Relatively extraction module 23, for when the first screen picture and the second screen picture are incomplete same, comparing first
Screen picture and the pixel point value of the second screen picture, the pixel point value according to the first screen picture and the second screen picture is extracted
Same area in first screen picture and the second screen picture;
Identification module 24, for, in the described same area in the first screen picture, identifying whether there is pause button.Enter
One step, identification module 24 also includes:Scanning search module 241 and determination module 242;
241 pieces of scanning search mould, carries out pixel column scan for the above-mentioned same area in the first screen picture, looks into
Look for and in described same area, whether there is two identical subregions;Determination module 252, for when presence two in above-mentioned same area
Individual identical subregion, and two identical subregions meet following condition:First, two identical subregions are parallel;Second, two
Identical subregion distance is less than or equal to first threshold (such as 2mm);3rd, the respective apex coordinate of two identical subregions corresponds to
Pixel value with described apex coordinate adjacent area and the pixel value of the pixel being not belonging in identical subregion differs, then sentence
Fixed described two identical subregions are pause button.Further, identification module 24, are additionally operable to:When same area has multiple,
Whether identification same area has pause button successively, if having recognized pause button, stops identifying remaining remaining same zone
Domain.
First logging modle 25, for when there being pause button in the same area in the first screen picture, record time-out is pressed
The first edge coordinate of button.
Performing module 26, for the first edge coordinate corresponding region execution button on the current screen of mobile terminal
Event.
Respond module 27, for responding interrupt event.So when interrupting arriving, Exit Game will not be forced, improve
Consumer's Experience sense.
Further, said apparatus also include:Second logging modle 28, the second edge for recording same area is sat
Mark, conveniently when there being multiple same area, the identification of follow-up pause button, such as do not recognize temporarily in first same area
Stop button, whether Direct Recognition has temporarily in the range of the corresponding edge coordinate of corresponding second same area of the first screen picture
Stop button.
Those skilled in the art can be understood that, for convenience and simplicity of description, only with above-mentioned each function
Unit, the division of module are illustrated, and in practical application, can distribute above-mentioned functions by different work(as desired
Energy unit, module complete, and that is, the internal structure of described device is divided into different functional units or module, to complete above description
All or part of function.Each functional unit in embodiment or module can be integrated in a processing unit it is also possible to
It is that unit is individually physically present it is also possible to two or more units are integrated in a unit, above-mentioned integrated list
Unit or module both can be to be realized in the form of hardware, it would however also be possible to employ the form of SFU software functional unit is realized.In addition, each function
Unit, the specific name of module, also only to facilitate mutual distinguish, are not limited to the protection domain of the application.Above-mentioned dress
Put the specific work process of middle unit, module, may be referred to the corresponding process in preceding method embodiment, will not be described here.
Those of ordinary skill in the art are further appreciated that all or part of step realizing in above-described embodiment method is can
Completed with the hardware instructing correlation by program, described program can be stored in a computer read/write memory medium
In, described storage medium, including ROM/RAM, disk, CD etc..
The foregoing is only presently preferred embodiments of the present invention, not in order to limit the present invention, all essences in the present invention
Any modification, equivalent and improvement made within god and principle etc., should be included within the scope of the present invention.