CN110471709B - Method, device, medium and electronic equipment for accelerating webpage opening speed - Google Patents

Method, device, medium and electronic equipment for accelerating webpage opening speed Download PDF

Info

Publication number
CN110471709B
CN110471709B CN201910636751.5A CN201910636751A CN110471709B CN 110471709 B CN110471709 B CN 110471709B CN 201910636751 A CN201910636751 A CN 201910636751A CN 110471709 B CN110471709 B CN 110471709B
Authority
CN
China
Prior art keywords
public module
information
resource file
public
static 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.)
Active
Application number
CN201910636751.5A
Other languages
Chinese (zh)
Other versions
CN110471709A (en
Inventor
马俊辰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 CN201910636751.5A priority Critical patent/CN110471709B/en
Publication of CN110471709A publication Critical patent/CN110471709A/en
Application granted granted Critical
Publication of CN110471709B publication Critical patent/CN110471709B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44568Immediately runnable code
    • G06F9/44578Preparing or optimising for loading

Abstract

The invention provides a method, a device, a medium and electronic equipment for accelerating the opening speed of a webpage, wherein the method comprises the following steps: analyzing the static resource file and identifying a public module from the static resource file; matching public module association information corresponding to the public module according to a preset rule; deleting the codes corresponding to the public modules from the static resource file, and writing the public module association information into the static resource file to obtain a modified static resource file; the public module is a module of which the corresponding code download times are more than or equal to a preset download time threshold value. According to the invention, the modified static resource file is obtained by deleting the code corresponding to the public module and writing the public module associated information into the original static resource file, so that the modified static resource file is slimming, the expenditure of the whole network is reduced, and the webpage opening speed is accelerated.

Description

Method, device, medium and electronic equipment for accelerating webpage opening speed
Technical Field
The invention relates to the technical field of computers, in particular to a method, a device, a medium and electronic equipment for accelerating the opening speed of a webpage.
Background
In the prior art, opening a web page is divided into the following steps, which are specifically described as follows:
step 1: downloading a hypertext markup language;
step 2: analyzing the hypertext markup language and loading static resources, such as JS scripts, cascading style sheet resources and the like;
and step 3: receiving and unloading the JS script;
and 4, step 4: executing the JS script;
for a web Page using SPA (Single Page Application) technology, a user waits for the above four steps to be performed and then can see the content of the web Page.
In order to speed up the process of opening the web page, a common solution at present is: the PWA technology is a technology of Progressive Web App (Web App) proposed by Google corporation, and the PWA technology mainly uses a scheme of intercepting a resource request and caching by a ServiceWorker reverse proxy to achieve the purpose of reducing the time for downloading the resource.
For the PWA technology, when loading for the first time, the loading of the ServiceWorker needs JS downloading, and after the JS analysis is completed, the webpage can be opened, and because the frequently used core codes which are nearly twenty percent need to be repeatedly downloaded, the cost of the whole network is increased, and finally the webpage opening speed is slowed down. Therefore, in the long-term research and development, the inventor has made a lot of research on how to accelerate the opening speed of the web page, and has proposed a method for accelerating the opening speed of the web page to solve one of the above technical problems.
Disclosure of Invention
The invention aims to provide a method, a device, a medium and an electronic device for accelerating the webpage opening speed, which can solve at least one technical problem mentioned above. The specific scheme is as follows:
according to an embodiment of the present invention, in a first aspect, the present disclosure provides a method for accelerating a web page opening speed, including:
analyzing a static resource file and identifying a public module from the static resource file;
matching public module associated information corresponding to the public module according to a preset rule;
deleting the codes corresponding to the public modules from the static resource file, and writing the public module association information into the static resource file to obtain a modified static resource file;
the public module is a module of which the corresponding code downloading times are more than or equal to a preset downloading time threshold value.
Optionally, after obtaining the modified static resource file, the method further includes:
and returning the modified static resource file to a corresponding developer so that the developer can conveniently release the modified static resource file to a website specified by the developer.
Optionally, the method further includes:
storing and managing the public module associated information of each version;
wherein the common module association information includes: version number information corresponding to the public module and source and outlet information corresponding to the public module;
version number information and source information in the public module associated information of each version are in one-to-one correspondence.
Optionally, the method further includes:
receiving a request of the client for acquiring the public module associated information under the condition that the client does not have the public module associated information;
acquiring corresponding public module associated information according to the label attribute information carried by the request for acquiring the public module associated information;
and sending the public module association information to the client.
According to a second aspect of the present invention, there is provided a method for accelerating a web page opening speed, including:
sending a request for acquiring the modified static resource file to a website server;
receiving the modified static resource file returned by the website server;
analyzing the modified static resource file, and judging whether public module associated information exists or not;
under the condition that the public module associated information does not exist, sending a request for acquiring the public module associated information to a cloud server so that the cloud server can acquire corresponding public module associated information according to label attribute information carried by the request for acquiring the public module associated information;
receiving the public module correlation information sent by the cloud server;
the public module is a module of which the corresponding code download times are more than or equal to a preset download time threshold value.
Optionally, the method further includes:
storing the public module correlation information, and merging and injecting the public module correlation information into a corresponding page;
wherein the common module association information comprises: version number information corresponding to the public module and source-outlet information corresponding to the public module; alternatively, the first and second liquid crystal display panels may be,
and setting a public resource cache pool, wherein the public resource cache pool is used for sharing common codes among different domain names. According to the embodiments of the present invention, in a third aspect, the present invention provides an apparatus for accelerating a web page opening speed, including:
the analysis and identification unit is used for analyzing the static resource file and identifying a public module from the static resource file;
the matching unit is used for matching the public module correlation information corresponding to the public module identified by the analysis and identification unit according to a preset rule;
a deletion writing unit, configured to delete the code corresponding to the public module identified by the analysis and identification unit from the static resource file, and write the public module association information matched by the matching unit into the static resource file, so as to obtain a modified static resource file;
the public module identified by the analysis identification unit is a module of which the corresponding code download times are more than or equal to a preset download time threshold value.
According to a fourth aspect of the present invention, there is provided an apparatus for accelerating a web page opening speed, including:
the first request sending unit is used for sending a request for acquiring the modified static resource file to the website server;
the file receiving unit is used for receiving the modified static resource file returned by the website server;
the processing unit is used for analyzing the modified static resource file received by the receiving unit and judging whether public module associated information exists or not;
a second request sending unit, configured to send, to a cloud server, a request for obtaining the public module related information when the processing unit determines that the public module related information does not exist, so that the cloud server obtains corresponding public module related information according to tag attribute information carried in the request for obtaining the public module related information;
an information receiving unit, configured to receive the public module association information sent by the cloud server;
the public module is a module of which the corresponding code download times are more than or equal to a preset download time threshold value.
According to a fifth aspect, the present invention provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor implements a method of editing content in a document as described in any one of the above.
According to a sixth aspect thereof, the present invention provides an electronic device, comprising: one or more processors; storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to carry out a method as claimed in any preceding claim.
Compared with the prior art, the scheme of the embodiment of the invention at least has the following beneficial effects:
the invention provides a method, a device, a medium and electronic equipment for accelerating the webpage opening speed, wherein the modified static resource file is obtained by deleting a code corresponding to a public module and writing the public module associated information into an original static resource file, so that the modified static resource file can be slimmed, the cost of the whole network is reduced, and the webpage opening speed is accelerated.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention. It is obvious that the drawings in the following description are only some embodiments of the invention, and that for a person skilled in the art, other drawings can be derived from them without inventive effort. In the drawings:
FIG. 1 is a flowchart illustrating a method for accelerating the opening speed of a web page according to an embodiment of the present invention;
FIG. 2 is a flow chart illustrating another method for accelerating the opening speed of a web page according to an embodiment of the present invention;
FIG. 3 is a schematic diagram illustrating an apparatus for accelerating a web page opening speed according to an embodiment of the present invention;
FIG. 4 is a schematic diagram illustrating an apparatus for accelerating a web page opening speed according to an embodiment of the present invention;
fig. 5 shows a schematic diagram of an electronic device connection structure according to an embodiment of the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terminology used in the embodiments of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the examples of the present invention and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise, and "a plurality" typically includes at least two.
It should be understood that the term "and/or" as used herein is merely a relationship that describes an associated object, meaning that three relationships may exist, e.g., a and/or B, may represent: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
It should be understood that, although the terms first, second, third, etc. may be used in the embodiments of the present invention to describe \8230; \8230, these terms are not intended to be limiting for 8230; etc. These terms are used only to distinguish between \8230; \8230. For example, a first of the embodiments 8230; may also be referred to as a second of the embodiments 8230; for example, without departing from the scope of embodiments of the invention, similarly, the second one (8230) \\8230; also known as the first one (8230); 8230).
The words "if", as used herein may be interpreted as "at \8230; \8230whenor" when 8230; \8230when or "in response to a determination" or "in response to a detection", depending on the context. Similarly, the phrase "if determined" or "if detected (a stated condition or event)" may be interpreted as "upon determining" or "in response to determining" or "upon detecting (a stated condition or event)" or "in response to detecting (a stated condition or event)", depending on the context.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a good 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 good or apparatus. Without further limitation, an element defined by the phrases "comprising one of \8230;" does not exclude the presence of additional like elements in an article or device comprising the element.
An alternative embodiment of the present invention is described in detail below with reference to the drawings.
Example 1
As shown in fig. 1, according to a specific embodiment of the present disclosure, in a first aspect, the present disclosure provides a method for accelerating a web page opening speed, including:
s102: and analyzing the static resource file and identifying the public module from the static resource file.
It should be noted that the execution subject of the method for accelerating the web page opening speed shown in fig. 1 is a cloud server.
In this step, the common module refers to a common module corresponding to the core code.
In order to better define the public module, the public module is a module of which the corresponding code download times are more than or equal to a preset download time threshold value.
In practical application, the preset download time threshold may be set, for example, the preset download time threshold may be set to a specific numerical value according to a statistical result, and if the preset download time threshold exceeds a specific preset download time threshold, the module may be set to be a public module.
Besides the above mode, the download times of the codes corresponding to all the modules can be counted through big data, so as to obtain corresponding statistical results. If the statistical result shows that the number of times of downloading the code corresponding to the current module is far greater than the number of times of downloading the code corresponding to other modules, and the code is repeatedly used and occupies a large amount of network traffic, the code of the current module can be set as a core code, and the module corresponding to the core code is a public module.
S104: matching public module associated information corresponding to the public module according to a preset rule; wherein the common module associated information comprises: version number information corresponding to the public module and source information corresponding to the public module.
In this step, the preset rule may be adjusted according to a specific application scenario, for example, if the addition operation of each input value is currently performed in advance, the preset rule may be set as: adding the sequentially input numerical values; therefore, the original addition function is deleted, the public module associated information corresponding to the addition function is matched, the public module associated information not only comprises the version number information corresponding to the public module, but also comprises the source-source information corresponding to the public module, and the public module associated information is used as the unique identifier of the public module for the subsequent starting of the corresponding addition operation.
S106: deleting the codes corresponding to the public modules from the static resource file, and writing the public module association information into the static resource file to obtain a modified static resource file; the public module is a module of which the corresponding code download times are more than or equal to a preset download time threshold; the common module association information includes: version number information corresponding to the public module and source information corresponding to the public module.
In this step, the code corresponding to the public module is deleted from the static resource file, and the version number information only including the public module and the source-out information corresponding to the public module are written into the static resource file, so that the size of the original static resource file is greatly reduced, the network overhead is greatly reduced, the time node for completing the resource loading is greatly advanced, and the speed of opening the webpage is finally accelerated.
Optionally, after obtaining the modified static resource file, the method further includes: and returning the modified static resource file to the corresponding developer so that the developer can conveniently release the modified static resource file to the website specified by the developer.
Optionally, the method further includes: storing and managing the public module associated information of each version;
wherein the common module associated information comprises: version number information corresponding to the public module and source-outlet information corresponding to the public module; version number information and source information in the public module associated information of each version are in one-to-one correspondence.
Optionally, the method further includes: judging whether the client has the public module correlation information or not, and receiving a request of the client for acquiring the public module correlation information under the condition that the client does not have the public module correlation information;
acquiring corresponding public module associated information according to the tag attribute information carried by the request for acquiring the public module associated information; the tag attribute information carried by the request for obtaining the public module associated information is used for marking the function corresponding to the public module associated information required by the client, for example, adding each input numerical value;
sending the public module association information to a client; the public module associated information not only comprises version number information corresponding to the public module, but also comprises source and output information corresponding to the public module.
The invention provides a method, a device, a medium and electronic equipment for accelerating the webpage opening speed.
Example 2
As shown in fig. 2, according to a second aspect of the present disclosure, there is provided another method for accelerating a web page opening speed, including:
s202: and sending a request for acquiring the modified static resource file to the website server.
In this step, the modified static resource file acquisition request is used for acquiring the modified static resource file, deleting the original public module code, writing the public module associated information associated with the public module into the original static resource file, and acquiring the modified static resource file, so as to reduce the size of the original static resource file; the public module associated information not only comprises version number information corresponding to the public module, but also comprises source and output information corresponding to the public module.
S204: and receiving the modified static resource file returned by the website server.
In this step, the modified static resource file is processed by the cloud server as follows: and deleting the original public module code, writing the public module associated information associated with the public module into the original static resource file to obtain the modified static resource file, and reducing the size of the original static resource file.
The cloud server returns the returned modified static resource file to a specified developer, for example, developer a, and then publishes the modified static resource file to a website specified by developer a, for example, website a, via developer a.
S206: analyzing the modified static resource file, and judging whether public module association information exists or not; the public module associated information not only comprises version number information corresponding to the public module, but also comprises source and output information corresponding to the public module.
S208: and sending a request for acquiring the public module associated information to the cloud server under the condition that the public module associated information does not exist, so that the cloud server can acquire the corresponding public module associated information according to the tag attribute information carried by the request for acquiring the public module associated information.
In this step, the tag attribute information carried in the request for obtaining the common module related information is used to mark the function corresponding to the common module related information required by the client, for example, add each input numerical value.
S210: receiving public module association information sent by a cloud server;
the public module is a module of which the corresponding code downloading times are more than or equal to a preset downloading time threshold value; the public module associated information not only includes version number information corresponding to the public module, but also includes source and source information corresponding to the public module.
In this step, the common module refers to a common module corresponding to the core code.
In order to better define the public module, the public module is a module of which the corresponding code download times are more than or equal to a preset download time threshold value.
In practical applications, the preset download time threshold may be set, for example, the preset download time threshold may be set to a specific numerical value according to a statistical result, and if the value exceeds a specific preset download time threshold, the module may be set to be a public module.
Besides the above mode, the download times of the codes corresponding to all the modules can be counted through big data, so as to obtain corresponding statistical results. If the statistical result shows that the number of times of downloading the code corresponding to the current module is far greater than the number of times of downloading the code corresponding to other modules, and the code is repeatedly used and occupies a large amount of network traffic, the code of the current module can be set as a core code, and the module corresponding to the core code is a public module.
Optionally, the method further includes:
storing the public module correlation information and combining the public module correlation information to a corresponding page;
wherein the public module association information includes: version number information corresponding to the public module and source and outlet information corresponding to the public module; in this way, by storing the public module association information, it is possible to: and directly reading the stored public module associated information, and starting function operation corresponding to the public module associated information, thereby reducing the cost of the whole network and accelerating the webpage opening speed.
Optionally, the method further includes:
setting a public resource cache pool, wherein the public resource cache pool is used for sharing common codes among different domain names; therefore, the problem that common codes among different domain names cannot share the cache due to the fact that cache resources are divided by taking the domain name as a unit is solved.
Setting a common resource cache pool, wherein the common resource cache pool is used for sharing common codes among different domain names; therefore, the client can directly call the shared common code in the public resource cache pool, thereby reducing the expense of the whole network and accelerating the webpage opening speed.
In practical application, the shared common code in the common resource cache pool is: and counting the common codes with the highest using frequency of the client by a big data method.
In practical application, the commonly used core codes are often shared in the public resource cache pool, so that the core codes shared in the public resource cache pool cannot be repeatedly downloaded, and the core codes shared in the public resource cache pool are directly read and called, thereby reducing the cost of the whole network and accelerating the webpage opening speed.
The method, the device, the medium and the electronic equipment for accelerating the webpage opening speed are provided, whether public module associated information exists or not is judged by analyzing a modified static resource file, and a request for acquiring the public module associated information is sent to a cloud server under the condition that the public module associated information does not exist, so that the cloud server can acquire corresponding public module associated information according to label attribute information carried by the request for acquiring the public module associated information; receiving public module association information sent by the cloud server; therefore, webpage loading can be directly carried out through the received public module associated information, and JS downloading and JS analyzing processes required by first loading in the prior art are avoided, so that the overhead of the whole network is reduced, and the webpage opening speed is accelerated.
Example 3
As shown in fig. 3, according to a specific embodiment of the present disclosure, in a third aspect, the present disclosure provides an apparatus for accelerating an opening speed of a web page, where the apparatus includes a parsing and identifying unit 302, a matching unit 304, a deleting and writing unit 306, and the like, which are as follows:
the analysis and identification unit 302 is configured to analyze the static resource file and identify a common module from the static resource file;
a matching unit 304, configured to match, according to a preset rule, public module association information corresponding to the public module identified by the parsing and identifying unit 302;
a deletion writing unit 306, configured to delete the code corresponding to the public module identified by the parsing and identifying unit 302 from the static resource file, and write the public module association information matched by the matching unit 304 into the static resource file, so as to obtain a modified static resource file;
the public module identified by the parsing and identifying unit 302 is a module whose corresponding code download times are greater than or equal to a preset download time threshold.
Optionally, after obtaining the modified static resource file, the apparatus further includes:
the file returning unit 308 is configured to return the modified static resource file obtained by the deletion writing unit 306 to a corresponding developer, so that the developer can publish the modified static resource file to a website specified by the developer.
Optionally, the apparatus further comprises: a storage management unit 310, configured to store and manage common module associated information of each version; wherein the common module associated information comprises: version number information corresponding to the public module and source and outlet information corresponding to the public module; version number information and source information in the public module correlation information of each version are in one-to-one correspondence.
Optionally, the apparatus further comprises:
a receiving request unit 312, configured to receive a request of the client for obtaining the common module related information if the client does not have the common module related information;
an obtaining unit 314, configured to obtain corresponding public module related information according to tag attribute information carried in the request for obtaining public module related information received by the receiving requesting unit 312;
an information sending unit 316, configured to send the public module association information obtained by the obtaining unit 314 to the client.
The invention provides a method, a device, a medium and electronic equipment for accelerating the webpage opening speed.
Example 4
As shown in fig. 4, according to a fourth aspect of the present disclosure, the present disclosure provides another apparatus for accelerating an opening speed of a web page, where the apparatus includes a first request sending unit 402, a file receiving unit 404, a processing unit 406, a second request sending unit 408, an information receiving unit 410, and the like, specifically as follows:
a first request sending unit 402, configured to send a request for obtaining a modified static resource file to a website server;
a file receiving unit 404, configured to receive the modified static resource file returned by the website server;
the processing unit 406 is configured to analyze the modified static resource file received by the receiving unit, and determine whether public module association information exists;
a second request sending unit 408, configured to send, to the cloud server, a request for obtaining the public module related information when the processing unit 406 determines that the public module related information does not exist, so that the cloud server obtains the corresponding public module related information according to the tag attribute information carried in the request for obtaining the public module related information;
an information receiving unit 410, configured to receive public module association information sent by a cloud server; the public module is a module of which the corresponding code download times are more than or equal to a preset download time threshold value.
Optionally, the apparatus further comprises:
a saving unit 412, configured to save the public module association information received by the information receiving unit 410, where the public module association information includes: version number information corresponding to the public module and source-outlet information corresponding to the public module;
optionally, the apparatus further comprises:
a merging and injecting page unit 414, configured to merge and inject the public module related information received by the information receiving unit 410 into a corresponding page;
optionally, the apparatus further comprises:
and a common resource cache pool setting unit 416, configured to set a common resource cache pool, where the common resource cache pool is used to share common codes among different domain names.
The method, the device, the medium and the electronic equipment for accelerating the webpage opening speed are provided, whether public module associated information exists or not is judged by analyzing a modified static resource file, and a request for acquiring the public module associated information is sent to a cloud server under the condition that the public module associated information does not exist, so that the cloud server can acquire corresponding public module associated information according to label attribute information carried by the request for acquiring the public module associated information; receiving public module correlation information sent by the cloud server; therefore, webpage loading can be directly carried out through the received public module associated information, the JS downloading and JS analyzing processes required by the first loading in the prior art are avoided, the expenditure of the whole network is reduced, and the webpage opening speed is accelerated.
Example 5
As shown in fig. 5, the present embodiment provides an electronic device, which is used for accelerating a web page opening speed, and the electronic device includes: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the one processor to cause the at least one processor to perform the method steps of the above embodiments.
Example 6
The disclosed embodiments provide a non-volatile computer storage medium storing computer-executable instructions that can perform the method of merging documents into the same folder in any of the above method embodiments.
Example 7
Referring now to FIG. 5, a block diagram of an electronic device 500 suitable for use in implementing embodiments of the present disclosure is shown. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal 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 terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 5 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. 5, electronic device 500 may include a processing means (e.g., central processing unit, graphics processor, etc.) 501 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM) 502 or a program loaded from a storage means 508 into a Random Access Memory (RAM) 503. In the RAM503, various programs and data necessary for the operation of the electronic apparatus 500 are also stored. The processing device 501, the ROM 502, and the RAM503 are connected to each other through a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
Generally, the following devices may be connected to the I/O interface 505: input devices 506 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 507 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage devices 508 including, for example, magnetic tape, hard disk, etc.; and a communication device 509. The communication means 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. While fig. 5 illustrates an electronic device 500 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 be alternatively implemented or provided.
In particular, the processes described above with reference to the flow diagrams may be implemented as computer software programs, according to embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 509, or installed from the storage means 508, or installed from the ROM 502. The computer program performs the above-described functions defined in the methods of the embodiments of the present disclosure when executed by the processing device 501.
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 any of a variety of 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.
The computer readable medium may be embodied in the electronic device; or may be separate and not incorporated 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: the modified static resource file is obtained by deleting the code corresponding to the public module and writing the public module association information into the original static resource file, so that the modified static resource file is slimming, the expenditure of the whole network is reduced, and the webpage opening speed is accelerated.
Alternatively, the computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: the modified static resource file is obtained by deleting the code corresponding to the public module and writing the public module association information into the original static resource file, so that the modified static resource file is slimming, the expenditure of the whole network is reduced, and the webpage opening speed is accelerated.
Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including 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 a unit does not in some cases constitute a limitation of the unit itself, for example, the first retrieving unit may also be described as a "unit for retrieving at least two internet protocol addresses".

Claims (10)

1. A method for accelerating the opening speed of a webpage is characterized by comprising the following steps:
analyzing a static resource file and identifying a public module from the static resource file;
matching public module association information corresponding to the public module according to a preset rule; wherein the common module association information comprises: version number information corresponding to the public module and source and outlet information corresponding to the public module;
deleting the code corresponding to the public module from the static resource file, and writing the public module association information into the static resource file to obtain a modified static resource file;
the public module is a module of which the corresponding code download times are more than or equal to a preset download time threshold value.
2. The method of claim 1, wherein after obtaining the modified static resource file, the method further comprises:
and returning the modified static resource file to a corresponding developer so that the developer can conveniently release the modified static resource file to a website specified by the developer.
3. The method of claim 1, further comprising:
storing and managing the public module associated information of each version;
version number information and source information in the public module correlation information of each version are in one-to-one correspondence.
4. The method of claim 1, further comprising:
receiving a request of the client for acquiring the public module associated information under the condition that the client does not have the public module associated information;
acquiring corresponding public module associated information according to the label attribute information carried by the request for acquiring the public module associated information;
and sending the public module association information to the client.
5. A method for accelerating the opening speed of a webpage is characterized by comprising the following steps:
sending a request for acquiring the modified static resource file to a website server;
receiving the modified static resource file returned by the website server;
analyzing the modified static resource file, and judging whether public module associated information exists or not; wherein the common module association information comprises: version number information corresponding to the public module and source-outlet information corresponding to the public module;
under the condition that the public module associated information does not exist, sending a request for acquiring the public module associated information to a cloud server so that the cloud server can acquire corresponding public module associated information according to label attribute information carried by the request for acquiring the public module associated information;
receiving the public module correlation information sent by the cloud server;
the public module is a module of which the corresponding code download times are more than or equal to a preset download time threshold value.
6. The method of claim 5, further comprising:
storing the public module correlation information, and merging and injecting the public module correlation information into a corresponding page;
and setting a public resource cache pool, wherein the public resource cache pool is used for sharing common codes among different domain names.
7. An apparatus for accelerating the opening speed of a web page, comprising:
the analysis and identification unit is used for analyzing the static resource file and identifying a public module from the static resource file;
the matching unit is used for matching the public module associated information corresponding to the public module identified by the analysis and identification unit according to a preset rule; wherein the common module association information comprises: version number information corresponding to the public module and source and outlet information corresponding to the public module;
a deletion writing unit, configured to delete the code corresponding to the public module identified by the analysis and identification unit from the static resource file, and write the public module association information matched by the matching unit into the static resource file, so as to obtain a modified static resource file;
the public module identified by the analysis identification unit is a module of which the corresponding code download times are more than or equal to a preset download time threshold value.
8. An apparatus for accelerating the opening speed of a web page, comprising:
the first request sending unit is used for sending a request for acquiring the modified static resource file to the website server;
the file receiving unit is used for receiving the modified static resource file returned by the website server;
the processing unit is used for analyzing the modified static resource file received by the receiving unit and judging whether public module associated information exists or not; wherein the common module association information comprises: version number information corresponding to the public module and source and outlet information corresponding to the public module;
a second request sending unit, configured to send, to a cloud server, a request for obtaining the public module related information when the processing unit determines that the public module related information does not exist, so that the cloud server obtains, according to tag attribute information carried in the request for obtaining the public module related information, corresponding public module related information;
an information receiving unit, configured to receive the public module association information sent by the cloud server;
the public module is a module of which the corresponding code downloading times are more than or equal to a preset downloading time threshold value.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 4.
10. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to carry out the method of any one of claims 1 to 4.
CN201910636751.5A 2019-07-15 2019-07-15 Method, device, medium and electronic equipment for accelerating webpage opening speed Active CN110471709B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910636751.5A CN110471709B (en) 2019-07-15 2019-07-15 Method, device, medium and electronic equipment for accelerating webpage opening speed

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910636751.5A CN110471709B (en) 2019-07-15 2019-07-15 Method, device, medium and electronic equipment for accelerating webpage opening speed

Publications (2)

Publication Number Publication Date
CN110471709A CN110471709A (en) 2019-11-19
CN110471709B true CN110471709B (en) 2022-12-06

Family

ID=68508695

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910636751.5A Active CN110471709B (en) 2019-07-15 2019-07-15 Method, device, medium and electronic equipment for accelerating webpage opening speed

Country Status (1)

Country Link
CN (1) CN110471709B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110968365B (en) * 2019-11-29 2023-08-29 中国银行股份有限公司 Loading method and device
CN111562913B (en) * 2020-04-28 2023-03-14 抖音视界有限公司 Method, device and equipment for pre-creating view component and computer readable medium
CN113076147B (en) * 2021-03-09 2024-02-02 北京一亩田新农网络科技有限公司 Dynamic APK resource loading method, device, system and medium
CN114265997B (en) * 2022-03-01 2022-05-20 成都鲁易科技有限公司 Page information output method, device, storage medium and terminal
CN117407091B (en) * 2023-12-12 2024-03-19 中核武汉核电运行技术股份有限公司 Rapid WEB picture loading method and system based on file localization deployment

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103777970A (en) * 2012-10-22 2014-05-07 联想(北京)有限公司 Software upgrading method and electronic device
CN104850602A (en) * 2015-05-04 2015-08-19 微梦创科网络科技(中国)有限公司 Method and apparatus for rendering and refreshing based on Internet webpage
CN105335206A (en) * 2015-10-16 2016-02-17 Tcl集团股份有限公司 Customized system widget expansion method and system
CN105630981A (en) * 2015-12-25 2016-06-01 小米科技有限责任公司 Network resource loading and configuration method and device
CN107193834A (en) * 2016-03-15 2017-09-22 广州市动景计算机科技有限公司 Computing device, device and method for browsing pages
CN107357890A (en) * 2017-07-12 2017-11-17 腾讯科技(深圳)有限公司 A kind of web page files processing method, apparatus and system and storage device
CN107995245A (en) * 2016-10-27 2018-05-04 腾讯科技(深圳)有限公司 The method and terminal of a kind of resource-sharing
CN108572818A (en) * 2017-03-08 2018-09-25 阿里巴巴集团控股有限公司 A kind of user interface rendering intent and device
CN109117119A (en) * 2018-07-02 2019-01-01 成都四方伟业软件股份有限公司 A kind of polymorphic component fusion method
CN109388766A (en) * 2017-08-07 2019-02-26 阿里巴巴集团控股有限公司 The method and apparatus of page load
CN109597610A (en) * 2018-12-10 2019-04-09 南京华苏科技有限公司 A kind of application structure modularization construction method based on micro services framework
CN109614162A (en) * 2018-11-15 2019-04-12 福建天泉教育科技有限公司 Based on the loaded and optimized method in front end under component development paradigm, storage medium
CN109753622A (en) * 2019-01-31 2019-05-14 天津字节跳动科技有限公司 static resource management method, device, storage medium and electronic equipment
CN109871499A (en) * 2019-01-16 2019-06-11 中国平安财产保险股份有限公司 Page loading method and client
CN109918595A (en) * 2019-01-31 2019-06-21 广州视源电子科技股份有限公司 The method and apparatus for obtaining public module

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9319720B2 (en) * 2005-12-13 2016-04-19 Audio Pod Inc. System and method for rendering digital content using time offsets
CN102223624B (en) * 2010-04-15 2015-11-25 宏达国际电子股份有限公司 The document down loading method of mobile device, server and mobile device
EP3111410A4 (en) * 2014-02-24 2017-12-13 Opanga Networks, Inc. Playback of content pre-delivered to a user device
CN104901979A (en) * 2014-03-04 2015-09-09 北京奇虎科技有限公司 Method and device for downloading application program files
CN105653526B (en) * 2014-11-10 2019-04-12 腾讯科技(深圳)有限公司 Page access method and apparatus
CN105611328B (en) * 2015-12-25 2019-01-01 深圳Tcl新技术有限公司 Video data based on HLS Streaming Media accelerates method for down loading and device
CN107436777B (en) * 2016-05-27 2019-07-02 北京京东尚科信息技术有限公司 Mobile terminal, application crash processing method and processing device
CN107515764B (en) * 2017-07-28 2020-04-24 平安科技(深圳)有限公司 Application page opening method, terminal and computer readable storage medium
CN108307039B (en) * 2017-12-21 2021-02-02 维沃移动通信有限公司 Application information display method and mobile terminal
CN108632366B (en) * 2018-04-18 2021-01-29 Oppo广东移动通信有限公司 File downloading method and device and terminal equipment

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103777970A (en) * 2012-10-22 2014-05-07 联想(北京)有限公司 Software upgrading method and electronic device
CN104850602A (en) * 2015-05-04 2015-08-19 微梦创科网络科技(中国)有限公司 Method and apparatus for rendering and refreshing based on Internet webpage
CN105335206A (en) * 2015-10-16 2016-02-17 Tcl集团股份有限公司 Customized system widget expansion method and system
CN105630981A (en) * 2015-12-25 2016-06-01 小米科技有限责任公司 Network resource loading and configuration method and device
CN107193834A (en) * 2016-03-15 2017-09-22 广州市动景计算机科技有限公司 Computing device, device and method for browsing pages
CN107995245A (en) * 2016-10-27 2018-05-04 腾讯科技(深圳)有限公司 The method and terminal of a kind of resource-sharing
CN108572818A (en) * 2017-03-08 2018-09-25 阿里巴巴集团控股有限公司 A kind of user interface rendering intent and device
CN107357890A (en) * 2017-07-12 2017-11-17 腾讯科技(深圳)有限公司 A kind of web page files processing method, apparatus and system and storage device
CN109388766A (en) * 2017-08-07 2019-02-26 阿里巴巴集团控股有限公司 The method and apparatus of page load
CN109117119A (en) * 2018-07-02 2019-01-01 成都四方伟业软件股份有限公司 A kind of polymorphic component fusion method
CN109614162A (en) * 2018-11-15 2019-04-12 福建天泉教育科技有限公司 Based on the loaded and optimized method in front end under component development paradigm, storage medium
CN109597610A (en) * 2018-12-10 2019-04-09 南京华苏科技有限公司 A kind of application structure modularization construction method based on micro services framework
CN109871499A (en) * 2019-01-16 2019-06-11 中国平安财产保险股份有限公司 Page loading method and client
CN109753622A (en) * 2019-01-31 2019-05-14 天津字节跳动科技有限公司 static resource management method, device, storage medium and electronic equipment
CN109918595A (en) * 2019-01-31 2019-06-21 广州视源电子科技股份有限公司 The method and apparatus for obtaining public module

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于物联网的智能会议室预定系统设计与实现;黄园园等;《电脑知识与技术》;20180715(第20期);第68-70页 *

Also Published As

Publication number Publication date
CN110471709A (en) 2019-11-19

Similar Documents

Publication Publication Date Title
CN110471709B (en) Method, device, medium and electronic equipment for accelerating webpage opening speed
CN111274760B (en) Rich text data processing method and device, electronic equipment and computer storage medium
CN110489101B (en) Interface simulation method, system, medium and electronic equipment
CN111488185B (en) Page data processing method, device, electronic equipment and readable medium
CN110365973B (en) Video detection method and device, electronic equipment and computer readable storage medium
CN110865852B (en) Webpage component loading method and device, electronic equipment and storage medium
US11886798B2 (en) Method and apparatus for obtaining loading time length of image in webpage, and electronic device
CN111400625B (en) Page processing method and device, electronic equipment and computer readable storage medium
CN111310482A (en) Real-time translation method, device, terminal and storage medium
CN111813465B (en) Information acquisition method, device, medium and equipment
CN109902726B (en) Resume information processing method and device
CN110765386A (en) Webpage image monitoring method and device, electronic equipment and readable storage medium
CN111783010B (en) Webpage blank page monitoring method, device, terminal and storage medium
CN110069186B (en) Method and equipment for displaying operation interface of application
CN111177634A (en) Multi-language supporting file content loading method, device, equipment and medium
CN110717126A (en) Page browsing method and device, electronic equipment and computer readable storage medium
CN111324835A (en) Method and device for rendering user interface component, electronic equipment and storage medium
CN112910855B (en) Sample message processing method and device
CN110618772B (en) View adding method, device, equipment and storage medium
CN109669720B (en) Chain type asynchronous request processing method and device based on Promise and electronic equipment
CN111241368B (en) Data processing method, device, medium and equipment
CN111124627A (en) Method, device, terminal and storage medium for determining application program caller
CN111209058B (en) Method, device, medium and equipment for acquiring process name
CN114613355B (en) Video processing method and device, readable medium and electronic equipment
CN111562913B (en) Method, device and equipment for pre-creating view component and computer readable medium

Legal Events

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