CN113010821A - Page loading method, device, equipment and storage medium - Google Patents

Page loading method, device, equipment and storage medium Download PDF

Info

Publication number
CN113010821A
CN113010821A CN202110400534.3A CN202110400534A CN113010821A CN 113010821 A CN113010821 A CN 113010821A CN 202110400534 A CN202110400534 A CN 202110400534A CN 113010821 A CN113010821 A CN 113010821A
Authority
CN
China
Prior art keywords
page
loaded
file
code
spliced
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
CN202110400534.3A
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 ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network 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 ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202110400534.3A priority Critical patent/CN113010821A/en
Publication of CN113010821A publication Critical patent/CN113010821A/en
Priority to PCT/CN2022/076356 priority patent/WO2022218028A1/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/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

Abstract

The embodiment of the disclosure relates to a page loading method, a page loading device, a page loading equipment and a storage medium, wherein a page code of a page to be loaded and a spliced file formed by splicing page resources to be loaded on the page to be loaded are requested from a server, and the page resources at corresponding positions in the spliced file are loaded on the page to be loaded according to position information of the page resources carried in the page code in the spliced file, so that the page is loaded quickly. According to the embodiment of the invention, the multiple page resources can be fed back to the browser at one time through the spliced file, so that the acquisition process of the page resources is simplified, and the loading speed and efficiency of the page are improved.

Description

Page loading method, device, equipment and storage medium
Technical Field
The embodiment of the disclosure relates to the technical field of computers, and in particular relates to a page loading method, a page loading device, page loading equipment and a storage medium.
Background
When a page of a browser or an application is opened in the related art, resources (such as pictures, texts, audio, video, etc.) on the page are generally required to be downloaded from a server, and then the page resources are loaded on the page. The downloading speed of the page resource directly affects the opening speed of the page, and therefore, how to increase the downloading speed of the page resource is also a problem to be solved by those skilled in the art.
Disclosure of Invention
In order to solve the technical problem or at least partially solve the technical problem, embodiments of the present disclosure provide a page loading method, apparatus, device and storage medium.
A first aspect of the embodiments of the present disclosure provides a page loading method, where the method includes: requesting to obtain a page code of a page to be loaded and a spliced file obtained by splicing page resources to be loaded on the page to be loaded from a server, wherein the page code comprises information of the positions of the page resources in the spliced file; and reading the page resources from the position of the spliced file based on the page code, and loading the page resources to the page to be loaded.
In one embodiment, the spliced file is obtained by splicing at least two formats of page resources.
In an embodiment, the requesting, from the server, a page code of a page to be loaded and a spliced file spliced by page resources to be loaded onto the page to be loaded includes:
based on the address of the page to be loaded, requesting the server to obtain a page code of the page to be loaded, wherein the page code also comprises an identifier of the spliced file; and requesting the server to obtain the spliced file based on the identification.
In an embodiment, the requesting, from the server, a page code of a page to be loaded and a spliced file spliced by page resources to be loaded onto the page to be loaded includes:
sending a downloading request to a server, wherein the downloading request comprises an address of a page to be loaded; and receiving the page code of the page to be loaded and the splicing file fed back by the server according to the address.
In one embodiment, the information of the position of the page resource in the mosaic file comprises information of a starting position and a data size of the page resource;
the reading the page resource from the position of the spliced file based on the page code comprises:
reading the information of the initial position and the data size from the page code; determining the ending position of the page resource in the spliced file according to the information of the starting position and the data size; and reading the page resources from the spliced file based on the starting position and the ending position.
A second aspect of the embodiments of the present disclosure provides a page loading method, including:
receiving a first acquisition request sent by a browser, wherein the first acquisition request comprises an address of a page to be loaded; based on the address, feeding back a page code of the page to be loaded to the browser, wherein the page code comprises an identifier of a spliced file where a page resource to be loaded to the page to be loaded is located and information of the position of the page resource in the spliced file; receiving a second acquisition request sent by the browser, wherein the second acquisition request comprises the identification of the spliced file; and feeding back the spliced file to the browser according to the identifier, so that the browser loads the page resource to the page to be loaded based on the page code and the spliced file.
A third aspect of the embodiments of the present disclosure provides a page loading method, where the method includes:
receiving a downloading request sent by a browser, wherein the downloading request comprises an address of a page to be loaded; and feeding back a page code of the page to be loaded and a spliced file obtained by splicing page resources to be loaded on the page to be loaded to the browser according to the address, wherein the page code comprises the information of the position of the page resources in the spliced file, so that the browser loads the page resources on the page to be loaded according to the page code and the spliced file.
A fourth aspect of the embodiments of the present disclosure provides a page loading apparatus, including:
the request module is used for requesting to obtain a page code of a page to be loaded and a spliced file obtained by splicing page resources to be loaded on the page to be loaded from a server, wherein the page code comprises information of the positions of the page resources in the spliced file;
and the loading module is used for reading the page resources from the positions of the spliced file based on the page codes and loading the page resources to the page to be loaded.
In one embodiment, the spliced file is obtained by splicing at least two formats of page resources.
In one embodiment, the request module includes:
the first request submodule is used for requesting the server to obtain a page code of the page to be loaded based on the address of the page to be loaded, and the page code also comprises an identifier of the spliced file;
and the second request submodule is used for requesting the server to obtain the spliced file based on the identification.
In one embodiment, the request module includes:
the third request submodule is used for sending a downloading request to the server, wherein the downloading request comprises an address of a page to be loaded;
and the receiving submodule is used for receiving the page code of the page to be loaded and the spliced file fed back by the server according to the address.
In one embodiment, the information of the position of the page resource in the mosaic file comprises information of a starting position and a data size of the page resource;
the loading module is used for:
reading the information of the initial position and the data size from the page code;
determining the ending position of the page resource in the spliced file according to the information of the starting position and the data size;
and reading the page resources from the spliced file based on the starting position and the ending position.
A fifth aspect of the embodiments of the present disclosure provides a page loading apparatus, including:
the first receiving module is used for receiving a first acquisition request sent by a browser, wherein the first acquisition request comprises an address of a page to be loaded;
a first feedback module, configured to feed back, based on the address, a page code of the page to be loaded to the browser, where the page code includes an identifier of a spliced file in which a page resource to be loaded onto the page to be loaded is located, and information of a position of the page resource in the spliced file;
a second receiving module, configured to receive a second acquisition request sent by the browser, where the second acquisition request includes an identifier of the spliced file;
and the second feedback module is used for feeding the spliced file back to the browser according to the identifier so as to enable the browser to load the page resource onto the page to be loaded based on the page code and the spliced file.
A sixth aspect of the embodiments of the present disclosure provides a page loading apparatus, including:
the system comprises a receiving module, a downloading module and a loading module, wherein the receiving module is used for receiving a downloading request sent by a browser, and the downloading request comprises an address of a page to be loaded;
and the feedback module is used for feeding back the page code of the page to be loaded and a spliced file obtained by splicing page resources to be loaded on the page to be loaded to the browser according to the address, wherein the page code comprises the information of the positions of the page resources in the spliced file, so that the browser loads the page resources on the page to be loaded according to the page code and the spliced file.
A seventh aspect of the disclosed embodiments provides an electronic device, including:
the display is used for displaying the page of the browser or the application program loaded on the electronic equipment;
a memory having a computer program stored therein;
a processor for executing the computer program, the processor performing the method of the first aspect when the computer program is executed by the processor.
An eighth aspect of the embodiments of the present disclosure provides a server, including: a processor and a memory, wherein the memory has stored therein a computer program which, when executed by the processor, performs the method of the second or third aspect described above.
A ninth aspect of embodiments of the present disclosure provides a computer-readable storage medium having a computer program stored therein, which, when executed by a processor, can implement the method of any one of the first to third aspects described above.
Compared with the prior art, the technical scheme provided by the embodiment of the disclosure has the following advantages:
according to the page resource loading method and device, the page code of the page to be loaded and the spliced file formed by splicing the page resources to be loaded on the page to be loaded are requested from the server, and the page resources on the corresponding positions in the spliced file are loaded on the page to be loaded according to the position information of the page resources carried in the page code in the spliced file, so that the page is loaded quickly. According to the embodiment of the invention, the multiple page resources can be fed back to the browser at one time through the spliced file, so that the acquisition process of the page resources is simplified, and the loading speed and efficiency of the page are improved.
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.
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present disclosure, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a flowchart of a page loading method provided by an embodiment of the present disclosure;
fig. 2 and fig. 3 are schematic diagrams of a method for acquiring page codes and page resources according to an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of another method for acquiring page codes and page resources according to an embodiment of the present disclosure;
fig. 5 is a flowchart of a page loading method provided by the embodiment of the present disclosure;
fig. 6 is a flowchart of a page loading method provided by the embodiment of the present disclosure;
fig. 7 is a flowchart of a page loading method provided by the embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of a page loading apparatus according to an embodiment of the present disclosure;
fig. 9 is a schematic structural diagram of an electronic device in an embodiment of the present disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, aspects of the present disclosure will be further described below. It should be noted that the embodiments and features of the embodiments of the present disclosure may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced in other ways than those described herein; it is to be understood that the embodiments disclosed in the specification are only a few embodiments of the present disclosure, and not all embodiments.
Fig. 1 is a flowchart of a page loading method provided by an embodiment of the present disclosure, which may be executed by an electronic device. The electronic device can be understood as a device with a page display function, such as a mobile phone, a tablet computer, a notebook computer, a desktop computer, a smart television, and the like. As shown in fig. 1, the method provided by this embodiment includes the following steps:
step 101, a page code of a page to be loaded and a spliced file obtained by splicing page resources to be loaded on the page to be loaded are obtained from a server in a request mode, wherein the page code comprises information of positions of the page resources on the page to be loaded in the spliced file.
And 102, reading the page resources of the page to be loaded from the corresponding position of the spliced file based on the page code of the page to be loaded, and loading the read page resources to the page to be loaded.
The spliced file in this embodiment may be obtained by splicing a plurality of page resources, and the splicing manner may be, for example, end-to-end, but is not limited to end-to-end. The multiple page resources constituting the mosaic file may be all page resources on a certain page, or may be partial page resources on a certain page. The formats of the multiple page resources constituting the mosaic file may be the same or different, that is, in one embodiment, the mosaic file may be obtained by mosaicing page resources in at least two formats.
The page to be loaded in this embodiment may be exemplarily understood as a hypertext Markup Language (HTML) page. The page code in the present embodiment may be exemplarily understood as code written in the HTML language. The page code describes at least in the HTML language the information of the page resources on the page, such as pictures, video, audio, text, etc. The information of the page resource may be at least one of a name, a format, and a position of the page resource in the mosaic file, for example.
Optionally, in this embodiment, the electronic device requests the server for the page code of the page to be loaded and the spliced file containing the page resource of the page to be loaded by sending the request message, where the number of the spliced files may be one or multiple. The modes of the electronic equipment for requesting the page code and the splicing file at least comprise the following modes:
in one implementation, the electronic device may obtain the page code and the mosaic file of the page to be loaded simultaneously through one download request. For example, fig. 2 and fig. 3 are schematic diagrams of a method for acquiring a page code and a page resource according to an embodiment of the present disclosure, as shown in fig. 2, in this way, an electronic device 21 may carry an address of a page to be loaded in a download request and send the download request to a server 22, and after receiving the download request, the server 22 defaults to feed back the page code and a splicing file of the page to be loaded to the electronic device 21 according to the address in the download request; or, as shown in fig. 3, the electronic device 21 may also simultaneously carry the address of the page to be loaded and its own performance information, such as the type, version, network speed, and the like of the supported browser, in the download request, and send the download request to the server 22, after receiving the download request, the server 22 determines in what manner to feed back the page resource of the page to be loaded according to the performance information in the download request, and if the performance information in the download request meets preset conditions (for example, both the type and the version of the browser meet preset browser types and versions), feed back the splicing file and the page code including the page resource of the page to be loaded to the electronic device 21. If the performance information in the download request does not meet the preset condition, the page code and the mosaic file of the page to be loaded are fed back to the electronic device 21 in other predetermined manners (such as, but not limited to, packing and compressing the page resource or synthesizing the picture in the page into a picture). After receiving the page code of the page to be loaded and the spliced file, the electronic device 21 loads the page resource at the corresponding position in the spliced file to the page according to the position of each page resource recorded in the page code in the spliced file.
In another implementation manner, the electronic device may obtain the page code and the mosaic file of the page to be loaded through two requests. For example, fig. 4 is a schematic diagram of another method for acquiring a page code and a page resource provided by an embodiment of the present disclosure, as shown in fig. 4, in this manner, in a first request, an electronic device 41 may carry an address of a page to be loaded in a request message and send the request message to a server 42, and receive a page code fed back by the server 42 according to the request message, where the page code includes, in addition to a name and a format of each page resource on the page and location information of the page resource in a concatenation file, an identifier of a concatenation file in which each page resource is located. After receiving the page code fed back by the server 42, the electronic device 41 requests the server 42 to obtain a corresponding spliced file according to the identifier of the spliced file in the page code, and loads the page resource at the corresponding position onto the page according to the position of each page resource recorded on the page code in the spliced file, thereby completing the loading of the page. It should be noted that in this implementation manner, a plurality of page resources on the page to be loaded may be dispersed in a plurality of spliced files, and identifiers of spliced files corresponding to different page resources in the page code may also be different.
Of course, the above two implementation manners are only used for illustration and are not all manners of the embodiment, and actually, the specific manner in which the electronic device requests the server for the page code and the splicing file may be configured according to needs, and is not necessarily limited to one or several specific manners.
According to the page resource loading method and device, the page code of the page to be loaded and the spliced file formed by splicing the page resources to be loaded on the page to be loaded are requested from the server, and the page resources on the corresponding positions in the spliced file are loaded on the page to be loaded according to the position information of the page resources carried in the page code in the spliced file, so that the page is loaded quickly. According to the embodiment of the invention, the multiple page resources can be fed back to the browser at one time through the spliced file, so that the acquisition process of the page resources is simplified, and the loading speed and efficiency of the page are improved. The spliced file can comprise page resources in various formats, the formats and the data sizes of the page resources are not limited, and the spliced file supports dynamic images and non-image resources.
Fig. 5 is a flowchart of a page loading method provided in the embodiment of the present disclosure, and as shown in fig. 5, the method provided in the embodiment includes:
step 501, obtaining a page code of a page to be loaded and a spliced file obtained by splicing page resources to be loaded on the page to be loaded from a server in a request mode, wherein the page code comprises information of the initial position and the data size of the page resources on the page to be loaded in the spliced file.
Step 502, reading information of the starting position and the data size of the page resource in the splicing file from the page code.
Step 503, determining the ending position of the page resource in the spliced file according to the information of the starting position and the data size of the page resource.
Step 504, reading the page resources from the spliced file based on the starting position and the ending position of the page resources, and loading the page resources onto the page to be loaded.
For example, the following code is a page code of a certain page to be loaded:
<html><body>
<img src="1.jpeg"multi-src="all;0;2000">
<img src="2.webp"multi-src="all;2000;1000">
<script src="3.js"multi-src="all;3000;500"></script>
</body></html>
wherein "< img src ═ 1.jpeg" multi-src ═ all in the page code; 0; 2000">" indicates that a picture insertion page with the file format of ". jpeg" and the file name of "1" is obtained from the network, the picture is in a spliced file with the name of "all", the address of the starting position of the picture in the spliced file is "0", and the data size is "2000". In page code "< img src ═ 2.webp" multi-src ═ all; 2000; 1000">", which means that a picture insertion page with a file format of ". webp" and a file name of "2" is obtained from the network, the picture is in a spliced file with a name of "all", the address of the starting position of the picture in the spliced file is "2000", and the data size is "1000". "script src ═"3.js "multi-src ═" all "in the page code; 3000A; 500 ">/script" indicates that a client-side script named "3.js" is obtained from the network, the script is in a spliced file named "all", the address of the starting position of the picture in the spliced file is "3000", and the data size is "500".
Then, from the address "0" of the start position of the picture "1.jpeg" and the data size "2000", it can be found that the address of the end position of the picture "1.jpeg" in the mosaic file is "1999"; according to the address "2000" and the data size "1000" of the starting position of the picture "2.webp", it can be obtained that the address of the ending position of the picture "2.webp" in the mosaic file is "2999"; according to the address "3000" and the data size "500" of the start position of the client script "3.js", it can be obtained that the address of the end position of the client script "3.js" in the mosaic file is "3499". Therefore, according to the address of the starting position and the address of the ending position of the picture 1.jpeg, the picture 2.webp and the client script 3.js in the spliced file, the 1.jpeg, the 2.webp and the 3.js can be loaded on the page to be loaded.
Of course, the above is merely illustrative and not the only limitation on the page code.
It should be noted that although this embodiment provides only one method for loading a page resource from a mosaic file, this method is not the only method of this disclosure, and actually, in some embodiments, the field in the page code for indicating the data size of the page resource may be replaced by a field for indicating the address of the end position of the page resource in the mosaic file. That is, in this case, the location of the page resource in the mosaic file may be represented by the starting location and the ending location of the page resource in the mosaic file.
According to the embodiment, the starting position and the data size of the page resource in the spliced file are carried in the page code, so that the position of the page in the spliced file can be rapidly and accurately determined by the electronic equipment, and therefore, a guarantee is provided for realizing rapid page loading.
Fig. 6 is a flowchart of a page loading method provided by an embodiment of the present disclosure, which may be executed by a server. As shown in fig. 6, the method includes:
step 601, receiving a first obtaining request sent by a browser on the electronic device, where the first obtaining request includes an address of a page to be loaded.
Step 602, based on the address of the page to be loaded, feeding back the page code of the page to be loaded to the browser, where the page code includes an identifier of a spliced file where the page resource to be loaded on the page to be loaded is located, and information of positions of the page resources in the spliced file.
Step 603, receiving a second obtaining request sent by the browser, where the second obtaining request includes an identifier of the spliced file.
And step 604, feeding back the corresponding spliced file to the browser according to the identifier of the spliced file, so that the browser loads the page resource to the page to be loaded based on the received page code and the spliced file.
The implementation and the beneficial effects of this embodiment can be seen from the related contents in the embodiment of fig. 1, which are not described herein again.
Fig. 7 is a flowchart of a page loading method provided by an embodiment of the present disclosure, which may be executed by a server. As shown in fig. 7, the method includes:
step 701, receiving a download request sent by a browser on the electronic device, where the download request includes an address of a page to be loaded.
Step 702, feeding back a page code of the page to be loaded and a spliced file obtained by splicing page resources to be loaded on the page to be loaded to the browser according to the address of the page to be loaded, wherein the page code includes information of positions of the page resources in the spliced file, so that the browser loads the page resources on the page to be loaded according to the received page code and the spliced file.
The implementation and the beneficial effects of this embodiment can be seen from the related contents in the embodiment of fig. 1, which are not described herein again.
Fig. 8 is a schematic structural diagram of a page loading apparatus according to an embodiment of the present disclosure, where the page loading apparatus may be understood as the electronic device or a part of functional modules in the electronic device. As shown in fig. 8, the page loading apparatus 80 includes:
the request module 81 is configured to request, from a server, a page code of a page to be loaded and a spliced file obtained by splicing page resources to be loaded onto the page to be loaded, where the page code includes information of positions of the page resources in the spliced file;
and the loading module 82 is configured to read the page resource from the position of the stitched file based on the page code, and load the page resource onto the page to be loaded.
In one embodiment, the spliced file is obtained by splicing at least two formats of page resources.
In one embodiment, the request module 81 includes:
the first request submodule is used for requesting the server to obtain a page code of the page to be loaded based on the address of the page to be loaded, and the page code also comprises an identifier of the spliced file;
and the second request submodule is used for requesting the server to obtain the spliced file based on the identification.
In one embodiment, the request module 81 includes:
the third request submodule is used for sending a downloading request to the server, wherein the downloading request comprises an address of a page to be loaded;
and the receiving submodule is used for receiving the page code of the page to be loaded and the spliced file fed back by the server according to the address.
In one embodiment, the information of the position of the page resource in the mosaic file comprises information of a starting position and a data size of the page resource;
the loading module 82 is configured to:
reading the information of the initial position and the data size from the page code;
determining the ending position of the page resource in the spliced file according to the information of the starting position and the data size;
and reading the page resources from the spliced file based on the starting position and the ending position.
The apparatus provided in this embodiment can execute the method in any one of the embodiments in fig. 1 to fig. 5, and the execution manner and the beneficial effects are similar, and are not described herein again.
The present disclosure also provides a page loading apparatus, which may be understood as the server or a part of the functional modules in the server in the above embodiments. In one embodiment, the page loading device may include:
the first receiving module is used for receiving a first acquisition request sent by a browser, wherein the first acquisition request comprises an address of a page to be loaded;
a first feedback module, configured to feed back, based on the address, a page code of the page to be loaded to the browser, where the page code includes an identifier of a spliced file in which a page resource to be loaded onto the page to be loaded is located, and information of a position of the page resource in the spliced file;
a second receiving module, configured to receive a second acquisition request sent by the browser, where the second acquisition request includes an identifier of the spliced file;
and the second feedback module is used for feeding the spliced file back to the browser according to the identifier so as to enable the browser to load the page resource onto the page to be loaded based on the page code and the spliced file.
In another embodiment, the page loading apparatus may include:
the system comprises a receiving module, a downloading module and a loading module, wherein the receiving module is used for receiving a downloading request sent by a browser, and the downloading request comprises an address of a page to be loaded;
and the feedback module is used for feeding back the page code of the page to be loaded and a spliced file obtained by splicing page resources to be loaded on the page to be loaded to the browser according to the address, wherein the page code comprises the information of the positions of the page resources in the spliced file, so that the browser loads the page resources on the page to be loaded according to the page code and the spliced file.
The apparatus provided in this embodiment can execute the method in the embodiment of fig. 6 or fig. 7, and the execution manner and the beneficial effects are similar, which are not described herein again.
An embodiment of the present disclosure further provides a server, where the server includes: a processor and a memory, wherein the memory has stored therein a computer program which, when executed by the processor, performs the method of fig. 6 or 7 described above.
An embodiment of the present disclosure further provides an electronic device, including:
the display is used for displaying the page of the browser or the application program loaded on the electronic equipment;
a memory having a computer program stored therein;
a processor for executing the computer program, wherein the computer program, when executed by the processor, may implement the method of any of the embodiments of fig. 1-5 described above.
For example, fig. 9 is a schematic structural diagram of an electronic device in an embodiment of the present disclosure. Referring now specifically to fig. 9, a schematic diagram of an electronic device 1000 suitable for use in implementing embodiments of the present disclosure is shown. The electronic device 1000 in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle-mounted terminal (e.g., a car navigation terminal), and the like, and fixed terminals such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 9 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 9, the electronic device 1000 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 1001 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)1002 or a program loaded from a storage means 1008 into a Random Access Memory (RAM) 1003. In the RAM 1003, various programs and data necessary for the operation of the electronic apparatus 1000 are also stored. The processing device 1001, the ROM 1002, and the RAM 1003 are connected to each other by a bus 1004. An input/output (I/O) interface 1005 is also connected to bus 1004.
Generally, the following devices may be connected to the I/O interface 1005: input devices 1006 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 1007 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage devices 1008 including, for example, magnetic tape, hard disk, and the like; and a communication device 1009. The communication device 1009 may allow the electronic device 1000 to communicate with other devices wirelessly or by wire to exchange data. While fig. 9 illustrates an electronic device 1000 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication means 1009, or installed from the storage means 1008, or installed from the ROM 1002. The computer program, when executed by the processing device 1001, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: requesting to obtain a page code of a page to be loaded and a spliced file obtained by splicing page resources to be loaded on the page to be loaded from a server, wherein the page code comprises information of the positions of the page resources in the spliced file; and reading the page resources from the position of the spliced file based on the page code, and loading the page resources to the page to be loaded.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of an element does not in some cases constitute a limitation on the element itself.
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The embodiments of the present disclosure further provide a computer-readable storage medium, where a computer program is stored in the storage medium, and when the computer program is executed by a processor, the method of any one of the embodiments in fig. 1 to 7 may be implemented, where the execution manner and the beneficial effects are similar, and are not described herein again.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present disclosure, which enable those skilled in the art to understand or practice the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (17)

1. A page loading method is characterized by comprising the following steps:
requesting to obtain a page code of a page to be loaded and a spliced file obtained by splicing page resources to be loaded on the page to be loaded from a server, wherein the page code comprises information of positions of the page resources in the spliced file;
and reading the page resources from the position of the spliced file based on the page code, and loading the page resources to the page to be loaded.
2. The method of claim 1, wherein the mosaic file is obtained by mosaicing page resources in at least two formats.
3. The method according to claim 1, wherein the requesting from the server for the page code of the page to be loaded and the splicing file spliced by the page resources to be loaded on the page to be loaded comprises:
based on the address of the page to be loaded, requesting the server to obtain a page code of the page to be loaded, wherein the page code also comprises an identifier of the spliced file;
and requesting the server to obtain the spliced file based on the identification.
4. The method according to claim 1, wherein the requesting from the server for the page code of the page to be loaded and the splicing file spliced by the page resources to be loaded on the page to be loaded comprises:
sending a downloading request to a server, wherein the downloading request comprises an address of a page to be loaded;
and receiving the page code of the page to be loaded and the splicing file fed back by the server according to the address.
5. The method according to any one of claims 1-4, wherein the information of the position of the page resource in the mosaic file comprises information of a start position and a data size of the page resource;
the reading the page resource from the position of the spliced file based on the page code comprises:
reading the information of the initial position and the data size from the page code;
determining the ending position of the page resource in the spliced file according to the information of the starting position and the data size;
and reading the page resources from the spliced file based on the starting position and the ending position.
6. A page loading method is characterized by comprising the following steps:
receiving a first acquisition request sent by a browser, wherein the first acquisition request comprises an address of a page to be loaded;
based on the address, feeding back a page code of the page to be loaded to the browser, wherein the page code comprises an identifier of a spliced file where a page resource to be loaded to the page to be loaded is located and information of the position of the page resource in the spliced file;
receiving a second acquisition request sent by the browser, wherein the second acquisition request comprises the identification of the spliced file;
and feeding back the spliced file to the browser according to the identifier, so that the browser loads the page resource to the page to be loaded based on the page code and the spliced file.
7. A page loading method is characterized by comprising the following steps:
receiving a downloading request sent by a browser, wherein the downloading request comprises an address of a page to be loaded;
and feeding back a page code of the page to be loaded and a spliced file obtained by splicing page resources to be loaded on the page to be loaded to the browser according to the address, wherein the page code comprises the information of the position of the page resources in the spliced file, so that the browser loads the page resources on the page to be loaded according to the page code and the spliced file.
8. A page loading apparatus, comprising:
the request module is used for requesting to obtain a page code of a page to be loaded and a spliced file obtained by splicing page resources to be loaded on the page to be loaded from a server, wherein the page code comprises information of the positions of the page resources in the spliced file;
and the loading module is used for reading the page resources from the positions of the spliced file based on the page codes and loading the page resources to the page to be loaded.
9. The apparatus of claim 8, wherein the mosaic file is obtained by mosaicing page resources of at least two formats.
10. The apparatus of claim 8, wherein the request module comprises:
the first request submodule is used for requesting the server to obtain a page code of the page to be loaded based on the address of the page to be loaded, and the page code also comprises an identifier of the spliced file;
and the second request submodule is used for requesting the server to obtain the spliced file based on the identification.
11. The apparatus of claim 8, wherein the request module comprises:
the third request submodule is used for sending a downloading request to the server, wherein the downloading request comprises an address of a page to be loaded;
and the receiving submodule is used for receiving the page code of the page to be loaded and the spliced file fed back by the server according to the address.
12. The apparatus according to any one of claims 8-11, wherein the information of the position of the page resource in the mosaic file comprises information of a start position and a data size of the page resource;
the loading module is used for:
reading the information of the initial position and the data size from the page code;
determining the ending position of the page resource in the spliced file according to the information of the starting position and the data size;
and reading the page resources from the spliced file based on the starting position and the ending position.
13. A page loading apparatus, comprising:
the first receiving module is used for receiving a first acquisition request sent by a browser, wherein the first acquisition request comprises an address of a page to be loaded;
a first feedback module, configured to feed back, based on the address, a page code of the page to be loaded to the browser, where the page code includes an identifier of a spliced file in which a page resource to be loaded onto the page to be loaded is located, and information of a position of the page resource in the spliced file;
a second receiving module, configured to receive a second acquisition request sent by the browser, where the second acquisition request includes an identifier of the spliced file;
and the second feedback module is used for feeding the spliced file back to the browser according to the identifier so as to enable the browser to load the page resource onto the page to be loaded based on the page code and the spliced file.
14. A page loading apparatus, comprising:
the system comprises a receiving module, a downloading module and a loading module, wherein the receiving module is used for receiving a downloading request sent by a browser, and the downloading request comprises an address of a page to be loaded;
and the feedback module is used for feeding back the page code of the page to be loaded and a spliced file obtained by splicing page resources to be loaded on the page to be loaded to the browser according to the address, wherein the page code comprises the information of the positions of the page resources in the spliced file, so that the browser loads the page resources on the page to be loaded according to the page code and the spliced file.
15. An electronic device, comprising:
the display is used for displaying the page of the browser or the application program loaded on the electronic equipment;
a memory having a computer program stored therein;
a processor for executing the computer program, the processor performing the method of any of claims 1-5 when the computer program is executed by the processor.
16. A server, comprising:
a processor and a memory, wherein the memory has stored therein a computer program which, when executed by the processor, performs the method of claim 6 or 7.
17. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-7.
CN202110400534.3A 2021-04-14 2021-04-14 Page loading method, device, equipment and storage medium Pending CN113010821A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202110400534.3A CN113010821A (en) 2021-04-14 2021-04-14 Page loading method, device, equipment and storage medium
PCT/CN2022/076356 WO2022218028A1 (en) 2021-04-14 2022-02-15 Page loading method and apparatus, and device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110400534.3A CN113010821A (en) 2021-04-14 2021-04-14 Page loading method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113010821A true CN113010821A (en) 2021-06-22

Family

ID=76389424

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110400534.3A Pending CN113010821A (en) 2021-04-14 2021-04-14 Page loading method, device, equipment and storage medium

Country Status (2)

Country Link
CN (1) CN113010821A (en)
WO (1) WO2022218028A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022218028A1 (en) * 2021-04-14 2022-10-20 北京字节跳动网络技术有限公司 Page loading method and apparatus, and device and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130227056A1 (en) * 2012-02-28 2013-08-29 Martin Vecera Reducing web page loading time using a backwards-compatible mechanism
WO2015153677A1 (en) * 2014-03-31 2015-10-08 Open Garden Inc. System and method for improving webpage loading speeds
CN107291759A (en) * 2016-04-01 2017-10-24 腾讯科技(深圳)有限公司 The treating method and apparatus of browser page resource
CN107800748A (en) * 2016-09-07 2018-03-13 广州市动景计算机科技有限公司 Page resource obtains and distribution method, device, equipment and system
CN108415963A (en) * 2018-02-07 2018-08-17 阿里巴巴集团控股有限公司 A kind of page generation method and device
CN109710870A (en) * 2018-12-27 2019-05-03 北京微播视界科技有限公司 Loading method, device, electronic equipment and the readable storage medium storing program for executing of the H5 page
CN111639278A (en) * 2020-05-26 2020-09-08 北京三快在线科技有限公司 Webpage loading method and device
CN112347404A (en) * 2020-10-26 2021-02-09 长沙市到家悠享网络科技有限公司 SPA page rendering method, device and system and storage medium
CN112612977A (en) * 2020-12-15 2021-04-06 京东数字科技控股股份有限公司 Page display method, system, device, equipment and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110239108A1 (en) * 2010-03-26 2011-09-29 Microsoft Corporation Configurable dynamic combination of html resources for download optimization in script based web page
CN106055649A (en) * 2016-05-31 2016-10-26 乐视控股(北京)有限公司 Page resource loading method, device and system
CN113010821A (en) * 2021-04-14 2021-06-22 北京字节跳动网络技术有限公司 Page loading method, device, equipment and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130227056A1 (en) * 2012-02-28 2013-08-29 Martin Vecera Reducing web page loading time using a backwards-compatible mechanism
WO2015153677A1 (en) * 2014-03-31 2015-10-08 Open Garden Inc. System and method for improving webpage loading speeds
CN107291759A (en) * 2016-04-01 2017-10-24 腾讯科技(深圳)有限公司 The treating method and apparatus of browser page resource
CN107800748A (en) * 2016-09-07 2018-03-13 广州市动景计算机科技有限公司 Page resource obtains and distribution method, device, equipment and system
CN108415963A (en) * 2018-02-07 2018-08-17 阿里巴巴集团控股有限公司 A kind of page generation method and device
CN109710870A (en) * 2018-12-27 2019-05-03 北京微播视界科技有限公司 Loading method, device, electronic equipment and the readable storage medium storing program for executing of the H5 page
CN111639278A (en) * 2020-05-26 2020-09-08 北京三快在线科技有限公司 Webpage loading method and device
CN112347404A (en) * 2020-10-26 2021-02-09 长沙市到家悠享网络科技有限公司 SPA page rendering method, device and system and storage medium
CN112612977A (en) * 2020-12-15 2021-04-06 京东数字科技控股股份有限公司 Page display method, system, device, equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022218028A1 (en) * 2021-04-14 2022-10-20 北京字节跳动网络技术有限公司 Page loading method and apparatus, and device and storage medium

Also Published As

Publication number Publication date
WO2022218028A1 (en) 2022-10-20

Similar Documents

Publication Publication Date Title
CN110809189B (en) Video playing method and device, electronic equipment and computer readable medium
CN111930534A (en) Data calling method and device and electronic equipment
CN111459364B (en) Icon updating method and device and electronic equipment
CN112965673A (en) Content printing method, device, equipment and storage medium
CN111163329A (en) Live broadcast room gift list configuration method, device, medium and electronic equipment
WO2023103861A1 (en) Screen projection method, screen projection device, screen projection display device, screen projection system and medium
CN110781437A (en) Method and device for acquiring webpage image loading duration and electronic equipment
CN113157153A (en) Content sharing method and device, electronic equipment and computer readable storage medium
CN112269959A (en) Display content control method and device, readable medium and electronic equipment
CN113761097B (en) Map tile loading method, device, equipment and medium for browser end
CN111324834A (en) Image-text mixed arranging method and device, electronic equipment and computer readable medium
WO2022218028A1 (en) Page loading method and apparatus, and device and storage medium
CN113596530A (en) Method and device for transferring data
CN111352872A (en) Execution engine, data processing method, apparatus, electronic device, and medium
CN111756953A (en) Video processing method, device, equipment and computer readable medium
CN111754600A (en) Poster image generation method and device and electronic equipment
CN113126985B (en) Method, apparatus, electronic device and computer readable medium for page rendering
CN112084441A (en) Information retrieval method and device and electronic equipment
CN111581556B (en) Page data processing method, device, electronic equipment and readable medium
CN111444457B (en) Data release method and device, storage medium and electronic equipment
CN114860213A (en) Application package generation method, device, equipment and medium
CN113032046A (en) Method, device and equipment for repairing so file and storage medium
CN112732457A (en) Image transmission method, image transmission device, electronic equipment and computer readable medium
CN113157365B (en) Program running method, program running device, electronic equipment and computer readable medium
CN111399730A (en) Image processing method, image processing device, electronic equipment and computer readable 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