CN111639276A - Resource preloading method and device and storage medium - Google Patents

Resource preloading method and device and storage medium Download PDF

Info

Publication number
CN111639276A
CN111639276A CN202010328929.2A CN202010328929A CN111639276A CN 111639276 A CN111639276 A CN 111639276A CN 202010328929 A CN202010328929 A CN 202010328929A CN 111639276 A CN111639276 A CN 111639276A
Authority
CN
China
Prior art keywords
preloading
list
code
page
resource
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.)
Pending
Application number
CN202010328929.2A
Other languages
Chinese (zh)
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.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information 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 Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202010328929.2A priority Critical patent/CN111639276A/en
Publication of CN111639276A publication Critical patent/CN111639276A/en
Pending legal-status Critical Current

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/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • G06F16/9562Bookmark management
    • 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/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • G06F16/9558Details of hyperlinks; Management of linked annotations

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 present disclosure relates to a resource preloading method, a device and a storage medium, wherein the resource preloading method comprises: the method comprises the steps that a first electronic device obtains a project code, scans the project code according to a preset rule, determines a uniform resource locator of a target resource from the project code, generates a preloading list according to the uniform resource locator of the target resource, adds the preloading list into the project code, and sends the project code comprising the preloading list to a server, so that a second electronic device can obtain the preloading list from the server and preload the target resource according to the preloading list. The first electronic equipment directly scans the project codes, and the URL of the resource needing to be preloaded is determined from the project codes according to the preset rule, so that the process that a user manually determines and arranges the URL from the project codes can be avoided, and the URL obtaining efficiency can be improved.

Description

Resource preloading method and device and storage medium
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a resource preloading method, apparatus, and storage medium.
Background
With the rapid development of internet technology, web pages have become one of the main channels for people to obtain information. When information is acquired through a webpage, in order to display content in the webpage as soon as possible, a resource preloading method can be adopted, and resources (such as pictures, characters, audio and the like) in the webpage are preloaded and cached locally before the webpage is opened. When a user accesses a webpage, the webpage is rendered and displayed directly through the locally cached resources, the display time of the webpage is shortened, and the user experience is improved.
At present, developers mainly perform manual arrangement on Uniform Resource Locators (URLs) of resources that need to be preloaded in a webpage display process, and add the arranged URLs to preset positions in webpage codes. And in the process that the user accesses the webpage through the client, the client acquires the corresponding resource through the URL stored in the preset position of the webpage code and caches the resource.
As the size of the web site increases, the amount of resources that need to be preloaded increases. The user needs to manually determine a large number of URLs (URLs corresponding to resources to be preloaded) from project codes of the website, and arrange the URLs to be added to preset positions in the project codes. The process of manually arranging the URL by the user is complex in operation and low in efficiency.
Disclosure of Invention
The disclosure provides a resource preloading method, a resource preloading device and a storage medium, which are used for at least solving the problems of complicated operation and low efficiency in the URL arrangement process in the resource preloading process.
The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, there is provided a resource preloading method, applied to a first electronic device, including:
acquiring a project code;
scanning the project codes according to preset rules, and determining uniform resource locators of target resources from the project codes;
generating a preloading list according to the uniform resource locator of the target resource;
adding the preloaded list to the item code;
and sending an item code comprising the preloading list to a server so as to enable the second electronic equipment to acquire the preloading list from the server and preload the target resource according to the preloading list.
Optionally, the item code includes at least one page code, and the generating a preloaded list according to the uniform resource locator of the target resource includes:
and generating a preloading list corresponding to the first page code according to the uniform resource locator of the target resource corresponding to the first page code, wherein the first page code is part or all of the at least one page code.
Optionally, the adding the preloaded list to the item code includes:
converting the preloading list corresponding to the first page code into a target character string;
and adding the target character string into a second page code, wherein the second page code is a page code corresponding to the first page code in the at least one page code.
According to a second aspect of the embodiments of the present disclosure, there is provided another resource preloading method, applied to a server, including:
receiving an item code which is sent by first electronic equipment and comprises a preloading list, wherein the preloading list is generated by the first electronic equipment according to a uniform resource locator of a target resource determined from the item code;
receiving a data request sent by second electronic equipment;
and responding to the data request, sending a page code comprising the preloading list to the second electronic equipment so as to enable the second electronic equipment to preload the target resource according to the preloading list, wherein the page code is any page code included in the project code.
Optionally, the method further includes:
in response to user input, determining a target preloading strategy from a plurality of preloading strategies, wherein the preloading strategy is used for adjusting the priority of a preloading list corresponding to each first page code when a second page code comprises a preloading list corresponding to each first page code; the first page code is a part or all of at least one page code included in the project code, and the second page code is a page code corresponding to the first page code in the at least one page code;
and under the condition that the second page codes comprise the preloading lists corresponding to the first page codes respectively, adjusting the priority of the preloading lists corresponding to the first page codes respectively according to the target preloading strategy, so that the second electronic equipment can sequentially preload the target resources corresponding to the first page codes according to the priority of the preloading lists corresponding to the first page codes respectively.
Optionally, the adjusting the priority of the preload list corresponding to each first page code according to the target preload policy includes:
acquiring a user log;
determining the access frequency of each first page code according to the user log;
sorting the pre-loading list corresponding to each first page code according to the access frequency of each first page code to obtain a first sorting result;
and determining the priority of the preloading list corresponding to each first page code according to the first sequencing result.
Optionally, the adjusting the priority of the preload list corresponding to each first page code according to the target preload policy includes:
generating a user label of a user according to a preset algorithm;
sequencing the pre-loaded list corresponding to each first page code according to the user label and the resource corresponding to each first page code to obtain a second sequencing result;
and determining the priority of the preloading list corresponding to each first page code according to the second sequencing result.
Optionally, the adjusting the priority of the preload list corresponding to each first page code according to the target preload policy includes:
determining the display time of a page corresponding to each first page code;
sorting the pre-loaded lists corresponding to the first page codes respectively according to the display time of the pages corresponding to the first page codes respectively to obtain a third sorting result;
and determining the priority of the preloading list corresponding to each first page code according to the third sequencing result.
According to a third aspect of the embodiments of the present disclosure, there is provided a resource preloading method applied to a second electronic device, including:
sending a data request to a server;
receiving a page code which is sent by the server and comprises a preloading list, wherein the preloading list comprises a uniform resource locator of a target resource;
and preloading the target resource according to the preloading list.
Optionally, the page code is a second page code, where the second page code includes a pre-loading list corresponding to each first page code and a priority of each pre-loading list;
the preloading the target resource according to the preloading list comprises:
sequentially preloading target resources corresponding to each preloading list according to the priority of each preloading list;
the first page code is a part or all of at least one page code included in the project code, and the second page code is a page code corresponding to the first page code in the at least one page code.
Optionally, the sequentially preloading target resources corresponding to each of the preloading lists according to the priority of each of the preloading lists includes:
and sequentially preloading target resources corresponding to each preloading list according to the priority of each preloading list in an idle state.
Optionally, after the sending the data request to the server, the method further includes:
and sending the data requests of preset times to the server under the condition that the target resource preloading fails, so as to preload the target resource according to the data requests of the preset times.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a resource preloading device disposed on a first electronic device, including:
an acquisition module configured to acquire a project code;
the scanning module is configured to scan the project codes according to preset rules and determine uniform resource locators of target resources from the project codes;
a generation module configured to generate a preloaded list from a uniform resource locator of the target resource;
an adding module configured to add the preloaded list to the item code;
a sending module configured to send an item code including the preloading list to a server, so that a second electronic device obtains the preloading list from the server and preloads the target resource according to the preloading list.
Optionally, the project code includes at least one page code, and the generating module is specifically configured to generate a preloaded list corresponding to a first page code according to a uniform resource locator of a target resource corresponding to the first page code, where the first page code is a part or all of the at least one page code.
Optionally, the adding module is specifically configured to convert the preloaded list corresponding to the first page code into a target character string;
and adding the target character string into a second page code, wherein the second page code is a page code corresponding to the first page code in the at least one page code.
According to a fifth aspect of the embodiments of the present disclosure, there is provided another resource preloading device, disposed in a server, including:
a first receiving module configured to receive an item code sent by a first electronic device and including a preloaded list generated by the first electronic device according to a uniform resource locator of a target resource determined from the item code;
the second receiving module is configured to receive a data request sent by the second electronic device;
a sending module configured to send, in response to the data request, a page code including the preloading list to the second electronic device, so that the second electronic device preloads the target resource according to the preloading list, where the page code is any one of page codes included in the item code.
Optionally, the method further includes:
a determining module configured to determine a target preloading strategy from a plurality of preloading strategies in response to a user input, wherein the preloading strategy is used for adjusting the priority of a preloading list corresponding to each first page code when a second page code comprises a preloading list corresponding to each first page code; the first page code is a part or all of at least one page code included in the project code, and the second page code is a page code corresponding to the first page code in the at least one page code;
the adjusting module is configured to adjust the priority of the preloading list corresponding to each first page code according to the target preloading strategy when the second page code includes the preloading list corresponding to each first page code, so that the second electronic device sequentially preloads the target resource corresponding to each first page code according to the priority of the preloading list corresponding to each first page code.
Optionally, the adjusting module is specifically configured to obtain a user log; determining the access frequency of each first page code according to the user log; sorting the pre-loading list corresponding to each first page code according to the access frequency of each first page code to obtain a first sorting result; and determining the priority of the preloading list corresponding to each first page code according to the first sequencing result.
Optionally, the adjusting module is specifically configured to generate a user tag of the user according to a preset algorithm; sequencing the pre-loaded list corresponding to each first page code according to the user label and the resource corresponding to each first page code to obtain a second sequencing result; and determining the priority of the preloading list corresponding to each first page code according to the second sequencing result.
Optionally, the adjusting module is specifically configured to determine a display time of a page corresponding to each of the first page codes; sorting the pre-loaded lists corresponding to the first page codes respectively according to the display time of the pages corresponding to the first page codes respectively to obtain a third sorting result; and determining the priority of the preloading list corresponding to each first page code according to the third sequencing result.
According to a sixth aspect of the embodiments of the present disclosure, there is provided a resource preloading device disposed on a second electronic device, including:
a sending module configured to send a data request to a server;
the server comprises a receiving module, a processing module and a processing module, wherein the receiving module is configured to receive page codes which comprise a preloading list and are sent by the server, and the preloading list comprises uniform resource locators of target resources;
a preloading module configured to preload the target resource according to the preloading list.
Optionally, the page code is a second page code, where the second page code includes a pre-loading list corresponding to each first page code and a priority of each pre-loading list;
the preloading module is specifically configured to sequentially preload the target resources corresponding to each preloading list according to the priority of each preloading list;
the first page code is a part or all of at least one page code included in the project code, and the second page code is a page code corresponding to the first page code in the at least one page code.
Optionally, the preloading module is further specifically configured to sequentially preload, in an idle state, the target resource corresponding to each of the preloading lists according to the priority of each of the preloading lists.
Optionally, the preloading module is further configured to send the data requests of a preset number of times to the server under the condition that the target resource preloading fails, so as to preload the target resource according to the data requests of the preset number of times.
According to a seventh aspect of the embodiments of the present disclosure, there is provided another resource preloading device, including:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the resource preloading method as provided in the first aspect of the embodiments of the present disclosure.
According to an eighth aspect of the embodiments of the present disclosure, there is provided a storage medium, wherein instructions, when executed by a processor of a resource preloading device, enable the resource preloading device to execute the resource preloading method as provided in the first aspect of the embodiments of the present disclosure.
According to a ninth aspect of the embodiments of the present disclosure, there is provided a computer program product containing instructions, which when run on a computer, causes the computer to perform the resource preloading method as provided in the first aspect of the embodiments of the present disclosure.
The technical scheme provided by the embodiment of the disclosure at least has the following beneficial effects:
in this embodiment, a first electronic device obtains a project code, scans the project code according to a preset rule, determines a uniform resource locator of a target resource from the project code, generates a preloading list according to the uniform resource locator of the target resource, adds the preloading list to the project code, and sends the project code including the preloading list to a server, so that a second electronic device can obtain the preloading list from the server and preload the target resource according to the preloading list. The first electronic equipment directly scans the project codes, and the URL of the resource needing to be preloaded is determined from the project codes according to the preset rule, so that the process that a user manually determines and arranges the URL from the project codes can be avoided, and the URL obtaining efficiency can be improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
FIG. 1 is a flow diagram illustrating a resource preloading method in accordance with an exemplary embodiment;
FIG. 2 is a flow diagram illustrating another method of resource preloading, according to an example embodiment;
FIG. 3 is a block diagram illustrating a resource preloading apparatus in accordance with an exemplary embodiment;
FIG. 4 is a block diagram illustrating another resource preloading apparatus in accordance with an exemplary embodiment;
FIG. 5 is a block diagram illustrating yet another resource preloading apparatus in accordance with an exemplary embodiment;
FIG. 6 is a block diagram illustrating yet another resource preloading apparatus in accordance with an exemplary embodiment;
fig. 7 is a block diagram illustrating yet another resource preloading apparatus according to an example embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
Fig. 1 is a flowchart illustrating a resource preloading method according to an exemplary embodiment, and referring to fig. 1, the resource preloading method provided in this embodiment may be applied to preloading of resources, so as to avoid an operation of manually collating URLs by a user, and improve efficiency. The resource preloading method provided in this embodiment may be executed by a resource preloading device, where the resource preloading device is usually implemented in a software and/or hardware manner, and the resource preloading device may be disposed in the first electronic device, and the method includes the following steps:
and step 101, acquiring a project code.
The project code is a Text code written by a user using a programming Language, which is used for constructing a website, and the programming Language may be, for example, hypertext Markup Language (HTML).
In this embodiment, the first electronic device may directly receive the item code input by the user, or may obtain the item code from other electronic devices, and the specific obtaining process of the item code may refer to the prior art, which is not limited in this embodiment.
And 102, scanning the project codes according to a preset rule, and determining the uniform resource locator of the target resource from the project codes.
The target resource is a resource which can be loaded in advance in the webpage display process, such as a resource of pictures, characters, audio or videos.
In this embodiment, the project code may be scanned according to a preset rule to determine the URL of the target resource included in the project code. For example, a code compiling tool (e.g., webpack) may be used to traverse a preset type of file included in the project code to determine a URL corresponding to a preset type of resource, i.e., a target resource, in the preset type of file. For example, a code compiling tool may be used to traverse JS (javascript) files and/or Cascading Style Sheets (CSS) files in the project code, and determine URLs in the JS files and/or the CSS files corresponding to resources of preset types such as png, jpg, mp3, mp4, svg, jif, and icom. In practical application, the type of the file of the preset type and the type of the resource of the preset type may be selected according to requirements, which is not limited in this embodiment.
And 103, generating a preloading list according to the uniform resource locator of the target resource.
And the preloading list comprises the URL of the determined target resource.
In this embodiment, after determining the URL of the target resource, the preloading list may be constructed according to the determined URL of the target resource. Specifically, the preloading list may be established in advance, and after determining the URL of the target resource, the determined URL may be added to the preloading list. The establishment process and the specific structure of the preloading list can be set according to requirements, and the embodiment does not limit this.
Step 104, add the preloaded list to the item code.
In this implementation, the preloaded list may be added to the item code after it is generated. Specifically, the preloaded list may be converted into a character string that can be added to the project code by a code compiling tool, for example, a json (javascript Object notification) character string, and the converted character string is added to a preset position (the preset position may be, for example, a Script tag of an HTML file) in the project code, where the specific position of the preset position in the project code may be set according to a requirement, which is not limited in this embodiment.
Step 105, sending the item code comprising the preloaded list to the server.
In this embodiment, the first electronic device may send the item code added with the preloading list to the server, and the second electronic device may obtain the preloading list from the server and preload the corresponding target resource according to the URL in the preloading list. The process of the first electronic device sending the item code including the preloaded list to the server can refer to the prior art, and the embodiment does not limit this.
In this embodiment, a first electronic device obtains a project code, scans the project code according to a preset rule, determines a uniform resource locator of a target resource from the project code, generates a preloading list according to the uniform resource locator of the target resource, adds the preloading list to the project code, and sends the project code including the preloading list to a server, so that a second electronic device can obtain the preloading list from the server and preload the target resource according to the preloading list. The first electronic equipment directly scans the project codes, and the URL of the resource needing to be preloaded is determined from the project codes according to the preset rule, so that the process that a user manually determines and arranges the URL from the project codes can be avoided, and the URL obtaining efficiency can be improved.
FIG. 2 is a flow diagram illustrating another method of resource preloading, which may include the steps of:
step 201, the first electronic device obtains an item code.
Step 202, the first electronic device scans the project codes according to preset rules, and determines the uniform resource locator of the target resource from the project codes.
And 203, generating a preloading list by the first electronic equipment according to the uniform resource locator of the target resource.
The project code may include at least one page code, each page code may be, for example, an HTML file, the page code corresponds to a page in the website, and the electronic device may display the corresponding page according to the page code.
Accordingly, step 203 may be implemented as follows:
generating a preloading list corresponding to the first page code according to the uniform resource locator of the target resource corresponding to the first page code; the first page code is a part or all of at least one page code.
In this embodiment, the item code may include at least one page code. For example, the project codes may include page code X, page code Y, page code a, page code B, and page code C, and page code a1, page code a2, and page code A3. In the process of generating the preloading list, the first electronic device may generate the preloading list corresponding to each page code for the target resource corresponding to the page code. For example, for the page code X, the first electronic device may generate the preloaded list X corresponding to the page code X according to the URL corresponding to the target resource included in the page code X. Similarly, for the page code a, the page code B and the page code C, a preloading list a corresponding to the page code a, a preloading list B corresponding to the page code B and a preloading list C corresponding to the page code C may be generated, respectively. It should be noted that, for all page codes in the project code, a pre-loading list corresponding to each page code may be generated, or only a pre-loading list corresponding to a part of the page codes may be generated, for example, only pre-loading lists corresponding to the page code a, the page code B, and the page code C are generated, which is not limited in this embodiment.
During actual application, a corresponding preloading list is generated according to the URL of the target resource included by each page code, and the target resource can be preloaded by taking the page code as a unit in the resource preloading process. For example, the target resources corresponding to all URLs included in the preloading list a may be preloaded directly in units of the preloading list a. The resources are preloaded by taking the page codes as units, and the resources corresponding to each page code can be sequentially preloaded in the page display process.
Step 204, the first electronic device adds the preloaded list to the item code.
Optionally, step 204 may be implemented as follows:
converting the preloading list corresponding to the first page code into a target character string;
and adding the target character string into a second page code, wherein the second page code is a page code corresponding to the first page code in at least one page code.
The second page code is a page code corresponding to the first page code in the at least one page code.
In this embodiment, the page corresponding to the second page code is a main page, the page corresponding to the first page code is a sub-page, the client may jump from the main page to the sub-page, the main page is a page corresponding to the sub-page, and the second page code corresponding to the main page corresponds to the first page code corresponding to the sub-page. For example, if the page corresponding to the page code X (second page code) is the main page W, and the pages corresponding to the page code a, the page code B, and the page code C are sub-pages with respect to the main page W, the page code X (second page code) corresponds to the page code a, the page code B, and the page code C (first page code). Similarly, page code a is the second page code corresponding to page code a1, page code a2, and page code A3 (first page code), and page code a1, page code a2, and page code A3 are the first page code corresponding to page code a. When a user accesses a webpage through a client, the main page corresponding to the second page code can enter the sub-page corresponding to the sub-first page code, for example, when the user accesses the main page corresponding to the page code X (the second page code) through the client, the main page corresponding to the page code X can enter any one of the sub-pages corresponding to the page code a, the page code B and the page code C respectively.
In this embodiment, after the preloading list corresponding to the page code is generated, the preloading list corresponding to the first page code may be added to the second page code. In combination with step 104, the preloaded list a, the preloaded list B, and the preloaded list C may be converted into JSON character string A, JSON character string B and JSON character string C, respectively, and the converted JSON character string A, JSON character string B and JSON character string C are added to the Script tag of the page code X. And adding the preloading list corresponding to each first page code into the second page code, and sequentially preloading the target resources corresponding to each sub-page according to the preloading list corresponding to each sub-page under the main page when a user accesses the main page through a client.
In practical application, a preloading list corresponding to the page code may also be added to the page code itself, for example, if the preloading list a is added to the page code a, when the user accesses the page corresponding to the page code a through the client, if only part of the page corresponding to the page code a is displayed, the target resource included in the undisplayed page part in the page corresponding to the page code a may be preloaded through the URL in the preloading list a.
Step 205, the first electronic device sends an item code comprising the preloaded list to the server.
Step 206, the server sends the page code including the preloaded list to the second electronic device in response to the data request sent by the second electronic device.
The page code is any one of project codes.
In this embodiment, the server may receive an item code including the preloaded list sent by the first electronic device, receive a data request sent by the second electronic device after receiving the item code including the preloaded list, and send a page code including the preloaded list to the second electronic device in response to the data request sent by the second electronic device. The server responds to the data request sent by the second electronic device, and the process of sending the page code to the second electronic device may refer to the prior art, which is not described in this embodiment.
Optionally, the method may further include:
in response to user input, determining a target preloading strategy from a plurality of preloading strategies, wherein the preloading strategy is used for adjusting the priority of a preloading list corresponding to each first page code when the second page code comprises a preloading list corresponding to each first page code;
and under the condition that the second page codes comprise the preloading lists corresponding to the first page codes respectively, adjusting the priority of the preloading lists corresponding to the first page codes respectively according to a target preloading strategy, so that the second electronic equipment can sequentially preload the target resources corresponding to the first page codes according to the priority of the preloading lists corresponding to the first page codes respectively.
The user input may be, for example, a selection instruction input by the user through the electronic device, or a selection operation manually performed by the user.
In this embodiment, a plurality of preloading policies may be preset, and the server may determine, in response to a user input, a target preloading policy from the plurality of preloading policies, so as to adjust the priority of the preloading list corresponding to each first page code included in the second page code according to the target preloading policy. With reference to the above example, the page code X includes a pre-loading list a corresponding to the page code a, a pre-loading list B corresponding to the page code B, and a pre-loading list C corresponding to the page code C. The server may adjust the priority of preload list a, preload list B, and preload list C, respectively, according to a target preload policy. For example, the priority of the preloading list a is adjusted to be 2, the priority of the preloading list B is adjusted to be 1, and the priority of the preloading list C is adjusted to be 3, wherein the smaller the value of the priority, the higher the priority. In practical application, a plurality of preloading strategies are set, a target preloading strategy is determined from the plurality of preloading strategies according to user input, the priority of a preloading list is adjusted according to the target preloading strategy, the preloading strategies can be flexibly selected according to requirements, and the flexibility of resource preloading is improved.
Optionally, the priority of the preload list corresponding to each first page code is adjusted according to the target preload policy, and the method may be implemented as follows:
the first method is as follows: acquiring a user log;
determining the access frequency of each first page code according to the user log;
sorting the pre-loading list corresponding to each first page code according to the access frequency of each first page code to obtain a first sorting result;
and determining the priority of the preloading list corresponding to each first page code according to the first sequencing result.
The access frequency of the first page code is the frequency that the electronic equipment acquires the first page code from the server and displays the corresponding page according to the first page code in the process that the user accesses the webpage through the client.
In this embodiment, the server may sort all the first page codes corresponding to the second page code according to the access frequency of each first page code to obtain a sorting result, and determine the priority of the preload list corresponding to each first page code according to the sorting result. Specifically, in the process that the user accesses the webpage through the client, the client can generate a user log and send the user log to the server. The server can obtain a user log of each user sent by the client, determine the frequency of each first page code accessed by the user according to all the user logs, and sequence all the first page codes corresponding to the second page codes in sequence according to the access frequency from large to small or from small to large to obtain a first sequencing result, wherein the higher the access frequency of the first page codes in the first sequencing result is, the higher the priority of the corresponding preloading list is. For example, if the access frequency of the page code B is greater than that of the page code a and the access frequency of the page code a is greater than that of the page code C, it may be determined that the priority of the preloading list B is 1, the priority of the preloading list a is 2, and the priority of the preloading list C is 3 according to the first ordering result. The priority of the preloading list corresponding to each page code is determined according to the access frequency of each page code, so that the target resources in the page codes which are accessed by a user in a large number can be preloaded preferentially, the preloading of the target resources is in line with the access habits of the user, and the resource preloading efficiency is improved. The process of determining the access frequency of the sub-page code according to the user log may be set according to the requirement, which is not limited in this embodiment.
The second method comprises the following steps: generating a user label of a user according to a preset algorithm;
sequencing the pre-loaded lists corresponding to the first page codes respectively according to the user tags and the resources corresponding to the first page codes to obtain a second sequencing result;
and determining the priority of the preloading list corresponding to each first page code according to the second sequencing result.
In this embodiment, the server may sort all the first page codes corresponding to the second page code according to the user tag and the resource corresponding to each first page code to obtain a sorting result, and determine the priority of the preload list corresponding to each first page code according to the sorting result. Specifically, the server may obtain the relevant information of the user, generate a user tag of the user through a preset algorithm according to the relevant information of the user, determine the relevance between each first page code and the user according to the user tag and the resource corresponding to each first page code, sort all the first page codes corresponding to the second page codes according to the relevance from large to small or from small to large, and obtain a second sorting result, where the higher the relevance between the first page code and the user in the second sorting result is, the higher the priority of the corresponding preloading list is. For example, if the user tags of the user W generated according to the preset algorithm are "sports" and "male", the resource included in the page code a is related to soccer, the resource included in the page code B is related to military, and the resource included in the page code C is related to entertainment, then it may be determined that the correlation between the page code a and the user W is higher than that between the page code B and the page code C according to the user tag "sports" of the user W, and it is determined that the correlation between the page code B and the user W is higher than that between the page code C according to the user tag "male", then it may be determined that the priority of the preloading list a is 1, the priority of the preloading list B is 2, and the priority of the preloading list C is 3 according to the second sorting result. When the user W accesses the page corresponding to the page code X through the client, the second electronic device preferentially preloads the resource in the page code A (target resource corresponding to the preloading list A), then preloads the resource in the page code B, and finally preloads the resource in the page code C. The priority of the preloading list corresponding to the page code is determined through the user tag, so that the preloaded resources can better meet the user requirements, and the user experience is improved. The process of generating the user tag according to the preset algorithm may refer to the prior art, which is not limited in this embodiment.
The third method comprises the following steps: determining the display time of the page corresponding to each first page code;
sorting the pre-loaded lists corresponding to the first page codes respectively according to the display time of the pages corresponding to the first page codes respectively to obtain a third sorting result;
and determining the priority of the preloading list corresponding to each first page code according to the third sequencing result.
In this embodiment, the server may sort all the first page codes corresponding to the second page code according to the display time of the page corresponding to each first page code, to obtain a sorting result, and determine the priority of the pre-loaded list corresponding to each first page code according to the sorting result. Specifically, when a user accesses a page in a website through a client, the client can determine the display time of the page, that is, the time from the time when the client acquires a page code, loads a resource, parses the resource, and renders the page to the time when the page is completely displayed. The longer the display time of the page is, the longer the time required by the page code corresponding to the page in the process of loading the resource is. And sequencing all the first page codes corresponding to the second page codes in sequence from large to small or from small to large according to the display time of each page to obtain a third sequencing result, wherein the longer the display time of the page corresponding to the first page code is, the higher the priority of the corresponding preloading list is. For example, if the display time of the page corresponding to the page code a is longer than that of the page corresponding to the page code C, and the display time of the page corresponding to the page code C is longer than that of the page corresponding to the page code B, according to the third sorting result, it may be determined that the priority of the preloading list a is 1, the priority of the preloading list C is 2, and the priority of the preloading list B is 3. In practical application, according to the display time of the page, the resources corresponding to the page codes with long display time (longer time required for loading the resources) are preloaded preferentially, so that the performance of the page with lower performance (longer display time) can be improved.
The method is as follows: and determining the priority of the preloading list corresponding to each first page code respectively in response to user operation.
The user selection operation may be, for example, a selection instruction input by the user through the electronic device or a selection operation directly performed by the user, and the server may determine, in response to the user operation, a priority of the preloaded list corresponding to each first page code. The user directly sets the priority of the preloading list corresponding to each first page code, and the user can flexibly adjust the preloading sequence of the resource corresponding to each first page code.
And step 207, the second electronic equipment receives the page code which is sent by the server and comprises the preloading list.
In this embodiment, the second electronic device may receive a page code including the preloaded list sent by the server, load a resource corresponding to the page code, and render and display a page through the loaded resource. The process of receiving the page code, loading the resource, rendering and displaying by the second electronic device may refer to the prior art, which is not described in detail in this embodiment.
And step 208, the second electronic equipment preloads the target resource according to the preloading list.
In this embodiment, after receiving the page code including the preloading list sent by the server, the second electronic device may preload the target resource according to the preloading list included in the page code. Specifically, the second electronic device may obtain the preloading list from the page code, determine a URL included in the preloading list, and obtain the corresponding target resource according to the URL. The process of obtaining the target resource by the second electronic device according to the URL may refer to a process of obtaining the resource according to the URL in the prior art, which is not described in detail in this embodiment.
Optionally, when the page code is a second page code, and the second page code includes a pre-loading list corresponding to each first page code and a priority of each pre-loading list, step 208 may be implemented as follows:
and sequentially preloading the target resources corresponding to each preloading list according to the priority of each preloading list.
With reference to the foregoing example, if the page code is a second page code, and the second page code includes a pre-loading list and a priority level corresponding to each first page code, the second electronic device may sequentially pre-load the target resources corresponding to each pre-loading list according to the priority level of each pre-loading list. For example, if the page code is the page code X, the second electronic device may load the corresponding target resource sequentially according to the priorities corresponding to the preloading list a, the preloading list B, and the preloading list C, respectively, and according to the URL included in each preloading list.
Optionally, step 208 may be specifically implemented by the following steps:
and in an idle state, sequentially preloading the target resources corresponding to each preloading list according to the priority of each preloading list.
In this embodiment, the second electronic device may preload, in an idle state, the target resource corresponding to each of the preloading lists according to the priority of the preloading list. For example, the second electronic device may detect a currently displayed page, and upon determining that the current page is in an idle state, preload the resources according to the priority of the preload list. If the page corresponding to the currently displayed page code X is detected, when the page corresponding to the page code X is determined to be in an idle state, target resources corresponding to the page code A, the page code B and the page code C are preloaded according to the priority of each preloading list. The method for specifically detecting whether the page is in the idle state may refer to the prior art, which is not limited in this embodiment.
Optionally, the method may further include:
and under the condition that the static time of the page exceeds a preset threshold, pre-loading the resources corresponding to the preset position according to the uniform resource locator corresponding to the preset position.
The preset position may be a middle position of a display area of the second electronic device, or the entire display area, and a specific position of the preset position in the display area may be set according to a requirement.
In this embodiment, in the process of displaying the page, when the stationary time of the page exceeds a preset threshold (for example, 3 seconds), the second electronic device may pre-load the resource corresponding to the preset position according to the URL corresponding to the preset position. For example, when the user displays a page corresponding to the page code a through the client, if the stationary time of the page exceeds 3 seconds, the URL corresponding to the middle position of the display area (screen) in the second electronic device may be determined, and the resource corresponding to the middle position is loaded in advance according to the determined URL. If the URL link corresponding to the middle position of the display area is audio data, the audio data may be preloaded according to the URL corresponding to the middle position. In practical application, if the stationary time of the page is long, it is indicated that the user is interested in the resource corresponding to the preset position, and the possibility that the user accesses the resource corresponding to the preset position is high, at this time, the resource which the user may access next step can be preloaded, and the user experience is improved.
Optionally, the method may further include: determining a non-display area of a page;
according to the preloading list, determining the URL of the target resource corresponding to the non-display area;
and acquiring the target resource according to the URL of the target resource corresponding to the non-display area.
In this embodiment, when the display area of the second electronic device cannot display all pages, the second electronic device may determine a non-display area of the page, that is, a portion of the page that is not displayed in the display area, determine, according to a pre-loaded list included in the page code, a URL of a target resource corresponding to the non-display area, and load the resource of the non-display area in advance. When a user operates a client to enter a non-display area from a display area of a page, the non-display area can be displayed as fast as possible through pre-loaded resources, the display time of the non-display area is shortened, and the user experience is improved. The method for determining the non-display area of the page may refer to the prior art, which is not described in detail in this embodiment.
Optionally, after sending the data request to the server, the method may further include: and under the condition that the target resource is unsuccessfully preloaded, sending a data request with preset times to the server so as to preload the target resource according to the data request with the preset times.
In this embodiment, when the target resource fails to be preloaded, the second electronic device may repeatedly send the data request to the server for a preset number of times (for example, 3 times), so as to preload the target resource again. The method and the device can prevent the problem that the target resource cannot be preloaded due to failure in preloading of the target resource under the condition of network congestion and the like, so that the display time of the page is prolonged.
Optionally, after the preset number of requests are sent to the server, if the target resource preloading fails, the second electronic device may modify a Content Delivery Network (CND) domain name, and obtain the target resource through the modified CDN domain name.
In this embodiment, after the preset number of times of requests are sent to the server, if the target resource preloading fails, it may be preliminarily determined that the CDN fault is, the second electronic device may modify the CDN domain name, and reload the target resource through the modified CDN domain name. The problem that target resources cannot be preloaded when the CDN fails can be solved.
In this embodiment, a first electronic device obtains a project code, scans the project code according to a preset rule, determines a uniform resource locator of a target resource from the project code, generates a preloading list according to the uniform resource locator of the target resource, adds the preloading list to the project code, and sends the project code including the preloading list to a server, so that a second electronic device can obtain the preloading list from the server and preload the target resource according to the preloading list. The first electronic equipment directly scans the project codes, and the URL of the resource needing to be preloaded is determined from the project codes according to the preset rule, so that the process that a user manually determines and arranges the URL from the project codes can be avoided, and the URL obtaining efficiency can be improved. Meanwhile, through the setting of the preloading strategy, resources corresponding to the webpage can be flexibly preloaded, the display time of the webpage is shortened, and the user experience is improved.
Referring to fig. 3, fig. 3 is a block diagram illustrating a resource preloading device according to an exemplary embodiment. The resource preloading device 300 may be disposed on a first electronic device, and may include: an acquisition module 301, a scanning module 302, a generation module 303, an addition module 304, and a transmission module 305.
The acquisition module 301 is configured to acquire an item code.
The scanning module 302 is configured to scan the project codes according to preset rules, and determine the uniform resource locator of the target resource from the project codes.
The generation module 303 is configured to generate the preloaded list from the uniform resource locator of the target resource.
The add module 304 is configured to add the preloaded list to the item code.
The sending module 305 is configured to send the item code including the preloaded list to the server, so that the second electronic device obtains the preloaded list from the server and preloads the target resource according to the preloaded list.
Optionally, the item code includes at least one page code, and the generating module 303 is specifically configured to generate a preloaded list corresponding to the first page code according to a uniform resource locator of a target resource corresponding to the first page code, where the first page code is a part or all of the at least one page code.
Optionally, the adding module 304 is specifically configured to convert the preloaded list corresponding to the first page code into a target character string; and adding the target character string into a second page code, wherein the second page code is a page code corresponding to the first page code in at least one page code.
In this embodiment, a first electronic device obtains a project code, scans the project code according to a preset rule, determines a uniform resource locator of a target resource from the project code, generates a preloading list according to the uniform resource locator of the target resource, adds the preloading list to the project code, and sends the project code including the preloading list to a server, so that a second electronic device can obtain the preloading list from the server and preload the target resource according to the preloading list. The first electronic equipment directly scans the project codes, and the URL of the resource needing to be preloaded is determined from the project codes according to the preset rule, so that the process that a user manually determines and arranges the URL from the project codes can be avoided, and the URL obtaining efficiency can be improved.
Referring to fig. 4, fig. 4 is a block diagram illustrating another resource preloading apparatus according to an example embodiment. The resource preloading device 400 may be disposed in a server, and may include: a first receiving module 401, a second receiving module 402 and a transmitting module 403.
The first receiving module 401 is configured to receive an item code sent by the first electronic device, which includes a preloaded list generated by the first electronic device according to a uniform resource locator of a target resource determined from the item code.
The second receiving module 402 is configured to receive a data request transmitted by the second electronic device.
The sending module 403 is configured to send, in response to the data request, a page code including the preloading list to the second electronic device, so that the second electronic device preloads the target resource according to the preloading list, where the page code is any one of page codes included in the project code.
Optionally, the apparatus 400 may further include: the device comprises a determining module and an adjusting module.
The determining module is configured to determine a target preloading strategy from a plurality of preloading strategies in response to user input, wherein the preloading strategies are used for adjusting the priority of the preloading list corresponding to each first page code when the second page code comprises the preloading list corresponding to each first page code; the first page code is a part or all of at least one page code included in the project code, and the second page code is a page code corresponding to the first page code in the at least one page code.
The adjusting module is configured to adjust the priority of the preloading list corresponding to each first page code according to a target preloading strategy under the condition that the second page code comprises the preloading list corresponding to each first page code, so that the second electronic device can sequentially preload the target resource corresponding to each first page code according to the priority of the preloading list corresponding to each first page code.
Optionally, the adjusting module is specifically configured to obtain a user log; determining the access frequency of each first page code according to the user log; sorting the pre-loading list corresponding to each first page code according to the access frequency of each first page code to obtain a first sorting result; and determining the priority of the preloading list corresponding to each first page code according to the first sequencing result.
Optionally, the adjusting module is specifically configured to generate a user tag of the user according to a preset algorithm; sequencing the pre-loaded lists corresponding to the first page codes respectively according to the user tags and the resources corresponding to the first page codes to obtain a second sequencing result; and determining the priority of the preloading list corresponding to each first page code according to the second sequencing result.
Optionally, the adjusting module is specifically configured to determine display time of a page corresponding to each first page code; sorting the pre-loaded lists corresponding to the first page codes respectively according to the display time of the pages corresponding to the first page codes respectively to obtain a third sorting result; and determining the priority of the preloading list corresponding to each first page code according to the third sequencing result.
Referring to fig. 5, fig. 5 is a block diagram illustrating yet another resource preloading apparatus according to an exemplary embodiment. The resource preloading device 500 may be disposed on a second electronic device, and may include: a sending module 501, a receiving module 502 and a preloading module 503.
The sending module 501 is configured to send a data request to a server.
The receiving module 502 is configured to receive page code sent by a server that includes a preloaded list that includes uniform resource locators of target resources.
The preloading module 503 is configured to preload the target resource according to the preloading list.
Optionally, the page code is a second page code, where the second page code includes a pre-loading list corresponding to each first page code and a priority of each pre-loading list;
the preloading module 503 is specifically configured to sequentially preload the target resource corresponding to each preloading list according to the priority of each preloading list
The first page code is a part or all of at least one page code, and the second page code is a page code corresponding to the first page code in the at least one page code.
Optionally, the preloading module 503 is further specifically configured to sequentially preload the target resource corresponding to each preloading list according to the priority of each preloading list in the idle state.
Optionally, the preloading module is further configured to send the data requests of the preset number of times to the server under the condition that the target resource preloading fails, so as to preload the target resource according to the data requests of the preset number of times.
Referring to fig. 6, fig. 6 is a block diagram illustrating yet another resource preloading apparatus according to an exemplary embodiment. The resource preloading device 600 includes:
a processor 601.
A memory 602 for storing instructions executable by the processor 601.
Wherein the processor 601 is configured to execute executable instructions stored by the memory 602 to implement the resource preloading method in the embodiments shown in fig. 1 and 2.
In an exemplary embodiment, a storage medium comprising instructions, such as a memory 602 comprising instructions, which are executable by a processor 601 of the resource preloading device 600 to perform the resource preloading method as in the embodiments shown in fig. 1 and 2, is also provided.
Alternatively, the storage medium may be a non-transitory computer readable storage medium, which may be, for example, a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the resource preloading method as in the embodiments shown in fig. 1 and 2.
Referring to fig. 7, fig. 7 is a block diagram illustrating yet another resource preloading apparatus, according to an example embodiment, the apparatus 700 may include one or more of the following components: processing component 702, memory 704, power component 706, multimedia component 708, audio component 710, input/output (I/O) interface 713, sensor component 714, and communications component 716.
The processing component 702 generally controls overall operation of the device 700, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 702 may include one or more processors 720 to execute instructions to perform all or part of the steps of the resource preloading method described above. Further, the processing component 702 may include one or more modules that facilitate interaction between the processing component 702 and other components. For example, the processing component 702 may include a multimedia module to facilitate interaction between the multimedia component 708 and the processing component 702.
The memory 704 is configured to store various types of data to support operations at the apparatus 700. Examples of such data include instructions for any application or method operating on device 700, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 704 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 706 provides power to the various components of the device 700. The power components 706 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the apparatus 700.
The multimedia component 708 includes a screen that provides an output interface between the device 700 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 708 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the device 700 is in an operation mode, such as a photographing mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 710 is configured to output and/or input audio signals. For example, audio component 710 includes a Microphone (MIC) configured to receive external audio signals when apparatus 700 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 704 or transmitted via the communication component 716. In some embodiments, audio component 710 also includes a speaker for outputting audio signals.
The I/O interface 713 provides an interface between the processing component 702 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 714 includes one or more sensors for providing status assessment of various aspects of the apparatus 700. For example, sensor assembly 714 may detect an open/closed state of device 700, the relative positioning of components, such as a display and keypad of device 700, sensor assembly 714 may also detect a change in position of device 700 or a component of device 700, the presence or absence of user contact with device 700, orientation or acceleration/deceleration of device 700, and a change in temperature of device 700. The sensor assembly 714 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 714 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 714 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 716 is configured to facilitate wired or wireless communication between the apparatus 700 and other devices. The apparatus 700 may access a wireless network based on a communication standard, such as WiFi, an operator network (such as 2G, 3G, 4G, or 5G), or a combination thereof. In an exemplary embodiment, the communication component 716 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 716 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 700 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described resource preloading method.
In an exemplary embodiment, a non-transitory computer readable storage medium comprising instructions, such as the memory 704 comprising instructions, executable by the processor 720 of the apparatus 700 to perform the resource preloading method described above is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product.
The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can store or a data storage device, such as a server, a data center, etc., that is integrated with one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the 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 system, apparatus and method may 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 be in an electrical, mechanical or other form.
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.
In addition, functional units in the embodiments of the present application 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 application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes 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 application. 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.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A resource preloading method is applied to a first electronic device and comprises the following steps:
acquiring a project code;
scanning the project codes according to preset rules, and determining uniform resource locators of target resources from the project codes;
generating a preloading list according to the uniform resource locator of the target resource;
adding the preloaded list to the item code;
and sending an item code comprising the preloading list to a server so as to enable the second electronic equipment to acquire the preloading list from the server and preload the target resource according to the preloading list.
2. The method of claim 1, wherein the item code comprises at least one page code, and wherein generating the preloaded list based on the uniform resource locator of the target resource comprises:
and generating a preloading list corresponding to the first page code according to the uniform resource locator of the target resource corresponding to the first page code, wherein the first page code is part or all of the at least one page code.
3. The method of claim 2, wherein adding the preloaded list to the item code comprises:
converting the preloading list corresponding to the first page code into a target character string;
and adding the target character string into a second page code, wherein the second page code is a page code corresponding to the first page code in the at least one page code.
4. A resource preloading method is applied to a server and comprises the following steps:
receiving an item code which is sent by first electronic equipment and comprises a preloading list, wherein the preloading list is generated by the first electronic equipment according to a uniform resource locator of a target resource determined from the item code;
receiving a data request sent by second electronic equipment;
and responding to the data request, sending a page code comprising the preloading list to the second electronic equipment so as to enable the second electronic equipment to preload the target resource according to the preloading list, wherein the page code is any page code included in the project code.
5. A resource preloading method is applied to a second electronic device and comprises the following steps:
sending a data request to a server;
receiving a page code which is sent by the server and comprises a preloading list, wherein the preloading list comprises a uniform resource locator of a target resource;
and preloading the target resource according to the preloading list.
6. A resource preloading device, provided on a first electronic device, includes:
an acquisition module configured to acquire a project code;
the scanning module is configured to scan the project codes according to preset rules and determine uniform resource locators of target resources from the project codes;
a generation module configured to generate a preloaded list from a uniform resource locator of the target resource;
an adding module configured to add the preloaded list to the item code;
a sending module configured to send an item code including the preloading list to a server, so that a second electronic device obtains the preloading list from the server and preloads the target resource according to the preloading list.
7. A resource preloading device, provided in a server, includes:
a first receiving module configured to receive an item code sent by a first electronic device and including a preloaded list generated by the first electronic device according to a uniform resource locator of a target resource determined from the item code;
the second receiving module is configured to receive a data request sent by the second electronic device;
a sending module configured to send, in response to the data request, a page code including the preloading list to the second electronic device, so that the second electronic device preloads the target resource according to the preloading list, where the page code is any one of page codes included in the item code.
8. A resource preloading device, disposed on a second electronic device, includes:
a sending module configured to send a data request to a server;
the server comprises a receiving module, a processing module and a processing module, wherein the receiving module is configured to receive page codes which comprise a preloading list and are sent by the server, and the preloading list comprises uniform resource locators of target resources;
a preloading module configured to preload the target resource according to the preloading list.
9. A resource preloading apparatus, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the resource preloading method as recited in any one of claims 1-3.
10. A storage medium having instructions that, when executed by a processor of a resource preloading device, enable the resource preloading device to perform the resource preloading method as recited in any one of claims 1-3.
CN202010328929.2A 2020-04-23 2020-04-23 Resource preloading method and device and storage medium Pending CN111639276A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010328929.2A CN111639276A (en) 2020-04-23 2020-04-23 Resource preloading method and device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010328929.2A CN111639276A (en) 2020-04-23 2020-04-23 Resource preloading method and device and storage medium

Publications (1)

Publication Number Publication Date
CN111639276A true CN111639276A (en) 2020-09-08

Family

ID=72331847

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010328929.2A Pending CN111639276A (en) 2020-04-23 2020-04-23 Resource preloading method and device and storage medium

Country Status (1)

Country Link
CN (1) CN111639276A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112764732A (en) * 2021-01-25 2021-05-07 百果园技术(新加坡)有限公司 Code generation method and device applied to loading target resource
CN113392358A (en) * 2021-07-12 2021-09-14 维沃移动通信(杭州)有限公司 Static resource preloading method and device
CN114138357A (en) * 2021-10-29 2022-03-04 北京达佳互联信息技术有限公司 Request processing method and device, electronic equipment, storage medium and product
CN116257707A (en) * 2023-01-04 2023-06-13 腾讯科技(深圳)有限公司 Application release method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102446222A (en) * 2011-12-22 2012-05-09 华为技术有限公司 Method, device and system of webpage content preloading
CN103440276A (en) * 2013-08-08 2013-12-11 星云融创(北京)信息技术有限公司 Method and device for improving webpage display speed
CN103618799A (en) * 2013-12-04 2014-03-05 北京奇虎科技有限公司 Browser caching processing method and system and proxy server
US20150200994A1 (en) * 2012-05-29 2015-07-16 Google Inc. Preloading resources of a web page

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102446222A (en) * 2011-12-22 2012-05-09 华为技术有限公司 Method, device and system of webpage content preloading
US20150200994A1 (en) * 2012-05-29 2015-07-16 Google Inc. Preloading resources of a web page
CN103440276A (en) * 2013-08-08 2013-12-11 星云融创(北京)信息技术有限公司 Method and device for improving webpage display speed
CN103618799A (en) * 2013-12-04 2014-03-05 北京奇虎科技有限公司 Browser caching processing method and system and proxy server

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112764732A (en) * 2021-01-25 2021-05-07 百果园技术(新加坡)有限公司 Code generation method and device applied to loading target resource
CN112764732B (en) * 2021-01-25 2024-03-08 百果园技术(新加坡)有限公司 Code generation method and device applied to loading target resource
CN113392358A (en) * 2021-07-12 2021-09-14 维沃移动通信(杭州)有限公司 Static resource preloading method and device
CN114138357A (en) * 2021-10-29 2022-03-04 北京达佳互联信息技术有限公司 Request processing method and device, electronic equipment, storage medium and product
CN116257707A (en) * 2023-01-04 2023-06-13 腾讯科技(深圳)有限公司 Application release method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN107329743B (en) Application page display method and device and storage medium
CN111639276A (en) Resource preloading method and device and storage medium
CN109032606B (en) Native application compiling method and device and terminal
CN107229711B (en) Webpage display method and device
CN111737617B (en) Page resource loading method and device, electronic equipment and storage medium
CN113542886B (en) Video playing method and device for playing video
CN117390330A (en) Webpage access method and device
CN107220059B (en) Application interface display method and device
CN111259289B (en) Picture loading method and device, electronic equipment and storage medium
CN113076504B (en) Skeleton screen generation method, device, equipment and storage medium
CN104144357A (en) Video playing method and system
CN108153832B (en) Push information display method and device
CN115061745A (en) Page resource preloading method and device and storage medium
CN105808304B (en) Code deployment method, device and system
CN108073610B (en) Method and device for realizing webpage loading
CN113238881B (en) Page communication method and device
CN104572230B (en) Script file loading method and device and script file generating method and device
CN111079040B (en) Resource sniffing method, device, terminal, server and storage medium
CN107220371B (en) Page display method and device and storage medium
CN105630948B (en) Network page display method and device
CN112486770A (en) Client dotting reporting method and device, electronic equipment and storage medium
CN111782997A (en) Method and device for loading webpage and storage medium
CN110543265A (en) Page title bar generation method and device, electronic equipment and storage medium
CN111159615A (en) Webpage processing method and device
CN105868354B (en) Webpage repairing method and device

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