CN107463627B - Picture loading method and terminal - Google Patents

Picture loading method and terminal Download PDF

Info

Publication number
CN107463627B
CN107463627B CN201710564756.2A CN201710564756A CN107463627B CN 107463627 B CN107463627 B CN 107463627B CN 201710564756 A CN201710564756 A CN 201710564756A CN 107463627 B CN107463627 B CN 107463627B
Authority
CN
China
Prior art keywords
picture
loaded
terminal
memory
window
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
CN201710564756.2A
Other languages
Chinese (zh)
Other versions
CN107463627A (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.)
Shenzhen Yunlingtianxia Technology Co ltd
Original Assignee
Shenzhen Yunlingtianxia Technology Co 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 Shenzhen Yunlingtianxia Technology Co ltd filed Critical Shenzhen Yunlingtianxia Technology Co ltd
Priority to CN201710564756.2A priority Critical patent/CN107463627B/en
Publication of CN107463627A publication Critical patent/CN107463627A/en
Application granted granted Critical
Publication of CN107463627B publication Critical patent/CN107463627B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention discloses a picture loading method and a terminal, and relates to the technical field of computers. The method comprises the following steps: when a user opens a webpage, judging whether a loading position of a picture to be loaded on the webpage is in a current display window of the terminal; if the current display window is in the current display window, inquiring whether the picture to be loaded exists in the internal memory of the terminal; if the picture to be loaded exists in the memory, reading the picture to be loaded in the memory, and displaying the picture in the current window; if the picture to be loaded does not exist in the internal memory, inquiring whether the picture to be loaded exists in a hardware cache of the terminal; if the picture to be loaded exists in the hardware cache, reading the picture to be loaded from the hardware cache, and displaying the picture to be loaded in a current window; and if the picture to be loaded does not exist in the hardware cache, downloading the picture to be loaded from the network, and displaying the picture to be loaded in the current window. The embodiment of the invention can save flow, improve the fluency of webpage picture loading and improve user experience.

Description

Picture loading method and terminal
Technical Field
The invention relates to the technical field of computers, in particular to a picture loading method and a terminal.
Background
With the development of economy, the functions of intelligent terminals such as mobile phones and the like are more and more powerful, and webpage picture display has become a mainstream content display mode of most application programs. In the prior art, web page pictures are usually stored on a network server, and when a user browses a web page, the user needs to download the web page pictures to a local hard disk first, then load the web page pictures from the local hard disk for display, and finally put the downloaded web page pictures into a memory for caching for the next display. However, due to a restriction mechanism of an operating system memory, most of the memories of the intelligent terminals such as the mobile phones can only cache a few pictures, and in practical application, if a user slides a browsing interface of a webpage back and forth on the terminal and the pictures on the webpage are not all cached in the memory, the terminal needs to download the same picture from the network server for many times, which consumes much traffic; in addition, when the number of pictures on the web page is large, the downloading time is long, which causes the web page browsing interface to be unsmooth, and brings bad experience to the user.
Disclosure of Invention
The embodiment of the invention provides a picture loading method and a terminal, which can save the consumption of network flow, improve the fluency of webpage picture loading and improve the user experience.
In a first aspect, an embodiment of the present invention provides a picture loading method, where the picture loading method includes:
when a user opens a webpage, judging whether a loading position of a picture to be loaded on the webpage is in a current display window of the terminal;
if the current display window is in the current display window, inquiring whether the picture to be loaded exists in a terminal memory;
if the picture to be loaded exists in the memory, reading the picture to be loaded in the memory, and displaying the picture in a current window;
if the picture to be loaded does not exist in the memory, inquiring whether the picture to be loaded exists in a hardware cache of the terminal;
if the picture to be loaded exists in the hardware cache, reading the picture to be loaded from the hardware cache, and displaying the picture to be loaded in the current window;
and if the picture to be loaded does not exist in the hardware cache, downloading the picture to be loaded from the network, and displaying the picture to be loaded in the current window.
In a second aspect, an embodiment of the present invention provides a terminal, where the terminal includes:
the judging unit is used for judging whether the loading position of the picture to be loaded on the webpage is in the current display window of the terminal when the user opens the webpage;
the memory query unit is used for querying whether the picture to be loaded exists in the memory of the terminal if the picture is in the current display window;
the memory reading unit is used for reading the picture to be loaded in the memory and displaying the picture in the current window if the picture to be loaded exists in the memory;
the hard disk inquiring unit is used for inquiring whether the picture to be loaded exists in a hardware cache of the terminal if the picture to be loaded does not exist in the internal memory;
a hard disk reading unit, configured to read the picture to be loaded from the hardware cache if the picture to be loaded exists in the hardware cache, and display the picture to be loaded on the current window;
and the downloading unit is used for downloading the picture to be loaded from the network and displaying the picture to be loaded on the current window if the picture to be loaded does not exist in the hardware cache.
In a third aspect, an embodiment of the present invention provides another terminal, which includes a processor, an input device, an output device, and a memory, where the processor, the input device, the output device, and the memory are connected to each other, where the memory is used to store an application program code that supports the terminal to execute the foregoing method, and the processor is configured to call the application program code to execute the foregoing picture loading method according to the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored, where the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is caused to execute the picture loading method according to the first aspect.
The embodiment of the invention judges whether the loading position of the picture to be loaded on the webpage is in the current display window of the terminal when the user opens the webpage; if the current display window is in the current display window, inquiring whether the picture to be loaded exists in a terminal memory; if the picture to be loaded exists in the memory, reading the picture to be loaded in the memory, and displaying the picture in a current window; if the picture to be loaded does not exist in the memory, inquiring whether the picture to be loaded exists in a hardware cache of the terminal; if the picture to be loaded exists in the hardware cache, reading the picture to be loaded from the hardware cache, and displaying the picture to be loaded in the current window; if the picture to be loaded does not exist in the hardware cache, the picture to be loaded is downloaded from the network, and the picture to be loaded is displayed in the current window, so that the consumption of network flow can be saved, the fluency of webpage picture loading is improved, and the user experience is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, 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 some embodiments of the present invention, 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 schematic flowchart of a picture loading method according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a specific implementation of step S106 in a method for loading pictures according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a picture loading method according to an embodiment of the present invention;
fig. 4 is a schematic block diagram of a terminal according to an embodiment of the present invention;
fig. 5 is a schematic block diagram of a terminal according to an embodiment of the present invention;
fig. 6 is a schematic block diagram of a terminal according to an embodiment of the present invention;
fig. 7 is a schematic block diagram of a terminal according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. 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 invention.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to a determination" or "in response to a detection". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
In particular implementations, the terminals described in embodiments of the invention include, but are not limited to, other portable devices such as mobile phones, laptop computers, or tablet computers having touch sensitive surfaces (e.g., touch screen displays and/or touch pads). It should also be understood that in some embodiments, the device is not a portable communication device, but is a desktop computer having a touch-sensitive surface (e.g., a touch screen display and/or touchpad).
In the discussion that follows, a terminal that includes a display and a touch-sensitive surface is described. However, it should be understood that the terminal may include one or more other physical user interface devices such as a physical keyboard, mouse, and/or joystick.
The terminal supports various applications, such as one or more of the following: a drawing application, a presentation application, a word processing application, a website creation application, a disc burning application, a spreadsheet application, a gaming application, a telephone application, a video conferencing application, an email application, an instant messaging application, an exercise support application, a photo management application, a digital camera application, a web browsing application, a digital music player application, and/or a digital video player application.
Various applications that may be executed on the terminal may use at least one common physical user interface device, such as a touch-sensitive surface. One or more functions of the touch-sensitive surface and corresponding information displayed on the terminal can be adjusted and/or changed between applications and/or within respective applications. In this way, a common physical architecture (e.g., touch-sensitive surface) of the terminal can support various applications with user interfaces that are intuitive and transparent to the user.
Referring to fig. 1, which is a schematic flowchart illustrating a picture loading method according to an embodiment of the present invention, as shown in fig. 1, the picture loading method may include:
step S101, when a user opens a webpage, judging whether a loading position of a picture to be loaded on the webpage is in a current display window of a terminal, and if the loading position is in the current display window, entering step S102; otherwise, the picture to be loaded at the loading position is not loaded.
Preferably, in this embodiment, the web page includes a plurality of pictures, each picture corresponds to a loading position, when the user opens the web page, first obtaining a loading position coordinate corresponding to each picture, then comparing the loading position coordinate corresponding to each picture with a coordinate of a current window displayed on a terminal foreground, and determining whether the loading position corresponding to each picture is within a display range of the current window, if so, entering step S102 to load the picture; otherwise, the picture corresponding to the position is not loaded. Therefore, only pictures needing to be displayed currently can be loaded, and pictures which are not in the display range are not loaded, so that the network flow consumption of the terminal is saved, and the fluency of webpage browsing is improved.
Step S102, inquiring whether the picture to be loaded exists in a terminal memory, and entering step S103 if the picture to be loaded exists in the memory; if the picture to be loaded does not exist in the memory, the process proceeds to step S104.
Preferably, in this embodiment, the memory of the terminal is equivalent to a buffer, and stores the picture in the form of key-value, when the terminal determines that the position to be loaded is within the current display window, the picture is first searched from the memory according to the URLKey of the loaded position, if the picture matching the URLKey of the loaded position is found, the process proceeds to step S103, otherwise, if the picture matching the URLKey of the loaded position is not found, the process proceeds to step S104.
Preferably, in this embodiment, some notifications may be registered, and when the memory is warned or the application is backed up to the background, the picture cached in the memory is cleaned, or when the application is ended, the expired picture cached in the memory is cleaned according to the time of the picture caching. The memory warning is a warning that the size of the cached picture in the memory exceeds a preset threshold value, namely the memory space is full.
And step S103, reading the picture to be loaded in the memory, and displaying the picture in the current window.
Preferably, in this embodiment, if the picture matched with the URLkey at the loading position is stored in the memory, the callback function is called to output the picture corresponding to the URLkey at the loading position to the web browsing interface of the current display window for display, so that the picture does not need to be downloaded from a hard disk or from a network, the consumption of network traffic is avoided, the picture loading speed is increased, and the web display is smoother.
Step S104, inquiring whether the picture to be loaded exists in a hardware cache of the terminal, and if the picture to be loaded exists in the hardware cache, entering step S105; otherwise, if the to-be-loaded picture does not exist in the hardware cache, the process proceeds to step S106.
Preferably, in this embodiment, if the picture matching the URLkey at the loading position is not stored in the memory, a sub-thread NSInvocationOperation is generated and added to a queue, and whether the picture to be loaded is stored is searched from a hardware cache of the terminal through the NSInvocationOperation operation, specifically: and attempting to read the picture file under a hardware cache directory according to the URLKEy of the loading position through NSoperation, and inquiring whether the picture to be loaded exists in the hardware cache. And the hardware is a hard disk in the terminal.
Step S105, reading the picture to be loaded from the hardware cache, and displaying the picture to be loaded on the current window.
Preferably, in this embodiment, if the picture to be loaded is queried in the hardware cache, the queried picture to be loaded is added to the memory of the terminal, and then the callback function is called to display the picture to be loaded in the current display window. In the process, if the memory is too small, the picture cached in the memory is cleared first, and the picture to be loaded is added to the memory.
And step S106, downloading the picture to be loaded from the network, and displaying the picture to be loaded on the current window.
Preferably, in this embodiment, if the to-be-loaded picture does not exist in both the memory and the hardware cache of the terminal, the to-be-loaded picture needs to be downloaded from the network, and at this time, the picture-calling-back loading function downloads the to-be-loaded picture from the network server according to the URL of the loading location. According to the embodiment of the invention, the picture to be loaded does not exist in the terminal memory and the hardware cache, and then the picture is downloaded from the network server, so that the consumption of terminal flow can be saved, and the picture loading speed is increased.
As can be seen from the above, in the image loading method provided by this embodiment, when the user opens the webpage, it is determined whether the loading position of the image to be loaded on the webpage is within the current display window of the terminal; if the current display window is in the current display window, inquiring whether the picture to be loaded exists in a terminal memory; if the picture to be loaded exists in the memory, reading the picture to be loaded in the memory, and displaying the picture in a current window; if the picture to be loaded does not exist in the memory, inquiring whether the picture to be loaded exists in a hardware cache of the terminal; if the picture to be loaded exists in the hardware cache, reading the picture to be loaded from the hardware cache, and displaying the picture to be loaded in the current window; if the picture to be loaded does not exist in the hardware cache, the picture to be loaded is downloaded from the network, and the picture to be loaded is displayed in the current window, so that the consumption of network flow can be saved, the fluency of webpage picture loading is improved, and the user experience is improved.
Fig. 2 is a flowchart illustrating a specific implementation of step S106 in the image loading method according to an embodiment of the present invention. Referring to fig. 2, in this embodiment, step S106 specifically includes:
step S201, sharing or regenerating a downloader, and downloading the picture to be loaded from the network server through the downloader;
step S202, if the picture to be loaded is downloaded, another sub thread decodes the picture to be loaded, and the picture to be loaded is decoded into a bitmap which can be directly used by a control displayed by the current window;
step S203, displaying the decoded picture to be loaded in the current window.
In this embodiment, the downloader downloads the picture to be loaded from the network server by using the NSURLConnection, and implements the related delete to determine the picture download state and call back the download data and the state to the loading module in the terminal. Wherein, the picture downloading state comprises: in download, download complete, and download failure.
In this embodiment, after determining that the data of the picture to be loaded is downloaded, the loading module in the terminal creates an nsaperationqueue sub-thread to decode the downloaded data corresponding to the picture to be loaded, so as to decode the picture to be loaded into a bitmap which can be directly used by the control, and after the decoding is completed, the bitmap is called back to the loading module, and the picture is called back to a required place in the main thread to be displayed. Because the data decoding is carried out in the newly-built sub thread instead of the main thread, the main thread is not dragged, and the loading speed of the picture is further improved.
In addition, it should be noted that, if the picture to be loaded downloaded from the network can be directly used by the control, it is not necessary to decode the picture, and the picture is directly called back to the loading module of the terminal.
Preferably, in this embodiment, after step S203, the method may further include:
and storing the decoded picture to be loaded into the memory and the hard disk cache.
Preferably, in this embodiment, the decoded picture to be loaded may be written into the memory and the hard disk of the terminal by another sub-thread nsinvocalization operation, so that the slow-down of the main thread may be avoided.
In the embodiment, after the picture to be loaded is downloaded from the network server, the picture to be loaded is decoded, and the decoded picture is written into the memory and the hard disk of the terminal, so that the picture to be loaded can be directly loaded from the memory or the hard disk when the webpage is opened next time without downloading from the network server again, thereby not only saving the consumption of terminal flow, but also improving the loading speed of the picture and promoting the fluency of a user for browsing the webpage picture.
Fig. 3 is a schematic flowchart of a picture loading method according to an embodiment of the present invention. Referring to fig. 3, in comparison with the embodiment shown in fig. 1, the method for loading a picture provided in this embodiment further includes:
step S301, setting an occupation map for the loading position of the picture to be loaded on the webpage in advance, wherein the occupation map is a self-defined picture or a blank.
Preferably, in this embodiment, a user can set a placeholder map of a loading position corresponding to a picture to be loaded on a webpage by a user-defined method, and can also set the placeholder map to be empty. Specifically, when the user opens the webpage, the image loading position on the webpage is judged, and if the image loading position is not in the current display window of the terminal, the image corresponding to the position is not loaded, and the position is blank, or a user-defined occupation map preset for the position is loaded to the corresponding position. Therefore, the browsing experience of the user can be further improved.
It should be noted that, in this embodiment, the implementation manners of step S302 to step S307 are the same as the implementation manners of step S101 to step S106, and therefore, the detailed description thereof is omitted.
As can be seen from the above, the picture loading method provided by the embodiment can also save the consumption of network traffic and improve the fluency of webpage picture loading; in addition, compared with the previous embodiment, the page browsing experience of the user can be further improved.
Fig. 4 is a schematic block diagram of a terminal according to an embodiment of the present invention. For convenience of explanation, only the portions related to the present embodiment are shown.
Referring to fig. 4, the present embodiment provides a terminal 100, including:
the judging unit 11 is configured to judge whether a loading position of a picture to be loaded on a webpage is within a current display window of the terminal when a user opens the webpage;
a memory query unit 12, configured to query whether the picture to be loaded exists in the terminal memory if the picture is in the current display window;
a memory reading unit 13, configured to read the picture to be loaded in the memory and display the picture in the current window if the picture to be loaded exists in the memory;
a hard disk querying unit 14, configured to query whether the picture to be loaded exists in a hardware cache of the terminal if the picture to be loaded does not exist in the memory;
a hard disk reading unit 15, configured to read the picture to be loaded from the hardware cache if the picture to be loaded exists in the hardware cache, and display the picture to be loaded in the current window;
a downloading unit 16, configured to download the picture to be loaded from the network if the picture to be loaded does not exist in the hardware cache, and display the picture to be loaded in the current window.
Optionally, referring to fig. 5, in an embodiment, the downloading unit 16 includes:
a downloader management unit 161, configured to share or regenerate a downloader, and download the picture to be loaded from the network server through the downloader;
a picture decoding unit 162, configured to, if the to-be-loaded picture is downloaded, start another sub-thread to decode the to-be-loaded picture, and decode the to-be-loaded picture into a bitmap that can be directly used by the control displayed in the current window;
and a picture display unit 163, configured to display the decoded picture to be loaded in the current window.
Optionally, the terminal 100 further includes:
and the cache writing unit 17 is configured to store the decoded picture to be loaded into the memory and the hard disk cache.
Optionally, referring to fig. 6, in an embodiment, the terminal 100 further includes:
and the occupied cell 18 is used for setting an occupied bitmap for the loading position of the picture to be loaded on the webpage in advance, wherein the occupied bitmap is a self-defined picture or is empty.
It should be noted that, since each unit in the terminal provided in the embodiment of the present invention is based on the same concept as that of the embodiment of the method of the present invention, the technical effect brought by the unit is the same as that of the embodiment of the method of the present invention, and specific contents may refer to descriptions in the embodiment of the method of the present invention, and are not described herein again.
Therefore, it can be seen that the terminal provided by the embodiment of the invention can also save the consumption of network traffic, improve the fluency of webpage picture loading, and improve the user experience.
Fig. 7 is a schematic block diagram of a terminal according to another embodiment of the present invention. The terminal 100 in the present embodiment as shown in the figure may include: one or more processors 701; one or more input devices 702, one or more output devices 703, and memory 704. The processor 701, the input device 702, the output device 703, and the memory 704 are connected by a bus 705. The memory 702 is used to store instructions and the processor 701 is used to execute application program instructions stored by the memory 702. The processor 701 is configured to call the application program instruction to perform the following steps:
when a user opens a webpage, judging whether a loading position of a picture to be loaded on the webpage is in a current display window of the terminal;
if the current display window is in the current display window, inquiring whether the picture to be loaded exists in a terminal memory;
if the picture to be loaded exists in the memory, reading the picture to be loaded in the memory, and displaying the picture in a current window;
if the picture to be loaded does not exist in the memory, inquiring whether the picture to be loaded exists in a hardware cache of the terminal;
if the picture to be loaded exists in the hardware cache, reading the picture to be loaded from the hardware cache, and displaying the picture to be loaded in the current window;
and if the picture to be loaded does not exist in the hardware cache, downloading the picture to be loaded from the network, and displaying the picture to be loaded in the current window.
Optionally, the processor 701 is further configured to call the application program instruction to perform the following steps:
sharing or regenerating a downloader, and downloading the picture to be loaded from the network server through the downloader;
if the picture to be loaded is downloaded, another sub thread is started to decode the picture to be loaded, and the picture to be loaded is decoded into a bitmap which can be directly used by a control displayed by the current window;
and displaying the decoded picture to be loaded in the current window.
Optionally, the processor 701 is further configured to call the application program instruction to perform the following steps:
and storing the decoded picture to be loaded into the memory and the hard disk cache.
Optionally, the processor 701 is further configured to call the application program instruction to perform the following steps:
setting an occupation map for a loading position of a picture to be loaded on the webpage in advance, wherein the occupation map is a self-defined picture or a blank.
It should be understood that, in the embodiment of the present invention, the Processor 701 may be a Central Processing Unit (CPU), and the Processor may also be other general processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The input device 702 may include a touch pad, a fingerprint sensor (for collecting fingerprint information of a user and direction information of the fingerprint), a microphone, etc., and the output device 703 may include a display (LCD, etc.), a speaker, etc.
The memory 704 may include both read-only memory and random-access memory, and provides instructions and data to the processor 701. A portion of the memory 704 may also include non-volatile random access memory. For example, the memory 704 may also store device type information.
In a specific implementation, the processor 701, the input device 702, and the output device 703 described in this embodiment of the present invention may execute the implementation manners described in the first embodiment and the second embodiment of the method provided in this embodiment of the present invention, and may also execute the implementation manners of the terminal described in this embodiment of the present invention, which is not described herein again.
In another embodiment of the invention, a computer-readable storage medium is provided, storing a computer program which, when executed by a processor, implements:
when a user opens a webpage, judging whether a loading position of a picture to be loaded on the webpage is in a current display window of the terminal;
if the current display window is in the current display window, inquiring whether the picture to be loaded exists in a terminal memory;
if the picture to be loaded exists in the memory, reading the picture to be loaded in the memory, and displaying the picture in a current window;
if the picture to be loaded does not exist in the memory, inquiring whether the picture to be loaded exists in a hardware cache of the terminal;
if the picture to be loaded exists in the hardware cache, reading the picture to be loaded from the hardware cache, and displaying the picture to be loaded in the current window;
and if the picture to be loaded does not exist in the hardware cache, downloading the picture to be loaded from the network, and displaying the picture to be loaded in the current window.
Optionally, the computer program when executed by the processor implements:
sharing or regenerating a downloader, and downloading the picture to be loaded from the network server through the downloader;
if the picture to be loaded is downloaded, another sub thread is started to decode the picture to be loaded, and the picture to be loaded is decoded into a bitmap which can be directly used by a control displayed by the current window;
and displaying the decoded picture to be loaded in the current window.
Optionally, the computer program when executed by the processor implements:
and storing the decoded picture to be loaded into the memory and the hard disk cache.
Optionally, the computer program when executed by the processor implements:
setting an occupation map for a loading position of a picture to be loaded on the webpage in advance, wherein the occupation map is a self-defined picture or a blank.
The computer readable storage medium may be an internal storage unit of the terminal according to any of the foregoing embodiments, for example, a hard disk or a memory of the terminal. The computer readable storage medium may also be an external storage device of the terminal, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the terminal. Further, the computer-readable storage medium may also include both an internal storage unit and an external storage device of the terminal. The computer-readable storage medium is used for storing the computer program and other programs and data required by the terminal. The computer readable storage medium may also be used to temporarily store data that has been output or is to be output.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the terminal and the unit described above may refer to corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed terminal and method can be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may also be an electric, mechanical or other form of connection.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment of the present invention.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention essentially or partially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (9)

1. A picture loading method is characterized by comprising the following steps:
when a user opens a webpage, acquiring the loading position coordinates corresponding to each picture to be loaded, respectively comparing the loading position coordinates corresponding to each picture to be loaded with the coordinates of a current window displayed on a terminal foreground, and judging whether the loading position of the picture to be loaded on the webpage is in the current display window of the terminal;
if the current display window is in the current display window, inquiring whether the picture to be loaded exists in a terminal memory;
if the picture to be loaded exists in the memory, reading the picture to be loaded in the memory, and displaying the picture in a current window;
if the picture to be loaded does not exist in the memory, inquiring whether the picture to be loaded exists in a hardware cache of the terminal;
if the picture to be loaded exists in the hardware cache, reading the picture to be loaded from the hardware cache, and displaying the picture to be loaded in the current window;
and if the picture to be loaded does not exist in the hardware cache, downloading the picture to be loaded from the network, and displaying the picture to be loaded in the current window.
2. The picture loading method according to claim 1, wherein the downloading the picture to be loaded from the network and displaying the picture to be loaded in the current window comprises:
sharing or regenerating a downloader, and downloading the picture to be loaded from the network server through the downloader;
if the picture to be loaded is downloaded, another sub thread is started to decode the picture to be loaded, and the picture to be loaded is decoded into a bitmap which can be directly used by a control displayed by the current window;
and displaying the decoded picture to be loaded in the current window.
3. The picture loading method according to claim 2, further comprising, after the current window displays the decoded picture to be loaded:
and storing the decoded picture to be loaded into the memory and the hard disk cache.
4. The picture loading method according to claim 1, wherein before determining whether the loading position of the picture to be loaded on the web page is within the current display window of the terminal when the user opens the web page, the method further comprises:
setting an occupation map for a loading position of a picture to be loaded on the webpage in advance, wherein the occupation map is a self-defined picture or a blank.
5. A terminal, comprising:
the judging unit is used for acquiring the loading position coordinates corresponding to each picture to be loaded when a user opens the webpage, comparing the loading position coordinates corresponding to each picture to be loaded with the coordinates of the current window displayed on the foreground of the terminal respectively, and judging whether the loading position of the picture to be loaded on the webpage is in the current display window of the terminal or not;
the memory query unit is used for querying whether the picture to be loaded exists in the memory of the terminal if the picture is in the current display window;
the memory reading unit is used for reading the picture to be loaded in the memory and displaying the picture in the current window if the picture to be loaded exists in the memory;
the hard disk inquiring unit is used for inquiring whether the picture to be loaded exists in a hardware cache of the terminal if the picture to be loaded does not exist in the internal memory;
a hard disk reading unit, configured to read the picture to be loaded from the hardware cache if the picture to be loaded exists in the hardware cache, and display the picture to be loaded on the current window;
and the downloading unit is used for downloading the picture to be loaded from the network and displaying the picture to be loaded on the current window if the picture to be loaded does not exist in the hardware cache.
6. The terminal of claim 5, wherein the downloading unit comprises:
the downloader management unit is used for sharing or regenerating a downloader and downloading the picture to be loaded from the network server through the downloader;
the picture decoding unit is used for decoding the picture to be loaded by another sub thread if the picture to be loaded is downloaded, and decoding the picture to be loaded into a bitmap which can be directly used by a control displayed by the current window;
and the picture display unit is used for displaying the decoded picture to be loaded in the current window.
7. The terminal of claim 6, further comprising:
and the cache writing unit is used for storing the decoded picture to be loaded into the memory and the hard disk cache.
8. The terminal of claim 5, further comprising:
and the occupation unit is used for setting an occupation map for the loading position of the picture to be loaded on the webpage in advance, and the occupation map is a self-defined picture or is empty.
9. A computer-readable storage medium, characterized in that the computer storage medium stores a computer program comprising program instructions that, when executed by a processor, cause the processor to perform the picture loading method according to any one of claims 1-4.
CN201710564756.2A 2017-07-11 2017-07-11 Picture loading method and terminal Active CN107463627B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710564756.2A CN107463627B (en) 2017-07-11 2017-07-11 Picture loading method and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710564756.2A CN107463627B (en) 2017-07-11 2017-07-11 Picture loading method and terminal

Publications (2)

Publication Number Publication Date
CN107463627A CN107463627A (en) 2017-12-12
CN107463627B true CN107463627B (en) 2020-08-11

Family

ID=60543947

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710564756.2A Active CN107463627B (en) 2017-07-11 2017-07-11 Picture loading method and terminal

Country Status (1)

Country Link
CN (1) CN107463627B (en)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108287892B (en) * 2018-01-18 2022-03-04 北京奇艺世纪科技有限公司 Picture loading method and device and electronic equipment
CN108536768A (en) * 2018-03-22 2018-09-14 努比亚技术有限公司 picture loading method, terminal and computer readable storage medium
CN108924668B (en) * 2018-06-11 2021-07-27 聚好看科技股份有限公司 Picture loading and data providing method and device
CN109298905A (en) * 2018-08-15 2019-02-01 深圳点猫科技有限公司 Utilize the method and electronic equipment of the optimization picture lazyness load of front end programming language
CN109361947A (en) * 2018-09-14 2019-02-19 深圳Tcl数字技术有限公司 Internet resources batch loading method, smart television, storage medium and device
CN110928935B (en) * 2018-09-19 2023-11-14 阿里巴巴集团控股有限公司 Data access command processing method, device and system
CN110175053B (en) * 2019-04-24 2023-10-27 创新先进技术有限公司 Picture loading method and device
CN111399753B (en) * 2019-08-23 2022-08-05 杭州海康威视系统技术有限公司 Method and device for writing pictures
CN110658969B (en) * 2019-10-08 2024-01-09 广州市百果园信息技术有限公司 Picture processing method, device, equipment and storage medium
CN110868624B (en) * 2019-11-08 2023-08-22 Vidaa(荷兰)国际控股有限公司 Picture loading method and intelligent television
CN111597479A (en) * 2020-04-18 2020-08-28 北京奇保信安科技有限公司 Intelligent picture loading method and device for terminal and electronic equipment
CN111931095A (en) * 2020-08-26 2020-11-13 重庆帮企科技集团有限公司 Picture loading method of Android system
CN112445990A (en) * 2020-11-26 2021-03-05 北京沃东天骏信息技术有限公司 Picture processing method, device, terminal and storage medium
CN112559922B (en) * 2020-12-08 2022-11-22 歌尔科技有限公司 Page rendering method, terminal device and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI259451B (en) * 2001-10-04 2006-08-01 Wistron Corp Audio-visual player capable of updating core programs automatically
US20080249882A1 (en) * 2006-12-05 2008-10-09 Spolar Margaret M System for purchasing commercial products and items having monetary value with entertainment content
CN102541605B (en) * 2011-12-30 2014-10-29 Tcl集团股份有限公司 Method and device for picture loading based on Android system
CN104657380A (en) * 2013-11-20 2015-05-27 青岛海信移动通信技术股份有限公司 Picture loading method and device

Also Published As

Publication number Publication date
CN107463627A (en) 2017-12-12

Similar Documents

Publication Publication Date Title
CN107463627B (en) Picture loading method and terminal
US8949739B2 (en) Creating and maintaining images of browsed documents
WO2018176960A1 (en) Network picture displaying method, device and user terminal
CN107925749B (en) Method and apparatus for adjusting resolution of electronic device
US10599336B2 (en) Method of displaying content and electronic device adapted to the same
CN110049456B (en) Method and device for displaying rich media on mobile terminal and mobile terminal
CN107181858B (en) Method and terminal for displaying notification message
CN108463799B (en) Flexible display of electronic device and operation method thereof
CN106469396B (en) Method and terminal for pushing advertisement information
CN104834637B (en) Webpage picture display method and device
US20220035655A1 (en) Method and Device for Anonymous Page Management, Terminal Device, and Readable Storage Medium
US9747007B2 (en) Resizing technique for display content
CN109857573B (en) Data sharing method, device, equipment and system
CN111931093A (en) Display method of table in page and mobile terminal
CN114489648A (en) Page generation method, system, terminal and medium
CN107632852B (en) Information updating method and device
CN111142650B (en) Screen brightness adjusting method, screen brightness adjusting device and terminal
CN105491129A (en) Page loading progress display method and device and mobile terminal
CN109358927B (en) Application program display method and device and terminal equipment
CN105279164B (en) File processing method and device based on IOS (input/output system)
EP3043252A1 (en) Method and electronic device for displaying electronic document
CN108132803B (en) Timing keep-alive and awakening method, system, terminal and medium based on mobile terminal
CN115269077A (en) Picture display method, module, mobile terminal and storage medium
CN106886600B (en) File management method and terminal
CN114647411A (en) Programming interface loading method and device, electronic equipment and storage medium

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