WO2016107325A1 - Page resource loading method and device based on mobile terminal - Google Patents

Page resource loading method and device based on mobile terminal Download PDF

Info

Publication number
WO2016107325A1
WO2016107325A1 PCT/CN2015/095013 CN2015095013W WO2016107325A1 WO 2016107325 A1 WO2016107325 A1 WO 2016107325A1 CN 2015095013 W CN2015095013 W CN 2015095013W WO 2016107325 A1 WO2016107325 A1 WO 2016107325A1
Authority
WO
WIPO (PCT)
Prior art keywords
page
loaded
loading
application
switching direction
Prior art date
Application number
PCT/CN2015/095013
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 WO2016107325A1 publication Critical patent/WO2016107325A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures

Definitions

  • the present invention relates to the field of resource loading technologies, and in particular, to a method and device for loading a page resource based on a mobile terminal.
  • the scenario application is an application composed of a plurality of pages, and the page is developed by using a hypertext markup language HTML technology, and is suitable for use on a mobile terminal, and usually performs a page switch by a touch operation performed by the user on the mobile terminal, thereby The interaction is completed and is now often used for product promotion.
  • each picture uses a jpg format of about 100 kb, and if there are 10 pictures, it is equivalent to 1 M, and other pictures and other resources are generally 2 to 5 M.
  • the mobile terminal when the user browses the scenario application, the mobile terminal can completely perform page switching after the page in the entire scenario application is loaded, but if the mobile terminal is in a network with a slow network speed such as a 2G network or a 3G network.
  • the page load time of the mobile terminal is too long, which seriously affects the user experience.
  • the user does not necessarily browse all the pages in the scenario application, and still needs to load all the pages in the scenario application, and also on the user. Traffic is a waste.
  • the present invention has been made in order to provide a mobile terminal-based page resource loading method and a corresponding mobile terminal-based page resource loading device that overcome the above problems or at least partially solve the above problems.
  • a method for loading a page resource based on a mobile terminal includes:
  • a mobile terminal-based page resource loading apparatus includes:
  • An operation acquirer configured to acquire a touch operation of the user on the interface when the current page of the application is displayed in the interface, where the application program is composed of several pages;
  • a direction determining unit configured to determine a page switching direction of the application according to the touch operation
  • the loading trigger is adapted to determine a page to be loaded in the application according to the current page and page switching direction, and trigger resource loading of the page to be loaded.
  • a computer program comprising computer readable code that, when executed on a mobile terminal, causes the mobile terminal to perform the mobile terminal based Page resource loading method.
  • a computer readable medium wherein the computer program described above is stored.
  • FIG. 1 is a flow chart of steps of a method for loading a page resource based on a mobile terminal according to an embodiment of the present invention
  • FIG. 2 is a flow chart of steps of a method for loading a page resource based on a mobile terminal according to an embodiment of the present invention
  • FIG. 3 is a diagram showing an example of a page in a scenario application according to an embodiment of the present invention.
  • FIG. 4 is a diagram showing an example of a scenario application applied for the first time browsing according to an embodiment of the present invention
  • FIG. 5 is a diagram showing an example of switching a scene application from page 1 to page 2 according to an embodiment of the present invention
  • FIG. 6 is a diagram showing an example of switching a scene application from page 2 to page 3 in accordance with an embodiment of the present invention
  • FIG. 7 is a diagram showing an example of switching a scene application from page 2 to page 1 according to an embodiment of the present invention.
  • FIG. 8 is a diagram showing an example of switching a scene application from page 1 to page 1 in accordance with an embodiment of the present invention
  • FIG. 9 is a flowchart of steps of a method for loading a page resource based on a mobile terminal according to an embodiment of the present invention.
  • FIG. 10 is a structural block diagram of a page resource loading apparatus based on a mobile terminal according to an embodiment of the present invention.
  • FIG. 11 is a structural block diagram of a page resource loading apparatus based on a mobile terminal according to an embodiment of the present invention.
  • Figure 12 is a schematic block diagram showing a mobile terminal for performing the method according to the present invention.
  • Fig. 13 schematically shows a storage unit for holding or carrying program code implementing the method according to the invention.
  • FIG. 1 is a flowchart of steps of a method for loading a page resource based on a mobile terminal according to an embodiment of the present invention; referring to FIG. 1, the method includes:
  • S101 Acquire a touch operation of the user on the interface when the current page of the application is displayed in the interface, where the application is composed of several pages;
  • the interface is the display interface of the mobile terminal
  • the current page is the page currently displayed in the display interface of the mobile terminal
  • the application is the scenario application.
  • the correspondence between the touch operation and the page switching mode may be preset in the mobile terminal, and then the page switching direction of the application is determined according to the touch operation;
  • buttons are preset in the interface, and when the touch operation is clicking the first button, the page switching direction is determined to be positive (the Nth page is the current page, that is, the Nth page applied from the scene) Switching to the direction of page N+1), when the touch operation is to click the second button, it can be determined that the page fantasy direction is reversed (ie, switching from the Nth page of the scene application to the direction of the N-1th page) ;
  • step S102 may also use other manners to determine the page switching direction of the application, which is not limited in this embodiment.
  • S103 Determine a to-be-loaded page in the application according to the current page and page switching direction, and trigger resource loading of the to-be-loaded page.
  • the user performs a touch operation on the interface, determines a page switching direction of the application according to the touch operation, and determines a page to be loaded in the application according to the current page and the page switching direction.
  • the resource loading of the page to be loaded is triggered, which effectively shortens the loading time of the scenario application, improves the user experience, and does not need to load some pages that may not be browsed, thereby saving user traffic.
  • FIG. 2 is a flow chart of steps of a method for loading a page resource based on a mobile terminal according to an embodiment of the present invention; referring to FIG. 2, the method includes:
  • S201 Acquire a touch operation of the user on the interface when the current page of the application is displayed in the interface, where the application is composed of several pages;
  • steps S201 to S202 are the same as the steps S101 to S102 in the embodiment shown in FIG. 1 and will not be further described herein.
  • S203 Determine a to-be-displayed page in the application according to the current page and a page switching direction, and switch a current page displayed in the interface to the to-be-displayed page, where the application is from the current page. Starting the first unloaded page along the page switching direction as described The page to be loaded triggers resource loading of the page to be loaded.
  • the first application in the application is switched from the current page along the page switching direction.
  • the page is not loaded as the page to be loaded.
  • the initial page usually needs to include the first page of the scenario application, and at least one page adjacent to the scenario application is required. Since the user's usual browsing habits are viewed from the front to the back, the scene is set in this embodiment.
  • the first and second pages of the application are set as the initial page. Of course, other pages can also be set as the initial page.
  • the third page is also set as the initial page, or the last page is also set as the initial page. The embodiment does not limit this.
  • the on-demand loading of the user is implemented, and the next page to be browsed is predicted according to the current page and the page switching direction, and the resource of the page is loaded; the user does not need to load some page resources that may not be browsed in the future, and each time only Loading a page resource reduces the http request, effectively shortening the load time of the scenario application and improving the user experience.
  • the scene application is composed of several pages, referring to FIG. 3, the scene application can be regarded as a list, each of which acts as a page, and each page has many resources.
  • the touch operation of the user on the interface is obtained, and the page switching direction is determined to be positive according to the touch operation.
  • the to-be-loaded is determined.
  • the page is page 3, triggering the resource loading of page 3, and the current page is switched from page 1 to page 2;
  • the user After the resource loading on page 3 is completed, when the user needs to switch from the second page to the third page, the user performs a touch operation on the interface, and determines that the page switching direction is positive according to the touch operation. Referring to FIG. 6, it is determined that the page to be loaded is the fourth page, triggering the resource loading of the fourth page, and the current page is switched from the second page to the third page;
  • the user touches the touch operation on the interface, and determines the page switching according to the touch operation.
  • the direction is positive, thereby determining that the page to be loaded is the last page, triggering the resource loading of the last page, and the current page is switched from the third page to the second page of the last;
  • the touch operation of the user on the interface is obtained, and the page switching direction is determined to be reverse according to the touch operation. 7, thereby determining that the page to be loaded is the last page, triggering the resource loading of the last page, and the current page is switched from the second page to the first page;
  • the touch operation of the user on the interface is obtained, and the page switching direction is determined to be reverse according to the touch operation. , thereby determining that the page to be loaded is the second page of the last, triggering the resource loading of the second page of the last, and the current page is switched from the first page to the last page;
  • the current page is the last page
  • the user when the user needs to switch from the last page to the second page, the user performs a touch operation on the interface, and determines that the page switching direction is reversed according to the touch operation.
  • the page to be loaded is the third page of the last, triggering the resource loading of the third page of the last, and the current page is switched from the last page to the second page.
  • FIG. 9 is a flowchart of steps of a method for loading a page resource based on a mobile terminal according to an embodiment of the present invention. referring to FIG. 9, the method includes:
  • S901 Acquire a touch operation of the user on the interface when the current page of the application is displayed in the interface, where the application is composed of several pages;
  • S902 Determine a page switching direction of the application according to the touch operation.
  • Steps S901 to S902 are the same as steps S101 to S102 of the embodiment shown in FIG. 1, and details are not described herein again.
  • S903 Determine a to-be-loaded page in the application according to the current page and the page switching direction, trigger a picture loading of the to-be-loaded page, and trigger a background image loading of the to-be-loaded page.
  • the resources of the page are a picture and a background image.
  • a plurality of methods may be used.
  • the URL of the picture in the attribute, the URL of the background image placed in the data-src attribute is written to the background attribute in the body tag of the page to be loaded, and the corresponding picture is downloaded according to the URL of the picture, according to the background Downloading a corresponding background image of the URL of the image, thereby implementing loading of the image of the page to be loaded and the background image;
  • the method may be implemented in other manners, for example, the URL of the background image and the image are placed in other attributes, or the URL of the background image and the image is directly written into the js variable array, which is not limited in this embodiment. .
  • FIG. 10 is a structural block diagram of a device for loading a page resource based on a mobile terminal according to an embodiment of the present invention. and referring to FIG. 10, the device includes:
  • the operation acquirer 1001 is configured to acquire a touch operation of the user on the interface when the current page of the application is displayed in the interface, where the application is composed of several pages;
  • the direction determiner 1002 is adapted to determine a page switching direction of the application according to the touch operation
  • the loading trigger 1003 is adapted to determine a page to be loaded in the application according to the current page and page switching direction, and trigger resource loading of the page to be loaded.
  • the loading trigger is further adapted to use, as the first unloaded page in the application, from the current page along the page switching direction.
  • the page to be loaded is further adapted to use, as the first unloaded page in the application, from the current page along the page switching direction. The page to be loaded.
  • the loading trigger is further adapted to trigger a picture loading of the page to be loaded, and trigger a background image loading of the page to be loaded.
  • the loading trigger is further adapted to write a uniform resource locator URL of the image to the src attribute in the img tag of the page to be loaded, according to the URL of the picture. Downloading a corresponding picture, thereby implementing image loading of the page to be loaded.
  • the loading trigger is further adapted to write a uniform resource locator URL of the background image to a background attribute in the body tag of the page to be loaded, according to the background image.
  • the URL downloads the corresponding background image, thereby implementing background image loading of the page to be loaded.
  • FIG. 11 is a structural block diagram of a device for loading a page resource based on a mobile terminal according to an embodiment of the present invention. and referring to FIG. 11, the device includes:
  • the operation acquirer 1101 is configured to acquire a touch operation of the user on the interface when the current page of the application is displayed in the interface, where the application is composed of several pages;
  • the direction determiner 1102 is configured to determine a page switching direction of the application according to the touch operation
  • the loading trigger 1103 is adapted to determine a page to be loaded in the application according to the current page and page switching direction, and trigger resource loading of the page to be loaded.
  • the page switcher 1104 is configured to determine, according to the current page and the page switching direction, a page to be displayed in the application, and switch the current page displayed in the interface to the page to be displayed.
  • the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
  • the components therein are logically divided according to the functions to be implemented, but the present invention is not limited thereto, and the respective components may be re-divided as needed. Alternatively, for example, some components may be combined into a single component, or some components may be further broken down into more subcomponents.
  • the various component embodiments of the present invention may be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof.
  • a microprocessor or digital signal processor can be used in practice to implement Some or all of the functions of some or all of the components of the mobile terminal based page resource loading device of the embodiments of the present invention.
  • the invention can also be implemented as a device or device program (e.g., a computer program and a computer program product) for performing some or all of the methods described herein.
  • a program implementing the invention may be stored on a computer readable medium or may be in the form of one or more signals. Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
  • Figure 12 schematically illustrates a block diagram of a mobile terminal for performing the method in accordance with the present invention.
  • the mobile terminal conventionally includes a processor 1210 and a computer program product or computer readable medium in the form of a memory 1220.
  • the memory 1220 may be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read Only Memory), an EPROM, a hard disk, or a ROM.
  • Memory 1220 has a memory space 1230 for program code 1231 for performing any of the method steps described above.
  • storage space 1230 for program code may include various program codes 1231 for implementing various steps in the above methods, respectively.
  • the program code can be read from or written to one or more computer program products.
  • Such computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards or floppy disks.
  • Such a computer program product is typically a portable or fixed storage unit as described with reference to FIG.
  • the storage unit may have a storage section, a storage space, and the like arranged similarly to the storage 1220 in the mobile terminal of FIG.
  • the program code can be compressed, for example, in an appropriate form.
  • the storage unit comprises computer readable code 1231' for performing the steps of the method according to the invention, ie code readable by a processor such as 1210, which when run by the mobile terminal causes the movement The terminal performs the various steps in the method described above.

Abstract

Disclosed are a page resource loading method and device based on a mobile terminal, which relate to the technical field of resource loading. The method comprises: when a current page of an application program is displayed in an interface, acquiring a touch control operation of a user on the interface; determining a page switching direction of the application program according to the touch control operation; and determining a page to be loaded in the application program and triggering resource loading of the page to be loaded according to the current page and the page switching direction. By means of the present invention, as the touch control operation of the user on the interface is acquired, the page switching direction of the application program is determined according to the touch control operation, the page to be loaded in the application program is determined according to the current page and the page switching direction, and then the resource loading of the page to be loaded is triggered, a loading time of a scene application is effectively shortened, the user experience is improved, it is unnecessary to load some pages which may not be browsed, and the user traffic is saved.

Description

基于移动终端的页面资源加载方法及装置Method and device for loading page resource based on mobile terminal 技术领域Technical field
本发明涉及资源加载技术领域,特别涉及一种基于移动终端的页面资源加载方法及装置。The present invention relates to the field of resource loading technologies, and in particular, to a method and device for loading a page resource based on a mobile terminal.
背景技术Background technique
场景应用是由若干页面所组成的应用程序,所述页面通过应用超文本标记语言HTML技术开发,适合在移动终端上使用,通常通过用户在移动终端上进行的触控操作来实现页面切换,从而完成交互,如今常用于产品的推广。The scenario application is an application composed of a plurality of pages, and the page is developed by using a hypertext markup language HTML technology, and is suitable for use on a mobile terminal, and usually performs a page switch by a touch operation performed by the user on the mobile terminal, thereby The interaction is completed and is now often used for product promotion.
由于场景应用的页面绝大部分是图片资源,而一般各张图片使用jpg格式在100kb左右,若有10张图片则相当于1M,再加上其他图片样式等资源,一般有2~5M。Since most of the pages of the scene application are picture resources, generally each picture uses a jpg format of about 100 kb, and if there are 10 pictures, it is equivalent to 1 M, and other pictures and other resources are generally 2 to 5 M.
现有技术中,用户在浏览场景应用时,由移动终端将整个场景应用中的页面全部加载完成后,才能进行页面切换,但若移动终端在2G网络或3G网络等网速较慢的网络中,会导致移动终端的页面加载时间过长,严重影响用户体验,另外,用户不一定会浏览所述场景应用中的所有页面,仍需加载所述场景应用中的所有页面,也会对用户的流量造成一定浪费。In the prior art, when the user browses the scenario application, the mobile terminal can completely perform page switching after the page in the entire scenario application is loaded, but if the mobile terminal is in a network with a slow network speed such as a 2G network or a 3G network. The page load time of the mobile terminal is too long, which seriously affects the user experience. In addition, the user does not necessarily browse all the pages in the scenario application, and still needs to load all the pages in the scenario application, and also on the user. Traffic is a waste.
发明内容Summary of the invention
鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决上述问题的一种基于移动终端的页面资源加载方法和相应的一种基于移动终端的页面资源加载装置。In view of the above problems, the present invention has been made in order to provide a mobile terminal-based page resource loading method and a corresponding mobile terminal-based page resource loading device that overcome the above problems or at least partially solve the above problems.
依据本发明的一个方面,提供了一种基于移动终端的页面资源加载方法,所述方法包括:According to an aspect of the present invention, a method for loading a page resource based on a mobile terminal is provided, and the method includes:
在界面中展示应用程序的当前页面时,获取用户在所述界面上的触控操作,所述应用程序由若干页面组成;When the current page of the application is displayed in the interface, the touch operation of the user on the interface is obtained, and the application is composed of several pages;
根据所述触控操作确定所述应用程序的页面切换方向;Determining a page switching direction of the application according to the touch operation;
根据所述当前页面和页面切换方向确定所述应用程序中的待加载页面, 触发所述待加载页面的资源加载。Determining a page to be loaded in the application according to the current page and page switching direction, Triggering resource loading of the page to be loaded.
依据本发明的另一个方面,提供了一种基于移动终端的页面资源加载装置,所述装置包括:According to another aspect of the present invention, a mobile terminal-based page resource loading apparatus is provided, and the apparatus includes:
操作获取器,适于在界面中展示应用程序的当前页面时,获取用户在所述界面上的触控操作,所述应用程序由若干页面组成;An operation acquirer, configured to acquire a touch operation of the user on the interface when the current page of the application is displayed in the interface, where the application program is composed of several pages;
方向确定器,适于根据所述触控操作确定所述应用程序的页面切换方向;a direction determining unit, configured to determine a page switching direction of the application according to the touch operation;
加载触发器,适于根据所述当前页面和页面切换方向确定所述应用程序中的待加载页面,触发所述待加载页面的资源加载。The loading trigger is adapted to determine a page to be loaded in the application according to the current page and page switching direction, and trigger resource loading of the page to be loaded.
根据本发明的又一个方面,提出了一种计算机程序,包括计算机可读代码,当所述计算机可读代码在移动终端上运行时,导致所述移动终端执行上文所述的基于移动终端的页面资源加载方法。According to still another aspect of the present invention, a computer program is provided, comprising computer readable code that, when executed on a mobile terminal, causes the mobile terminal to perform the mobile terminal based Page resource loading method.
根据本发明的再一个方面,提出了一种计算机可读介质,其中存储了上述的计算机程序。According to still another aspect of the present invention, a computer readable medium is proposed, wherein the computer program described above is stored.
本发明通过获取用户在所述界面上的触控操作,根据所述触控操作确定所述应用程序的页面切换方向,根据当前页面和页面切换方向确定所述应用程序中的待加载页面,再触发所述待加载页面的资源加载,有效缩短了场景应用的加载时间,提高了用户体验,并且无需加载一些可能不浏览的页面,节约了用户的流量。The method of determining a page switching direction of the application according to the touch operation, determining a page switching direction of the application according to the current page and a page switching direction, and determining a page to be loaded in the application, and then The resource loading of the page to be loaded is triggered, which effectively shortens the loading time of the scenario application, improves the user experience, and does not need to load some pages that may not be browsed, thereby saving user traffic.
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solutions of the present invention, and the above-described and other objects, features and advantages of the present invention can be more clearly understood. Specific embodiments of the invention are set forth below.
附图说明DRAWINGS
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those skilled in the art from a The drawings are only for the purpose of illustrating the preferred embodiments and are not to be construed as limiting. Throughout the drawings, the same reference numerals are used to refer to the same parts. In the drawing:
图1是本发明一个实施例的一种基于移动终端的页面资源加载方法的步骤流程图; 1 is a flow chart of steps of a method for loading a page resource based on a mobile terminal according to an embodiment of the present invention;
图2是本发明一个实施例的一种基于移动终端的页面资源加载方法的步骤流程图;2 is a flow chart of steps of a method for loading a page resource based on a mobile terminal according to an embodiment of the present invention;
图3是本发明一个实施例的一种场景应用中页面的示例图;3 is a diagram showing an example of a page in a scenario application according to an embodiment of the present invention;
图4是本发明一个实施例的一种场景应用在首次浏览时的示例图;4 is a diagram showing an example of a scenario application applied for the first time browsing according to an embodiment of the present invention;
图5是本发明一个实施例的一种场景应用从第1页切换至第2页的示例图;FIG. 5 is a diagram showing an example of switching a scene application from page 1 to page 2 according to an embodiment of the present invention; FIG.
图6是本发明一个实施例的一种场景应用从第2页切换至第3页的示例图;6 is a diagram showing an example of switching a scene application from page 2 to page 3 in accordance with an embodiment of the present invention;
图7是本发明一种实施例的一种场景应用从第2页切换至第1页的示例图;7 is a diagram showing an example of switching a scene application from page 2 to page 1 according to an embodiment of the present invention;
图8是本发明一种实施例的一种场景应用从第1页切换至最后1页的示例图;8 is a diagram showing an example of switching a scene application from page 1 to page 1 in accordance with an embodiment of the present invention;
图9是本发明一个实施例的一种基于移动终端的页面资源加载方法的步骤流程图;FIG. 9 is a flowchart of steps of a method for loading a page resource based on a mobile terminal according to an embodiment of the present invention; FIG.
图10是本发明一个实施例的一种基于移动终端的页面资源加载装置的结构框图;FIG. 10 is a structural block diagram of a page resource loading apparatus based on a mobile terminal according to an embodiment of the present invention; FIG.
图11是本发明一个实施例的一种基于移动终端的页面资源加载装置的结构框图;FIG. 11 is a structural block diagram of a page resource loading apparatus based on a mobile terminal according to an embodiment of the present invention; FIG.
图12示意性地示出了用于执行根据本发明的方法的移动终端的框图;以及Figure 12 is a schematic block diagram showing a mobile terminal for performing the method according to the present invention;
图13示意性地示出了用于保持或者携带实现根据本发明的方法的程序代码的存储单元。Fig. 13 schematically shows a storage unit for holding or carrying program code implementing the method according to the invention.
具体实施例Specific embodiment
下面结合附图和实施例,对本发明的具体实施方式作进一步详细描述。以下实施例用于说明本发明,但不用来限制本发明的范围。The specific embodiments of the present invention are further described in detail below with reference to the drawings and embodiments. The following examples are intended to illustrate the invention but are not intended to limit the scope of the invention.
图1是本发明一个实施例的一种基于移动终端的页面资源加载方法的步骤流程图;参照图1,所述方法包括:FIG. 1 is a flowchart of steps of a method for loading a page resource based on a mobile terminal according to an embodiment of the present invention; referring to FIG. 1, the method includes:
S101:在界面中展示应用程序的当前页面时,获取用户在所述界面上的触控操作,所述应用程序由若干页面组成; S101: Acquire a touch operation of the user on the interface when the current page of the application is displayed in the interface, where the application is composed of several pages;
可理解的是,所述界面即为移动终端的显示界面,所述当前页面即为当前在移动终端的显示界面中所展示的页面,所述应用程序即为场景应用。It can be understood that the interface is the display interface of the mobile terminal, and the current page is the page currently displayed in the display interface of the mobile terminal, and the application is the scenario application.
S102:根据所述触控操作确定所述应用程序的页面切换方向;S102: Determine a page switching direction of the application according to the touch operation.
需要说明的是,可在移动终端中预先设置触控操作和页面切换方式之间的对应关系,再根据所述触控操作确定所述应用程序的页面切换方向;It should be noted that the correspondence between the touch operation and the page switching mode may be preset in the mobile terminal, and then the page switching direction of the application is determined according to the touch operation;
例如:在所述界面中预设两个按钮,当触控操作为点击第一按钮时,可确定为页面切换方向为正向(设第N页为当前页面,即从场景应用的第N页切换至第N+1页的方向),当触控操作为点击第二按钮时,可确定为页面奇幻方向为反向(即从场景应用的第N页切换至第N-1页的方向);For example, two buttons are preset in the interface, and when the touch operation is clicking the first button, the page switching direction is determined to be positive (the Nth page is the current page, that is, the Nth page applied from the scene) Switching to the direction of page N+1), when the touch operation is to click the second button, it can be determined that the page fantasy direction is reversed (ie, switching from the Nth page of the scene application to the direction of the N-1th page) ;
又例如:当触控操作为向上滑动时,可确定为页面切换方向为正向,当触控操作为向下滑动时,可确定为页面切换方向为反向;For another example, when the touch operation is sliding upward, it may be determined that the page switching direction is forward, and when the touch operation is sliding downward, it may be determined that the page switching direction is reverse;
当然,步骤S102还可采用其他方式来确定所述应用程序的页面切换方向,本实施例对此不加以限制。Certainly, the step S102 may also use other manners to determine the page switching direction of the application, which is not limited in this embodiment.
S103:根据所述当前页面和页面切换方向确定所述应用程序中的待加载页面,触发所述待加载页面的资源加载。S103: Determine a to-be-loaded page in the application according to the current page and page switching direction, and trigger resource loading of the to-be-loaded page.
本实施例通过获取用户在所述界面上的触控操作,根据所述触控操作确定所述应用程序的页面切换方向,根据当前页面和页面切换方向确定所述应用程序中的待加载页面,再触发所述待加载页面的资源加载,有效缩短了场景应用的加载时间,提高了用户体验,并且无需加载一些可能不浏览的页面,节约了用户的流量。In this embodiment, the user performs a touch operation on the interface, determines a page switching direction of the application according to the touch operation, and determines a page to be loaded in the application according to the current page and the page switching direction. The resource loading of the page to be loaded is triggered, which effectively shortens the loading time of the scenario application, improves the user experience, and does not need to load some pages that may not be browsed, thereby saving user traffic.
图2是本发明一个实施例的一种基于移动终端的页面资源加载方法的步骤流程图;参照图2,所述方法包括:2 is a flow chart of steps of a method for loading a page resource based on a mobile terminal according to an embodiment of the present invention; referring to FIG. 2, the method includes:
S201:在界面中展示应用程序的当前页面时,获取用户在所述界面上的触控操作,所述应用程序由若干页面组成;S201: Acquire a touch operation of the user on the interface when the current page of the application is displayed in the interface, where the application is composed of several pages;
S202:根据所述触控操作确定所述应用程序的页面切换方向;S202: Determine a page switching direction of the application according to the touch operation.
可理解的是,步骤S201~S202与图1所示的实施例中的步骤S101~S102相同,在此不再赘述。It is to be understood that the steps S201 to S202 are the same as the steps S101 to S102 in the embodiment shown in FIG. 1 and will not be further described herein.
S203:根据所述当前页面和页面切换方向确定所述应用程序中的待展示页面,将所述界面中展示的当前页面切换为所述待展示页面,将所述应用程序中从所述当前页面起沿所述页面切换方向的第一个未加载页面作为所述 待加载页面,触发所述待加载页面的资源加载。S203: Determine a to-be-displayed page in the application according to the current page and a page switching direction, and switch a current page displayed in the interface to the to-be-displayed page, where the application is from the current page. Starting the first unloaded page along the page switching direction as described The page to be loaded triggers resource loading of the page to be loaded.
需要说明的是,为实现对用户所需浏览页面进行预测,并保证用户浏览的连续性,本实施例中将所述应用程序中从所述当前页面起沿所述页面切换方向的第一个未加载页面作为所述待加载页面。It should be noted that, in order to implement the prediction of the browsing page required by the user, and to ensure the continuity of the browsing of the user, in the embodiment, the first application in the application is switched from the current page along the page switching direction. The page is not loaded as the page to be loaded.
可理解的是,为避免流量的浪费,并且保证用户的正常使用,需要在首次浏览场景应用时,先加载初始页面的所有资源。It can be understood that in order to avoid waste of traffic and ensure normal use of the user, all resources of the initial page need to be loaded when browsing the scenario application for the first time.
所述初始页面通常需要包括所述场景应用的第1页,另外还需要与场景应用相邻的至少1页,由于用户通常的浏览习惯均为从前向后浏览,故而,本实施例中将场景应用的第1、2页设置为初始页面,当然,还可将其他页面也设置为初始页面,例如:将第3页也设置为初始页面,或者,将最后1页也设置为初始页面,本实施例对此不加以限制。The initial page usually needs to include the first page of the scenario application, and at least one page adjacent to the scenario application is required. Since the user's usual browsing habits are viewed from the front to the back, the scene is set in this embodiment. The first and second pages of the application are set as the initial page. Of course, other pages can also be set as the initial page. For example, the third page is also set as the initial page, or the last page is also set as the initial page. The embodiment does not limit this.
由于本实施例中实现了用户的按需加载,根据当前页面和页面切换方向预测下一个将要浏览的页面,加载该页面的资源;用户无需加载一些将来可能不浏览的页面资源,同时各次只加载一个页面的资源,减少了http请求,有效缩短了场景应用的加载时间,提高了用户体验。In this embodiment, the on-demand loading of the user is implemented, and the next page to be browsed is predicted according to the current page and the page switching direction, and the resource of the page is loaded; the user does not need to load some page resources that may not be browsed in the future, and each time only Loading a page resource reduces the http request, effectively shortening the load time of the scenario application and improving the user experience.
下面以初始页面为第1、2页为例来说明待加载页面的确定,但并不限定本发明的保护范围。The following describes the determination of the page to be loaded by taking the initial page as the first and second pages as an example, but does not limit the scope of protection of the present invention.
由于场景应用由若干页面组成,参照图3,可将场景应用视为一个列表,各行为一个页面,各个页面均具有很多资源。Since the scene application is composed of several pages, referring to FIG. 3, the scene application can be regarded as a list, each of which acts as a page, and each page has many resources.
当用户首次浏览场景应用时,参照图4,会自动加载初始页面(即第1、2页)的所有资源,若第1、2页的所有资源未加载,则不可翻页,此时当前页面为第1页;When the user browses the scene application for the first time, referring to Figure 4, all the resources of the initial page (ie, pages 1 and 2) are automatically loaded. If all the resources of the first and second pages are not loaded, the page cannot be paged. For the first page;
当用户需要从第1页切换至第2页时,获取用户在所述界面上的触控操作,根据所述触控操作确定页面切换方向为正向,参照图5,从而确定所述待加载页面为第3页,触发第3页的资源加载,此时当前页面从第1页切换至第2页;When the user needs to switch from the first page to the second page, the touch operation of the user on the interface is obtained, and the page switching direction is determined to be positive according to the touch operation. Referring to FIG. 5, the to-be-loaded is determined. The page is page 3, triggering the resource loading of page 3, and the current page is switched from page 1 to page 2;
在第3页的资源加载完毕后,当用户需要从第2页切换至第3页时,获取用户在所述界面上的触控操作,根据所述触控操作确定页面切换方向为正向,参照图6,从而确定所述待加载页面为第4页,触发第4页的资源加载,此时当前页面从第2页切换至第3页; After the resource loading on page 3 is completed, when the user needs to switch from the second page to the third page, the user performs a touch operation on the interface, and determines that the page switching direction is positive according to the touch operation. Referring to FIG. 6, it is determined that the page to be loaded is the fourth page, triggering the resource loading of the fourth page, and the current page is switched from the second page to the third page;
依次类推,若当前页面在倒数第3页时,当用户需要从倒数第3页切换至倒数第2页时,获取用户在所述界面上的触控操作,根据所述触控操作确定页面切换方向为正向,从而确定所述待加载页面为最后1页,触发最后1页的资源加载,此时当前页面从倒数第3页切换至倒数第2页;And so on, if the current page is on the third page, when the user needs to switch from the third page to the second page, the user touches the touch operation on the interface, and determines the page switching according to the touch operation. The direction is positive, thereby determining that the page to be loaded is the last page, triggering the resource loading of the last page, and the current page is switched from the third page to the second page of the last;
在当前页面为第2页时,用户需要从第2页切换至第1页时,获取用户在所述界面上的触控操作,根据所述触控操作确定页面切换方向为反向,参照图7,从而确定所述待加载页面为最后1页,触发最后1页的资源加载,此时当前页面从第2页切换至第1页;When the current page is the second page, when the user needs to switch from the second page to the first page, the touch operation of the user on the interface is obtained, and the page switching direction is determined to be reverse according to the touch operation. 7, thereby determining that the page to be loaded is the last page, triggering the resource loading of the last page, and the current page is switched from the second page to the first page;
在当前页面为第1页,用户需要从第1页切换至最后1页时,获取用户在所述界面上的触控操作,根据所述触控操作确定页面切换方向为反向,参照图8,从而确定所述待加载页面为倒数第2页,触发倒数第2页的资源加载,此时当前页面从第1页切换至最后1页;When the current page is the first page, when the user needs to switch from the first page to the last page, the touch operation of the user on the interface is obtained, and the page switching direction is determined to be reverse according to the touch operation. , thereby determining that the page to be loaded is the second page of the last, triggering the resource loading of the second page of the last, and the current page is switched from the first page to the last page;
依次类推,若当前页面为最后1页,当用户需要从最后1页切换至倒数第2页时,获取用户在所述界面上的触控操作,根据所述触控操作确定页面切换方向为反向,从而确定所述待加载页面为倒数第3页,触发倒数第3页的资源加载,此时当前页面从最后1页切换至倒数第2页。And so on, if the current page is the last page, when the user needs to switch from the last page to the second page, the user performs a touch operation on the interface, and determines that the page switching direction is reversed according to the touch operation. To determine, the page to be loaded is the third page of the last, triggering the resource loading of the third page of the last, and the current page is switched from the last page to the second page.
图9是本发明一个实施例的一种基于移动终端的页面资源加载方法的步骤流程图;参照图9,所述方法包括:FIG. 9 is a flowchart of steps of a method for loading a page resource based on a mobile terminal according to an embodiment of the present invention; referring to FIG. 9, the method includes:
S901:在界面中展示应用程序的当前页面时,获取用户在所述界面上的触控操作,所述应用程序由若干页面组成;S901: Acquire a touch operation of the user on the interface when the current page of the application is displayed in the interface, where the application is composed of several pages;
S902:根据所述触控操作确定所述应用程序的页面切换方向;S902: Determine a page switching direction of the application according to the touch operation.
步骤S901~S902与图1所示的实施例的步骤S101~S102相同,在此不再赘述。Steps S901 to S902 are the same as steps S101 to S102 of the embodiment shown in FIG. 1, and details are not described herein again.
S903:根据所述当前页面和页面切换方向确定所述应用程序中的待加载页面,触发所述待加载页面的图片加载,并触发所述待加载页面的背景图像加载。S903: Determine a to-be-loaded page in the application according to the current page and the page switching direction, trigger a picture loading of the to-be-loaded page, and trigger a background image loading of the to-be-loaded page.
由于页面的资源中图片和背景图像的文件较大,对页面的资源加载速度其决定性的作用,故而本实施例中,所述页面的资源为图片和背景图像。Since the file of the page and the file of the background image are large, the resource loading speed of the page plays a decisive role. Therefore, in this embodiment, the resources of the page are a picture and a background image.
为使加载应用程序某一页面时不要一次性加载所有页面中的所有图片和/或背景图像,可采用多种方式,本实施例中,在编写页面HTML结构时, 将背景图像和/或图片的URL均放置于相应的data-src属性中,这样在应用程序中的某一页面被加载时(比如浏览器加载页面时)则不会一次性自动下载所有图片和/或所有背景图像,而是根据用户当前浏览的页面先预触发加载下页或上一页面对应的图片和/或背景图片。In order to load all the pictures and/or background images in all the pages in one page when loading the application, a plurality of methods may be used. In this embodiment, when writing the HTML structure of the page, Place the background image and/or the URL of the image in the corresponding data-src attribute, so that when a page in the application is loaded (such as when the browser loads the page), all the images will not be automatically downloaded at one time. / or all background images, but according to the user's current browsing page, the pre-trigger loading of the next page or the corresponding image and/or background image of the previous page.
当触发待加载页面的图片加载,并触发待加载页面的背景图像加载时,通过jquery中的回传函数$(‘[data-src]’)选择所述待加载页面中所有图片和背景图像(可在data-src中通过bg=1来标识背景图像),再通过new Image()创建图片和背景图像的对象,向所述待加载页面的img标签中的src属性写入放置于data-src属性中的图片的URL,向所述待加载页面的body标签中的background属性写入放置于data-src属性中的背景图像的URL,根据所述图片的URL下载对应的图片,根据所述背景图像的URL下载对应的背景图像,从而实现所述待加载页面的图片及背景图像的加载;When the image of the page to be loaded is triggered to be loaded, and the background image of the page to be loaded is triggered to be loaded, all the pictures and background images in the page to be loaded are selected by the return function $('[data-src]') in jquery ( The background image can be identified by bg=1 in the data-src, and the object of the image and the background image is created by new Image(), and the src attribute in the img tag of the page to be loaded is written and placed in the data-src. The URL of the picture in the attribute, the URL of the background image placed in the data-src attribute is written to the background attribute in the body tag of the page to be loaded, and the corresponding picture is downloaded according to the URL of the picture, according to the background Downloading a corresponding background image of the URL of the image, thereby implementing loading of the image of the page to be loaded and the background image;
当然,还可采用其他方式来实现,例如将背景图像和图片的URL均放置于其他属性中,或者,将背景图像和图片的URL直接写入js变量数组中,本实施例对此不加以限制。Of course, the method may be implemented in other manners, for example, the URL of the background image and the image are placed in other attributes, or the URL of the background image and the image is directly written into the js variable array, which is not limited in this embodiment. .
对于方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明实施例并不受所描述的动作顺序的限制,因为依据本发明实施例,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作并不一定是本发明实施例所必须的。For the method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should understand that the embodiments of the present invention are not limited by the described action sequence, because the embodiment according to the present invention Some steps can be performed in other orders or at the same time. In the following, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
图10是本发明一个实施例的一种基于移动终端的页面资源加载装置的结构框图;参照图10,所述装置包括:FIG. 10 is a structural block diagram of a device for loading a page resource based on a mobile terminal according to an embodiment of the present invention; and referring to FIG. 10, the device includes:
操作获取器1001,适于在界面中展示应用程序的当前页面时,获取用户在所述界面上的触控操作,所述应用程序由若干页面组成;The operation acquirer 1001 is configured to acquire a touch operation of the user on the interface when the current page of the application is displayed in the interface, where the application is composed of several pages;
方向确定器1002,适于根据所述触控操作确定所述应用程序的页面切换方向;The direction determiner 1002 is adapted to determine a page switching direction of the application according to the touch operation;
加载触发器1003,适于根据所述当前页面和页面切换方向确定所述应用程序中的待加载页面,触发所述待加载页面的资源加载。The loading trigger 1003 is adapted to determine a page to be loaded in the application according to the current page and page switching direction, and trigger resource loading of the page to be loaded.
在本发明的一种可选实施例中,所述加载触发器,还适于将所述应用程序中从所述当前页面起沿所述页面切换方向的第一个未加载页面作为所述 待加载页面。In an optional embodiment of the present invention, the loading trigger is further adapted to use, as the first unloaded page in the application, from the current page along the page switching direction. The page to be loaded.
在本发明的一种可选实施例中,所述加载触发器,还适于触发所述待加载页面的图片加载,并触发所述待加载页面的背景图像加载。In an optional embodiment of the present invention, the loading trigger is further adapted to trigger a picture loading of the page to be loaded, and trigger a background image loading of the page to be loaded.
在本发明的一种可选实施例中,所述加载触发器,还适于向所述待加载页面的img标签中的src属性写入图片的统一资源定位符URL,根据所述图片的URL下载对应的图片,从而实现所述待加载页面的图片加载。In an optional embodiment of the present invention, the loading trigger is further adapted to write a uniform resource locator URL of the image to the src attribute in the img tag of the page to be loaded, according to the URL of the picture. Downloading a corresponding picture, thereby implementing image loading of the page to be loaded.
在本发明的一种可选实施例中,所述加载触发器,还适于向所述待加载页面的body标签中的background属性写入背景图像的统一资源定位符URL,根据所述背景图像的URL下载对应的背景图像,从而实现所述待加载页面的背景图像加载。In an optional embodiment of the present invention, the loading trigger is further adapted to write a uniform resource locator URL of the background image to a background attribute in the body tag of the page to be loaded, according to the background image. The URL downloads the corresponding background image, thereby implementing background image loading of the page to be loaded.
图11是本发明一个实施例的一种基于移动终端的页面资源加载装置的结构框图;参照图11,所述装置包括:FIG. 11 is a structural block diagram of a device for loading a page resource based on a mobile terminal according to an embodiment of the present invention; and referring to FIG. 11, the device includes:
操作获取器1101,适于在界面中展示应用程序的当前页面时,获取用户在所述界面上的触控操作,所述应用程序由若干页面组成;The operation acquirer 1101 is configured to acquire a touch operation of the user on the interface when the current page of the application is displayed in the interface, where the application is composed of several pages;
方向确定器1102,适于根据所述触控操作确定所述应用程序的页面切换方向;The direction determiner 1102 is configured to determine a page switching direction of the application according to the touch operation;
加载触发器1103,适于根据所述当前页面和页面切换方向确定所述应用程序中的待加载页面,触发所述待加载页面的资源加载。The loading trigger 1103 is adapted to determine a page to be loaded in the application according to the current page and page switching direction, and trigger resource loading of the page to be loaded.
页面切换器1104,适于根据所述当前页面和页面切换方向确定所述应用程序中的待展示页面,将所述界面中展示的当前页面切换为所述待展示页面。The page switcher 1104 is configured to determine, according to the current page and the page switching direction, a page to be displayed in the application, and switch the current page displayed in the interface to the page to be displayed.
对于装置实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
应当注意的是,在本发明的装置的各个部件中,根据其要实现的功能而对其中的部件进行了逻辑划分,但是,本发明不受限于此,可以根据需要对各个部件进行重新划分或者组合,例如,可以将一些部件组合为单个部件,或者可以将一些部件进一步分解为更多的子部件。It should be noted that in the various components of the apparatus of the present invention, the components therein are logically divided according to the functions to be implemented, but the present invention is not limited thereto, and the respective components may be re-divided as needed. Alternatively, for example, some components may be combined into a single component, or some components may be further broken down into more subcomponents.
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据 本发明实施例的基于移动终端的页面资源加载装置中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。The various component embodiments of the present invention may be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or digital signal processor (DSP) can be used in practice to implement Some or all of the functions of some or all of the components of the mobile terminal based page resource loading device of the embodiments of the present invention. The invention can also be implemented as a device or device program (e.g., a computer program and a computer program product) for performing some or all of the methods described herein. Such a program implementing the invention may be stored on a computer readable medium or may be in the form of one or more signals. Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
例如,图12示意性地示出了用于执行根据本发明的方法的移动终端的框图。该移动终端传统上包括处理器1210和以存储器1220形式的计算机程序产品或者计算机可读介质。存储器1220可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。存储器1220具有用于执行上述方法中的任何方法步骤的程序代码1231的存储空间1230。例如,用于程序代码的存储空间1230可以包括分别用于实现上面的方法中的各种步骤的各个程序代码1231。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。这些计算机程序产品包括诸如硬盘,紧致盘(CD)、存储卡或者软盘之类的程序代码载体。这样的计算机程序产品通常为如参考图13所述的便携式或者固定存储单元。该存储单元可以具有与图12的移动终端中的存储器1220类似布置的存储段、存储空间等。程序代码可以例如以适当形式进行压缩。通常,存储单元包括用于执行根据本发明的方法步骤的计算机可读代码1231’,即可以由例如诸如1210之类的处理器读取的代码,这些代码当由移动终端运行时,导致该移动终端执行上面所描述的方法中的各个步骤。For example, Figure 12 schematically illustrates a block diagram of a mobile terminal for performing the method in accordance with the present invention. The mobile terminal conventionally includes a processor 1210 and a computer program product or computer readable medium in the form of a memory 1220. The memory 1220 may be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read Only Memory), an EPROM, a hard disk, or a ROM. Memory 1220 has a memory space 1230 for program code 1231 for performing any of the method steps described above. For example, storage space 1230 for program code may include various program codes 1231 for implementing various steps in the above methods, respectively. The program code can be read from or written to one or more computer program products. These computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards or floppy disks. Such a computer program product is typically a portable or fixed storage unit as described with reference to FIG. The storage unit may have a storage section, a storage space, and the like arranged similarly to the storage 1220 in the mobile terminal of FIG. The program code can be compressed, for example, in an appropriate form. Typically, the storage unit comprises computer readable code 1231' for performing the steps of the method according to the invention, ie code readable by a processor such as 1210, which when run by the mobile terminal causes the movement The terminal performs the various steps in the method described above.
本文中所称的“一个实施例”、“实施例”或者“一个或者多个实施例”意味着,结合实施例描述的特定特征、结构或者特性包括在本发明的至少一个实施例中。此外,请注意,这里“在一个实施例中”的词语例子不一定全指同一个实施例。"an embodiment," or "an embodiment," or "an embodiment," In addition, it is noted that the phrase "in one embodiment" is not necessarily referring to the same embodiment.
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下被实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. However, it is understood that the embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques are not shown in detail so as not to obscure the understanding of the description.
应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制, 并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。It should be noted that the above embodiments are illustrative of the invention and are not intended to limit the invention. Alternative embodiments can be devised by those skilled in the art without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as a limitation. The word "comprising" does not exclude the presence of the elements or steps that are not recited in the claims. The word "a" or "an" The invention can be implemented by means of hardware comprising several distinct elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means can be embodied by the same hardware item. The use of the words first, second, and third does not indicate any order. These words can be interpreted as names.
此外,还应当注意,本说明书中使用的语言主要是为了可读性和教导的目的而选择的,而不是为了解释或者限定本发明的主题而选择的。因此,在不偏离所附权利要求书的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。对于本发明的范围,对本发明所做的公开是说明性的,而非限制性的,本发明的范围由所附权利要求书限定。In addition, it should be noted that the language used in the specification has been selected for the purpose of readability and teaching, and is not intended to be construed or limited. Therefore, many modifications and changes will be apparent to those skilled in the art without departing from the scope of the invention. The disclosure of the present invention is intended to be illustrative, and not restrictive, and the scope of the invention is defined by the appended claims.
以上实施方式仅用于说明本发明,而并非对本发明的限制,有关技术领域的普通技术人员,在不脱离本发明的精神和范围的情况下,还可以做出各种变化和变型,因此所有等同的技术方案也属于本发明的范畴,本发明的专利保护范围应由权利要求限定。 The above embodiments are merely illustrative of the present invention and are not intended to be limiting of the invention, and various modifications and changes can be made without departing from the spirit and scope of the invention. Equivalent technical solutions are also within the scope of the invention, and the scope of the invention is defined by the claims.

Claims (14)

  1. 一种基于移动终端的页面资源加载方法,其特征在于,所述方法包括:A method for loading a page resource based on a mobile terminal, the method comprising:
    在界面中展示应用程序的当前页面时,获取用户在所述界面上的触控操作,所述应用程序由若干页面组成;When the current page of the application is displayed in the interface, the touch operation of the user on the interface is obtained, and the application is composed of several pages;
    根据所述触控操作确定所述应用程序的页面切换方向;Determining a page switching direction of the application according to the touch operation;
    根据所述当前页面和页面切换方向确定所述应用程序中的待加载页面,触发所述待加载页面的资源加载。Determining a page to be loaded in the application according to the current page and a page switching direction, and triggering resource loading of the page to be loaded.
  2. 如权利要求1所述的方法,其特征在于,所述根据所述当前页面和页面切换方向确定所述应用程序中的待加载页面,进一步包括:The method of claim 1, wherein the determining the page to be loaded in the application according to the current page and the page switching direction further comprises:
    将所述应用程序中从所述当前页面起沿所述页面切换方向的第一个未加载页面作为所述待加载页面。The first unloaded page in the application from the current page along the page switching direction is used as the to-be-loaded page.
  3. 如权利要求1所述的方法,其特征在于,所述触发所述待加载页面的资源加载,进一步包括:The method of claim 1, wherein the triggering the resource loading of the page to be loaded further comprises:
    触发所述待加载页面的图片加载,并触发所述待加载页面的背景图像加载。Triggering a picture loading of the page to be loaded, and triggering background image loading of the page to be loaded.
  4. 如权利要求3所述的方法,其特征在于,所述触发所述待加载页面的图片加载,进一步包括:The method of claim 3, wherein the triggering the loading of the image of the page to be loaded further comprises:
    向所述待加载页面的img标签中的src属性写入图片的统一资源定位符URL,根据所述图片的URL下载对应的图片,从而实现所述待加载页面的图片加载。Writing a uniform resource locator URL of the image to the src attribute of the img tag of the page to be loaded, and downloading a corresponding picture according to the URL of the picture, thereby implementing image loading of the page to be loaded.
  5. 如权利要求3所述的方法,其特征在于,所述触发所述待加载页面的背景图像加载,进一步包括:The method of claim 3, wherein the triggering the background image loading of the page to be loaded further comprises:
    向所述待加载页面的body标签中的background属性写入背景图像的统一资源定位符URL,根据所述背景图像的URL下载对应的背景图像,从而实现所述待加载页面的背景图像加载。Writing a uniform resource locator URL of the background image to the background attribute in the body tag of the page to be loaded, and downloading a corresponding background image according to the URL of the background image, thereby implementing background image loading of the page to be loaded.
  6. 如权利要求1~5中任一项所述的方法,其特征在于,所述根据所述触控操作确定所述应用程序的页面切换方向之后,还包括:The method according to any one of claims 1 to 5, wherein after determining the page switching direction of the application according to the touch operation, the method further includes:
    根据所述当前页面和页面切换方向确定所述应用程序中的待展示页面,将所述界面中展示的当前页面切换为所述待展示页面。Determining, according to the current page and the page switching direction, the page to be displayed in the application, and switching the current page displayed in the interface to the to-be-displayed page.
  7. 一种基于移动终端的页面资源加载装置,其特征在于,所述装置包 括:A page resource loading device based on a mobile terminal, characterized in that the device package include:
    操作获取器,适于在界面中展示应用程序的当前页面时,获取用户在所述界面上的触控操作,所述应用程序由若干页面组成;An operation acquirer, configured to acquire a touch operation of the user on the interface when the current page of the application is displayed in the interface, where the application program is composed of several pages;
    方向确定器,适于根据所述触控操作确定所述应用程序的页面切换方向;a direction determining unit, configured to determine a page switching direction of the application according to the touch operation;
    加载触发器,适于根据所述当前页面和页面切换方向确定所述应用程序中的待加载页面,触发所述待加载页面的资源加载。The loading trigger is adapted to determine a page to be loaded in the application according to the current page and page switching direction, and trigger resource loading of the page to be loaded.
  8. 如权利要求7所述的装置,其特征在于,所述加载触发器,还适于将所述应用程序中从所述当前页面起沿所述页面切换方向的第一个未加载页面作为所述待加载页面。The apparatus according to claim 7, wherein said loading trigger is further adapted to use said first unloaded page in said application from said current page in said page switching direction as said The page to be loaded.
  9. 如权利要求7所述的装置,其特征在于,所述加载触发器,还适于触发所述待加载页面的图片加载,并触发所述待加载页面的背景图像加载。The device of claim 7, wherein the loading trigger is further adapted to trigger a picture loading of the page to be loaded and trigger a background image loading of the page to be loaded.
  10. 如权利要求9所述的装置,其特征在于,所述加载触发器,还适于向所述待加载页面的img标签中的src属性写入图片的统一资源定位符URL,根据所述图片的URL下载对应的图片,从而实现所述待加载页面的图片加载。The device according to claim 9, wherein the loading trigger is further adapted to write a uniform resource locator URL of the image to the src attribute in the img tag of the page to be loaded, according to the picture The URL downloads a corresponding picture, thereby implementing image loading of the page to be loaded.
  11. 如权利要求9所述的装置,其特征在于,所述加载触发器,还适于向所述待加载页面的body标签中的background属性写入背景图像的统一资源定位符URL,根据所述背景图像的URL下载对应的背景图像,从而实现所述待加载页面的背景图像加载。The device according to claim 9, wherein the loading trigger is further adapted to write a uniform resource locator URL of the background image to a background attribute in a body tag of the page to be loaded, according to the background The URL of the image downloads the corresponding background image, thereby implementing background image loading of the page to be loaded.
  12. 如权利要求7~11中任一项所述的装置,其特征在于,所述装置,还包括页面切换器,适于根据所述当前页面和页面切换方向确定所述应用程序中的待展示页面,将所述界面中展示的当前页面切换为所述待展示页面。The device according to any one of claims 7 to 11, wherein the device further comprises a page switch, configured to determine a page to be displayed in the application according to the current page and a page switching direction. And switching the current page displayed in the interface to the page to be displayed.
  13. 一种计算机程序,包括计算机可读代码,当所述计算机可读代码在移动终端上运行时,导致所述移动终端执行根据权利要求1-6中的任一项所述的基于移动终端的页面资源加载方法。A computer program comprising computer readable code, when the computer readable code is run on a mobile terminal, causing the mobile terminal to perform a mobile terminal based page according to any one of claims 1-6 Resource loading method.
  14. 一种计算机可读介质,其中存储了如权利要求13所述的计算机程序。 A computer readable medium storing the computer program of claim 13.
PCT/CN2015/095013 2014-12-29 2015-11-19 Page resource loading method and device based on mobile terminal WO2016107325A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410838477.7A CN104536791A (en) 2014-12-29 2014-12-29 Page resource loading method and device based on mobile terminal
CN201410838477.7 2014-12-29

Publications (1)

Publication Number Publication Date
WO2016107325A1 true WO2016107325A1 (en) 2016-07-07

Family

ID=52852323

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/095013 WO2016107325A1 (en) 2014-12-29 2015-11-19 Page resource loading method and device based on mobile terminal

Country Status (2)

Country Link
CN (1) CN104536791A (en)
WO (1) WO2016107325A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111552528A (en) * 2020-04-14 2020-08-18 携程旅游网络技术(上海)有限公司 Display method, system, electronic equipment and medium of mobile terminal page
CN111625432A (en) * 2019-02-28 2020-09-04 北京字节跳动网络技术有限公司 Page loading time consumption determination method and device and computer readable storage medium
CN113411622A (en) * 2021-05-26 2021-09-17 广州方硅信息技术有限公司 Loading method and device of live broadcast interface, client and storage medium

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104536791A (en) * 2014-12-29 2015-04-22 北京奇虎科技有限公司 Page resource loading method and device based on mobile terminal
CN105516467A (en) * 2015-11-26 2016-04-20 努比亚技术有限公司 Page displaying method and mobile terminal
CN106095461A (en) * 2016-06-21 2016-11-09 东软集团股份有限公司 The method and device of display module in interface
CN108076113B (en) * 2016-11-15 2021-04-16 同方威视技术股份有限公司 Method, server and system for operating security check data
CN107391610A (en) * 2017-07-04 2017-11-24 广州视源电子科技股份有限公司 Background picture method to set up, device, readable storage medium storing program for executing and computer equipment
CN112506603A (en) * 2021-02-08 2021-03-16 艾乐德电子(南京)有限公司 Switching method and system for display interface of electronic instrument equipment
CN113934949B (en) * 2021-11-24 2022-10-14 掌阅科技股份有限公司 Information page display method, electronic equipment and computer storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103390053A (en) * 2013-07-26 2013-11-13 贝壳网际(北京)安全技术有限公司 Page switching control method and device of browser and client
CN103809896A (en) * 2012-11-15 2014-05-21 腾讯科技(深圳)有限公司 Page switching method and device
CN103853729A (en) * 2012-11-29 2014-06-11 腾讯科技(深圳)有限公司 Page loading method and system
CN104536791A (en) * 2014-12-29 2015-04-22 北京奇虎科技有限公司 Page resource loading method and device based on mobile terminal

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102065114A (en) * 2009-11-17 2011-05-18 中国移动通信集团重庆有限公司 Method and device for mobile terminal to access webpage
CN103984686B (en) * 2013-02-07 2018-10-12 阿里巴巴集团控股有限公司 page switching method and device
CN104008114B (en) * 2013-02-27 2019-04-26 腾讯科技(深圳)有限公司 A kind of method for page jump and device of WAP browser
CN104216944A (en) * 2014-07-10 2014-12-17 腾讯科技(深圳)有限公司 Webpage content display method and webpage content display device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103809896A (en) * 2012-11-15 2014-05-21 腾讯科技(深圳)有限公司 Page switching method and device
CN103853729A (en) * 2012-11-29 2014-06-11 腾讯科技(深圳)有限公司 Page loading method and system
CN103390053A (en) * 2013-07-26 2013-11-13 贝壳网际(北京)安全技术有限公司 Page switching control method and device of browser and client
CN104536791A (en) * 2014-12-29 2015-04-22 北京奇虎科技有限公司 Page resource loading method and device based on mobile terminal

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111625432A (en) * 2019-02-28 2020-09-04 北京字节跳动网络技术有限公司 Page loading time consumption determination method and device and computer readable storage medium
CN111625432B (en) * 2019-02-28 2023-03-28 北京字节跳动网络技术有限公司 Page loading time consumption determination method and device and computer readable storage medium
CN111552528A (en) * 2020-04-14 2020-08-18 携程旅游网络技术(上海)有限公司 Display method, system, electronic equipment and medium of mobile terminal page
CN113411622A (en) * 2021-05-26 2021-09-17 广州方硅信息技术有限公司 Loading method and device of live broadcast interface, client and storage medium
CN113411622B (en) * 2021-05-26 2022-03-15 广州方硅信息技术有限公司 Loading method and device of live broadcast interface, client and storage medium

Also Published As

Publication number Publication date
CN104536791A (en) 2015-04-22

Similar Documents

Publication Publication Date Title
WO2016107325A1 (en) Page resource loading method and device based on mobile terminal
US10261669B2 (en) Publishing electronic documents utilizing navigation information
KR102047568B1 (en) Measuring web page rendering time
US10460016B2 (en) Method and apparatus for playing multimedia in browser
EP3442238A1 (en) Video frame capturing method and device
CN107590228B (en) Page content processing method and mobile terminal
CN111639289A (en) Webpage loading method and device
CN106293352B (en) Page construction method, terminal and server
CN105824830B (en) Method, client and equipment for displaying page
CN109218819B (en) Video preview method and mobile terminal
CN102547450B (en) Delayed image decoding
WO2017000804A1 (en) Method and device for browsing news on mobile terminal
WO2018072388A1 (en) Method for pre-reading webpage, method and device for accessing webpage, and programmable device
WO2015109832A1 (en) Page switching method and electronic device
CN104199684A (en) Browser cold-booting method and device
WO2016192546A1 (en) Method and device for updating data point of dynamic curve
WO2017101390A1 (en) Picture display method and apparatus
CN105630310A (en) Method and device for displaying titles during graph group switching
US20170169599A1 (en) Methods and electronic devices for displaying picture
US20160196240A1 (en) Method of displaying content and electronic device implementing same
CN107391534B (en) Page display method, page file return method, page display device, page file return device and computer storage medium
CN113010814A (en) Webpage content processing method, computing device and computer storage medium
CN113032073A (en) Page display method and device based on operation behaviors
WO2016111882A1 (en) Control of access and management of browser annotations
WO2019019641A1 (en) Video display method and device

Legal Events

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

Ref document number: 15875004

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15875004

Country of ref document: EP

Kind code of ref document: A1