WO2017181619A1 - Page response method and device - Google Patents

Page response method and device Download PDF

Info

Publication number
WO2017181619A1
WO2017181619A1 PCT/CN2016/101686 CN2016101686W WO2017181619A1 WO 2017181619 A1 WO2017181619 A1 WO 2017181619A1 CN 2016101686 W CN2016101686 W CN 2016101686W WO 2017181619 A1 WO2017181619 A1 WO 2017181619A1
Authority
WO
WIPO (PCT)
Prior art keywords
event
registration
touch screen
focusable
page
Prior art date
Application number
PCT/CN2016/101686
Other languages
French (fr)
Chinese (zh)
Inventor
曹刚
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2017181619A1 publication Critical patent/WO2017181619A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/725Cordless telephones
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • H04M1/72445User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality for supporting Internet browser applications

Definitions

  • the present invention relates to the field of communications, and in particular to a page response method and apparatus.
  • an A tag containing a URL link an INPUT tag can be input, and a keyboard confirmation event (such as an OK key event) is registered. That is, the ENTER key event) other tags of the response transaction (such as DIV, BUTTON, etc.) are marked as focusable elements; when the user navigates through the webpage using the keyboard direction keys, the focus display is performed on the focusable elements in turn;
  • a button confirmation event occurs, the event transaction registered by the element can be responded to, such as opening a new link, submitting an input, and the like;
  • the embodiment of the invention provides a page response method and device, so as to solve at least the problem of browsing a touch screen-based webpage by using a button event of a physical key for a mobile phone with a physical key in the related art.
  • a page response method including:
  • the registration of the touch screen event in the page is converted into the registration of the key event; after the page loading is completed, the first focusable element applied to the touch screen in the web page is acquired, and the first focusable element is converted a second focusable element applied to the button; triggering a response operation to the second focusable element by the button event.
  • converting the registration of the touch screen event in the page to the registration of the key event includes:
  • event transaction registration is a registration of a touch screen event
  • determining whether the event transaction registration is a registration of a touch screen event comprises:
  • the method before acquiring the first focusable element applied to the touch screen in the webpage, the method further includes:
  • the filtered focusable element is used as the first focusable element of the touch screen.
  • the feature set at least includes: a gesture event indicated by the touch screen event, an attribute feature of the first focusable element, wherein the attribute feature comprises: key information in response to the event.
  • the feature set is updated when a predetermined time comes.
  • a page response apparatus including:
  • the conversion module is configured to convert the registration of the touch screen event in the page into the registration of the key event during the page loading process; the obtaining module is configured to obtain the first focusable element applied to the touch screen in the webpage after the page is loaded, And converting the first focusable element into a second focusable element applied to the button; the triggering module is configured to trigger a response operation to the second focusable element by the button event.
  • the conversion module includes: a determining unit, configured to: when the page is monitored for event transaction registration, determine whether the event transaction registration is a registration of a touch screen event; and the stopping unit is set to register as an event transaction.
  • the stopping unit is set to register as an event transaction.
  • the loading unit is set to load the registration of the key event into the event transaction registration.
  • the determining unit is further configured to determine whether the event transaction registration exists in a preset feature set; if yes, determine that the event transaction is registered as a registration of a touch screen event; if not, determine the Event transactions are registered as registrations for key events.
  • the device further includes: a screening module, configured to filter, from the focusable elements of all the labels of the webpage, the focusable elements located in the preset feature set; the determining module, Used to use the filtered focusable element as the first focusable element of the touch screen.
  • a screening module configured to filter, from the focusable elements of all the labels of the webpage, the focusable elements located in the preset feature set
  • the determining module Used to use the filtered focusable element as the first focusable element of the touch screen.
  • a computer storage medium is further provided, and the computer storage medium may store an execution instruction for executing the implementation of the page response method in the foregoing embodiment.
  • the registration of the touch screen event in the page is converted into the registration of the key event; after the page loading is completed, the first focusable element applied to the touch screen in the webpage is acquired, and the first focusable element is converted For the second focusable element applied to the button, and then the technical solution for triggering the response operation to the second focusable element by the button event, solving the related art for the mobile phone with the physical key, the physical key cannot be used.
  • the button event is used to browse the touch screen-based webpage, thereby realizing that even if the user uses a low-end mobile phone with only physical keys, it can still respond to most of the touch screen-based pages on the market, greatly improving the user. Experience.
  • FIG. 1 is a flowchart of a page response method according to an embodiment of the present invention.
  • FIG. 2 is a block diagram showing the structure of a page response apparatus according to an embodiment of the present invention.
  • FIG. 3 is a structural block diagram of a conversion module 20 of a page response apparatus according to an embodiment of the present invention
  • FIG. 4 is a block diagram showing another structure of a page response apparatus according to an embodiment of the present invention.
  • Figure 5 is a block diagram showing the overall structure of a preferred embodiment 1 of the present invention.
  • FIG. 6 is a flowchart of main processing of touch screen event registration conversion according to a preferred embodiment 1 of the present invention.
  • FIG. 7 is a flow chart showing the main processing of capturing a focusable element when a direction key of a preferred embodiment 1 is navigated in a web page according to the preferred embodiment of the present invention.
  • FIG. 1 is a flowchart of a page response method according to an embodiment of the present invention. As shown in FIG. 1 , the process includes the following steps:
  • Step S102 in the page loading process, converting the registration of the touch screen event in the page into the registration of the button event;
  • Step S104 after the page loading is completed, acquiring a first focusable element applied to the touch screen in the webpage, and converting the first focusable element into a second focusable element applied to the button;
  • Step S106 triggering a response operation to the second focusable element by a button event.
  • the registration of the touch screen event in the page is converted into the registration of the key event; after the page loading is completed, the first focusable element applied to the touch screen in the webpage is acquired, and the first focusable element is converted into the application.
  • the second focusable element of the button and then the technical solution for triggering the response operation of the second focusable element by the button event, solving the related art technology for the mobile phone with the physical key, the button event of the physical key cannot be used for the touch screen based webpage
  • the problem of browsing enables the user to respond to most of the current touch screen-based pages on the market, even if the user uses a low-end mobile phone with only physical keys, which greatly improves the user experience.
  • step S102 converting the registration of the touch screen event in the page to the registration of the key event may be implemented by: when the page is monitored for event transaction registration. Whether the event transaction registration is a registration of the touch screen event; if yes, the current event transaction registration process is stopped, and the registration of the key event is registered in the event transaction registration, that is, the registration of the touch screen event during the page loading process is uniformly converted into a button. The registration of the event enables subsequent key events to be responded to.
  • the event transaction registration is a registration of a touch screen event by:
  • the method before acquiring the first focusable element applied to the touch screen in the webpage, the method further includes: filtering out the focusable elements located in the preset feature set from the focusable elements of all the labels of the webpage;
  • the focusable element is the first focusable element of the touch screen, that is, the focusable element located in the feature set is also filtered out from the focusable elements of all the labels in the webpage according to the preset feature set.
  • the feature set includes at least: a gesture event indicated by the touch screen event, an attribute feature of the first focusable element, wherein the attribute feature includes: key information in response to the event.
  • the feature set is updated when the predetermined time comes.
  • the browser supports button navigation in the webpage.
  • the most important thing is to capture the focusable elements in the webpage.
  • the previous method can only detect the regular focusable elements (such as the A-tag with the URL link, you can input INPUT). Labels, other tags with registered keyboard click event responses, etc., can't do anything about the focusable elements in a large number of touchscreen web pages.
  • the technical solution of the embodiment of the present invention proposes a method based on an element touch event and a feature feature set to focus and process an element of a touch screen webpage according to the feature of the focusable element in the touch screen, so that the webpage can be normally used on various webpages.
  • the use of button browsing breaks through the bottleneck problem that the traditional button machine cannot access the touch screen webpage, and has high technical value and commercial value.
  • the touch screen test webpage including the touch gesture event and the attribute feature mentioned in the embodiment of the present invention is accessed on the server by comparing the browser, and if the normal navigation operation can be performed on the webpage through the keyboard, that is, in the present invention Within the scope of protection.
  • the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases, the former is A better implementation.
  • the technical solution of the present invention which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
  • the optical disc includes a number of instructions for causing a terminal device (which may be a cell phone, a computer, a server, or a network device, etc.) to perform the methods of various embodiments of the present invention.
  • a page response device is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and details are not described herein.
  • the term "module” may implement a combination of software and/or hardware of a predetermined function.
  • the apparatus described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware, is also possible and contemplated.
  • FIG. 2 is a structural block diagram of a page response apparatus according to an embodiment of the present invention. As shown in FIG. 2, the apparatus includes:
  • the conversion module 20 is configured to convert the registration of the touch screen event in the page into the registration of the button event during the page loading process
  • the obtaining module 22 is configured to: after the page loading is completed, acquire a first focusable element applied to the touch screen in the webpage, and convert the first focusable element into a second focusable element applied to the button;
  • the triggering module 24 is configured to trigger a response operation to the second focusable element by a button event.
  • the registration of the touch screen event in the page is converted into the registration of the key event; after the page loading is completed, the first focusable element applied to the touch screen in the webpage is acquired, and the first focusable element is converted.
  • the second focusable element applied to the button and then the technical solution for triggering the response operation to the second focusable element by the button event, solving the related art for the mobile phone with the physical key, the button event pair that cannot use the physical key is based on touch screen
  • the problem of browsing the webpage further realizes that even if the user uses a low-end mobile phone with only physical keys, it can still respond to most of the touch screen-based pages currently on the market, greatly improving the user experience.
  • FIG. 3 is a structural block diagram of a conversion module 20 of a page response apparatus according to an embodiment of the present invention.
  • the conversion module 20 includes: a determining unit 200 configured to perform event transaction registration when a page is detected, and determine an event transaction. Whether the registration is a registration of a touch screen event; the stopping unit 202 is configured to stop the current event transaction registration process when the event transaction is registered as a registration of the touch screen event; the loading unit 204 is configured to register the registration event event of the key event.
  • the determining unit 200 is further configured to determine whether an event transaction registration exists in the preset feature set; if yes, determine that the event transaction is registered as a registration of the touch screen event; if not, determine that the event transaction is registered as a key event registered.
  • the apparatus further includes: a screening module 26 configured to filter out the pre-sets of the focusable elements of all the labels of the webpage. A focusable element in the set of features; a determination module 28 configured to use the filtered focusable element as the first focusable element of the touch screen.
  • FIG. 5 is a block diagram showing the overall structure of a preferred embodiment 1 according to the present invention. As shown in FIG. 5, the main control module 50 and the focus element capturing module are included. 52. The touch screen event conversion module 54, the focus navigation module 56, the feature set query module 58, and the feature set update module 60. The role of each core module is roughly described as follows:
  • the focus element capture module 52 (corresponding to the acquisition module 22 of the above embodiment), in addition to capturing elements of a conventional focus attribute (such as an A-tag with a URL link, an INPUT tag, another tag with a registered keyboard click event response, etc.), Also need to capture the query system based on feature set Determining the focusable elements on the touch screen;
  • a conventional focus attribute such as an A-tag with a URL link, an INPUT tag, another tag with a registered keyboard click event response, etc.
  • the touch screen event conversion module 54 (corresponding to the conversion module 20 of the above embodiment) also converts the touch event registration of the touch screen webpage into a keyboard event registration according to the feature set query system, so that only the response triggered by the touch event can be triggered by the keyboard event instead. ;
  • the focus navigation module 56 is the next focusable element that is closest to the focused element in the current web page in the direction when the mobile phone direction key is triggered;
  • the feature set query module 58 includes a query of touch screen events and an attribute feature query of the touch screen focusable elements.
  • the touch screen event mainly refers to a gesture event that can only be triggered on the touch screen, and whether the event registered by the web page belongs to a touch screen event to determine the registration converted into a button event.
  • the attribute feature of the touch screen focusable element means that although some elements do not have regular focus features (A-tag, INPUT tag, with registered keyboard confirmation event response), some attribute fields of the element contain key information for response event processing, these attributes.
  • the fields form the attribute feature set of the touch screen focusable elements (such as data-src, data-href, data-url, data-target, etc.).
  • the feature set update module 60 mainly considers that in addition to the attribute fields associated with the event processing included in the most common touch screen focusable elements, some web pages may also have other attribute fields associated with the event processing. Therefore, it is necessary to automatically update this feature set at any time in order to include as much as possible the attribute fields associated with event processing on all touch screen web pages;
  • FIG. 5 is a schematic diagram of an overall structure of a button webpage navigation method provided by the embodiment, and includes a main control module 50, a focus element capture module 52, a touch screen event conversion module 54, a focus navigation module 56, and a feature set.
  • the main control module 50 activates the touch screen event conversion module 54 to convert the registration of the web page touch screen event into a registration of the key confirmation event.
  • the main control module 50 when the user presses the direction key
  • the focus navigation module 56 is again activated to navigate through the web page.
  • the most critical focus element detection step in the navigation process is mainly that the module captures the elements of the web page with the focus attribute through another focus element capture module 52.
  • the above touch screen event conversion module 54 and focus element capture module 52 both rely on the feature set query module 58 to find corresponding features to perform touch screen event conversion and touch screen focus element detection, respectively.
  • the feature data in the feature set query module 58 is that the master module 50 periodically updates the features through the feature set update module 60.
  • the updating of the feature set and the focus processing after capturing the focusable elements are conventional methods and will not be described in detail herein. The following focuses on two key technical processing steps, touch screen event registration conversion and touch screen focus element detection.
  • FIG. 6 is a flowchart of main processing of touch screen event registration conversion according to a preferred embodiment 1 of the present invention. As shown in FIG. 6, the steps are as follows:
  • Step S602 monitoring the webpage for event transaction registration during the webpage loading phase or other interaction phase;
  • Step S604 Determine whether the event belongs to a touch screen event in the feature set query module.
  • the feature set mainly includes touchstart, touchend, mousedown, mouseup, etc., which can be continuously updated and supplemented by the update module. If the event does not belong to the touch screen event, proceed to step S608, otherwise proceed to the next step S606;
  • Step S606 Acquire a registration transaction corresponding to the event, and register a button confirmation event into the transaction, that is, the transaction is processed when a button confirmation event occurs on the webpage;
  • Step S608 registering the event according to the original registration process
  • those elements that only register the touch event without registering the button confirmation event can be regarded as the focusable element and thus navigated on the button.
  • the middle can be focused, and the second is that when the button confirms that the event occurs, the transaction that the original touch event wishes to trigger can also occur.
  • FIG. 7 is a flowchart of main processes for capturing a focusable element when a direction key is navigated in a webpage according to a preferred embodiment of the present invention. As shown in FIG. 7, the main steps are as follows:
  • Step S702 When the user presses the direction key to start navigation in the webpage, first traverse the network Individual element nodes in the page DOM tree;
  • Step S704 determining whether the element node belongs to a conventional focusable node, and if the element node is a conventional focusable node, proceeding to step S712, otherwise proceeding to the next step S706.
  • the primary condition for determining whether it is a regular focusable node is that the element is an A-tag or an INPUT tag or a transaction registration with a registered keyboard confirmation event on the element;
  • Step S706 determining whether the ancestor node of the element node has a transaction registration registering a keyboard confirmation event, if not, proceeding to step S710, otherwise proceeding to the next step S708.
  • the judgment of this step is mainly to consider that the touch screen webpage is to uniformly register the event response of multiple elements on an ancestor node;
  • Step S708 The attribute feature field of each touch screen focusable element in the feature set query module is sequentially searched as the attribute field of the element. If one of the corresponding element attributes is not empty, the process proceeds to step S712, otherwise Go to the next step S710 for processing.
  • the attribute feature field of the touch screen focusable element mainly includes href, url, data-src, data-href, data-url, data-target, etc., and these feature fields can be continuously updated and supplemented by the update module;
  • Step S710 Obtain the next element node in the DOM tree and then re-enter the process in step S702;
  • Step S712 The element node is included in the focusable element processing, that is, in the navigation processing module, it is determined whether to focus on the element according to the position of the element from the current focus element. This process ends.
  • those elements on the touch screen webpage that do not have the normal focus attribute can be detected in the button navigation to complete the focus processing of the element only if the focus is needed.
  • the embodiment of the present invention achieves the following technical effects: solving the problem that the touch screen-based webpage cannot be browsed by the button event of the physical key for the mobile phone with the physical key in the related art, thereby realizing even the user to use
  • the low-end mobile phone with only physical keys can still respond to most of the touch screen-based pages on the market, greatly improving the use. User experience.
  • Embodiments of the present invention also provide a storage medium.
  • the foregoing storage medium may be configured to store program code for performing the following steps:
  • the foregoing storage medium may include, but not limited to, a USB flash drive, a Read-Only Memory (ROM), a Random Access Memory (RAM), a mobile hard disk, and a magnetic memory.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • a mobile hard disk e.g., a hard disk
  • magnetic memory e.g., a hard disk
  • modules or steps of the present invention described above can be implemented by a general-purpose computing device that can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein.
  • the steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps thereof are fabricated as a single integrated circuit module.
  • the invention is not limited to any specific combination of hardware and software.
  • the registration of the touch screen event in the page is converted into the registration of the key event; after the page loading is completed, the first focusable element applied to the touch screen in the webpage is acquired, and the first focusable element is converted For the second focusable element applied to the button, and then the technical solution for triggering the response operation to the second focusable element by the button event, solving the related art for the mobile phone with the physical key, the physical key cannot be used.
  • the button event is used to browse the touch screen-based webpage, thereby realizing that even if the user uses a low-end mobile phone with only physical keys, it can still respond to most of the touch screen-based pages on the market, greatly improving the user. Experience.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Human Computer Interaction (AREA)
  • User Interface Of Digital Computer (AREA)
  • Input From Keyboards Or The Like (AREA)
  • Telephone Function (AREA)

Abstract

Provided are a page response method and device. The method comprises: during a page loading process, converting the registration of a touch screen event in a page into the registration of a button event; after page loading is completed, acquiring a first focusable element applied to the touch screen in a web page, and converting the first focusable element into a second focusable element applied to a button; and by means of the button event, triggering a response operation on the second focusable element. By means of the technical solution, the problem in the relevant art that, with regard to a mobile phone with a physical button, a button event of the physical button cannot be used to browser a touch screen based web page, and thus, although a user uses a low-end mobile phone with only a physical button, a response can still be made to most touch screen based web pages in the current market, thereby greatly improving the user experience.

Description

页面响应方法及装置Page response method and device 技术领域Technical field
本发明涉及通信领域,具体而言,涉及一种页面响应方法及装置。The present invention relates to the field of communications, and in particular to a page response method and apparatus.
背景技术Background technique
当前基于触摸屏的手机虽然在市场上占据主导地位,但基于键盘操作的按键机仍然占据很广阔的用户市场。但是当前使用按键机一个最大的问题就是在该手机的普通浏览器进行上网操作非常困难,这是因为在键盘机上浏览网站时,往往会收到各种各样基于触摸屏的网页(如网址包含“\touch”等)。由于这些网页中的各个元素相关的属性和事件都是基于当前触摸屏手势触发而设计的,按照传统的浏览器按键聚焦导航方法是无法正常地浏览这些网页的,比如无法聚焦到一个链接上去打开一个新的网页,也无法聚焦到输入框中进行输入并提交操作等等。Although current touch screen-based mobile phones dominate the market, keyboard-based push buttons still occupy a very broad user market. However, one of the biggest problems with the current use of button presses is that it is very difficult to access the Internet in the normal browser of the phone. This is because when browsing websites on the keyboard, it often receives a variety of touch screen-based web pages (such as URLs containing " \touch", etc.). Since the attributes and events related to each element in these web pages are designed based on the current touch screen gesture triggering, according to the traditional browser button focus navigation method, these web pages cannot be browsed normally, for example, can not focus on a link to open a New web pages can't focus on the input box for input and submit operations, and so on.
在早期支持键盘机的浏览器中,主要通过以下方法来依靠键盘操作在网页中导航浏览的:将包含有网址链接的A标签、可输入INPUT标签、具有注册有键盘确认事件(如OK键事件即ENTER键事件)响应事务的其他标签(如DIV、BUTTON等)标记为可聚焦元素;当用户使用键盘方向键在网页上导航时,依次在可聚焦的元素上进行聚焦显示;当在聚焦元素上发生按键确认事件时,即可响应该元素注册的事件事务处理,如打开新的链接、提交输入等;In the browsers that support the keyboard machine in the early days, the following methods are mainly used to navigate through the webpage by keyboard operation: an A tag containing a URL link, an INPUT tag can be input, and a keyboard confirmation event (such as an OK key event) is registered. That is, the ENTER key event) other tags of the response transaction (such as DIV, BUTTON, etc.) are marked as focusable elements; when the user navigates through the webpage using the keyboard direction keys, the focus display is performed on the focusable elements in turn; When a button confirmation event occurs, the event transaction registered by the element can be responded to, such as opening a new link, submitting an input, and the like;
普通浏览器这种按键网页导航方法,对于早期的简单手机网页浏览一般没有什么问题。但是随着超文件标记语言(Hypertext Markup Language,简称为HTML)5的发展,手机网页变得越来越复杂且多样化。特别是大量 为触摸屏终端设计的网页,完全摈弃了以往支持键盘导航的设计:一是不再对每一个具体需要响应事件的元素进行该事件的事务注册而是通过自身的JS框架统一对触摸事件进行管理,二是不再使用键盘确认事件而只关注触摸事件(如TOUCHU START、TOUCHU END)。这样使用传统方法就无法捕获具有聚焦属性的元素,即使能聚焦也无法响应按键事件,从而无法使用按键在这些触摸屏的网页上进行导航浏览。Ordinary browsers, such as button navigation methods, generally have no problem for early simple mobile web browsing. However, with the development of Hypertext Markup Language (HTML) 5, mobile web pages have become more and more complex and diverse. Especially a lot The webpage designed for the touch screen terminal completely abandons the previous design that supports keyboard navigation. First, the event registration of the event is no longer performed for each element that needs to respond to the event, but the touch event is managed through its own JS framework. The second is to no longer use the keyboard to confirm the event and only focus on touch events (such as TOUCHU START, TOUCHU END). In this way, it is impossible to capture the elements with the focus attribute using the conventional method, and even if the focus can not respond to the key events, the buttons cannot be navigated on the web pages of these touch screens.
针对相关技术中,对于带有物理键的手机,无法使用物理键的按键事件对基于触摸屏的网页进行浏览的问题,尚未提出有效的解决方案。In the related art, for a mobile phone with a physical key, it is not possible to use a button event of a physical key to browse a touch screen-based web page, and an effective solution has not been proposed.
发明内容Summary of the invention
本发明实施例提供了一种页面响应方法及装置,以至少解决相关技术中对于带有物理键的手机,无法使用物理键的按键事件对基于触摸屏的网页进行浏览的问题。The embodiment of the invention provides a page response method and device, so as to solve at least the problem of browsing a touch screen-based webpage by using a button event of a physical key for a mobile phone with a physical key in the related art.
根据本发明的一个实施例,提供了一种页面响应方法,包括:According to an embodiment of the present invention, a page response method is provided, including:
在页面加载过程中,将页面中的触摸屏事件的注册转换为按键事件的注册;在页面加载完成后,获取网页中应用于触摸屏的第一可聚焦元素,并将所述第一可聚焦元素转换为应用于按键的第二可聚焦元素;通过所述按键事件触发对所述第二可聚焦元素的响应操作。During the page loading process, the registration of the touch screen event in the page is converted into the registration of the key event; after the page loading is completed, the first focusable element applied to the touch screen in the web page is acquired, and the first focusable element is converted a second focusable element applied to the button; triggering a response operation to the second focusable element by the button event.
可选地,将页面中的触摸屏事件的注册转换为按键事件的注册,包括:Optionally, converting the registration of the touch screen event in the page to the registration of the key event includes:
当监测到所述页面进行事件事务注册,判断所述事件事务注册是否为触摸屏事件的注册;When the page is monitored for event transaction registration, it is determined whether the event transaction registration is a registration of a touch screen event;
如果是,则停止当前的事件事务注册过程,将所述按键事件的注册加载所述事件事务注册中。If so, the current event transaction registration process is stopped and the registration of the key event is loaded into the event transaction registration.
可选地,判断所述事件事务注册是否为触摸屏事件的注册,包括:Optionally, determining whether the event transaction registration is a registration of a touch screen event comprises:
判断在预先设置的特征集中是否存在所述事件事务注册;Determining whether the event transaction registration exists in a preset feature set;
如果有,则判定所述事件事务注册为触摸屏事件的注册; If so, determining that the event transaction is registered as a registration of a touch screen event;
如果无,则判定所述事件事务注册为按键事件的注册。If not, it is determined that the event transaction is registered as a registration of a button event.
可选地,获取网页中应用于触摸屏的第一可聚焦元素之前,所述方法还包括:Optionally, before acquiring the first focusable element applied to the touch screen in the webpage, the method further includes:
从所述网页的所有标签的可聚焦元素中筛选出位于预先设定的特征集中的可聚焦元素;Filtering the focusable elements located in a preset feature set from the focusable elements of all the labels of the webpage;
将筛选出的可聚焦元素作为所述触摸屏的第一可聚焦元素。The filtered focusable element is used as the first focusable element of the touch screen.
可选地,所述特征集中至少包括:触摸屏事件所指示的手势事件,所述第一可聚焦元素的属性特征,其中,所述属性特征包括:响应事件的关键信息。Optionally, the feature set at least includes: a gesture event indicated by the touch screen event, an attribute feature of the first focusable element, wherein the attribute feature comprises: key information in response to the event.
可选地,在预定时间到来时,对所述特征集进行更新。Optionally, the feature set is updated when a predetermined time comes.
根据本发明的另一个实施例,还提供了一种页面响应装置,包括:According to another embodiment of the present invention, a page response apparatus is further provided, including:
转换模块,设置为在页面加载过程中,将页面中的触摸屏事件的注册转换为按键事件的注册;获取模块,设置为在页面加载完成后,获取网页中应用于触摸屏的第一可聚焦元素,并将所述第一可聚焦元素转换为应用于按键的第二可聚焦元素;触发模块,设置为通过所述按键事件触发对所述第二可聚焦元素的响应操作。The conversion module is configured to convert the registration of the touch screen event in the page into the registration of the key event during the page loading process; the obtaining module is configured to obtain the first focusable element applied to the touch screen in the webpage after the page is loaded, And converting the first focusable element into a second focusable element applied to the button; the triggering module is configured to trigger a response operation to the second focusable element by the button event.
可选地,所述转换模块,包括:判断单元,设置为当监测到所述页面进行事件事务注册,判断所述事件事务注册是否为触摸屏事件的注册;停止单元,设置为在事件事务注册为触摸屏事件的注册时,停止当前的事件事务注册过程;加载单元,设置为将所述按键事件的注册加载所述事件事务注册中。Optionally, the conversion module includes: a determining unit, configured to: when the page is monitored for event transaction registration, determine whether the event transaction registration is a registration of a touch screen event; and the stopping unit is set to register as an event transaction. When the registration of the touch screen event is stopped, the current event transaction registration process is stopped; the loading unit is set to load the registration of the key event into the event transaction registration.
可选地,所述判断单元,还设置为判断在预先设置的特征集中是否存在所述事件事务注册;如果有,则判定所述事件事务注册为触摸屏事件的注册;如果无,则判定所述事件事务注册为按键事件的注册。Optionally, the determining unit is further configured to determine whether the event transaction registration exists in a preset feature set; if yes, determine that the event transaction is registered as a registration of a touch screen event; if not, determine the Event transactions are registered as registrations for key events.
可选地,所述装置还包括:筛选模块,设置为从所述网页的所有标签的可聚焦元素中筛选出位于预先设定的特征集中的可聚焦元素;确定模块, 用于将筛选出的可聚焦元素作为所述触摸屏的第一可聚焦元素。Optionally, the device further includes: a screening module, configured to filter, from the focusable elements of all the labels of the webpage, the focusable elements located in the preset feature set; the determining module, Used to use the filtered focusable element as the first focusable element of the touch screen.
在本发明实施例中,还提供了一种计算机存储介质,该计算机存储介质可以存储有执行指令,该执行指令用于执行上述实施例中的页面响应方法的实现。In the embodiment of the present invention, a computer storage medium is further provided, and the computer storage medium may store an execution instruction for executing the implementation of the page response method in the foregoing embodiment.
通过本发明实施例,将页面中的触摸屏事件的注册转换为按键事件的注册;在页面加载完成后,获取网页中应用于触摸屏的第一可聚焦元素,并将所述第一可聚焦元素转换为应用于按键的第二可聚焦元素,进而通过所述按键事件触发对所述第二可聚焦元素的响应操作的技术方案,解决相关技术中对于带有物理键的手机,无法使用物理键的按键事件对基于触摸屏的网页进行浏览的问题,进而实现了即使用户使用的是仅有物理键的低端手机,仍然能够对目前市场上绝大部分的基于触摸屏的页面进行响应,大大提高了用户体验。Through the embodiment of the present invention, the registration of the touch screen event in the page is converted into the registration of the key event; after the page loading is completed, the first focusable element applied to the touch screen in the webpage is acquired, and the first focusable element is converted For the second focusable element applied to the button, and then the technical solution for triggering the response operation to the second focusable element by the button event, solving the related art for the mobile phone with the physical key, the physical key cannot be used. The button event is used to browse the touch screen-based webpage, thereby realizing that even if the user uses a low-end mobile phone with only physical keys, it can still respond to most of the touch screen-based pages on the market, greatly improving the user. Experience.
附图说明DRAWINGS
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:The drawings described herein are intended to provide a further understanding of the invention, and are intended to be a part of the invention. In the drawing:
图1是根据本发明实施例的页面响应方法的流程图;1 is a flowchart of a page response method according to an embodiment of the present invention;
图2是根据本发明实施例的页面响应装置的结构框图;2 is a block diagram showing the structure of a page response apparatus according to an embodiment of the present invention;
图3是根据本发明实施例的页面响应装置的转换模块20的结构框图;FIG. 3 is a structural block diagram of a conversion module 20 of a page response apparatus according to an embodiment of the present invention; FIG.
图4是根据本发明实施例的页面响应装置的另一结构框图;4 is a block diagram showing another structure of a page response apparatus according to an embodiment of the present invention;
图5为根据本发明优选实施例1的总体结构框图;Figure 5 is a block diagram showing the overall structure of a preferred embodiment 1 of the present invention;
图6为根据本发明优选实施例1的触摸屏事件注册转换主要处理流程图;6 is a flowchart of main processing of touch screen event registration conversion according to a preferred embodiment 1 of the present invention;
图7为根据本发明优选实施例1的方向键在网页中导航时捕获可聚焦元素的主要处理流程图。 7 is a flow chart showing the main processing of capturing a focusable element when a direction key of a preferred embodiment 1 is navigated in a web page according to the preferred embodiment of the present invention.
具体实施方式detailed description
下文中将参考附图并结合实施例来详细说明本发明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。The invention will be described in detail below with reference to the drawings in conjunction with the embodiments. It should be noted that the embodiments in the present application and the features in the embodiments may be combined with each other without conflict.
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。It is to be understood that the terms "first", "second" and the like in the specification and claims of the present invention are used to distinguish similar objects, and are not necessarily used to describe a particular order or order.
在本实施例中提供了一种页面响应方法,图1是根据本发明实施例的页面响应方法的流程图,如图1所示,该流程包括如下步骤:A page response method is provided in this embodiment. FIG. 1 is a flowchart of a page response method according to an embodiment of the present invention. As shown in FIG. 1 , the process includes the following steps:
步骤S102,在页面加载过程中,将页面中的触摸屏事件的注册转换为按键事件的注册;Step S102, in the page loading process, converting the registration of the touch screen event in the page into the registration of the button event;
步骤S104,在页面加载完成后,获取网页中应用于触摸屏的第一可聚焦元素,并将第一可聚焦元素转换为应用于按键的第二可聚焦元素;Step S104, after the page loading is completed, acquiring a first focusable element applied to the touch screen in the webpage, and converting the first focusable element into a second focusable element applied to the button;
步骤S106,通过按键事件触发对第二可聚焦元素的响应操作。Step S106, triggering a response operation to the second focusable element by a button event.
通过上述各个步骤,将页面中的触摸屏事件的注册转换为按键事件的注册;在页面加载完成后,获取网页中应用于触摸屏的第一可聚焦元素,并将第一可聚焦元素转换为应用于按键的第二可聚焦元素,进而通过按键事件触发对第二可聚焦元素的响应操作的技术方案,解决相关技术中对于带有物理键的手机,无法使用物理键的按键事件对基于触摸屏的网页进行浏览的问题,进而实现了即使用户使用的是仅有物理键的低端手机,仍然能够对目前市场上绝大部分的基于触摸屏的页面进行响应,大大提高了用户体验。Through the above steps, the registration of the touch screen event in the page is converted into the registration of the key event; after the page loading is completed, the first focusable element applied to the touch screen in the webpage is acquired, and the first focusable element is converted into the application. The second focusable element of the button, and then the technical solution for triggering the response operation of the second focusable element by the button event, solving the related art technology for the mobile phone with the physical key, the button event of the physical key cannot be used for the touch screen based webpage The problem of browsing enables the user to respond to most of the current touch screen-based pages on the market, even if the user uses a low-end mobile phone with only physical keys, which greatly improves the user experience.
对于步骤S102可以有多种实现方式,在本发明实施例的一个可选示例中,将页面中的触摸屏事件的注册转换为按键事件的注册可以通过以下方式实现:当监测到页面进行事件事务注册,判断事件事务注册是否为触摸屏事件的注册;如果是,则停止当前的事件事务注册过程,将按键事件的注册加载事件事务注册中,即对于页面加载过程中触摸屏事件的注册,统一转换为按键事件的注册,使得后续的按键事件才能够被响应。 There may be multiple implementations for step S102. In an optional example of the embodiment of the present invention, converting the registration of the touch screen event in the page to the registration of the key event may be implemented by: when the page is monitored for event transaction registration. Whether the event transaction registration is a registration of the touch screen event; if yes, the current event transaction registration process is stopped, and the registration of the key event is registered in the event transaction registration, that is, the registration of the touch screen event during the page loading process is uniformly converted into a button. The registration of the event enables subsequent key events to be responded to.
在本发明实施例中,通过以下方式判断事件事务注册是否为触摸屏事件的注册:In the embodiment of the present invention, it is determined whether the event transaction registration is a registration of a touch screen event by:
预先需要设定一个特征集,在这个特征集中包括了所有可能存在的触摸屏事件,当然特征集的内容是可以根据需要实时更新的,如果在预先设置的特征集中存在当然正在执行的事件事务注册,则说明该事件事务注册为触摸屏事件注册,如果在这个特征集中没有,则判定事件事务注册为按键事件的注册,当然实际情况中有可能在特征集中不存在的事件事务注册,有可能并不是按键事件,在此说明其也在本发明实施例的保护范围内。It is necessary to set a feature set in advance, and all possible touch screen events are included in the feature set. Of course, the content of the feature set can be updated in real time as needed. If there is an event transaction registration that is of course being executed in a preset feature set, It indicates that the event transaction is registered as a touch screen event registration. If there is no feature set in this feature set, it is determined that the event transaction is registered as a registration of a button event. Of course, in actual circumstances, it is possible to register an event transaction that does not exist in the feature set, and may not be a button. The event, which is described herein, is also within the scope of the embodiments of the present invention.
可选地,获取网页中应用于触摸屏的第一可聚焦元素之前,上述方法还包括:从网页的所有标签的可聚焦元素中筛选出位于预先设定的特征集中的可聚焦元素;将筛选出的可聚焦元素作为触摸屏的第一可聚焦元素,即同样还是根据预先设定的特征集从网页中的所有标签的可聚焦元素中筛选出位于特征集的可聚焦元素。Optionally, before acquiring the first focusable element applied to the touch screen in the webpage, the method further includes: filtering out the focusable elements located in the preset feature set from the focusable elements of all the labels of the webpage; The focusable element is the first focusable element of the touch screen, that is, the focusable element located in the feature set is also filtered out from the focusable elements of all the labels in the webpage according to the preset feature set.
特征集中至少包括:触摸屏事件所指示的手势事件,第一可聚焦元素的属性特征,其中,属性特征包括:响应事件的关键信息。The feature set includes at least: a gesture event indicated by the touch screen event, an attribute feature of the first focusable element, wherein the attribute feature includes: key information in response to the event.
进一步地,在预定时间到来时,对特征集进行更新。Further, the feature set is updated when the predetermined time comes.
综上所述,浏览器支持按键在网页中导航浏览最关键是需要捕获网页中的可聚焦元素,但以往的方法只能检测常规的可聚焦元素(如有网址链接的A标签、可输入INPUT标签、具有注册键盘点击事件响应的其他标签等),而对当前大量触摸屏网页中的可聚焦元素则无能为力。本发明实施例的技术方案根据触摸屏中可聚焦元素的特征,提出了一种基于元素触摸事件和属性特征集的方法来聚焦和处理触摸屏网页的元素,从而可以在各种网页上都可以正常地使用按键浏览,突破了传统按键机无法访问触摸屏网页的瓶颈问题,具有很高的技术价值和商用价值。In summary, the browser supports button navigation in the webpage. The most important thing is to capture the focusable elements in the webpage. However, the previous method can only detect the regular focusable elements (such as the A-tag with the URL link, you can input INPUT). Labels, other tags with registered keyboard click event responses, etc., can't do anything about the focusable elements in a large number of touchscreen web pages. The technical solution of the embodiment of the present invention proposes a method based on an element touch event and a feature feature set to focus and process an element of a touch screen webpage according to the feature of the focusable element in the touch screen, so that the webpage can be normally used on various webpages. The use of button browsing breaks through the bottleneck problem that the traditional button machine cannot access the touch screen webpage, and has high technical value and commercial value.
对于包含有本发明实施例提到触摸手势事件和属性特征的触摸屏测试网页放在服务器上通过对比浏览器来访问,如果可以通过键盘能在该网页上进行正常的导航操作,即在本发明的保护范围内。 The touch screen test webpage including the touch gesture event and the attribute feature mentioned in the embodiment of the present invention is accessed on the server by comparing the browser, and if the normal navigation operation can be performed on the webpage through the keyboard, that is, in the present invention Within the scope of protection.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases, the former is A better implementation. Based on such understanding, the technical solution of the present invention, which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk, The optical disc includes a number of instructions for causing a terminal device (which may be a cell phone, a computer, a server, or a network device, etc.) to perform the methods of various embodiments of the present invention.
实施例2Example 2
在本实施例中还提供了一种页面响应装置,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。In the embodiment, a page response device is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and details are not described herein. As used below, the term "module" may implement a combination of software and/or hardware of a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware, is also possible and contemplated.
图2是根据本发明实施例的页面响应装置的结构框图,如图2所示,该装置包括:2 is a structural block diagram of a page response apparatus according to an embodiment of the present invention. As shown in FIG. 2, the apparatus includes:
转换模块20,设置为在页面加载过程中,将页面中的触摸屏事件的注册转换为按键事件的注册;The conversion module 20 is configured to convert the registration of the touch screen event in the page into the registration of the button event during the page loading process;
获取模块22,设置为在页面加载完成后,获取网页中应用于触摸屏的第一可聚焦元素,并将第一可聚焦元素转换为应用于按键的第二可聚焦元素;The obtaining module 22 is configured to: after the page loading is completed, acquire a first focusable element applied to the touch screen in the webpage, and convert the first focusable element into a second focusable element applied to the button;
触发模块24,设置为通过按键事件触发对第二可聚焦元素的响应操作。The triggering module 24 is configured to trigger a response operation to the second focusable element by a button event.
通过上述各个模块的综合作用,将页面中的触摸屏事件的注册转换为按键事件的注册;在页面加载完成后,获取网页中应用于触摸屏的第一可聚焦元素,并将第一可聚焦元素转换为应用于按键的第二可聚焦元素,进而通过按键事件触发对第二可聚焦元素的响应操作的技术方案,解决相关技术中对于带有物理键的手机,无法使用物理键的按键事件对基于触摸屏 的网页进行浏览的问题,进而实现了即使用户使用的是仅有物理键的低端手机,仍然能够对目前市场上绝大部分的基于触摸屏的页面进行响应,大大提高了用户体验。Through the comprehensive function of each module described above, the registration of the touch screen event in the page is converted into the registration of the key event; after the page loading is completed, the first focusable element applied to the touch screen in the webpage is acquired, and the first focusable element is converted. For the second focusable element applied to the button, and then the technical solution for triggering the response operation to the second focusable element by the button event, solving the related art for the mobile phone with the physical key, the button event pair that cannot use the physical key is based on touch screen The problem of browsing the webpage further realizes that even if the user uses a low-end mobile phone with only physical keys, it can still respond to most of the touch screen-based pages currently on the market, greatly improving the user experience.
图3是根据本发明实施例的页面响应装置的转换模块20的结构框图,如图3所示,转换模块20,包括:判断单元200,设置为当监测到页面进行事件事务注册,判断事件事务注册是否为触摸屏事件的注册;停止单元202,设置为在事件事务注册为触摸屏事件的注册时,停止当前的事件事务注册过程;加载单元204,设置为将按键事件的注册加载事件事务注册中。FIG. 3 is a structural block diagram of a conversion module 20 of a page response apparatus according to an embodiment of the present invention. As shown in FIG. 3, the conversion module 20 includes: a determining unit 200 configured to perform event transaction registration when a page is detected, and determine an event transaction. Whether the registration is a registration of a touch screen event; the stopping unit 202 is configured to stop the current event transaction registration process when the event transaction is registered as a registration of the touch screen event; the loading unit 204 is configured to register the registration event event of the key event.
可选地,判断单元200,还设置为判断在预先设置的特征集中是否存在事件事务注册;如果有,则判定事件事务注册为触摸屏事件的注册;如果无,则判定事件事务注册为按键事件的注册。Optionally, the determining unit 200 is further configured to determine whether an event transaction registration exists in the preset feature set; if yes, determine that the event transaction is registered as a registration of the touch screen event; if not, determine that the event transaction is registered as a key event registered.
图4是根据本发明实施例的页面响应装置的另一结构框图,如图4所示:上述装置还包括:筛选模块26,设置为从网页的所有标签的可聚焦元素中筛选出位于预先设定的特征集中的可聚焦元素;确定模块28,设置为将筛选出的可聚焦元素作为触摸屏的第一可聚焦元素。4 is a block diagram of another structure of a page response apparatus according to an embodiment of the present invention. As shown in FIG. 4, the apparatus further includes: a screening module 26 configured to filter out the pre-sets of the focusable elements of all the labels of the webpage. A focusable element in the set of features; a determination module 28 configured to use the filtered focusable element as the first focusable element of the touch screen.
以下结合优选实施例对上述技术方案中页面响应方法进行说明,但不用于限定本发明实施例。The page response method in the above technical solution is described below in conjunction with the preferred embodiment, but is not intended to limit the embodiments of the present invention.
优选实施例1Preferred embodiment 1
本发明优选实施例1提高的装置可以理解为主要由六部分组成,图5为根据本发明优选实施例1的总体结构框图,如图5所示,包括:主控模块50、聚焦元素捕获模块52、触摸屏事件转换模块54、聚焦导航模块56、特征集查询模块58、特征集更新模块60。其中各核心模块的的作用大概描述如下:The apparatus for improving the preferred embodiment 1 of the present invention can be understood to be mainly composed of six parts. FIG. 5 is a block diagram showing the overall structure of a preferred embodiment 1 according to the present invention. As shown in FIG. 5, the main control module 50 and the focus element capturing module are included. 52. The touch screen event conversion module 54, the focus navigation module 56, the feature set query module 58, and the feature set update module 60. The role of each core module is roughly described as follows:
聚焦元素捕获模块52(相当于上述实施例的获取模块22)除了捕获常规聚焦属性的元素(如有网址链接的A标签、可输入INPUT标签、具有注册键盘点击事件响应的其他标签等)外,还需捕获根据特征集查询系统 确定触摸屏上的可聚焦元素;The focus element capture module 52 (corresponding to the acquisition module 22 of the above embodiment), in addition to capturing elements of a conventional focus attribute (such as an A-tag with a URL link, an INPUT tag, another tag with a registered keyboard click event response, etc.), Also need to capture the query system based on feature set Determining the focusable elements on the touch screen;
触摸屏事件转换模块54(相当于上述实施例的转换模块20)也是根据特征集查询系统将触摸屏网页的触摸事件注册转换为键盘事件注册,这样以往只有触摸事件触发的响应可以由键盘事件来替代触发;The touch screen event conversion module 54 (corresponding to the conversion module 20 of the above embodiment) also converts the touch event registration of the touch screen webpage into a keyboard event registration according to the feature set query system, so that only the response triggered by the touch event can be triggered by the keyboard event instead. ;
聚焦导航模块56就是在手机方向键触发的时候,顺着该方向上去聚焦的下一个离当前网页中聚焦元素最近的可聚焦元素;The focus navigation module 56 is the next focusable element that is closest to the focused element in the current web page in the direction when the mobile phone direction key is triggered;
特征集查询模块58包含了触摸屏事件的查询和触摸屏可聚焦元素的属性特征查询。触摸屏事件主要指只能在触摸屏上触发的手势事件,查询网页注册的事件是否属于触摸屏事件以便确定转化为按键事件的注册。触摸屏可聚焦元素的属性特征是指虽然一些元素不具有常规聚焦特征(A标签、INPUT标签、具有注册键盘确认事件响应),但该元素的一些属性字段里包含响应事件处理的关键信息,这些属性字段就组成了触摸屏可聚焦元素的属性特征集(如data-src、data-href、data-url、data-target等)。虽然这些元素没有直接注册事件处理,但当触摸屏网页上有事件发生时,网页会根据事件发生对应元素的属性去动态构造该元素需要处理的事务。所以有了这个属性特征集,就可判断触摸屏上可聚焦的元素;The feature set query module 58 includes a query of touch screen events and an attribute feature query of the touch screen focusable elements. The touch screen event mainly refers to a gesture event that can only be triggered on the touch screen, and whether the event registered by the web page belongs to a touch screen event to determine the registration converted into a button event. The attribute feature of the touch screen focusable element means that although some elements do not have regular focus features (A-tag, INPUT tag, with registered keyboard confirmation event response), some attribute fields of the element contain key information for response event processing, these attributes. The fields form the attribute feature set of the touch screen focusable elements (such as data-src, data-href, data-url, data-target, etc.). Although these elements are not directly registered for event processing, when an event occurs on a touch screen web page, the web page dynamically constructs the transaction that the element needs to process based on the attributes of the corresponding element in the event. So with this attribute feature set, you can determine the elements that can be focused on the touch screen;
特征集更新模块60主要考虑到除了预置最常见的触摸屏可聚焦元素包含的与事件处理有关联的属性字段外,一些网页还会出现其他与事件处理有关联属性字段。所以需要随时能自动更新这个特征集,以便尽可能包含所有触摸屏网页上与事件处理有关联的属性字段;The feature set update module 60 mainly considers that in addition to the attribute fields associated with the event processing included in the most common touch screen focusable elements, some web pages may also have other attribute fields associated with the event processing. Therefore, it is necessary to automatically update this feature set at any time in order to include as much as possible the attribute fields associated with event processing on all touch screen web pages;
本发明优选实施例1提供了一种在浏览器中基于触摸屏网页可聚焦元素特征集在触摸屏网页上通过按键进行导航浏览的方法。如图5所示是本实施例提供的按键网页导航方法的总体结构示意图,在该结构中包括了主控模块50、聚焦元素捕获模块52、触摸屏事件转换模块54、聚焦导航模块56、特征集查询模块58、特征集更新模块60。从图5中可以看出,在网页加载过程中主控模块50会启动触摸屏事件转换模块54将网页触摸屏事件的注册转换为按键确认事件的注册。当用户按下方向键时主控模块50 又会启动聚焦导航模块56在网页中进行导航,其导航过程中最关键的聚焦元素检测步骤主要是该模块通过另一个聚焦元素捕获模块52来捕获网页中有聚焦属性的元素。以上触摸屏事件转换模块54和聚焦元素捕获模块52都是依赖特征集查询模块58来查找对应的特征来分别进行触摸屏事件转换和触摸屏聚焦元素检测的处理。该特征集查询模块58中的特征数据则是主控模块50定时通过特征集更新模块60来对这些特征进行在线更新的。在本发明优选实施例中涉及到特征集的更新和捕获到可聚焦元素后进行聚焦处理都是常规方法,这里不再详细描述。下面重点详细描述两个关键技术处理步骤即触摸屏事件注册转换和触摸屏聚焦元素检测。A preferred embodiment 1 of the present invention provides a method for navigating through a button on a touch screen web page based on a touch screen web page focusable element feature set in a browser. FIG. 5 is a schematic diagram of an overall structure of a button webpage navigation method provided by the embodiment, and includes a main control module 50, a focus element capture module 52, a touch screen event conversion module 54, a focus navigation module 56, and a feature set. The query module 58 and the feature set update module 60. As can be seen from FIG. 5, during the web page loading process, the main control module 50 activates the touch screen event conversion module 54 to convert the registration of the web page touch screen event into a registration of the key confirmation event. The main control module 50 when the user presses the direction key The focus navigation module 56 is again activated to navigate through the web page. The most critical focus element detection step in the navigation process is mainly that the module captures the elements of the web page with the focus attribute through another focus element capture module 52. The above touch screen event conversion module 54 and focus element capture module 52 both rely on the feature set query module 58 to find corresponding features to perform touch screen event conversion and touch screen focus element detection, respectively. The feature data in the feature set query module 58 is that the master module 50 periodically updates the features through the feature set update module 60. In the preferred embodiment of the invention, the updating of the feature set and the focus processing after capturing the focusable elements are conventional methods and will not be described in detail herein. The following focuses on two key technical processing steps, touch screen event registration conversion and touch screen focus element detection.
图6为根据本发明优选实施例1的触摸屏事件注册转换主要处理流程图,如图6所示,包括步骤如下:6 is a flowchart of main processing of touch screen event registration conversion according to a preferred embodiment 1 of the present invention. As shown in FIG. 6, the steps are as follows:
步骤S602:在网页加载阶段或其他互动阶段,监测网页进行事件事务注册;Step S602: monitoring the webpage for event transaction registration during the webpage loading phase or other interaction phase;
步骤S604:在特征集查询模块中判断该事件是否属于触摸屏事件。该特征集中主要包含有touchstart、touchend、mousedown、mouseup等,这些都可以通过更新模块不断更新和补充。如果该事件不属于触摸屏事件,则进入步骤S608处理,否则进入下一步骤S606处理;Step S604: Determine whether the event belongs to a touch screen event in the feature set query module. The feature set mainly includes touchstart, touchend, mousedown, mouseup, etc., which can be continuously updated and supplemented by the update module. If the event does not belong to the touch screen event, proceed to step S608, otherwise proceed to the next step S606;
步骤S606:取得该事件对应的注册事务,将按键确认事件注册到该事务中,即网页上有按键确认事件发生时即会处理该事务;Step S606: Acquire a registration transaction corresponding to the event, and register a button confirmation event into the transaction, that is, the transaction is processed when a button confirmation event occurs on the webpage;
步骤S608:将该事件按照原有注册流程进行事件的事务注册;Step S608: registering the event according to the original registration process;
在不影响原来触摸事件的处理流程外,通过以上这个步骤处理主要可取得两个好处:一是那些只注册了触摸事件没有注册按键确认事件的元素就可以被当作可聚焦元素从而在按键导航中可以被聚焦,二是按键确认事件发生时,原来触摸事件希望触发的事务同样也可以发生。In addition to the processing flow of the original touch event, the above steps can mainly achieve two advantages: First, those elements that only register the touch event without registering the button confirmation event can be regarded as the focusable element and thus navigated on the button. The middle can be focused, and the second is that when the button confirms that the event occurs, the transaction that the original touch event wishes to trigger can also occur.
图7为根据本发明优选实施例1的方向键在网页中导航时捕获可聚焦元素的主要处理流程图,如图7所示,主要包括步骤如下:FIG. 7 is a flowchart of main processes for capturing a focusable element when a direction key is navigated in a webpage according to a preferred embodiment of the present invention. As shown in FIG. 7, the main steps are as follows:
步骤S702:当用户按下方向键开始在网页中进行导航时,首先遍历网 页DOM树中的各个元素节点;Step S702: When the user presses the direction key to start navigation in the webpage, first traverse the network Individual element nodes in the page DOM tree;
判断S704:判断该元素节点是否属于常规可聚焦节点,如果该元素节点属常规可聚焦节点,则进入步骤S712处理,否则进入下一步骤S706处理。判断是否是常规可聚焦节点的主要条件是该元素是A标签或INPUT标签或在该元素上具有注册键盘确认事件的事务注册;Decision S704: determining whether the element node belongs to a conventional focusable node, and if the element node is a conventional focusable node, proceeding to step S712, otherwise proceeding to the next step S706. The primary condition for determining whether it is a regular focusable node is that the element is an A-tag or an INPUT tag or a transaction registration with a registered keyboard confirmation event on the element;
判断S706:判断该元素节点的祖先节点是否具有注册键盘确认事件的事务注册,如果不具有则进入步骤S710处理,否则进入下一步骤S708处理。这一步骤的判断主要是考虑触摸屏网页是将多个元素的事件响应统一注册在一个祖先节点上;Decision S706: determining whether the ancestor node of the element node has a transaction registration registering a keyboard confirmation event, if not, proceeding to step S710, otherwise proceeding to the next step S708. The judgment of this step is mainly to consider that the touch screen webpage is to uniformly register the event response of multiple elements on an ancestor node;
步骤S708:依次将特征集查询模块中的每一个触摸屏可聚焦元素的属性特征字段作为该元素的属性字段进行查找,若满足对应的该元素属性有一个不为空,则进入步骤S712处理,否则进入下一步骤S710处理。触摸屏可聚焦元素的属性特征字段主要包含有href、url、data-src、data-href、data-url、data-target等,这些特征字段都可以通过更新模块不断更新和补充;Step S708: The attribute feature field of each touch screen focusable element in the feature set query module is sequentially searched as the attribute field of the element. If one of the corresponding element attributes is not empty, the process proceeds to step S712, otherwise Go to the next step S710 for processing. The attribute feature field of the touch screen focusable element mainly includes href, url, data-src, data-href, data-url, data-target, etc., and these feature fields can be continuously updated and supplemented by the update module;
步骤S710:在DOM树中取得下一个元素节点再重新进入步骤S702中处理;Step S710: Obtain the next element node in the DOM tree and then re-enter the process in step S702;
步骤S712:将该元素节点列入可聚焦元素处理,即在导航处理模块中再去根据该元素离当前焦点元素的位置判断是否要聚焦到该元素。本流程结束。Step S712: The element node is included in the focusable element processing, that is, in the navigation processing module, it is determined whether to focus on the element according to the position of the element from the current focus element. This process ends.
通过以上这个步骤处理则触摸屏网页上那些不具有常规聚焦属性的元素只有聚焦需要都可以在按键导航中被检测出来从而完成该元素的聚焦处理。Through the above steps, those elements on the touch screen webpage that do not have the normal focus attribute can be detected in the button navigation to complete the focus processing of the element only if the focus is needed.
综上所述,本发明实施例达到了以下技术效果:解决相关技术中对于带有物理键的手机,无法使用物理键的按键事件对基于触摸屏的网页进行浏览的问题,进而实现了即使用户使用的是仅有物理键的低端手机,仍然能够对目前市场上绝大部分的基于触摸屏的页面进行响应,大大提高了用 户体验。In summary, the embodiment of the present invention achieves the following technical effects: solving the problem that the touch screen-based webpage cannot be browsed by the button event of the physical key for the mobile phone with the physical key in the related art, thereby realizing even the user to use The low-end mobile phone with only physical keys can still respond to most of the touch screen-based pages on the market, greatly improving the use. User experience.
本发明的实施例还提供了一种存储介质。可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的程序代码:Embodiments of the present invention also provide a storage medium. Optionally, in the embodiment, the foregoing storage medium may be configured to store program code for performing the following steps:
S1,在页面加载过程中,将页面中的触摸屏事件的注册转换为按键事件的注册;S1, during the page loading process, converting the registration of the touch screen event in the page into the registration of the button event;
S2,在页面加载完成后,获取网页中应用于触摸屏的第一可聚焦元素,并将第一可聚焦元素转换为应用于按键的第二可聚焦元素;S2, after the page loading is completed, acquiring a first focusable element applied to the touch screen in the webpage, and converting the first focusable element into a second focusable element applied to the button;
S3,通过按键事件触发对第二可聚焦元素的响应操作。S3, triggering a response operation to the second focusable element by a button event.
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。Optionally, in this embodiment, the foregoing storage medium may include, but not limited to, a USB flash drive, a Read-Only Memory (ROM), a Random Access Memory (RAM), a mobile hard disk, and a magnetic memory. A variety of media that can store program code, such as a disc or a disc.
可选地,本实施例中的具体示例可以参考上述实施例及可选实施方式中所描述的示例,本实施例在此不再赘述。For example, the specific examples in this embodiment may refer to the examples described in the foregoing embodiments and the optional embodiments, and details are not described herein again.
显然,本领域的技术人员应该明白,上述的本发明的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。It will be apparent to those skilled in the art that the various modules or steps of the present invention described above can be implemented by a general-purpose computing device that can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein. The steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps thereof are fabricated as a single integrated circuit module. Thus, the invention is not limited to any specific combination of hardware and software.
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。 The above description is only the preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes can be made to the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and scope of the present invention are intended to be included within the scope of the present invention.
工业实用性Industrial applicability
通过本发明实施例,将页面中的触摸屏事件的注册转换为按键事件的注册;在页面加载完成后,获取网页中应用于触摸屏的第一可聚焦元素,并将所述第一可聚焦元素转换为应用于按键的第二可聚焦元素,进而通过所述按键事件触发对所述第二可聚焦元素的响应操作的技术方案,解决相关技术中对于带有物理键的手机,无法使用物理键的按键事件对基于触摸屏的网页进行浏览的问题,进而实现了即使用户使用的是仅有物理键的低端手机,仍然能够对目前市场上绝大部分的基于触摸屏的页面进行响应,大大提高了用户体验。 Through the embodiment of the present invention, the registration of the touch screen event in the page is converted into the registration of the key event; after the page loading is completed, the first focusable element applied to the touch screen in the webpage is acquired, and the first focusable element is converted For the second focusable element applied to the button, and then the technical solution for triggering the response operation to the second focusable element by the button event, solving the related art for the mobile phone with the physical key, the physical key cannot be used. The button event is used to browse the touch screen-based webpage, thereby realizing that even if the user uses a low-end mobile phone with only physical keys, it can still respond to most of the touch screen-based pages on the market, greatly improving the user. Experience.

Claims (10)

  1. 一种页面响应方法,包括:A page response method, including:
    在页面加载过程中,将页面中的触摸屏事件的注册转换为按键事件的注册;During the page loading process, the registration of the touch screen event in the page is converted into the registration of the button event;
    在页面加载完成后,获取网页中应用于触摸屏的第一可聚焦元素,并将所述第一可聚焦元素转换为应用于按键的第二可聚焦元素;After the page loading is completed, acquiring a first focusable element applied to the touch screen in the webpage, and converting the first focusable element into a second focusable element applied to the button;
    通过所述按键事件触发对所述第二可聚焦元素的响应操作。A response operation to the second focusable element is triggered by the button event.
  2. 根据权利要求1所述的方法,其中,将页面中的触摸屏事件的注册转换为按键事件的注册,包括:The method of claim 1 wherein converting the registration of the touch screen event in the page to the registration of the key event comprises:
    当监测到所述页面进行事件事务注册,判断所述事件事务注册是否为触摸屏事件的注册;When the page is monitored for event transaction registration, it is determined whether the event transaction registration is a registration of a touch screen event;
    如果是,则停止当前的事件事务注册过程,将所述按键事件的注册加载所述事件事务注册中。If so, the current event transaction registration process is stopped and the registration of the key event is loaded into the event transaction registration.
  3. 根据权利要求2所述的方法,其中,判断所述事件事务注册是否为触摸屏事件的注册,包括:The method of claim 2, wherein determining whether the event transaction registration is a registration of a touch screen event comprises:
    判断在预先设置的特征集中是否存在所述事件事务注册;Determining whether the event transaction registration exists in a preset feature set;
    如果有,则判定所述事件事务注册为触摸屏事件的注册;If so, determining that the event transaction is registered as a registration of a touch screen event;
    如果无,则判定所述事件事务注册为按键事件的注册。If not, it is determined that the event transaction is registered as a registration of a button event.
  4. 根据权利要求1所述的方法,其中,获取网页中应用于触摸屏的第一可聚焦元素之前,所述方法还包括:The method of claim 1, wherein before acquiring the first focusable element applied to the touch screen in the webpage, the method further comprises:
    从所述网页的所有标签的可聚焦元素中筛选出位于预先设定的特征集中的可聚焦元素; Filtering the focusable elements located in a preset feature set from the focusable elements of all the labels of the webpage;
    将筛选出的可聚焦元素作为所述触摸屏的第一可聚焦元素。The filtered focusable element is used as the first focusable element of the touch screen.
  5. 根据权利要求3或4所述的方法,其中,The method according to claim 3 or 4, wherein
    所述特征集中至少包括:触摸屏事件所指示的手势事件,所述第一可聚焦元素的属性特征,其中,所述属性特征包括:响应事件的关键信息。The feature set includes at least: a gesture event indicated by the touch screen event, an attribute feature of the first focusable element, wherein the attribute feature includes: key information in response to the event.
  6. 根据权利要求3或4所述所述的方法,其中,在预定时间到来时,对所述特征集进行更新。The method according to claim 3 or 4, wherein the feature set is updated when a predetermined time comes.
  7. 一种页面响应装置,包括:A page response device comprising:
    转换模块,设置为在页面加载过程中,将页面中的触摸屏事件的注册转换为按键事件的注册;The conversion module is configured to convert the registration of the touch screen event in the page into the registration of the key event during the page loading process;
    获取模块,设置为在页面加载完成后,获取网页中应用于触摸屏的第一可聚焦元素,并将所述第一可聚焦元素转换为应用于按键的第二可聚焦元素;Obtaining a module, configured to: after the page loading is completed, acquire a first focusable element applied to the touch screen in the webpage, and convert the first focusable element into a second focusable element applied to the button;
    触发模块,设置为通过所述按键事件触发对所述第二可聚焦元素的响应操作。A triggering module is configured to trigger a response operation to the second focusable element by the button event.
  8. 根据权利要求7所述的装置,其中,所述转换模块,包括:The apparatus of claim 7, wherein the conversion module comprises:
    判断单元,设置为当监测到所述页面进行事件事务注册,判断所述事件事务注册是否为触摸屏事件的注册;a determining unit, configured to: when the page is monitored for event transaction registration, determine whether the event transaction registration is a registration of a touch screen event;
    停止单元,设置为在事件事务注册为触摸屏事件的注册时,停止当前的事件事务注册过程;Stop unit, set to stop the current event transaction registration process when the event transaction is registered as a registration of a touch screen event;
    加载单元,设置为将所述按键事件的注册加载所述事件事务注册中。 a load unit configured to load the registration of the key event into the event transaction registration.
  9. 根据权利要求8所述的装置,其中,所述判断单元,还设置为判断在预先设置的特征集中是否存在所述事件事务注册;如果有,则判定所述事件事务注册为触摸屏事件的注册;如果无,则判定所述事件事务注册为按键事件的注册。The apparatus according to claim 8, wherein the determining unit is further configured to determine whether the event transaction registration exists in a feature set set in advance; if yes, determine that the event transaction is registered as a registration of a touch screen event; If not, it is determined that the event transaction is registered as a registration of a button event.
  10. 根据权利要求7所述的装置,其中,所述装置还包括:The apparatus of claim 7 wherein said apparatus further comprises:
    筛选模块,设置为从所述网页的所有标签的可聚焦元素中筛选出位于预先设定的特征集中的可聚焦元素;a screening module configured to filter out focusable elements located in a preset feature set from focusable elements of all tags of the web page;
    确定模块,设置为将筛选出的可聚焦元素作为所述触摸屏的第一可聚焦元素。 A determining module is arranged to use the filtered focusable element as the first focusable element of the touch screen.
PCT/CN2016/101686 2016-04-20 2016-10-10 Page response method and device WO2017181619A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610247570.XA CN107306308B (en) 2016-04-20 2016-04-20 Page response method and device
CN201610247570.X 2016-04-20

Publications (1)

Publication Number Publication Date
WO2017181619A1 true WO2017181619A1 (en) 2017-10-26

Family

ID=60115551

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/101686 WO2017181619A1 (en) 2016-04-20 2016-10-10 Page response method and device

Country Status (2)

Country Link
CN (1) CN107306308B (en)
WO (1) WO2017181619A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111625169B (en) * 2020-05-28 2022-04-15 海信电子科技(深圳)有限公司 Method for browsing webpage by remote controller and display equipment
CN114153536B (en) * 2021-11-12 2024-04-09 华东计算技术研究所(中国电子科技集团公司第三十二研究所) Web page focus control method and system compatible with physical keys of touch screen

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101980191A (en) * 2010-10-14 2011-02-23 优视科技有限公司 Method and device for locking focus element in webpage browsing process
CN103049193A (en) * 2012-12-26 2013-04-17 广东欧珀移动通信有限公司 Method and device for implementing webpage turning by keys

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103309483B (en) * 2012-03-12 2017-03-01 联想(北京)有限公司 A kind of electronic equipment and touch information input method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101980191A (en) * 2010-10-14 2011-02-23 优视科技有限公司 Method and device for locking focus element in webpage browsing process
CN103049193A (en) * 2012-12-26 2013-04-17 广东欧珀移动通信有限公司 Method and device for implementing webpage turning by keys

Also Published As

Publication number Publication date
CN107306308A (en) 2017-10-31
CN107306308B (en) 2021-01-26

Similar Documents

Publication Publication Date Title
US9330179B2 (en) Configuring web crawler to extract web page information
CA2684822C (en) Data transformation based on a technical design document
US8799353B2 (en) Scope-based extensibility for control surfaces
WO2015039566A1 (en) Method and system for facilitating automated web page testing
US20120310914A1 (en) Unified Crawling, Scraping and Indexing of Web-Pages and Catalog Interface
CN102799372B (en) A kind of method for uploading of pictorial information and upload device
JP6085897B2 (en) Method and system for causing a web application to acquire database changes
US20130275453A1 (en) Method and system for providing temporal search suggestions in real-time
WO2018018882A1 (en) Voice broadcast method and apparatus
WO2015043352A1 (en) Method and apparatus for selecting test nodes on webpages
TWI519980B (en) Method and device for displaying web page and computer-readable storage medium
WO2017181619A1 (en) Page response method and device
US10853438B1 (en) History state management
CN107145494A (en) A kind of method and device for browsing thumbnail in webpage
US20140337709A1 (en) Method and apparatus for displaying web page
CN104268246A (en) Method for generating instruction script for visiting websites and visiting method and device
JP5423149B2 (en) Browsing information collection system, browsing information collection method, server, and program
KR102365434B1 (en) Content search method and content search system
US9753901B1 (en) Identifying important document content using geometries of page elements
JP6729166B2 (en) Information processing device and program
US11921986B1 (en) System and method for web page navigation behavior
CN103425775A (en) Method and device for determining corresponding processing according to event collection correlated with webpages
JP2009176194A (en) Automatic teller machine
JP2017004208A (en) Test support device and test support method
JP5670377B2 (en) Web browsing history acquisition device and program

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16899204

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 16899204

Country of ref document: EP

Kind code of ref document: A1