Disclosure of Invention
In view of this, the main objective of the present invention is to provide an interaction method based on a browser, so as to reduce the probability of misoperation and improve the accuracy of gesture operation.
Another objective of the present invention is to provide an interactive device based on a browser, so as to reduce the probability of misoperation and improve the accuracy of gesture operation.
In order to achieve the above object, the present invention provides an interaction method based on a browser, and after the browser is started, the method includes:
receiving a trigger event, and displaying a self-defined gesture operation control;
acquiring an operation track of the gesture operation control, determining gesture operation matched with the operation track, and executing an application function mapped by the gesture operation matched with the operation track according to a preset mapping relation between each gesture operation and the application function.
The triggering event is a shaking event generated when a gravity acceleration sensor which is preset on the mobile phone monitors that the mobile phone shakes.
The self-defined gesture operation control is a small ball, and the operation track of the gesture operation control comprises: sliding a small ball operation track, clicking a small ball operation track, double-clicking the small ball operation track, long-pressing and then dragging the small ball operation track, and a gesture operation track taking the small ball as a starting point.
The sliding small ball operation track comprises: a left-direction operation trajectory, a right-direction operation trajectory, an upper-left-direction operation trajectory, an upper-right-direction operation trajectory, and an upper-direction operation trajectory.
The operation track of the gesture operation control is a track for dragging the small ball after long pressing, the operation track of the gesture operation control is obtained, and the gesture operation corresponding to the operation track is determined to comprise the following steps:
determining that the operation track of the gesture operation control is a long pressing small ball, and triggering a current screen to display a preset position prompt box;
and monitoring the dragging of the small ball, acquiring a position prompt box where the small ball is released, and determining the position prompt box as a corresponding gesture operation.
A browser-based interaction device, the device comprising: a gesture operation control triggering module, an operation track acquiring module, a gesture operation determining module, an application function determining module and an application function executing module, wherein,
the gesture operation control triggering module is used for receiving a triggering event and displaying a self-defined gesture operation control after the browser is started;
the operation track acquisition module is used for acquiring the operation track of the gesture operation control and outputting the operation track to the gesture operation determination module;
the gesture operation determining module is used for determining gesture operation matched with the received operation track and outputting the gesture operation to the application function determining module;
the application function determining module is used for acquiring the application function mapped by the gesture operation matched with the operation track according to the preset mapping relation between each gesture operation and the application function and outputting the application function to the application function executing module;
and the application function execution module is used for executing operation according to the received application function.
Further comprising:
and the editing module is used for editing and defining the operation track when the gesture operation determining module determines that the received operation track has no corresponding gesture operation, setting the gesture operation corresponding to the edited operation track, setting the application function mapped by the gesture operation, and storing the application function into the mapping relation table.
The gesture operation control triggering module comprises: a trigger event monitoring unit and a gesture operation control trigger unit, wherein,
the mobile phone comprises a triggering event monitoring unit, a gesture operation control triggering unit and a control unit, wherein the triggering event monitoring unit is used for monitoring whether the mobile phone shakes after entering a browser browsing area, acquiring a shaking event if the mobile phone shakes, and outputting the shaking event to the gesture operation control triggering unit;
and the gesture operation control triggering unit is used for receiving the shaking event, triggering the small ball to be hidden when the small ball is displayed, and triggering the small ball to recover the normal display state when the small ball is hidden.
The operation track obtaining module comprises: an operation track input unit, a monitoring unit and a recording unit, wherein,
the operation track input unit is used for receiving user input and displaying an operation track input by the user;
in the embodiment of the invention, the operation track input unit is a touch liquid crystal display screen.
The monitoring unit is used for monitoring the operation track input unit in real time and detecting the operation track input by the user;
and the recording unit is used for recording the operation track detected by the monitoring unit and outputting the operation track to the gesture operation determining module.
According to the technical scheme, after the browser is started, the browser-based interaction method and the browser-based interaction equipment receive the trigger event and display the self-defined gesture operation control; acquiring an operation track of the gesture operation control, determining gesture operation matched with the operation track, and executing an application function mapped by the gesture operation matched with the operation track according to a preset mapping relation between each gesture operation and the application function. Therefore, the user-defined gesture operation control is triggered and displayed through setting, so that the user-defined gesture operation control is isolated from the default gesture operation trigger of the browser, the conflict with the default gesture of the browser is avoided, misoperation is effectively avoided, and the accuracy of gesture operation is improved.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail with reference to the accompanying drawings and specific embodiments.
In the prior art, after the user-defined gesture operation is directly performed in the browsing area of the browser and the application function corresponding to the gesture operation is set, the user-defined gesture operation and the default gesture information of the browser are stored in the same database, and after the browser detects the gesture operation of the user in the browsing area, the judgment is performed according to the gesture information stored in the database so as to determine the application function corresponding to the gesture operation input by the user, so that the user-defined gesture operation easily conflicts with the default gesture of the browser. In the embodiment of the invention, in order to avoid misoperation caused by the conflict between the user-defined gesture operation and the default gesture operation of the browser, a control for triggering the user-defined gesture operation is set when the user-defined gesture operation is carried out in the browsing area of the mobile phone browser, and the user-defined gesture operation can be carried out only after the control is activated, so that the user-defined gesture operation is isolated from the default gesture operation of the browser; meanwhile, after the control is activated, various operations are performed on the control, so that a brand-new browser-based interaction method is provided, the conflict caused by default gestures of the browser is avoided, the browsing experience can be improved, and the method has strong function expansibility, so that the operation of the browser is more diversified, smoother and simpler.
Fig. 1 is a flowchart illustrating an interaction method based on a browser according to an embodiment of the present invention. Referring to fig. 1, after the browser is started, the process includes:
step 101, receiving a trigger event, and displaying a self-defined gesture operation control;
in this step, the operation of the user may be monitored by a gravity acceleration sensor preset on the mobile phone, if it is monitored that the mobile phone shakes, for example, left-right shaking or up-down shaking, the shaking event is obtained, and if the user-defined gesture operation control is not displayed in the current browsing area, the user-defined gesture operation control is displayed.
In the embodiment of the present invention, the customized gesture operation control may be spherical, and of course, may also be in other shapes, for example, a column shape, a square shape, and the like. Taking the gesture operation control as the small ball as an example, when the gravity acceleration sensor arranged on the mobile phone monitors that the mobile phone shakes left and right to obtain a shaking event, when the small ball is displayed, the shaking of the mobile phone triggers the hidden small ball, and when the small ball is hidden, the shaking of the mobile phone triggers the small ball to recover a normal display state, so that when the small ball is not shaken, a normal gesture operation is performed in a browsing area to trigger the default gesture isolation of the browser, the misoperation is effectively avoided, and the accuracy of the gesture operation is improved.
In practical application, the small ball is newly arranged, gesture operation is carried out on the small ball, the operation mode of a toolbar button can be replaced, namely the arranged small ball can bear various application functions on the toolbar, and the small ball has better expansibility compared with the toolbar so as to meet the personalized operation requirements of users.
And 102, acquiring an operation track of the gesture operation control, determining a gesture operation corresponding to the operation track, and executing a corresponding application function according to a preset mapping relation table of the gesture operation and the application function.
The method comprises the steps of obtaining an operation track of a gesture operation control, determining gesture operations matched with the operation track, and executing an application function mapped by the gesture operation matched with the operation track according to a preset mapping relation table of each gesture operation and the application function. The operation track of the gesture operation control comprises the following tracks formed by operations with the small ball as a starting point, and application functions mapped by various types of gesture operations can be mutually independent and do not have direct relation with each other.
1. Sliding ball operation
The gesture operation control can slide along with the gesture in the left direction, the right direction, the upper left direction, the upper right direction and the upper left direction and the upper right direction respectively to form operation tracks on the left direction, the right direction, the upper left direction, the upper right direction and the upper right direction respectively, when the small ball starts to be displayed, the position of the small ball at the moment is the starting point of the operation track, and when the small ball stops sliding, the position of the small ball at the moment is the end point of the operation track. According to the coordinates of the starting point and the ending point of the small ball, the horizontal displacement and the vertical displacement of the small ball in the current browsing area can be obtained, and the sliding direction of the small ball can be obtained through the horizontal displacement and the vertical displacement. And if the horizontal displacement and the vertical displacement of the small ball are within the preset direction sliding displacement interval, the gesture operation corresponding to the operation track can be correspondingly determined. Of course, in practical application, the phase angle of the small ball may also be calculated according to the start point coordinates and the end point coordinates of the small ball, so as to determine the gesture operation corresponding to the operation trajectory.
For example, application functions respectively corresponding to a left direction gesture operation, a right direction gesture operation, an upper left direction gesture operation, an upper right direction gesture operation, and an upper direction gesture operation may be respectively preset to form a mapping relationship table, for example, the left direction gesture operation corresponds to a previous page application function, the right direction gesture operation corresponds to a next page application function, the upper direction gesture operation corresponds to a previous level application function, the application functions corresponding to the upper left direction gesture operation and the upper right direction gesture operation are reserved, a specific mapping relationship may be determined according to actual needs, and meanwhile, real-time updating may also be performed; after the application function corresponding to the gesture operation is set, a left direction sliding displacement interval (including a left direction horizontal displacement interval and a left direction vertical displacement interval, the same below), a right direction sliding displacement interval, an upper left direction sliding displacement interval, an upper right direction sliding displacement interval and an upper direction sliding displacement interval are respectively set, if the horizontal displacement and the vertical displacement of the small ball are in a certain preset direction sliding displacement interval, for example, if the horizontal displacement and the vertical displacement of the small ball are in the set left direction sliding displacement interval, the left direction gesture operation can be determined, the application function corresponding to the previous page is operated according to the left direction gesture in the mapping relation (table), and the previous page application function is executed.
Of course, in practical application, it may also be set that when the operation track of the small ball exceeds the set direction sliding displacement interval, or the user's finger leaves the screen of the browsing area, the small ball will automatically return to the starting point position.
2. Click on a ball
If the operation track of the gesture operation control is single click, the application function same as that of the common button can be provided. And after clicking the small ball, detecting the state of the small ball, triggering and popping up a navigation toolbar if the current state of the small ball is a common state, and stopping webpage loading if the current state of the small ball is a webpage loading state.
3. Double click ball operation
And if the operation track of the gesture operation control is double-click, setting the mapping relation as the corresponding application function returned to the starting page.
4. Long press and drag small ball operation
If the operation track of the gesture operation control is long pressing of the small ball, the current screen is triggered to display a preset position prompt box, and when the position prompt box appears on the screen, the small ball is dragged to the corresponding position prompt box and then released, so that the application function mapped by the position prompt box can be triggered. For example, a grid in which 9 small balls are displayed in the middle of the current screen is triggered, the small balls are dragged to the corresponding grid and released, and an application function for executing grid mapping, such as an application function operation of locking or unlocking a browser page, is triggered.
5. Gesture operation using small ball as starting point
If the user presses the small ball, some special gesture operation tracks are drawn, the mobile phone obtains the gesture operation tracks, the gesture operation tracks are matched with the preset gesture operation tracks, and then the application functions mapped by the matched gesture operation tracks are obtained and executed. Therefore, the small ball is used as the starting point of the gesture operation track, and the special gesture operation triggering problem is solved.
Fig. 2 is a schematic flowchart of an interaction method based on a browser according to an embodiment of the present invention. Referring to fig. 2, the process includes:
step 201, entering a browser browsing area, and triggering to display a small ball;
in this step, after entering the browsing area of the browser for the first time, if the gesture operation is performed in the current browsing area, the flow execution matching with the default gesture of the existing browser is performed. If the user shakes the mobile phone, the gravity acceleration sensor arranged on the mobile phone monitors that the mobile phone shakes, a shaking event is obtained, and the small ball is displayed so that the user can perform self-defined gesture operation. For the process of monitoring whether the mobile phone shakes by the gravity acceleration sensor, reference may be made to related technical documents, which are not described herein again.
Step 202, monitoring and obtaining a small ball operation track, and determining the type of the small ball operation track;
in this step, the operation track types of the small ball include: sliding, clicking, double clicking, dragging the small ball after long pressing and gesture operation with the small ball as a starting point.
If the situation that the user slides the small ball is monitored, determining the type of the small ball operation track as sliding, and acquiring a starting point coordinate and an end point coordinate in the sliding process of the small ball;
if the fact that the user clicks the small ball is monitored, determining that the type of the small ball operation track is clicking;
if the fact that the user double-clicks the small ball is monitored, determining that the operation track type of the small ball is double-clicking;
if the situation that the user presses the small ball for a long time is monitored, for example, the preset time threshold is exceeded, and other operations are not executed, the small ball is dragged after the small ball is pressed for a long time, a preset position prompt box is triggered to be displayed on the current screen, and after the position prompt box appears on the screen, the position prompt box where the small ball is released is obtained;
and if the situation that the user presses the small ball and draws a gesture operation track on the screen is monitored, determining that the type of the small ball operation track is gesture operation with the small ball as a starting point.
Step 203, matching the small ball operation track with a gesture operation track in a preset small ball operation track type according to the determined small ball operation track type to obtain a corresponding gesture operation;
in this step, if it is determined that the type of the small ball operation trajectory is sliding, according to the obtained small ball operation trajectory, that is, the start point coordinate and the end point coordinate in the sliding process of the small ball, the horizontal displacement and the vertical displacement of the small ball in the current browsing area are calculated, and are matched with a preset direction sliding displacement interval, so that the sliding direction of the small ball can be determined. For example, if it is determined that the small ball slides in the displacement interval in the left direction in the horizontal displacement and the vertical displacement of the current browsing area, it is determined that the corresponding gesture operation is a left direction gesture operation.
If the type of the small ball operation track is determined to be clicking, if the current state of the small ball is in a common state, the corresponding gesture operation can be determined to be a gesture operation for popping up a navigation toolbar, and if the current state of the small ball is in a webpage loading state, the corresponding gesture operation can be determined to be a gesture operation for stopping webpage loading.
If the type of the small ball operation track is determined to be double-click, the corresponding gesture operation can be determined to be the gesture operation of returning to the starting page.
If the type of the small ball operation track is determined to be dragging the small ball after long pressing, the corresponding gesture operation can be determined to be the gesture operation of the prompt box at the position when the small ball is released.
And if the type of the small ball operation track is determined to be gesture operation with the small ball as a starting point, matching the gesture operation track drawn on the screen with a preset gesture operation track to obtain the gesture operation corresponding to the matched gesture operation track.
In practical application, if the obtained small ball operation track is not matched with the preset gesture operation track, the small ball operation track can be further edited and defined, and is stored in the gesture operation track, and an application function mapped by the small ball operation track is set at the same time.
And step 204, inquiring the mapping relation table according to the acquired gesture operation, acquiring the application function mapped by the gesture operation and executing the application function.
In this step, according to the gesture operation determined instep 203, a preset and stored mapping relationship table is queried, so that an application function mapped by the gesture operation can be obtained, and a corresponding operation is executed according to the application function. For example, if it is determined as a left direction gesture operation, an operation of returning to the previous page is performed.
As can be seen from the above, in the browser-based interaction method in the embodiments of the present invention, the self-defined gesture operation control is triggered and displayed in the browsing area, so that the self-defined gesture operation control is isolated from the default gesture operation trigger of the browser, thereby avoiding a conflict with the default gesture of the browser, and effectively avoiding a misoperation, thereby improving the accuracy of the gesture operation, reducing the time required for performing a re-operation after the misoperation, and improving the interaction efficiency between the user and the browser; the method comprises the steps of obtaining an operation track of a gesture operation control, determining a gesture operation corresponding to the operation track, and executing a corresponding application function according to a preset mapping relation table of the gesture operation and the application function, so that browsing experience is improved, the method also has strong function expansibility, the browser is diversified in operation, and is smoother and simpler, and personalized operation requirements of users are met.
Fig. 3 is a schematic structural diagram of an interactive device based on a browser according to an embodiment of the present invention. Referring to fig. 3, the apparatus includes: a gesture operation control triggering module, an operation track acquiring module, a gesture operation determining module, an application function determining module and an application function executing module, wherein,
the gesture operation control triggering module is used for receiving a triggering event and displaying a self-defined gesture operation control after the browser is started;
in the embodiment of the invention, the triggering event is a shaking event generated when a gravity acceleration sensor which is preset on the mobile phone monitors that the mobile phone shakes.
The self-defined gesture operation control is a small ball, and the operation track of the gesture operation control comprises the following steps: sliding a small ball operation track, clicking a small ball operation track, double-clicking the small ball operation track, long-pressing and then dragging the small ball operation track, and a gesture operation track taking the small ball as a starting point. Wherein, the sliding ball operation track includes: a left-direction operation trajectory, a right-direction operation trajectory, an upper-left-direction operation trajectory, an upper-right-direction operation trajectory, and an upper-direction operation trajectory.
The operation track acquisition module is used for acquiring the operation track of the gesture operation control and outputting the operation track to the gesture operation determination module;
the gesture operation determining module is used for determining gesture operation corresponding to the received operation track and outputting the gesture operation to the application function determining module;
the application function determining module is used for acquiring the application function corresponding to the received gesture operation according to a preset mapping relation table of the gesture operation and the application function and outputting the application function to the application function executing module;
and the application function execution module is used for executing operation according to the received application function.
The apparatus further comprises:
and the editing module is used for editing and defining the operation track when the gesture operation determining module determines that the received operation track has no corresponding gesture operation, setting the gesture operation corresponding to the edited operation track, setting the application function mapped by the gesture operation, and storing the application function into the mapping relation table.
Wherein,
the gesture operation control triggering module comprises: a trigger event monitoring unit and a gesture operation control triggering unit (not shown in the figure), wherein,
the mobile phone comprises a triggering event monitoring unit, a gesture operation control triggering unit and a control unit, wherein the triggering event monitoring unit is used for monitoring whether the mobile phone shakes after entering a browser browsing area, acquiring a shaking event if the mobile phone shakes, and outputting the shaking event to the gesture operation control triggering unit;
and the gesture operation control triggering unit is used for receiving the shaking event, triggering the small ball to be hidden when the small ball is displayed, and triggering the small ball to recover the normal display state when the small ball is hidden.
The operation track acquisition module comprises: an operation trajectory input unit, a monitoring unit, and a recording unit (not shown in the figure), wherein,
the operation track input unit is used for receiving user input and displaying an operation track input by the user;
in the embodiment of the invention, the operation track input unit is a touch liquid crystal display screen.
The monitoring unit is used for monitoring the operation track input unit in real time and detecting the operation track input by the user;
and the recording unit is used for recording the operation track detected by the monitoring unit and outputting the operation track to the gesture operation determining module.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.