Summary of the invention
The purpose of the present invention is to provide a kind of method, apparatus and intelligence that web page element is quickly hidden based on gravity sensing
Terminal, to improve above-mentioned problem.
A kind of method that mobile terminal turn is quickly detected based on gravity sensing is provided in an embodiment of the present invention,
It is characterized in that, comprising:
Use the gravity point of gravity sensor per predetermined time acquisition X-axis, Y-axis and Z-direction in one section of preset time
Magnitude;
When the Z-direction acquired within a preset time weight component value and meanwhile meet the following conditions:
A) the weight component value of the Z axis acquired gradually becomes smaller according to acquisition sequencing;
B) the weight component value of the Z axis of last time acquisition is negative;And
C) the sum of the weight component value of the Z axis of one acquisition and the weight component value of Z axis of last time acquisition exist at first
Between [- 1,1], then confirmation detects mobile terminal turn.
Preferably, the preset time is 0.3-0.5 seconds, and the predetermined time is 0.1 second.
A kind of method that web page element is quickly hidden based on gravity sensing is additionally provided in an embodiment of the present invention, it is special
Sign is, comprising:
Whether detection mobile browser is in front stage operation state;
Mobile terminal is quickly detected based on gravity sensing using above-mentioned in the case where mobile browser is in front stage operation state
The method of overturning detects the motion state of mobile terminal;
When confirmation detects mobile terminal turn, the web page element on current browsing webpage is hidden.
Preferably, the web page element is picture, the video and/or audio on webpage.
Preferably, when hiding the web page element on current browsing webpage is picture, video and/or audio, default is used
Picture covers region shared by picture, video and/or audio, is simultaneously stopped the broadcasting of video and/or audio and recording played progress.
Preferably, after hiding the web page element on current browsing webpage, the motion state of mobile terminal is continued to test,
When confirmation detects mobile terminal turn, the web page element being hidden is shown.
Preferably, when the web page element that display is hidden is view piece, video and/or audio, covering picture, view are removed
The default picture in region shared by frequency and/or audio, continues to play the video and/or audio according to the playback progress of record.
Preferably, the motion state of mobile terminal is detected using the shell of mobile browser.
Additionally provide a kind of mobile terminal turn detection device in an embodiment of the present invention comprising gravity sensor and
Detection module, in which:
Gravity point of the gravity sensor for predetermined time acquisition X-axis per in one section of preset time, Y-axis and Z-direction
Magnitude;With
Whether the weight component value that detection module is used to analyze the Z-direction that gravity sensor acquires within a preset time is same
When meet the following conditions: a) acquire Z axis weight component value according to acquisition sequencing gradually become smaller, b) last time acquire
Z axis weight component value be negative and c) at first the weight component value of the Z axis of one acquisition and last time acquisition Z axis
The sum of weight component value between [- 1,1], the detection knot that mobile terminal is flipped is obtained when meeting the condition at the same time
Fruit.
Preferably, the preset time is 0.3-0.5 seconds, and the predetermined time is 0.1 second.
A kind of device that web page element is quickly hidden based on gravity sensing is additionally provided in an embodiment of the present invention, it is special
Sign is, comprising:
The module for whether being in front stage operation state for detecting mobile browser;
Above-mentioned mobile terminal turn detection device;
For hiding the module of the web page element on current browsing webpage.
Preferably, the web page element is picture, the video and/or audio on webpage.
Preferably, for stopping the module for playing simultaneously recording played progress of video and/or audio.
Preferably, for showing the module for the web page element being hidden.
Preferably, continue to play the module of the video and/or audio for the playback progress according to record.
A kind of intelligent terminal is additionally provided in an embodiment of the present invention, which is characterized in that including above-mentioned mobile terminal
Overturn detection device.
A kind of intelligent terminal is additionally provided in an embodiment of the present invention, which is characterized in that including above-mentioned based on gravity
The device of web page element is quickly hidden in induction.
The beneficial effect of technical solution provided in an embodiment of the present invention is: can be quickly detected based on gravity sensing technology
The overturning of mobile terminal is realized by the quick overturning of mobile terminal and is hidden to the quick of web page element.Technology of the invention
Scheme can allow user to pass through efficiently gesture operation quickly hide/to show audio-visual resources to realize, while not need to close clear
The webpage look at avoids in unnecessary misunderstanding and embarrassment, is requiring the crowd that will not influence periphery in quiet scene,
Preferably the user experience is improved.
Specific embodiment
Below in conjunction with attached drawing in the embodiment of the present invention, technical solution in the embodiment of the present invention carries out clear, complete
Ground description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.Usually exist
The component of the embodiment of the present invention described and illustrated in attached drawing can be arranged and be designed with a variety of different configurations herein.Cause
This, is not intended to limit claimed invention to the detailed description of the embodiment of the present invention provided in the accompanying drawings below
Range, but it is merely representative of selected embodiment of the invention.Based on the embodiment of the present invention, those skilled in the art are not doing
Every other embodiment obtained under the premise of creative work out, shall fall within the protection scope of the present invention.
In order to improve the technical issues of proposed, the present inventor is based on gravity sensing technology, by quickly detecting
The method that mobile terminal is flipped out, in conjunction with the hidden method of web page element, to realize without by manually selecting
Operation can quickly hide the purpose of web page element, and preferably the user experience is improved.
Below in conjunction with the drawings and specific embodiments of the invention, various technical solutions of the invention are carried out clear, complete
Site preparation description.
Fig. 1 is the flow chart of the method for the invention that mobile terminal turn is quickly detected based on gravity sensing.
As shown in Figure 1, the first embodiment of the present invention provides and a kind of quickly detect mobile terminal based on gravity sensing and turn over
The method turned comprising:
Step S101: using gravity sensor, per predetermined time acquires X-axis, Y-axis and Z-direction in one section of preset time
Weight component value.
Using gravity sensor in one section of preset time per predetermined time obtain the current gravity of mobile terminal (x, y,
Z) component value in reference axis, wherein X-direction is mobile terminal screen transverse direction, and Y direction is perpendicular for mobile terminal screen
To direction, Z-direction be with mobile terminal screen vertical direction, wherein the preset time is preferably 0.3-0.5 seconds, more preferably
, the preset time is preferably 0.4 second, and the predetermined time is preferably 0.1 second.Certainly, listed preset time and predetermined
The occurrence of time is merely illustrative of, and can also use other times value.
It is usually 0.3-0.5 that inventor counts people to carry out the time-consuming of wrist overturning under normal circumstances by test of many times
Second, so default at such as 0 to 0.3,0.4 or 0.5 second using gravity sensor in the preferred embodiments of the technical program
With the weight component value of for example every acquisition of 0.1 second predetermined time 1 group of X, Y and Z-direction in period, 3,4 or 5 are acquired altogether
The weight component value of group X, Y and Z-direction, for the analysis of next step.
Step S102: when the Z-direction acquired within a preset time weight component value and meanwhile meet the following conditions: a) adopt
The weight component value of the Z axis of collection gradually becomes smaller according to acquisition sequencing, b) the weight component value of the Z axis of last time acquisition is
Negative and c) at first the weight component value of the Z axis of one acquisition and the sum of weight component value of Z axis of last time acquisition [-
1,1] between, then confirmation detects mobile terminal turn.
It is main after the weight component value for acquiring such as 3,4 or 5 groups of X, Y and Z-direction in above-mentioned preferred embodiments
If the weight component value to Z-direction is analyzed.When the weight component value for the Z-direction that discovery acquires in chronological order is full
Sufficient the following conditions: a) Z that the weight component value of the Z axis acquired gradually becomes smaller according to acquisition sequencing, b) acquires for the last time
The weight for the Z axis that the weight component value of axis is negative and c) the weight component value of the Z axis of one acquisition and last time acquire at first
The sum of force component value then may determine that mobile terminal is overturn between [- 1,1].
Example 1:
One section of preset time is 0.3 second, and the predetermined time is 0.1 second, then acquires 3 groups of X, Y and Z axis sides respectively within every 0.1 second
To weight component value:
S1 (10,0,0), S2 (5,0, -5), S3 (0,0, -10).
The weight component value of 3 groups of Z-directions of acquisition order are as follows: 0, -5, -10.
It follows that it meets: a) the weight component value of the Z axis acquired gradually becomes smaller and b) according to acquisition sequencing
The weight component value of the Z axis of last time acquisition is negative, but is unsatisfactory for the weight component value of the c) Z axis of one acquisition at first
The sum of weight component value of Z axis acquired with last time is not considered as the fortune of mobile terminal at this time between [- 1,1]
Dynamic state is overturning.
Example 2:
One section of preset time is 0.4 second, and the predetermined time is 0.1 second, then acquires 4 groups of X, Y and Z axis sides respectively within every 0.1 second
To weight component value:
S1 (5,0,5), S2 (10,0,0), S3 (5,0, -5), S4 (0,0, -10).
The weight component value of 4 groups of Z-directions of acquisition order are as follows: 5,0, -5, -10.
It follows that it meets: a) the weight component value of the Z axis acquired gradually becomes smaller and b) according to acquisition sequencing
The weight component value of the Z axis of last time acquisition is negative, but is unsatisfactory for the weight component value of the c) Z axis of one acquisition at first
The sum of weight component value of Z axis acquired with last time is not considered as the fortune of mobile terminal at this time between [- 1,1]
Dynamic state is overturning.
Example 3:
One section of preset time is 0.5 second, and the predetermined time is 0.1 second, then acquires 5 groups of X, Y and Z axis sides respectively within every 0.1 second
To weight component value:
S1 (0,0,10), S2 (5,0,5), S3 (10,0,0), S4 (5,0, -5), S5 (0,0, -10).
The weight component value of 5 groups of Z-directions of acquisition order are as follows: 10,5,0, -5, -10.
It follows that it meets: a) the weight component value of the Z axis acquired gradually becomes smaller, b) most according to acquisition sequencing
Afterwards the weight component value of the Z axis of one acquisition be negative and c) at first the weight component value of the Z axis of one acquisition and last time
The sum of weight component value of the Z axis of acquisition is between [- 1,1], therefore, it is considered that the motion state of mobile terminal at this time is overturning.
The method provided in an embodiment of the present invention that mobile terminal turn is quickly detected based on gravity sensing, its advantages
It is: the overturning of mobile terminal can be quickly detected based on gravity sensing technology, and detection method according to the present invention is examined
The overturning for surveying mobile terminal, without considering the placement angle of mobile terminal, with simple, speed is fast, high accuracy for examination.
Fig. 2 is the flow chart of the method for the invention that web page element is quickly hidden based on gravity sensing.
As shown in Fig. 2, the second embodiment of the present invention provides and a kind of quickly hides web page element based on gravity sensing
Method comprising:
Step S201: whether detection mobile browser is in front stage operation state.
It can adopt and detect whether mobile browser is in front stage operation state with method known in this field.For example, logical
Cross the mode that detection browser interface is shown on foreground;Pass through Activity () function etc..
Step S202: it is quickly detected using above-mentioned based on gravity sensing in the case where mobile browser is in front stage operation state
The method of mobile terminal turn detects the motion state of mobile terminal.
Specifically, in the case where mobile browser is in front stage operation state, using gravity sensor in one section of preset time
Interior per predetermined time acquires X-axis, the weight component value of Y-axis and Z-direction.The preset time is preferably 0.3-0.5 seconds, more excellent
Choosing, the preset time is preferably 0.4 second, and the predetermined time is preferably 0.1 second.Certainly, listed preset time and solid
The occurrence fixed time is merely illustrative of, and can also use other times value.It is examined by the multiple groups weight component value of acquisition
Survey the motion state of mobile terminal.When the Z-direction acquired within a preset period of time weight component value and meanwhile meet following item
Part: the gravity for the Z axis that a) the weight component value of the Z axis acquired gradually becomes smaller according to acquisition sequencing, b) last time acquires
The weight component value for the Z axis that component value is negative and c) the weight component value of the Z axis of one acquisition and last time acquire at first
The sum of between [- 1,1], then detect the motion state of mobile terminal for overturning.
Step S203: the web page element on current browsing webpage is hidden when confirmation detects mobile terminal turn.
Specifically, when detecting the motion state of mobile terminal in step S202 to overturn, outside mobile browser
Shell mold block monitors this overturning result simultaneously and the kernel to mobile browser is notified to need to be implemented on hiding webpage at once
Web page element operation, kernel executes hiding operation to web page element.Preferably, on the webpage that kernel detection currently browses
The classification of web page element whether be picture, video and/or audio.If the web page element on the webpage currently browsed includes
Picture, video and/or audio then set picture, video and/or audio to hide attribute, such as display attribute are arranged
Are as follows: " none " hides web page element to realize, while using shared by default picture covering picture, video and/or audio
Region is simultaneously stopped the broadcasting of video and/or audio and recording played progress.Using default picture covering picture, video and/or
The specific method in region shared by audio, and stop the specific method for playing simultaneously recording played progress of video and/or audio,
Technological means well known in the art can be used, which is not described herein again.If the broadcasting of video and/or audio is broadcast using outside
Device is put to play, then exits exterior broadcaster while suspending and playing.If video and/or audio not yet plays, do not have to
Recording played progress.
In a preferred embodiment, the shell of mobile browser can pass through the API for the system installed in mobile terminal
The data of gravity sensor timing sampling are directly monitored and recorded, shifting is quickly detected based on gravity sensing according to described above
The data of the method analytical sampling of dynamic terminal overturning, to detect whether mobile terminal is flipped.Occur in mobile terminal
The kernel to mobile browser is notified to need to be implemented the operation of the web page element on hiding webpage when overturning at once.
Fig. 3 is the process of a preferred embodiment of the method for the invention that web page element is quickly hidden based on gravity sensing
Figure.
In a preferred embodiment as shown in connection with fig. 3, the method for web page element is quickly hidden also based on gravity sensing
Include:
Step S204: after hiding the web page element on current browsing webpage, the movement shape of mobile terminal is continued to test
State shows the web page element being hidden when confirmation detects mobile terminal turn.
Specifically, detection mobile terminal motion state be overturn method it is same as mentioned above, mobile browser
Shell module notifies the kernel to mobile browser to need to be implemented the net on display webpage at once when mobile terminal is flipped
The operation of page element, with the presence or absence of the web page element being hidden on the webpage that interior Nuclear monitoring currently browses, if it does, by webpage
Attribute of an element is set as display properties.If show that the web page element being hidden is picture, video and/or audio, remove
The default picture for covering picture, region shared by video and/or audio, according to the playback progress of record continue to play the video and/
Or audio.When on webpage without embedded included player, exterior broadcaster is called to play.
The method provided in an embodiment of the present invention that web page element is quickly hidden based on gravity sensing, the beneficial effect is that: base
In gravity sensing technology it can be quickly detected the overturning of mobile terminal, and detection method according to the present invention detects movement
The overturning of terminal is realized by the quick overturning of mobile terminal and is hidden to the quick of web page element, does not have to consider mobile terminal
Placement angle, have that simple, speed is fast, high accuracy for examination.It is quick that technical solution of the present invention can allow user to pass through
Gesture operation quickly hide/show audio-visual resources to realize, do not need close browsing webpage, avoid in unnecessary mistake
Solution and embarrassment, are requiring the crowd that periphery will not be influenced in quiet scene, preferably the user experience is improved.
Fig. 4 is a kind of structural schematic diagram of mobile terminal turn detection device of the invention.
As shown in figure 4, the mobile terminal turn detection device includes: gravity sensor and detection module, wherein gravity
Inductor is used for per predetermined time acquisition X-axis, the weight component value and the detection of Y-axis and Z-direction in one section of preset time
Module be used for analyze the Z-direction that gravity sensor acquires within a preset period of time weight component value whether simultaneously meet below
Condition: the weight for the Z axis that a) the weight component value of the Z axis acquired gradually becomes smaller according to acquisition sequencing, b) last time acquires
The weight component for the Z axis that force component value is negative and c) the weight component value of the Z axis of one acquisition and last time acquire at first
The sum of value obtains the testing result that mobile terminal is flipped between [- 1,1] when meeting the condition at the same time.
Wherein the preset time is preferably 0.3-0.5 seconds, it is furthermore preferred that the preset time is preferably 0.4 second, it is described
Predetermined time is preferably 0.1 second.
The beneficial effect of mobile terminal turn detection device provided in an embodiment of the present invention is: being based on gravity sensing technology energy
It is enough quickly detected the overturning of mobile terminal, detection device according to the present invention detects the overturning of mobile terminal, does not have to consider
The placement angle of mobile terminal, with simple, speed is fast, high accuracy for examination.
Fig. 5 is the structural schematic diagram of the device of the invention that web page element is quickly hidden based on gravity sensing.Such as Fig. 5 institute
Show, the device that web page element is quickly hidden based on gravity sensing includes:
The module for whether being in front stage operation state for detecting mobile browser;
According to above-mentioned mobile terminal turn detection device;With
For hiding the module of the web page element on current browsing webpage.
Preferably, further includes: for stopping the module for playing simultaneously recording played progress of video and/or audio.
Fig. 6 is the structure of a preferred embodiment of the device of the invention that web page element is quickly hidden based on gravity sensing
Schematic diagram.
In a preferred embodiment as shown in connection with fig. 6, further includes: for showing the mould for the web page element being hidden
Block.
Preferably, further includes: continue to play the module of video and/or audio for the playback progress according to record.
The beneficial effect of the device provided in an embodiment of the present invention that web page element is quickly hidden based on gravity sensing is: being based on
Gravity sensing technology can be quickly detected the overturning of mobile terminal, be realized by the quick overturning of mobile terminal to webpage member
The quick of element is hidden, without considering the placement angle of mobile terminal, with simple, speed is fast, high accuracy for examination.The present invention
Technical solution user can be allowed to pass through efficiently gesture operation quickly hide/show audio-visual resources to realize, do not need simultaneously
The webpage for closing browsing, avoids in unnecessary misunderstanding and embarrassment, is requiring that periphery will not be influenced in quiet scene
Crowd, preferably the user experience is improved.
A kind of intelligent terminal is additionally provided in an embodiment of the present invention comprising mobile terminal as described above turns over
Turn detection device.
A kind of intelligent terminal is additionally provided in an embodiment of the present invention comprising is based on gravity-feed tank as described above
The device of web page element should quickly be hidden.
The method of mobile terminal turn is quickly detected provided by the embodiment of the present invention based on gravity sensing and based on gravity
The computer program product of the method for web page element, the computer-readable storage including storing program code are quickly hidden in induction
Medium, the instruction that said program code includes can be used for executing previous methods method as described in the examples, and specific implementation can be joined
See embodiment of the method, details are not described herein.
It is apparent to those skilled in the art that for convenience and simplicity of description, the device of foregoing description
Specific work process, can refer to corresponding processes in the foregoing method embodiment, details are not described herein.
It, can be with if the function is realized in the form of SFU software functional unit and when sold or used as an independent product
It is stored in a computer readable storage medium.Based on this understanding, technical solution of the present invention is substantially in other words
The part of the part that contributes to existing technology or the technical solution can be embodied in the form of software products, the meter
Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be a
People's computer, server or network equipment etc.) it performs all or part of the steps of the method described in the various embodiments of the present invention.
And storage medium above-mentioned includes: that USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited
The various media that can store program code such as reservoir (RAM, Random Access Memory), magnetic or disk.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any
Those familiar with the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, and should all contain
Lid is within protection scope of the present invention.Therefore, protection scope of the present invention should be based on the protection scope of the described claims.