Response method and device for user input, equipment and storage medium

By determining scroll bar heights to differentiate scrolling and sliding operations, the method and device resolve conflicts, enhancing user experience on complex web pages.

CN119127049APending Publication Date: 2024-12-13CHINA MOBILE INTERNET CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411103747.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-12
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

Existing technologies fail to accurately distinguish between scrolling and sliding operations on complex web pages, leading to conflicts and reduced user experience due to false triggering of operations.

Method used

A method and device that determine the scroll bar height to differentiate between scrolling and sliding operations by setting a preset threshold, triggering the appropriate operation based on the scroll bar height, thereby avoiding conflicts and enhancing user experience.

Benefits of technology

Accurately determines user intent by judging scroll bar heights, effectively preventing conflicts between scrolling and sliding operations, thus improving user experience on web pages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119127049A_ABST
    Figure CN119127049A_ABST
Patent Text Reader

Abstract

The invention discloses a user input response method and device, equipment and a storage medium, in the process of responding to first input of a user to a target element in a first page area, scroll bar heights corresponding to all page elements in the first page area are obtained, and the target element in the first page area is input by judging whether the scroll bar heights meet a preset threshold value or not. And the operation intention of the user is judged. Under the condition that the scroll bar height of at least one page element meets the preset threshold value, it is represented that the user hopes to trigger the scroll operation, and the scroll operation jointly corresponding to the target scroll bar and the first input is triggered in the first page area. Under the condition that the scroll bar heights of all the page elements do not meet the preset threshold value, it is represented that the user wants to trigger the sliding operation, and the sliding operation corresponding to the first input is triggered in the first page area. According to the embodiment of the invention, the triggering conflict between the rolling operation and the sliding operation can be avoided, and the page browsing experience of a user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of data processing technology, and in particular, relates to a method, device, equipment, storage medium and computer program product for responding to user input. Background Art

[0002] With the development of mobile Internet, browser web pages often need to present complex and massive information within a limited screen range. In order to display rich information, many sliding components are often used. Common sliding components include pull-down refresh, pull-up load, infinite scroll, carousel, selector, side sliding button, etc. At present, it is mainly through real-time monitoring of user operations, and triggering sliding components and displaying corresponding animations according to the user input operation.

[0003] When the page scene of the browser web page is relatively complex, for example, there are multiple levels of content with scroll bars on the page, the repeated actions of sliding up, down, left, and right and operating the scroll bar may cause false triggering. For example, when the user inputs the scrolling operation that he wants to trigger, the sliding operation is triggered, or when the sliding operation is triggered, the scrolling operation is triggered, or the scrolling operation and the sliding operation are triggered at the same time. All of the above will result in the inability to operate the scroll bar normally or trigger the sliding operation normally, which reduces the user experience. Summary of the invention

[0004] The embodiments of the present application provide a method, apparatus, device, storage medium and computer program product for responding to user input, which can avoid conflicts between area sliding and page scrolling when there are multiple slidable and scrollable areas on a page, thereby improving the user experience.

[0005] In a first aspect, an embodiment of the present application provides a method for responding to user input, the method comprising:

[0006] Receiving a first input from a user on a target element in a first page area, where the first page area includes at least one page element having a hierarchical relationship;

[0007] In response to the first input, obtaining a scroll bar height corresponding to at least one page element;

[0008] When the height of the scroll bar is greater than a preset height threshold, a scroll operation corresponding to the target scroll bar and the first input is triggered, where the target scroll bar is a scroll bar corresponding to at least one page element and having a height greater than the preset height threshold;

[0009] When the heights of the scroll bars are not greater than the preset height threshold, a sliding operation corresponding to the first input is triggered.

[0010] In a second aspect, an embodiment of the present application provides a device for responding to user input, the device comprising:

[0011] A receiving module, configured to receive a first input from a user to a target element in a first page area, wherein the first page area includes at least one page element having a hierarchical relationship;

[0012] An acquisition module, configured to acquire a scroll bar height corresponding to at least one page element in response to a first input;

[0013] A trigger module, configured to trigger a scrolling operation corresponding to a target scroll bar and the first input when the scroll bar height is greater than a preset height threshold, wherein the target scroll bar is a scroll bar corresponding to at least one page element and having a height greater than the preset height threshold;

[0014] The trigger module is further used to trigger a sliding operation corresponding to the first input when the height of the scroll bar is not greater than a preset height threshold.

[0015] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the method for responding to user input as in the first aspect is implemented.

[0016] In a fourth aspect, an embodiment of the present application provides a computer storage medium having computer program instructions stored thereon, and when the computer program instructions are executed by a processor, the method for responding to user input as in the first aspect is implemented.

[0017] In a fifth aspect, an embodiment of the present application provides a computer program product. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the method for responding to user input as in the first aspect.

[0018] The method, device, equipment, storage medium and computer program product for responding to user input in the embodiment of the present application, in the process of responding to the first input of the user to the target element in the first page area, obtains the height of the scroll bar corresponding to all page elements in the first page area, and judges the user's operation intention by judging whether the height of the scroll bar meets the preset threshold. When the height of the scroll bar of at least one page element meets the preset threshold, it indicates that there is a scroll bar in the first page area, which means that the user wants to trigger a scroll operation, and then the scroll operation corresponding to the target scroll bar and the first input is triggered in the first page area. When the height of the scroll bar of all page elements does not meet the preset threshold, it indicates that there is no scroll bar in the first page area, which means that the user wants to trigger a sliding operation, and then the sliding operation corresponding to the first input is triggered in the first page area. In this way, by judging whether the height of the scroll bar in the first page area meets the preset threshold, the user's intention is accurately judged, and the corresponding scrolling operation or sliding operation is triggered based on the user's intention, which can avoid the triggering conflict between the scrolling operation and the sliding operation, and improve the user's experience of browsing pages. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0020] Figure 1 It is a flowchart of a method for responding to user input provided by an embodiment of the present application;

[0021] Figure 2 This is a schematic diagram of different default behaviors corresponding to the same sliding operation on multiple web pages provided by an embodiment of the present application;

[0022] Figure 3 is a schematic diagram of a settings page provided by an embodiment of the present application;

[0023] Figure 4 is a flowchart of a method for responding to user input provided by another embodiment of the present application;

[0024] Figure 5 is a schematic diagram of the structure of a device for responding to user input provided by an embodiment of the present application;

[0025] Figure 6 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0026] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.

[0027] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0028] With the development of mobile Internet, terminal web pages often need to present complex, massive, and real-time data within a limited page. In order to display rich data in real time and concisely within the limited screen range, many sliding components are often configured, including pull-down refresh, pull-up load, infinite scroll, carousel, selector, side sliding button, etc. The current common way to trigger sliding components is generally to monitor user operations in real time and determine the triggered sliding components and corresponding dynamic effects based on the user's gestures and positions.

[0029] When the business scenarios of the page are complex, such as when there are multiple or even multi-level contents with scroll bars on the page, the repeated actions of sliding up, down, left, and right and operating the scroll bar may cause false triggering. For example, the sliding component is triggered when the scroll bar is expected to be triggered, or the scroll bar is triggered when the sliding component is expected to be triggered, or the scroll bar and the sliding component are triggered at the same time, resulting in failure to scroll normally or trigger the sliding component normally, which reduces the user experience.

[0030] There are various browsers on the market, such as WeChat Browser, UC Browser, Safari, and built-in browsers on mobile phones. Different browsers will trigger their default sliding components for the same sliding operation. For example, swiping down from the top of the WeChat browser page will display the source site domain name, swiping down in UC Browser will display a prompt text, and Huawei Browser will refresh the page. The default behaviors triggered by these browsers are prone to conflict with the user's habitual operations, giving users a poor experience.

[0031] Moreover, the same browser may display different web pages differently. For example, most web pages will display a prompt text when you scroll down in UC Browser, but Baidu web pages will not trigger any action when you scroll down in UC Browser. The existing technology can only judge the business logic for specific sliding components or operations, and is not universal.

[0032] At the same time, the current sliding operation functions are relatively simple and mechanical, cannot provide more convenient operations, and cannot be adjusted according to user habits.

[0033] In order to solve the problems of the prior art, the embodiments of the present application provide a method, device, equipment, storage medium and computer program product for responding to user input. In the process of responding to the first input of the user to the target element in the first page area, the height of the scroll bar corresponding to all the page elements in the first page area is obtained, and the user's operation intention is judged by judging whether the height of the scroll bar meets the preset threshold. When the height of the scroll bar of at least one page element meets the preset threshold, it indicates that there is a scroll bar in the first page area, which means that the user wants to trigger a scroll operation, and then the scroll operation corresponding to the target scroll bar and the first input is triggered in the first page area. When the height of the scroll bar of all page elements does not meet the preset threshold, it indicates that there is no scroll bar in the first page area, which means that the user wants to trigger a sliding operation, and then the sliding operation corresponding to the first input is triggered in the first page area. In this way, by judging whether the height of the scroll bar in the first page area meets the preset threshold, the user's intention is accurately judged, and the scroll operation or sliding operation is triggered based on the user's intention, the triggering conflict between the scroll operation and the sliding operation can be avoided, and the user's experience of browsing pages can be improved.

[0034] The following first introduces the method for responding to user input provided in an embodiment of the present application.

[0035] Figure 1 FIG. 1 is a flow chart of a method for responding to user input provided by an embodiment of the present application. Figure 1 As shown, the method may include the following steps: S101 to S104.

[0036] S101: receiving a first input of a user to a target element in a first page area, where the first page area includes at least one page element having a hierarchical relationship.

[0037] In this step, the first page area is the page displayed on the terminal screen, and the page includes page elements with a hierarchical relationship. The target element is the page element in the first page area, and the page element may have a corresponding scroll bar and a sliding component. The sliding component is used to display rich data in real time and concisely within a limited screen range. Common sliding components include pull-down refresh, pull-up load, infinite scroll, carousel, selector, side sliding button, etc. The first input is the operation of the user continuously moving and touching the terminal screen page.

[0038] In some embodiments, the first page area can be a browser page or an application page, such as a chat application page, a shopping application page, etc. The target element can be a document object model (DOM) element, wherein the DOM element treats the document as a tree structure, and each node represents a tag or text. The first input can include operating a scroll bar up and down, sliding left and right, and pulling up and down. The first input can be completed by the user using a mouse or by touching the screen.

[0039] As an example, the first page area may be set as a monitoring area, and the first input of the user may be received by monitoring events in the first page area in real time.

[0040] S102: In response to a first input, obtaining a scroll bar height corresponding to at least one page element.

[0041] In some embodiments, a page element may have a corresponding scroll bar, which is used to help display more information in a limited page area. The height of the scroll bar is used to determine whether a page element has a corresponding scroll bar. When the height of the scroll bar is not zero, it indicates that the page element does not have a corresponding scroll bar. When the height of the scroll bar is zero, it indicates that the page element does not have a corresponding scroll bar.

[0042] In the case of a complex page business scenario, there may be multiple scroll bars and multiple sliding components in the first page area. After responding to the user's first input, since the actions of sliding up, down, left, and right are similar to those of operating the scroll bar, it may cause false triggering. For example, when the user's first input is intended to trigger a scrolling operation, a sliding operation is triggered, or when a sliding operation is intended to trigger a scrolling operation, a scrolling operation is triggered, or both a scrolling operation and a sliding operation are triggered at the same time. All of the above result in the inability to operate the scroll bar normally or trigger the sliding component normally, reducing the user experience.

[0043] To this end, this step obtains the height of the scroll bar corresponding to at least one page element, and determines whether there is a scroll bar in the first page area according to the height of the scroll bar. If there is a scroll bar in the first page area, it is determined that the user's first input is intended to trigger a scrolling operation; if there is no scroll bar in the first page area, it is determined that the user's first input is intended to trigger a sliding operation.

[0044] In this way, by determining the user's intention to trigger a corresponding operation, the trigger conflict problem between the scrolling operation and the sliding operation is avoided, thereby improving the user experience.

[0045] In some embodiments, the first input may include three events: touchstart, touchmove, and touchend. The touchstart event may indicate a touch operation of the first input at the start of input, the touchend event may indicate a touch operation of the first input at the end of input, and the touchmove event may indicate a continuous touch operation of the first input after the start of input and before the end of input.

[0046] In some embodiments, responding to the first input may be achieved by monitoring touchstart, touchmove, and touchend events on the page element in the first page area.

[0047] S103: When the scroll bar height is greater than a preset height threshold, trigger a scroll operation corresponding to a target scroll bar and the first input, wherein the target scroll bar is a scroll bar corresponding to at least one page element and having a height greater than the preset height threshold.

[0048] In this step, the preset height threshold is used to determine whether the scroll bar exists. The scrolling operation is to operate the scroll bar to scroll.

[0049] In some embodiments, the preset height threshold may be zero.

[0050] As an example, when the scroll bar height is greater than zero, it indicates that the page element has a corresponding scroll bar. It can be determined that the user's first input intends to trigger the scroll bar to scroll, and the scrolling operation corresponding to the target scroll bar and the first input is triggered.

[0051] S104: When the height of the scroll bar is not greater than a preset height threshold, triggering a sliding operation corresponding to the first input.

[0052] In this step, the sliding operation is used to represent sliding up, down, left, and right. Different from the up and down operation of the scroll bar, the up, down, left, and right sliding is used to display the dynamic effect of the corresponding sliding component.

[0053] As an example, when the scroll bar height is not greater than zero, it indicates that there is no corresponding scroll bar for the page element. It can be determined that the user's first input intends to trigger a sliding operation, and the sliding operation corresponding to the target scroll bar and the first input is triggered.

[0054] In the process of responding to the user's first input to the target element in the first page area, the embodiment of the present application obtains the scroll bar height corresponding to all page elements in the first page area, and determines the user's operation intention by determining whether the scroll bar height meets the preset threshold. When the scroll bar height of at least one page element meets the preset threshold, it indicates that there is a scroll bar in the first page area, which means that the user wants to trigger a scroll operation, and then a scroll operation corresponding to the target scroll bar and the first input is triggered in the first page area. When the scroll bar heights of all page elements do not meet the preset threshold, it indicates that there is no scroll bar in the first page area, which means that the user wants to trigger a sliding operation, and then a sliding operation corresponding to the first input is triggered in the first page area. In this way, by determining whether the scroll bar height in the first page area meets the preset threshold, the user's intention is accurately determined, and the corresponding scrolling operation or sliding operation is triggered based on the user's intention, the triggering conflict between the scrolling operation and the sliding operation can be avoided, thereby improving the user's experience of browsing pages.

[0055] In some embodiments, step S103: triggering a scrolling operation corresponding to the target scroll bar and the first input when the scroll bar height is greater than a preset height threshold may include:

[0056] Determine whether the scroll bar height corresponding to the target page element meets the preset height threshold;

[0057] When the height of the scroll bar corresponding to the target page element meets the preset threshold, the scrolling operation corresponding to the scroll bar of each level of the page element is triggered in sequence, starting from the target page element;

[0058] When the scroll bar height of the target page element does not meet the preset height threshold, the page element at the previous level of the target page element is updated to the target page element, and a determination is returned as to whether the scroll bar height corresponding to the target page element meets the preset height threshold.

[0059] When the business scenario in the first page area is complex, such as when there are multi-level page elements, in order to determine whether each level of page elements has a scroll bar, it is necessary to determine whether the height of the scroll bar corresponding to each level of page elements meets the preset height threshold.

[0060] To this end, a loop algorithm can be used to specifically determine whether the scroll bar height meets the threshold for each level of page elements, and trigger the scrolling operation accordingly. This can efficiently and quickly determine whether the scroll bar heights corresponding to all page elements in the first page area meet the preset height threshold, and promptly and effectively trigger the scrolling operation corresponding to the scroll bar of each level of page elements step by step.

[0061] In some embodiments, the upper level page element of the current page element may be the parent element of the current page element, and the uppermost level page element may be the root element. The preset height threshold may be zero.

[0062] In some embodiments, the above-mentioned loop algorithm may include: judging the scroll bar height of the current page element, if the scroll bar height of the previous page element is not zero, starting from the current page element, triggering the scrolling operation corresponding to the scroll bar of each level of the page element in turn; if the scroll bar height of the previous page element is zero, continue to search upward for the parent element; judge the scroll bar height of the parent element, if the scroll bar height of the parent element is also zero, continue to search upward until the root element is found, if the root element is not found, then at most the body tag is found, and the body tag is used to define the main body of the document.

[0063] In some embodiments, based on any of the above embodiments, the method for responding to user input may further include:

[0064] A first position located in the first page area when the first input starts to be inputted and a second position located in the first page area when the first input ends to be inputted are obtained.

[0065] In some embodiments, before step S104: triggering the sliding operation corresponding to the first input, the method for responding to the user input may further include the following steps:

[0066] Step a: Calculate the sliding distance and sliding direction of the first input according to the first position and the second position;

[0067] Step b: taking the first position as a reference point, determining an area within a preset range of the reference point as a sliding area of ​​the first input, wherein the preset range is determined according to a sliding distance and a sliding direction;

[0068] Step c: When the sliding area belongs to a preset partition area in the first page area and the sliding distance is greater than a preset distance threshold, a sliding operation corresponding to the first input is triggered.

[0069] In order to avoid the false triggering of the sliding operation due to the user's misoperation, the sliding distance and sliding direction of the first input are calculated by the first position of the first page area when the first input starts to be input and the second position of the first page area when the input ends, so as to determine the sliding area of ​​the first input. If the sliding area belongs to the preset partition area and the sliding distance meets the preset threshold condition, the sliding operation is triggered; if the sliding area does not belong to the preset partition area and the sliding distance does not meet the preset threshold condition, the sliding operation is not triggered, which can avoid the inconvenience caused by the false triggering of the sliding operation.

[0070] In some embodiments, the first position may be a touch position of a touchstart event, and the second position may be a touch position of a touchend event.

[0071] In some embodiments, the first position and the second position can be determined by establishing a coordinate system in the first page area. Based on the coordinate system, the coordinates (x1, y1) of the first position and the coordinates (x2, y2) of the second position can be determined. The distance between the first position and the second position is calculated by the coordinates of the first position and the second position as the sliding distance. The sliding direction of the first input is determined by calculating the slope of the line between the first position and the second position.

[0072] In some embodiments, the sliding area is determined by taking the first position as a reference point, that is, taking the first position as a circle point, and taking the sliding distance of the first input as a radius.

[0073] In some embodiments, the preset partition area and the preset distance threshold may be manually set.

[0074] As an example, the preset partition area may be a left area or a right area divided by taking the central vertical line of the first page area as the boundary. The preset distance threshold may be two centimeters.

[0075] In some embodiments, in step c, the sliding operation corresponding to the first input may include a first sliding operation and a second sliding operation;

[0076] In some embodiments, step c: triggering a sliding operation corresponding to the first input when the sliding area belongs to a preset partition area in the first page area and the sliding distance is greater than a preset distance threshold may include:

[0077] When the sliding distance satisfies a preset first distance threshold condition, triggering a first sliding operation corresponding to the first input;

[0078] When the sliding distance meets a preset second distance threshold condition, a second sliding operation corresponding to the first input is triggered.

[0079] Existing sliding operation triggers are relatively simple and mechanical, and cannot provide more convenient operations. In order to enrich the user experience, by setting different distance thresholds, when the sliding distance reaches different thresholds, the corresponding sliding operation will be triggered. When the first distance threshold is reached, the first sliding operation is triggered, and when the second distance threshold is reached, the second sliding operation is triggered. In this way, a more flexible operating space is provided for users, enriching the user experience.

[0080] In some embodiments, the first sliding operation may be a right-slide drag, and the second sliding operation may be a right-slide return.

[0081] In some embodiments, the first distance threshold and the second distance threshold may be relatively dynamically changing values, and may be adjusted according to the screen length, sliding sensitivity, and horizontal or vertical screen state of different models in addition to the basic value or default value set by the user. When the screen size changes, the threshold is adjusted in time, for example, when the screen changes from vertical to horizontal, the threshold is appropriately reduced.

[0082] In some embodiments, in step c, the preset partition area may include a preset first partition and a preset second partition; the preset first partition and the preset second partition may be determined by dividing the first page area according to the central vertical line of the first page area; the sliding operation corresponding to the first input may include a third sliding operation and a fourth sliding operation.

[0083] In some embodiments, step c: triggering a sliding operation corresponding to the first input when the sliding area belongs to a preset partition area in the first page area and the sliding distance is greater than a preset distance threshold may include:

[0084] When the sliding area is located in the preset first partition, triggering a third sliding operation corresponding to the first input;

[0085] When the sliding area is located in the preset second partition, a fourth sliding operation corresponding to the first input is triggered.

[0086] Due to the diversity of the market, each browser or application web page has different default behaviors corresponding to the same sliding operation. For example, swiping down from the top of the WeChat browser page will display the source site domain name, swiping down from the top of the UC browser page will display a prompt text, and Huawei browser will refresh the page. Figure 2 As shown in the figure, users cannot adapt to the sliding operations of all different browsers or application pages at the same time. It is possible that the user's habitual operations trigger the default behavior of the page, and these default behaviors are not what the user wants to trigger, resulting in a poor user experience.

[0087] In order to better be compatible with sliding operations on various pages and avoid conflicts between the default behavior of the web page and the original intention of the user's sliding operation, the first page area is divided into a first partition and a second partition based on the central vertical line of the first page area, so that the same sliding operation triggers different behaviors in the first partition and the second partition respectively, which is compatible with sliding operations on various pages and effectively avoids conflicts between the default behavior of the web page and the original intention of the user's sliding operation.

[0088] As an example, the first page area is divided into a left area and a right area based on the central vertical line of the first page area. The swiping down in the top left area of ​​the screen and the swiping down in the right area trigger different behaviors respectively. For the input operations of swiping left and right, in the left area, only swiping to the left will trigger the default behavior of the page, and swiping to the right will not trigger the default behavior of the page. In the right area, only swiping to the right will trigger the default behavior of the page. That is, when the user does not want to trigger the return slide, he only needs to swipe right in the left area, and the return slide will not be triggered, which can avoid conflicts with the default return slide of the page.

[0089] In some embodiments, after step S101: receiving a first input from a user to a target element in a first page area, the method further includes:

[0090] Start the timer, which is used to pop up the first setting page in the first page area after a preset time.

[0091] In some embodiments, the first setting page can be used to set information for triggering a sliding operation corresponding to the first input, the information including a first distance threshold, a second distance threshold, a first partition, a second partition, a first sliding operation, a second sliding operation, a third sliding operation, and a fourth sliding operation.

[0092] The setting page pops up after a preset time through the timer. After the user's first input is monitored, the setting page pops up automatically, and the user does not need to click into the setting bar to set it. The customization needs of the user are provided in time, and the setting convenience is provided to the user, which improves the user experience. At the same time, the user is provided with a page for customizing the parameter information related to the first input, so that the user can automatically adjust the sliding operation according to his own habits, realize user customization, and improve the user experience.

[0093] In some embodiments, the timer may be started after the touchstart event is monitored. The preset duration of the timer may be manually set.

[0094] As an example, the preset duration of the timer may be 2 seconds.

[0095] In some embodiments, the above settings page can be as follows Figure 3 shown.

[0096] As an example, the first distance threshold may be 5, the second distance threshold may be 10, the first partition may be the left area, the second partition may be the right area, and the first sliding operation, the second sliding operation, the third sliding operation, and the fourth sliding operation may be pull-up sliding, pull-down sliding, sliding to the left, and sliding to the right, respectively.

[0097] like Figure 3 As shown, the settings page can also include setting sliding sensitivity, whether to enable sliding in different areas, whether to enable left and right sliding, and adding custom actions.

[0098] In some embodiments, the information of the setting page may also include a priority action corresponding to the first input.

[0099] In some embodiments, the priority action can be the default action of the browser, for example, the source site domain name will be displayed in the WeChat browser, and the prompt text will be displayed in the UC browser. The priority action can be the default action of the web page, such as the pull-down refresh implemented by the sliding component, or calling the application program interface (API) provided by the browser to implement more functions. The priority action can be a user-defined action. If the default action of the browser is set, the web page will not respond to the sliding operation at this time.

[0100] As an example, if the default action of the web page is set, the originally defined sliding actions will be triggered, such as pull-down to refresh, pull-up to load, etc. If a user-defined action is set, the corresponding action will be performed. It can be set as a custom trigger action by setting the corresponding page to jump. The user can set the jump address by himself and jump to the commonly used function address. For example, on a rights supermarket website, you can set it to jump to the member rights collection page, local features and other pages; on a shopping website, you can set it to jump to a featured product page; on an information website, you can set it to jump to a favorite type of information page, etc.

[0101] In some embodiments, based on any of the above embodiments, the method for responding to user input may further include:

[0102] Obtaining a trigger frequency of a sliding operation corresponding to the first input within a preset time period;

[0103] Determine a target sliding operation whose trigger frequency meets a preset frequency threshold;

[0104] When the heights of the scroll bars are not greater than the preset height threshold, a target sliding operation corresponding to the first input is triggered.

[0105] Each triggered sliding operation can be recorded in the local cache. By counting the triggering frequency of the sliding operation in the historical time period, when the frequency of the sliding operation reaches the preset frequency threshold, it can be set as the sliding operation triggered by the first input priority. This can automatically modify the priority triggering operation according to user habits, thereby improving the user experience.

[0106] As an example, the preset frequency threshold may be 60%.

[0107] In some embodiments, in order to avoid system overload caused by frequent triggering, a throttling function is set before a scrolling operation corresponding to both the target scroll bar and the first input or before triggering a sliding operation corresponding to the first input.

[0108] In order to better describe the entire solution, some specific examples are given based on the above embodiments.

[0109] exist Figure 1 Based on this, take the user's operation on the browser page as an example, such as Figure 4 As shown, the method for responding to user input provided in the embodiment of the present application may include the following steps:

[0110] S401: a touchstart event is monitored.

[0111] The touchstart event is monitored in the first page area named slideArea. SlideArea is set as the monitoring area by determining the root element of slideArea. The div tag of slideArea can be used as the root element, and three internal events are monitored on the DOM element of slideArea: touchstart, touchmove, and touchend events. The terminal continuously monitors whether there is continuous action input to determine whether the sliding event touchstart has started.

[0112] S402: Obtain the sliding state information of the slideArea, and start a timer with a preset duration of 2 seconds.

[0113] Since sliding operations are often disabled in certain business scenarios, for example, pull-down refresh is allowed on page A but prohibited on page B, it is necessary to first obtain the sliding status information of slideArea for judgment.

[0114] S403: Determine whether the sliding state information is in an available state.

[0115] If it is disabled, the disabled state value is stored in a Boolean variable (flag). When the sliding state is disabled, the scrolling operation is directly triggered.

[0116] S404: When the sliding state information is in an available state, determine whether to trigger a throttling function.

[0117] The throttling function is used to avoid frequent triggering. Once the throttling function is triggered, the response ends.

[0118] S405: Without triggering the throttling function, determine whether the scroll bar height of the target page element is greater than zero.

[0119] S406: When the scroll bar height of the target page element is not greater than zero, find the parent element of the target page element, and update the parent element to the target page element until the target page element is the root element.

[0120] S407: Determine whether the scroll bar height of at least one target page element is not zero.

[0121] S408: When the height of the scroll bar of at least one target page element is not zero, the scroll bars of the first page area are triggered step by step in sequence.

[0122] S409: When the scroll bar heights of all target page elements are zero, trigger a sliding operation according to the sliding distance, sliding direction, and sliding area.

[0123] S410: When a touchend event is detected in slideArea, the sliding state of the first page area is restored to an available state, and a timer with a preset duration of 2 seconds is cleared.

[0124] S411: End response.

[0125] Figure 5 is a schematic diagram of a structure of a device 500 for responding to user input provided in an embodiment of the present application. Figure 5 As shown, the device may include a data receiving module 510 , an acquisition module 520 , and a triggering module 530 .

[0126] A receiving module 510 is configured to receive a first input from a user to a target element in a first page area, where the first page area includes at least one page element having a hierarchical relationship;

[0127] The acquisition module 520 is used to acquire the scroll bar height corresponding to at least one page element in response to the first input;

[0128] A trigger module 530, configured to trigger a scrolling operation corresponding to a target scroll bar and the first input when the scroll bar height is greater than a preset height threshold, wherein the target scroll bar is a scroll bar corresponding to at least one page element and having a height greater than the preset height threshold;

[0129] The trigger module 530 is further configured to trigger a sliding operation corresponding to the first input when the height of the scroll bar is not greater than a preset height threshold.

[0130] In the process of responding to the user's first input to the target element in the first page area, the embodiment of the present application obtains the scroll bar height corresponding to all page elements in the first page area, and determines the user's operation intention by determining whether the scroll bar height meets the preset threshold. When the scroll bar height of at least one page element meets the preset threshold, it indicates that there is a scroll bar in the first page area, which means that the user wants to trigger a scroll operation, and then a scroll operation corresponding to the target scroll bar and the first input is triggered in the first page area. When the scroll bar heights of all page elements do not meet the preset threshold, it indicates that there is no scroll bar in the first page area, which means that the user wants to trigger a sliding operation, and then a sliding operation corresponding to the first input is triggered in the first page area. In this way, by determining whether the scroll bar height in the first page area meets the preset threshold, the user's intention is accurately determined, and the corresponding scrolling operation or sliding operation is triggered based on the user's intention, the triggering conflict between the scrolling operation and the sliding operation can be avoided, thereby improving the user's experience of browsing pages.

[0131] In some embodiments, the trigger module 530 is further used to determine whether the height of the scroll bar corresponding to the target page element meets a preset height threshold;

[0132] When the height of the scroll bar corresponding to the target page element meets the preset threshold, the scrolling operation corresponding to the scroll bar of each level of the page element is triggered in sequence, starting from the target page element;

[0133] When the scroll bar height of the target page element does not meet the preset height threshold, the page element at the previous level of the target page element is updated to the target page element, and a determination is returned as to whether the scroll bar height corresponding to the target page element meets the preset height threshold.

[0134] In some embodiments, the acquisition module 520 is further used to acquire a first position located in the first page area when the first input starts to be input and a second position located in the first page area when the first input ends to be input.

[0135] The trigger module 530 is further used to calculate the sliding distance and sliding direction of the first input according to the first position and the second position;

[0136] Taking the first position as a reference point, determining an area within a preset range of the reference point as a sliding area of ​​the first input, wherein the preset range is determined according to a sliding distance and a sliding direction;

[0137] When the sliding area belongs to a preset partition area in the first page area and the sliding distance is greater than a preset distance threshold, a sliding operation corresponding to the first input is triggered.

[0138] In some embodiments, the trigger module 530 is further configured to trigger a first sliding operation corresponding to the first input when the sliding distance satisfies a preset first distance threshold condition.

[0139] In some embodiments, the trigger module 530 is further configured to trigger a second sliding operation corresponding to the first input when the sliding distance satisfies a preset second distance threshold condition.

[0140] In some embodiments, the trigger module 530 is further configured to trigger a third sliding operation corresponding to the first input when the sliding area is located in the preset first partition;

[0141] When the sliding area is located in the preset second partition, a fourth sliding operation corresponding to the first input is triggered.

[0142] In some embodiments, the trigger module 530 is also used to start a timer after receiving a first input from a user to a target element in the first page area. The timer is used to pop up a first setting page in the first page area after a preset time. The first setting page is used to set information that triggers a sliding operation corresponding to the first input. The information includes a first distance threshold, a second distance threshold, a first partition, a second partition, a first sliding operation, a second sliding operation, a third sliding operation, and a fourth sliding operation.

[0143] In some embodiments, the apparatus 500 for responding to user input further includes a determination module;

[0144] The acquisition module 520 is further used to acquire the triggering frequency of the sliding operation corresponding to the first input within a preset time period;

[0145] A determination module, used to determine a target sliding operation whose trigger frequency meets a preset frequency threshold;

[0146] The trigger module 530 is further configured to trigger a target sliding operation corresponding to the first input when the height of the scroll bar is not greater than a preset height threshold.

[0147] Figure 5 The various modules in the device shown can be implemented Figure 1 Each step in the above steps can achieve the corresponding technical effect, which will not be repeated here for the sake of brevity.

[0148] Figure 6 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application is shown.

[0149] The electronic device may include a processor 601 and a memory 602 storing computer program instructions.

[0150] Specifically, the processor 601 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0151] The memory 602 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 602 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 602 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 602 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 602 is a non-volatile solid-state memory.

[0152] In certain embodiments, the memory may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Thus, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of the present application.

[0153] The processor 601 reads and executes computer program instructions stored in the memory 602 to implement any one of the methods for responding to user input in the above embodiments.

[0154] In one example, the electronic device may further include a communication interface 603 and a bus 610. Figure 6 As shown, the processor 601, the memory 602, and the communication interface 603 are connected via a bus 610 and communicate with each other.

[0155] The communication interface 603 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.

[0156] Bus 610 includes hardware, software or both, and the parts of electronic equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 610 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the application considers any suitable bus or interconnection.

[0157] In addition, in combination with the method for responding to user input in the above embodiments, the embodiment of the present application may provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by the processor, any one of the methods for responding to user input in the above embodiments is implemented.

[0158] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed, implements any one of the methods for responding to user input in the above embodiments.

[0159] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.

[0160] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.

[0161] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.

[0162] The above reference is to the flowchart and / or block diagram of the method, device, equipment, storage medium and computer program product according to the embodiment of the present application. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.

[0163] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.

Claims

1. A method for responding to user input, characterized in that: include: Receiving a first input from a user on a target element in a first page area, wherein the first page area includes at least one page element having a hierarchical relationship; In response to the first input, obtaining a scroll bar height corresponding to the at least one page element; In the case where the height of the scroll bar is greater than a preset height threshold, triggering a scrolling operation corresponding to a target scroll bar and the first input, wherein the target scroll bar is a scroll bar whose height is greater than the preset height threshold among the scroll bars corresponding to the at least one page element; When the heights of the scroll bars are not greater than the preset height threshold, a sliding operation corresponding to the first input is triggered.

2. The method according to claim 1, characterized in that When the height of the scroll bar is greater than a preset height threshold, triggering a scrolling operation corresponding to the target scroll bar and the first input includes: Determine whether the scroll bar height corresponding to the target page element meets the preset height threshold; When the height of the scroll bar corresponding to the target page element meets a preset threshold, starting from the target page element, the scrolling operation corresponding to the scroll bar of each level of the page element is triggered step by step; When the scroll bar height of the target page element does not meet the preset height threshold, the page element at the previous level of the target page element is updated to the target page element, and the step of determining whether the scroll bar height corresponding to the target page element meets the preset height threshold is returned.

3. The method according to claim 1, characterized in that The method further comprises: Acquire a first position located in the first page area when the first input starts to be input and a second position located in the first page area when the first input ends to be input; Before triggering the sliding operation corresponding to the first input, the method further includes: Calculating a sliding distance and a sliding direction of the first input according to the first position and the second position; Taking the first position as a reference point, determining an area within a preset range of the reference point as a sliding area of ​​the first input, wherein the preset range is determined according to the sliding distance and the sliding direction; When the sliding area belongs to a preset partition area in the first page area and the sliding distance is greater than a preset distance threshold, a sliding operation corresponding to the first input is triggered.

4. The method according to claim 3, characterized in that The sliding operation corresponding to the first input includes a first sliding operation; The triggering of the sliding operation corresponding to the first input when the sliding area belongs to a partition area preset in the first page area and the sliding distance is greater than a preset distance threshold includes: When the sliding distance satisfies a preset first distance threshold condition, a first sliding operation corresponding to the first input is triggered.

5. The method according to claim 3, characterized in that: The sliding operation corresponding to the first input includes a second sliding operation; The triggering of the sliding operation corresponding to the first input when the sliding area belongs to a partition area preset in the first page area and the sliding distance is greater than a preset distance threshold includes: When the sliding distance satisfies a preset second distance threshold condition, a second sliding operation corresponding to the first input is triggered.

6. The method according to claim 3, characterized in that The preset partition area includes a preset first partition and a preset second partition; the preset first partition and the preset second partition are determined by dividing the first page area according to a central vertical line of the first page area.

7. The method according to claim 6, characterized in that The sliding operation corresponding to the first input includes a third sliding operation and a fourth sliding operation; The triggering of the sliding operation corresponding to the first input when the sliding area belongs to a partition area preset in the first page area and the sliding distance is greater than a preset distance threshold includes: When the sliding area is located in the preset first partition, triggering a third sliding operation corresponding to the first input; When the sliding area is located in the preset second partition, a fourth sliding operation corresponding to the first input is triggered.

8. The method according to claim 1, characterized in that After receiving a first input from a user to a target element in the first page area, the method further includes: Start a timer, where the timer is used to pop up a first setting page in the first page area after a preset time.

9. The method according to claim 8, characterized in that The first setting page is used to set information for triggering a sliding operation corresponding to the first input, and the information includes a first distance threshold, a second distance threshold, a first partition, a second partition, a first sliding operation, a second sliding operation, a third sliding operation, and a fourth sliding operation.

10. The method according to claim 1, characterized in that The method further comprises: Obtaining a trigger frequency of a sliding operation corresponding to the first input within a preset time period; Determine a target sliding operation in which the trigger frequency meets a preset frequency threshold; When the heights of the scroll bars are not greater than the preset height threshold, the target sliding operation corresponding to the first input is triggered.