CN108763297B - Webpage resource processing method and device and mobile terminal - Google Patents

Webpage resource processing method and device and mobile terminal Download PDF

Info

Publication number
CN108763297B
CN108763297B CN201810351175.5A CN201810351175A CN108763297B CN 108763297 B CN108763297 B CN 108763297B CN 201810351175 A CN201810351175 A CN 201810351175A CN 108763297 B CN108763297 B CN 108763297B
Authority
CN
China
Prior art keywords
priority
resource
webpage
resources
network
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201810351175.5A
Other languages
Chinese (zh)
Other versions
CN108763297A (en
Inventor
赵剑萍
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201810351175.5A priority Critical patent/CN108763297B/en
Publication of CN108763297A publication Critical patent/CN108763297A/en
Application granted granted Critical
Publication of CN108763297B publication Critical patent/CN108763297B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the application discloses a webpage resource processing method and device and a mobile terminal. The method comprises the following steps: analyzing the received webpage data; in the webpage data analysis process, when a node which needs to request resources from a network in the webpage data is analyzed, the priority of the resources corresponding to the node is obtained; and requesting the resources from the network based on the priority order of the resources, wherein the resources with higher priorities have larger influence on the content display speed of the webpage. The method can configure the priority of the resource which influences the larger display of the webpage content to be higher by configuring the priority of the resource corresponding to the node, so that the resource which influences the larger display of the webpage content can be requested from the network preferentially, the webpage content can be presented to the user more quickly, and the user experience is improved.

Description

Webpage resource processing method and device and mobile terminal
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for processing web page resources, and a mobile terminal.
Background
The main function of the browser installed in the terminal is to acquire web page data from the network, and to analyze and render the web page data for display to the user for browsing. When the browser parses and renders the web page data, the browser generally performs linear parsing and rendering according to the sequence of the resources included in the received web page data.
In this case, the browser does not consider the influence of the complexity of the web page on the web page display speed, but completely relies on the inherent loading mode of the browser to analyze and render the web page, which is not favorable for rapidly presenting the web page content to the user and has a great influence on the user experience.
Disclosure of Invention
In view of the above problems, the present application provides a method and an apparatus for processing web page resources, and a mobile terminal, so as to achieve faster presentation of web page content to a user and improve user experience.
In a first aspect, the present application provides a method for processing web page resources, which is applied to a mobile terminal, and the method includes: analyzing the received webpage data; in the webpage data analysis process, when a node which needs to request resources from a network in the webpage data is analyzed, the priority of the resources corresponding to the node is obtained; and requesting the resources from the network based on the priority order of the resources, wherein the resources with higher priorities have larger influence on the content display speed of the webpage.
In a second aspect, the present application provides a web page resource processing apparatus, operating on a mobile terminal, the apparatus including: the webpage analyzing unit is used for analyzing the received webpage data; the priority acquiring unit is used for acquiring the priority of the resource corresponding to the node when the node which needs to request the resource from the network in the webpage data is analyzed in the webpage data analyzing process; and the resource request unit is used for requesting the resources to the network based on the priority order of the resources, wherein the influence of the resources with higher priorities on the content display speed of the webpage is larger.
In a third aspect, the present application provides a mobile terminal comprising one or more processors and a memory; one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the methods described above.
In a fourth aspect, the present application provides a computer-readable storage medium comprising a stored program, wherein the method described above is performed when the program is executed.
According to the webpage resource processing method, the webpage resource processing device and the mobile terminal, received webpage data are analyzed, and in the webpage data analysis process, when a node needing to request resources to a network in the webpage data is analyzed, the priority of the required requested resources corresponding to the node is obtained. Requesting the required requested resources from the network based on the order of priority of the required requested resources. Therefore, the priority of the resource which influences the larger display of the webpage content can be configured to be higher by configuring the priority of the resource corresponding to the node, so that the resource which influences the larger display of the webpage content can be requested from the network preferentially, the webpage content can be presented to the user more quickly, and the user experience is improved.
These and other aspects of the present application will be more readily apparent from the following description of the embodiments.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a network environment diagram illustrating a web page resource processing method proposed in the present application;
FIG. 2 is a flowchart illustrating a method for processing web page resources according to the present application;
FIG. 3 is a flow chart illustrating another web page resource processing method proposed in the present application;
fig. 4 is a block diagram illustrating a structure of a screen control apparatus according to the present application;
fig. 5 is a block diagram showing a structure of another screen control apparatus proposed in the present application;
fig. 6 shows a block diagram of a mobile terminal according to the present application;
fig. 7 is a block diagram illustrating a mobile terminal for executing a web resource processing method according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The browser starts parsing when it receives web page data during operation, for example, a received web page html (hypertext Markup language) document. In the analysis process of the browser, a dom tree formed by a plurality of nodes is firstly constructed, then a rendering tree is constructed according to the dom tree, and finally the rendering tree is drawn to a page by the browser. Specifically, in the webpage data, the node is a tag in the webpage, for example, a picture tag < img >, the < img > tag represents that a picture resource needs to be requested, or a file tag < link > of an external connection, and the < img > tag represents that an external connection resource needs to be requested, such as an external connection word library file, an external connection (cascading Style sheets) file, or an external connection script file.
In the process of constructing the dom tree, the browser is constructed from top to bottom according to the html documents, namely constructed according to the sequence of the webpage contents to be finally displayed from top to bottom. When script file loading/execution is encountered, the construction of a subsequent dom tree is blocked (because javascript may change the dom tree), and when css file is encountered, the construction of a render tree is blocked, i.e., the dom tree continues to be constructed (unless script tag is encountered and css file is still not loaded yet), but rendering is not performed on the page.
However, the inventor finds that the browser does not consider the influence of the complexity of the web page on the web page display speed, and the browser completely relies on the inherent loading mode of the browser to analyze and render the web page, so that the mode is not favorable for rapidly presenting the web page content to the user, and has a great influence on the user experience. Therefore, the inventor provides a webpage resource processing method, a webpage resource processing device and a mobile terminal, which can realize that webpage content is presented to a user more quickly and user experience is improved.
The application environment to which the present application relates will be described first.
As shown in fig. 1, the mobile terminal 200 and the server 220 are located in a wireless network or a wired network 210, and the mobile terminal 200 and the server 220 perform data interaction through the wireless network or the wired network 210. In the present application, the mobile terminal 200 may be a mobile phone, a tablet computer, or the like.
A browser may be run in the mobile terminal 200 and the server 220 may run a server. Based on the above network environment, the browser may perform data interaction with the server 220 through the network 210, so as to perform data interaction with a server running on the server 220. For example, a browser in the mobile terminal 200 initiates a request for web page data to the server 220 through the network 210, and in response, the server 220 returns the requested web page data to the browser in the mobile terminal through the network 210, so that the browser can parse and render the web page data.
It should be noted that fig. 1 is only an exemplary illustration of the process of requesting web page data by a browser and the structural status of the network environment. When web page data or resources requested by browsers are different, the servers with which the interaction is performed may be different.
Embodiments of the present application will be described in detail below with reference to the accompanying drawings.
Referring to fig. 2, a method for processing web page resources provided by the present application is applied to a mobile terminal, and the method includes:
step S110: and analyzing the received webpage data.
As one mode, the browser requests the server for the web page data when detecting that the user touches a web page link displayed in the web page, or may request the server for the web page data when detecting that a preset web page data request event is triggered. After the server returns the web page data, the browser in the mobile terminal can analyze the received web page data.
Step S120: and in the webpage data analysis process, when a node which needs to request resources from a network in the webpage data is analyzed, acquiring the priority of the resources corresponding to the node.
Step S130: and requesting the resources from the network based on the priority order of the resources, wherein the resources with higher priorities have larger influence on the content display speed of the webpage.
As a mode, the priority of the configurable text resource, the style sheet corresponding to the text resource, the picture resource, and the style sheet corresponding to the picture resource is the highest, so that the text resource and the picture resource can be displayed preferentially in the following.
According to the webpage resource processing method, the required request resources are requested to a network based on the priority order of the required request resources. Therefore, the priority of the resource which influences the larger display of the webpage content can be configured to be higher by configuring the priority of the resource corresponding to the node, so that the resource which influences the larger display of the webpage content can be requested from the network preferentially, the webpage content can be presented to the user more quickly, and the user experience is improved.
Referring to fig. 3, a method for processing web page resources provided by the present application is applied to a mobile terminal, and the method includes:
step S210: and analyzing the received webpage data.
As one mode, the browser requests the server for the web page data when detecting that the user touches a web page link displayed in the web page, or may request the server for the web page data when detecting that a preset web page data request event is triggered. For example, when a jump to a specified page n seconds after the countdown of the preset configuration is detected, the browser requests the specified page from the server after the completion of the countdown of n seconds is detected. After the server returns the web page data, the browser in the mobile terminal can analyze the received web page data.
Step S220: and in the webpage data analysis process, when a node which needs to request resources from a network in the webpage data is analyzed, acquiring the priority of the resources corresponding to the node.
For a user, when a browser of the mobile terminal is triggered to load a webpage, the user wants to quickly browse texts and pictures in the webpage, and for the initial stage of loading the webpage, the requirement on instantaneity of some interactive operations in the webpage is not high. For example, some buttons or links may be clicked, and the user usually clicks on the buttons or links in the web page after browsing the web page content. The priority of the resource to be requested in the webpage parsing process can be configured based on the above manner.
For example, the priority of the text resource and the picture resource is configured to be the highest, the priority of the external font library resource is configured to be lower than the priority of the text resource and the picture resource, and the priority of the js script file describing the interactive operation of the button is configured to be lower than the priority of the external font library resource, so that the text and the picture content can be rapidly presented to the user.
Wherein, as one way, the priority of different resources can be configured in the form of files. In the multiple established files, the priorities of the multiple resources configured respectively may be different, so that when the browser loads different types of web pages, the browser can select to configure the priority of the resource required to be requested in the loaded web page based on the priority of the resource described by which file according to the type of the loaded web page.
For example, in the resource priority order described in the file a, the priority of the text resource is higher than the priority of the picture resource. In the resource priority order described in the file B, the priority of the picture resource is higher than the priority of the text resource. The browser can firstly judge the type of the webpage to which the webpage data belongs after receiving the webpage data, namely acquiring the html document, and when the type of the webpage is judged to be a text webpage, the priority of the resource can be acquired based on the file A, so that the text content can be presented to the user more quickly. When the type of the webpage is judged to be the picture webpage, the priority of the resource can be obtained based on the file B, so that the picture content can be presented to the user more quickly.
In addition to configuring the priority of the requested resource according to the type of the resource as described above, the priority of the resource may be configured according to a display mode of the resource. A subframe is also embedded in some web pages, and some subframes are hidden in the automatic loading process of the web pages and can be triggered to display only after a user performs touch operation. For example, a page having an iframe as a main frame includes a plurality of subframes, i.e., a plurality of frames. It is possible to configure the subframe in which the priority of the subframe that is not displayed after the initial loading of the web page is completed is lower than the priority of the subframe that is displayed after the initial loading of the web page is completed.
Step S230: a network request is generated for requesting the resource.
After acquiring the priority of the requested resource, the browser generates a network request based on a communication protocol with the server, that is, organizes data based on a data format specified by the communication protocol, so as to obtain the network request. As one approach, when the browser and the server communicate based on a common communication protocol, the browser may generate an http request based on http or an https request based on an https protocol. Further, when the browser supports private protocol communications, the browser can also generate a network request based on the private communication protocol.
Step S240: and acquiring a target storage queue from the established multiple priority queues, wherein the priority of the target storage queue is matched with the priority of the required request resource.
And for different priority queues, the corresponding priorities are different. For example, there may be a highest priority queue, a next highest priority queue, and a lowest priority queue. When the priority of the resource requested by the network request is the highest, the queue matched with the priority of the resource is the queue with the highest priority, and the browser correspondingly stores the resource to the queue with the highest priority.
Step S250: and sending the network request to the target deposit queue, wherein the network request in the queue with high priority is sent preferentially in the plurality of priority queues.
Step S260: when a resource returned by the network is detected.
Step S270: and acquiring the priority corresponding to the returned resource.
Step S280: and processing the returned resources according to the priority order corresponding to the returned resources, wherein the corresponding resources with high priority are processed preferentially.
Similarly, multiple priority queues may be established to hold resources returned by the server. When a returned resource is received, the resource is stored in a queue that matches the priority of the resource. And, among the plurality of priority queues, resources in a queue having a higher priority are preferentially processed. Wherein the processing procedure for returning includes at least one of updating the dom tree and direct rendering. For example, when the returned resource has no influence on the constructed dom tree, the returned resource is directly rendered. And when the returned resources have an influence on the currently constructed dom tree, for example, the script file of the external connection, the dom tree is updated based on the returned resources, and then the dom tree is rendered.
It should be noted that, when the resource is configured with priority according to the resource type, the priority of the priority queue stored in the network request when the resource is requested and the priority of the priority queue placed when the resource is returned are the same.
As one mode, when the browser of the mobile terminal detects that the area occupied by the display content analyzed from the web page data exceeds a preset value, the browser sends the remaining network requests in the priority queues in parallel. For example, when it is detected that the ratio of the area occupied by the display content analyzed from the web page data to the area of the display screen of the mobile terminal is 1, that is, it is detected that the display content analyzed from the web page data can be spread over the screen of the mobile terminal, the influence of the subsequent analysis and rendering of the web page data on the rapid presentation of the display content to the user is small, and then the remaining network requests in the plurality of priority queues can be directly sent in parallel. Similarly, for the resources returned subsequently, the processing can be performed in the order of return, and not necessarily in the order of priority configured in advance.
According to the webpage resource processing method, when the node needing to request data is analyzed, the network request for requesting the resource is generated, and then the network request is stored in the target storage queue with the matched priority, so that the priority of the resource which influences the larger webpage content display can be configured to be higher in a mode of configuring the priority of the resource corresponding to the node, the resource which influences the larger webpage content display can be requested from the network preferentially, the webpage content can be presented to a user more rapidly, and user experience is improved.
Referring to fig. 4, a web resource processing apparatus 300 provided by the present application runs on a mobile terminal, and the apparatus 300 includes: a web page parsing unit 310, a priority obtaining unit 320, and a resource requesting unit 330.
The web page parsing unit 310 is configured to parse the received web page data.
A priority obtaining unit 320, configured to, in the process of analyzing the web page data, obtain a priority of a resource corresponding to a node when the node that needs to request a resource from a network in the web page data is analyzed.
A resource requesting unit 330, configured to request the resources from the network based on an order of priorities of the resources, where a resource with a higher corresponding priority has a greater influence on a content display speed of the web page.
As a mode, the priority of the configurable text resource, the style sheet corresponding to the text resource, the picture resource, and the style sheet corresponding to the picture resource is the highest, so that the text resource and the picture resource can be displayed preferentially in the following.
Referring to fig. 5, a web resource processing apparatus 400 provided by the present application runs on a mobile terminal, and the apparatus 400 includes:
a web page parsing unit 410, configured to parse the received web page data.
A priority obtaining unit 420, configured to, in the process of analyzing the web page data, obtain a priority of a resource corresponding to a node when the node that needs to request a resource from a network in the web page data is analyzed.
A resource requesting unit 430, configured to request the resources from the network based on an order of priorities of the resources, where a resource with a higher priority has a greater influence on a content display speed of the web page.
By one way, the resource request unit 430 includes:
a network request generation subunit 431, configured to generate a network request for requesting the resource;
a network request enqueue subunit 432, configured to obtain a target storage queue from the multiple established priority queues, where a priority of the target storage queue is matched with a priority of the required request resource; and sending the network request to the target deposit queue, wherein the network request in the queue with high priority is sent preferentially in the plurality of priority queues.
The apparatus 400 further includes a display content detection unit 440 configured to detect an area occupied by display content parsed from the web page data.
In addition, the resource requesting unit 430 is further configured to, when the display content detecting unit 440 detects that the area occupied by the display content analyzed from the web page data exceeds a preset value, send the remaining network requests in the multiple priority queues in parallel.
In summary, according to the method, the device and the mobile terminal for processing the webpage resources provided by the application, the received webpage data are analyzed, and in the webpage data analysis process, when a node which needs to request resources from a network in the webpage data is analyzed, the priority of the required request resources corresponding to the node is obtained. Requesting the required requested resources from the network based on the order of priority of the required requested resources. Therefore, the priority of the resource which influences the larger display of the webpage content can be configured to be higher by configuring the priority of the resource corresponding to the node, so that the resource which influences the larger display of the webpage content can be requested from the network preferentially, the webpage content can be presented to the user more quickly, and the user experience is improved.
A mobile terminal provided by the present application will be described with reference to fig. 6 and 7.
Referring to fig. 6, based on the web resource processing method and apparatus, the embodiment of the present application further provides a mobile terminal 100 capable of executing the web resource processing method. The mobile terminal 100 includes an electronic body 10, and the electronic body 10 includes a housing 12 and a first screen 120 disposed on the housing 12. The housing 12 may be made of metal, such as steel or aluminum alloy. In this embodiment, the first screen 120 and the second screen 121 generally include a display panel 111, and may also include a circuit and the like for responding to a touch operation performed on the display panel 111. The Display panel 111 may be a Liquid Crystal Display (LCD) panel, and in some embodiments, the Display panel 111 is a touch screen 109.
As shown in fig. 7, in an actual application scenario, the mobile terminal 100 may be used as a smartphone terminal, in which case the electronic body 10 generally further includes one or more processors 102 (only one is shown in the figure), a memory 104, an RF (Radio Frequency) module 106, an audio circuit 110, a sensor 114, an input module 118, and a power module 122. It will be understood by those skilled in the art that the present application is not intended to be limited to the configuration of the electronics body portion 10. For example, the electronics body section 10 may include more or fewer components than shown, or have a different configuration than shown.
Those skilled in the art will appreciate that all other components are peripheral devices with respect to the processor 102, and the processor 102 is coupled to the peripheral devices through a plurality of peripheral interfaces 124. The peripheral interface 124 may be implemented based on the following criteria: universal Asynchronous Receiver/Transmitter (UART), General Purpose Input/Output (GPIO), Serial Peripheral Interface (SPI), and Inter-Integrated Circuit (I2C), but the present invention is not limited to these standards. In some examples, the peripheral interface 124 may comprise only a bus; in other examples, the peripheral interface 124 may also include other elements, such as one or more controllers, for example, a display controller for interfacing with the display panel 111 or a memory controller for interfacing with a memory. These controllers may also be separate from the peripheral interface 124 and integrated within the processor 102 or a corresponding peripheral.
The memory 104 may be used to store software programs and modules, and the processor 102 executes various functional applications and data processing by executing the software programs and modules stored in the memory 104. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid state memory. In some examples, the memory 104 may further include memory remotely located from the processor 102, which may be connected to the electronic body portion 10 or the first screen 120 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The RF module 106 is configured to receive and transmit electromagnetic waves, and achieve interconversion between the electromagnetic waves and electrical signals, so as to communicate with a communication network or other devices. The RF module 106 may include various existing circuit elements for performing these functions, such as an antenna, a radio frequency transceiver, a digital signal processor, an encryption/decryption chip, a Subscriber Identity Module (SIM) card, memory, and so forth. The RF module 106 may communicate with various networks such as the internet, an intranet, a wireless network, or with other devices via a wireless network. The wireless network may comprise a cellular telephone network, a wireless local area network, or a metropolitan area network. The Wireless network may use various Communication standards, protocols, and technologies, including, but not limited to, Global System for Mobile Communication (GSM), Enhanced Mobile Communication (Enhanced Data GSM Environment, EDGE), wideband Code division multiple Access (W-CDMA), Code Division Multiple Access (CDMA), Time Division Multiple Access (TDMA), Wireless Fidelity (WiFi) (e.g., IEEE802.1 a, IEEE802.11 b, IEEE802.1 g, and/or IEEE802.11 n), Voice over internet protocol (VoIP), world wide mail Access (Microwave for Wireless communications, wimax), and any other suitable protocol for instant messaging, and may even include those protocols that have not yet been developed.
The audio circuitry 110, speaker 101, sound jack 103, microphone 105 collectively provide an audio interface between a user and the electronic body portion 10 or the first screen 120. Specifically, the audio circuit 110 receives sound data from the processor 102, converts the sound data into an electrical signal, and transmits the electrical signal to the speaker 101. The speaker 101 converts an electric signal into a sound wave audible to the human ear. The audio circuitry 110 also receives electrical signals from the microphone 105, converts the electrical signals to sound data, and transmits the sound data to the processor 102 for further processing. Audio data may be retrieved from the memory 104 or through the RF module 106. In addition, audio data may also be stored in the memory 104 or transmitted through the RF module 106.
The sensor 114 is disposed in the electronic body portion 10 or the first screen 120, and examples of the sensor 114 include, but are not limited to: light sensors, operational sensors, pressure sensors, infrared heat sensors, distance sensors, gravitational acceleration sensors, and other sensors.
Specifically, the light sensors may include a light sensor 114F, a pressure sensor 114G. Among them, the pressure sensor 114G may detect a pressure generated by pressing on the mobile terminal 100. That is, the pressure sensor 114G detects pressure generated by contact or pressing between the user and the mobile terminal, for example, contact or pressing between the user's ear and the mobile terminal. Accordingly, the pressure sensor 114G may be used to determine whether contact or pressing has occurred between the user and the mobile terminal 100, as well as the magnitude of the pressure.
Referring to fig. 7 again, in the embodiment shown in fig. 7, the light sensor 114F and the pressure sensor 114G are disposed adjacent to the display panel 111. The light sensor 114F can turn off the display output when an object is near the first screen 120, for example, when the electronic body 10 moves to the ear.
As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in various directions (generally three axes), detect the magnitude and direction of gravity when stationary, and can be used for applications (such as horizontal and vertical screen switching, related games, magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tapping) and the like for recognizing the attitude of the mobile terminal 100. In addition, the electronic body 10 may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer and a thermometer, which are not described herein,
in this embodiment, the input module 118 may include the touch screen 109 disposed on the first screen 120, and the touch screen 109 may collect a touch operation of a user on or near the touch screen 109 (for example, an operation of the user on or near the touch screen 109 using any suitable object or accessory such as a finger, a stylus, etc.) and drive a corresponding connection device according to a preset program. Optionally, the touch screen 109 may include a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 102, and can receive and execute commands sent by the processor 102. In addition, the touch detection function of the touch screen 109 may be implemented by using resistive, capacitive, infrared, and surface acoustic wave types. In addition to the touch screen 109, in other variations, the input module 118 may include other input devices, such as keys. The keys may include, for example, character keys for inputting characters, and control keys for triggering control functions. Examples of such control keys include a "back to home" key, a power on/off key, and the like.
The first screen 120 is used to display information input by a user, information provided to the user, and various graphic user interfaces of the electronic main body part 10, which may be composed of graphics, text, icons, numbers, videos, and any combination thereof, and in one example, the touch screen 109 may be provided on the display panel 111 so as to be integrated with the display panel 111.
The power module 122 is used to provide power supply to the processor 102 and other components. Specifically, the power module 122 may include a power management system, one or more power sources (e.g., batteries or ac power), a charging circuit, a power failure detection circuit, an inverter, a power status indicator light, and any other components related to the generation, management, and distribution of power in the electronic body 10 or the first screen 120.
The mobile terminal 100 further comprises a locator 119, the locator 119 being configured to determine an actual location of the mobile terminal 100. In this embodiment, the locator 119 implements the positioning of the mobile terminal 100 by using a positioning service, which is understood to be a technology or a service for obtaining the position information (e.g., longitude and latitude coordinates) of the mobile terminal 100 by using a specific positioning technology and marking the position of the positioned object on an electronic map.
It should be understood that the mobile terminal 100 described above is not limited to a smartphone terminal, but it should refer to a computer device that can be used in mobility. Specifically, the mobile terminal 100 refers to a mobile computer device equipped with an intelligent operating system, and the mobile terminal 100 includes, but is not limited to, a smart phone, a smart watch, a tablet computer, and the like.
In the description herein, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present application, "plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and the scope of the preferred embodiments of the present application includes other implementations in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present application.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (mobile terminal) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments. In addition, functional units in the embodiments of the present application may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc. Although embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application, and that variations, modifications, substitutions and alterations may be made to the above embodiments by those of ordinary skill in the art within the scope of the present application.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not necessarily depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (9)

1. A webpage resource processing method is applied to a mobile terminal, and the method comprises the following steps:
analyzing the received webpage data;
in the webpage data analysis process, when a node which needs to request resources from a network in the webpage data is analyzed, the priority of the resources corresponding to the node is obtained, and the node is a label in the webpage data;
generating a network request for requesting the resource;
acquiring a target storage queue from the established multiple priority queues, wherein the priority of the target storage queue is matched with the priority of the required request resource;
sending the network request to the target storage queue for sending, wherein in the plurality of priority queues, the network request in the queue with a high priority is sent preferentially, and the influence of the resource with a higher corresponding priority on the content display speed of the webpage is larger;
and when the area of the area occupied by the display content analyzed from the webpage data is detected to exceed the preset value, the ratio of the area of the displayable area of the mobile terminal to the area of the area occupied by the display content analyzed from the webpage data is detected, and the rest network requests in the priority queues are sent in parallel.
2. The method of claim 1, further comprising;
when detecting the resource returned by the network;
acquiring the priority corresponding to the returned resource;
and processing the returned resources according to the priority order corresponding to the returned resources, wherein the corresponding resources with high priority are processed preferentially.
3. The method of claim 2, wherein the step of processing the returned resources in the order of their corresponding priorities comprises:
acquiring a target processing queue from a plurality of established priority queues, wherein the priority of the target processing queue is matched with the priority of the returned resource;
and sending the returned resources to the target processing queue, wherein the resources in the queue with high priority in the plurality of priority queues are processed preferentially.
4. The method according to claim 1, wherein the step of obtaining the priority of the required requested resource corresponding to the node comprises:
acquiring a priority configuration file corresponding to the type of the webpage to which the webpage data belongs;
and acquiring the priority of the required request resource corresponding to the node in the priority configuration file.
5. The method according to any one of claims 1-4, wherein the text resource, the style sheet corresponding to the text resource, the picture resource, and the style sheet corresponding to the picture resource have the highest priority.
6. A web page resource processing apparatus, operating on a mobile terminal, the apparatus comprising:
the webpage analyzing unit is used for analyzing the received webpage data;
a priority obtaining unit, configured to, when a node that needs to request a resource from a network in the web page data is analyzed in the web page data analysis process, obtain a priority of the resource corresponding to the node, where the node is a tag in the web page data;
a resource requesting unit, configured to request the resources from a network based on an order of priorities of the resources, where a resource with a higher corresponding priority has a greater influence on a content display speed of a web page;
wherein the resource request unit includes:
a network request generation subunit, configured to generate a network request for requesting the resource;
the network request enqueue subunit is used for acquiring a target storage queue from the established multiple priority queues, and the priority of the target storage queue is matched with the priority of the required request resource; and sending the network request to the target storage queue for sending, wherein the network request in the queue with higher priority is sent preferentially in the plurality of priority queues.
7. The apparatus of claim 6, further comprising:
a display content detection unit configured to detect an area occupied by display content analyzed from the web page data;
the resource request unit is further configured to send the remaining network requests in the plurality of priority queues in parallel when the display content detection unit detects that the area of the area occupied by the display content analyzed from the web page data exceeds a preset value, and the ratio of the area of the displayable area of the mobile terminal to the area of the area occupied by the display content detected from the web page data exceeds the preset value.
8. A mobile terminal comprising one or more processors and memory;
one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the method of any of claims 1-5.
9. A computer-readable storage medium having program code executable by a processor, the computer-readable storage medium comprising a stored program, wherein the method of any of claims 1-5 is performed when the program is run.
CN201810351175.5A 2018-04-18 2018-04-18 Webpage resource processing method and device and mobile terminal Active CN108763297B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810351175.5A CN108763297B (en) 2018-04-18 2018-04-18 Webpage resource processing method and device and mobile terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810351175.5A CN108763297B (en) 2018-04-18 2018-04-18 Webpage resource processing method and device and mobile terminal

Publications (2)

Publication Number Publication Date
CN108763297A CN108763297A (en) 2018-11-06
CN108763297B true CN108763297B (en) 2021-08-17

Family

ID=64011078

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810351175.5A Active CN108763297B (en) 2018-04-18 2018-04-18 Webpage resource processing method and device and mobile terminal

Country Status (1)

Country Link
CN (1) CN108763297B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110704781A (en) * 2019-09-30 2020-01-17 北京百度网讯科技有限公司 Web page parser
CN113535179B (en) * 2020-04-22 2023-03-28 Oppo(重庆)智能科技有限公司 Control method, wearable device and storage medium
CN112965756B (en) * 2021-01-21 2023-09-26 北京达佳互联信息技术有限公司 Page resource loading amount monitoring method and device, electronic equipment and storage medium
CN113467967A (en) * 2021-06-11 2021-10-01 广州虎牙科技有限公司 Configuration method of network loading resources, resource configuration system and related device
CN118035587A (en) * 2023-12-13 2024-05-14 天翼云科技有限公司 Browser rendering method, device and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103024044A (en) * 2012-12-14 2013-04-03 北京奇虎科技有限公司 Method and device for downloading web pages
CN104137104A (en) * 2012-02-24 2014-11-05 高通股份有限公司 Cooperative loading of webpages based on shared meta information
CN106210146A (en) * 2016-09-13 2016-12-07 郑州云海信息技术有限公司 File loading method based on B/S framework, device, server and system
CN107885799A (en) * 2017-10-30 2018-04-06 维沃移动通信有限公司 Info web display methods and device

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103258024B (en) * 2013-05-07 2016-06-15 百度在线网络技术(北京)有限公司 The sharing method of picture local content, system and device in webpage
CN105868608B (en) * 2016-04-12 2018-01-23 广东欧珀移动通信有限公司 The method and terminal of a kind of unlocked by fingerprint
CN106055647A (en) * 2016-05-31 2016-10-26 深圳市永兴元科技有限公司 Webpage display processing method and device
CN106294640B (en) * 2016-08-02 2020-02-21 三星电子(中国)研发中心 Webpage display method and device
US20180041563A1 (en) * 2016-08-05 2018-02-08 Koji Yoden Enhanced multifunctional computing device
CN107274470B (en) * 2017-06-15 2020-10-09 深圳市彬讯科技有限公司 Multi-priority queue scheduling method based on real-time offline rendering parallelism

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104137104A (en) * 2012-02-24 2014-11-05 高通股份有限公司 Cooperative loading of webpages based on shared meta information
CN103024044A (en) * 2012-12-14 2013-04-03 北京奇虎科技有限公司 Method and device for downloading web pages
CN106210146A (en) * 2016-09-13 2016-12-07 郑州云海信息技术有限公司 File loading method based on B/S framework, device, server and system
CN107885799A (en) * 2017-10-30 2018-04-06 维沃移动通信有限公司 Info web display methods and device

Also Published As

Publication number Publication date
CN108763297A (en) 2018-11-06

Similar Documents

Publication Publication Date Title
CN108763297B (en) Webpage resource processing method and device and mobile terminal
CN111178012B (en) Form rendering method, device, equipment and storage medium
CN107040609B (en) Network request processing method and device
US10643021B2 (en) Method and device for processing web page content
CN109857403B (en) Page updating method and device, page processing method and device
CN108197264B (en) Webpage acceleration display method and device, mobile terminal and storage medium
CN107247691B (en) Text information display method and device, mobile terminal and storage medium
CN109857506B (en) Method and device for realizing guide information, electronic equipment and storage medium
CN103399866A (en) Webpage rendering method, device and equipment
CN108073647B (en) Webpage display method and device
CN108170723B (en) Webpage resource acquisition method, terminal equipment, server and system
US9921735B2 (en) Apparatuses and methods for inputting a uniform resource locator
CN110020293B (en) Multimedia data display method, device and storage medium
WO2014206055A1 (en) A method and system for generating a user interface
WO2019233316A1 (en) Data processing method and device, mobile terminal, and storage medium
WO2014176906A1 (en) Online video playing method and apparatus and computer readable medium
US20180322101A1 (en) Method and apparatus for displaying page and a computer storage medium
CN105095161B (en) Method and device for displaying rich text information
WO2015003636A1 (en) Method and device for interception of page elements
CN109032491A (en) Data processing method, device and mobile terminal
CN112749074B (en) Test case recommending method and device
CN110674444B (en) Method and terminal for downloading dynamic webpage
CN108763544A (en) A kind of display methods and terminal
CN109491670A (en) A kind of page display method and terminal device
CN108182090A (en) Flash plug-in loading methods and device based on blink kernels

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant