CN114491344B - Webpage resource downloading type determining method, device, equipment and medium - Google Patents

Webpage resource downloading type determining method, device, equipment and medium Download PDF

Info

Publication number
CN114491344B
CN114491344B CN202210108290.6A CN202210108290A CN114491344B CN 114491344 B CN114491344 B CN 114491344B CN 202210108290 A CN202210108290 A CN 202210108290A CN 114491344 B CN114491344 B CN 114491344B
Authority
CN
China
Prior art keywords
score
preset
type
resource
webpage
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
CN202210108290.6A
Other languages
Chinese (zh)
Other versions
CN114491344A (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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202210108290.6A priority Critical patent/CN114491344B/en
Publication of CN114491344A publication Critical patent/CN114491344A/en
Application granted granted Critical
Publication of CN114491344B publication Critical patent/CN114491344B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The invention discloses a method, a device, equipment and a medium for determining a webpage resource downloading type. The method comprises the following steps: acquiring the type of the webpage resource, and determining a first score corresponding to the type of the webpage resource by utilizing a first preset rule; acquiring the duty ratio of the webpage resources in the visible area, and determining a second score corresponding to the duty ratio by utilizing a second preset rule; acquiring the network state of a browser used when browsing the page, determining a third score corresponding to the network state by utilizing a third preset rule, acquiring the historical browsing information of the webpage resource, and determining a fourth score corresponding to the historical browsing information by utilizing a fourth preset rule; summarizing the first score, the second score, the third score and the fourth score to generate a total score; and matching the total score with different preset score intervals corresponding to the multiple preset download types to determine the preset download types. The scheme of the invention realizes the dynamic adjustment of the download type according to the actual condition of the client, and improves the flexibility of webpage resource caching.

Description

Webpage resource downloading type determining method, device, equipment and medium
Technical Field
The present invention relates to the field of internet technologies, and in particular, to a method, an apparatus, a device, and a medium for determining a web resource download type.
Background
When using the web content service, HTML (Hypertext Markup Language ), CSS (Cascading Style Sheets, cascading style sheets), script (script), image (picture), and the like are downloaded first. After the web page resources (web resources) are downloaded, the web page resources can be used to render the picture. The time required for downloading these network resources depends on the bandwidth of the network, and if the web page resources are downloaded in an environment with low network speed, the delay of the screen is easily caused, resulting in poor experience of the user. If the web page resources can be downloaded in advance into the cache memory, the web page resources can be downloaded in a network environment with low network speed or network disconnection, for example: when the subway passes through the mountain, the condition that network resources are lacking and web page content services cannot be provided does not occur.
The pre-loading mode of the current webpage resources mainly comprises the following two modes: the first way is that the browser downloads the preset downloading priorities of various resources, and then downloads the resources in sequence from high priority to low priority, for example, HTML, CSS type resources are set to the Highest priority (Highest), and script is set to the medium priority; the second way is to add a fixed value to the < link > in each page to distinguish the download type to make the action of not downloading the web page resource from directly downloading the web page resource to the cache, for example, the action of downloading the resource is performed immediately when the browser executes to the page by using a preload instruction, or the action of downloading the resource is performed after the browser is idle by using a prefatch instruction. The existing webpage resource preloading mode has the following defects: the resource loading sequence is too strict, the actual network condition cannot be combined, the network of the client cannot be fully utilized, and the same strategy is adopted for different users, so that the flexibility is poor.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a method, apparatus, device and medium for determining a download type of a web page resource.
According to a first aspect of the present invention, there is provided a method for determining a download type of a web resource, the method comprising:
acquiring the type of the webpage resource, and determining a first score corresponding to the type of the webpage resource by utilizing a first preset rule;
acquiring the duty ratio of the webpage resources in the visible area, and determining a second score corresponding to the duty ratio by using a second preset rule;
acquiring a network state of a browser used when browsing a page, and determining a third score corresponding to the network state by utilizing a third preset rule;
acquiring historical browsing information of the webpage resource, and determining a fourth score corresponding to the historical browsing information by utilizing a fourth preset rule;
summarizing the first score, the second score, the third score and the fourth score to generate a total score;
and matching the total score with different preset score intervals corresponding to the preset download types to determine the preset download type corresponding to the webpage resource.
In some embodiments, the step of determining the first score corresponding to the type of the web page resource by using the first preset rule includes:
defining different first preset scores for a plurality of preset types of webpage resources in advance;
and matching the types of the webpage resources with a plurality of preset types, and taking a first preset score corresponding to the preset type as the first score.
In some embodiments, the step of determining the second score corresponding to the duty cycle using a second preset rule includes:
judging whether the duty ratio exceeds a first preset duty ratio, if so, giving a second preset score, otherwise, giving a value of zero;
judging whether the duty ratio exceeds a second preset duty ratio, if so, giving a second preset score, otherwise, assigning zero, wherein the second preset duty ratio is larger than the first preset duty ratio;
adding the two assignments to obtain the second score.
In some embodiments, the step of determining a third score corresponding to the network state using a third preset rule includes:
judging whether the network used by the browser is a high-speed network or not, if so, giving a third preset score, otherwise, giving a value of zero;
judging whether the speed change of the network used by the browser is from high to low, if so, giving a third preset score, otherwise, giving a value of zero;
adding the two assignments to obtain the third score.
In some embodiments, the step of determining a fourth score corresponding to the historical browsing information using a fourth preset rule includes:
judging whether the webpage resources do not exist in the cache, if yes, giving a fourth preset score, otherwise, giving a value of zero;
judging whether the time for downloading the webpage resource in the previous time exceeds the preset time, if so, giving a fourth preset score, otherwise, assigning zero;
counting the number of modification times of the webpage resources in the historical webpage browsing process;
and taking the sum of the two assignments and the modification times as the fourth score.
In some embodiments, the step of summarizing the first score, the second score, the third score, and the fourth score to generate a total score comprises:
pre-defining preset weights for the first score, the second score, the third score and the fourth score respectively;
calculating products of the first score, the second score, the third score and the fourth score and corresponding preset weights respectively;
the sum of all products is taken as the total score.
In some embodiments, the preset download types include a first preset type, a second preset type, a third preset type and a fourth preset type, where the first preset type characterizes that the action of downloading the web resource to the cache is performed no matter whether the user browses the page, the second preset type characterizes that the action of downloading the web resource to the cache is performed immediately when the browser executes the page where the web resource is located, the third preset type characterizes that the browser is idle and then performs the action of downloading the web resource to the cache, and the fourth preset type characterizes that the web resource is downloaded when the browser executes the code corresponding to the web resource.
According to a second aspect of the present invention, there is provided a web resource download type determining apparatus, the apparatus comprising:
the first determining module is configured to acquire the type of the webpage resource and determine a first score corresponding to the type of the webpage resource by utilizing a first preset rule;
the second determining module is configured to acquire the duty ratio of the webpage resource in the visual area and determine a second score corresponding to the duty ratio by utilizing a second preset rule;
the third determining module is configured to acquire a network state of a browser used when browsing a page, and determine a third score corresponding to the network state by utilizing a third preset rule;
a fourth determining module, configured to obtain historical browsing information of the web page resource, and determine a fourth score corresponding to the historical browsing information by using a fourth preset rule;
a summarizing module configured to summarize the first score, the second score, the third score, and the fourth score to generate a total score;
and the matching module is configured to match the total score with different preset score intervals corresponding to a plurality of preset download types so as to determine the preset download type corresponding to the webpage resource.
According to a third aspect of the present invention, there is also provided a computer device comprising:
at least one processor; and
the memory stores a computer program which can be run on a processor, and the processor executes the method for determining the download type of the webpage resource when executing the program.
According to a fourth aspect of the present invention, there is also provided a computer-readable storage medium storing a computer program which, when executed by a processor, performs the aforementioned web resource download type determining method.
According to the webpage resource downloading type determining method, the obtained webpage resource type, the ratio of the webpage resource in the visible area, the network state of the browser used when browsing the webpage and the historical browsing information of the webpage resource are analyzed to generate a plurality of scores, the obtained scores are summarized to generate the total score, and finally the total score is matched with different preset score intervals corresponding to various preset downloading types to determine the preset downloading type corresponding to the webpage resource.
In addition, the device for determining the download type of the web page resource, the computer equipment and the computer readable storage medium provided by the invention can also achieve the technical effects, and are not repeated here.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are necessary for the description of the embodiments or the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention and that other embodiments may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart illustrating a method 100 for determining a download type of a web page resource according to an embodiment of the present invention;
FIG. 2 is a schematic diagram illustrating a ratio of web page resources in a visible area according to another embodiment of the present invention;
fig. 3 is a schematic structural diagram of a device 200 for determining a download type of web page resources according to another embodiment of the present invention;
fig. 4 is an internal structural view of a computer device according to another embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention will be described in further detail with reference to the accompanying drawings.
It should be noted that, in the embodiments of the present invention, all the expressions "first" and "second" are used to distinguish two entities with the same name but different entities or different parameters, and it is noted that the "first" and "second" are only used for convenience of expression, and should not be construed as limiting the embodiments of the present invention, and the following embodiments are not described one by one.
In one embodiment, referring to fig. 1, the present invention provides a method 100 for determining a download type of a web page resource, specifically, the method includes the following steps:
step 101, obtaining the type of the webpage resource, and determining a first score corresponding to the type of the webpage resource by using a first preset rule;
in this embodiment, the types of web resources may be known from the definition in < link >, and the types of web resources may include existing Html (Hypertext Markup Language ), CSS, script, image, font (font), etc., and the first preset rule may be to divide the score corresponding to each of several major classes, for example, define documents and pictures as 5 points, or may separately maintain the score for each resource type, for example, define documents as 5 points.
102, obtaining the duty ratio of the web page resources in the visible area, and determining a second score corresponding to the duty ratio by using a second preset rule;
in this embodiment, please refer to fig. 2, wherein viewport indicates that the user is browsing the viewable area. And the interjectionratio indicates how much scale the web page component is in viewport (user viewable range). An intersectionRatio of more than 20% is generally considered to be ready to enter a page that the user is browsing. And more than 70% are considered to have entered the page the user is browsing.
Step 103, obtaining a network state of a browser used when browsing pages, and determining a third score corresponding to the network state by utilizing a third preset rule;
in this embodiment, the network status includes network speed and network variation, and the network status may be determined by the browser's networkinformation.
104, acquiring historical browsing information of the webpage resource, and determining a fourth score corresponding to the historical browsing information by using a fourth preset rule;
step 105, summarizing the first score, the second score, the third score and the fourth score to generate a total score;
in this embodiment, the way of summarizing the scores obtained in steps 101 to 104 may be directly added, or some important items may be adjusted to multiply by a factor greater than 1 to increase the specific gravity of a certain score, or a certain weight may be given to each score in advance to obtain a total score.
And 106, matching the total score with different preset score intervals corresponding to the preset download types to determine the preset download type corresponding to the webpage resource.
In this embodiment, in order to facilitate understanding of the score matching process, two types of preset download types may be assumed, that is, a preload type and a prefatch type, where the score interval corresponding to the preload type may be 5-10 minutes, the score interval corresponding to the prefatch type may be 0-4 minutes, and it is determined in which interval the obtained total score falls, so as to determine the download type of the network resource. It should be noted that the above preset download types are only used for illustration, and the partitions corresponding to the download types are also only used for illustration.
According to the webpage resource downloading type determining method, the obtained webpage resource type, the ratio of the webpage resource in the visible area, the network state of the browser used when browsing the webpage and the historical browsing information of the webpage resource are analyzed to generate a plurality of scores, the obtained scores are summarized to generate the total score, and finally the total score is matched with different preset score intervals corresponding to various preset downloading types to determine the preset downloading type corresponding to the webpage resource.
In some embodiments, in the step 101, the step of determining the first score corresponding to the type of the web page resource by using the first preset rule includes:
defining different first preset scores for a plurality of preset types of webpage resources in advance;
and matching the types of the webpage resources with a plurality of preset types, and taking a first preset score corresponding to the preset type as the first score.
In some embodiments, in the foregoing step 102, the step of determining the second score corresponding to the duty ratio using a second preset rule includes:
judging whether the duty ratio exceeds a first preset duty ratio, if so, giving a second preset score, otherwise, giving a value of zero;
judging whether the duty ratio exceeds a second preset duty ratio, if so, giving a second preset score, otherwise, assigning zero, wherein the second preset duty ratio is larger than the first preset duty ratio;
adding the two assignments to obtain the second score.
In some embodiments, in the step 103, the step of determining the third score corresponding to the network state by using a third preset rule includes:
judging whether the network used by the browser is a high-speed network or not, if so, giving a third preset score, otherwise, giving a value of zero;
judging whether the speed change of the network used by the browser is from high to low, if so, giving a third preset score, otherwise, giving a value of zero;
adding the two assignments to obtain the third score.
In some embodiments, in the step 104, the step of determining the fourth score corresponding to the historical browsing information by using a fourth preset rule includes:
judging whether the webpage resources do not exist in the cache, if yes, giving a fourth preset score, otherwise, giving a value of zero;
judging whether the time for downloading the web page resource in the previous time exceeds the preset time, if so, giving a fourth preset score, otherwise, giving a value of zero
Counting the number of modification times of the webpage resources in the historical webpage browsing process;
and taking the sum of the two assignments and the modification times as the fourth score.
In some embodiments, the foregoing step 105, the step of summing the first score, the second score, the third score, and the fourth score to generate a total score comprises:
pre-defining preset weights for the first score, the second score, the third score and the fourth score respectively;
calculating products of the first score, the second score, the third score and the fourth score and corresponding preset weights respectively;
the sum of all products is taken as the total score.
In some embodiments, the preset download types include a first preset type (denoted as direct cache), a second preset type (denoted as preload), a third preset type (denoted as prefetch), and a fourth preset type (denoted as no action), where the first preset type characterizes that the action of downloading the web resource to the cache is performed regardless of whether the user browses the page, the second preset type characterizes that the action of downloading the web resource to the cache is performed immediately when the browser performs the page where the web resource is located, the third preset type characterizes that the browser is idle and then performs the action of downloading the web resource to the cache, and the fourth preset type characterizes that the web resource is downloaded when the browser performs the code corresponding to the web resource.
In yet another embodiment, in order to facilitate understanding of the technical solution of the present invention, taking the following example of web page resources corresponding to five links (denoted as links a to link E), referring to table 1, a specific manner of determining each tag download type will be described in detail below:
the first step, judging the type of the webpage resource corresponding to each link, if the type is document, assigning five points, if the type is image, assigning three points, if the type is style, assigning four points, and if the type is script, assigning two points;
table 1 download types and score term comparison table
link A link B link C link D link E
Resource type document(5) image(3) image(3) style(4) script(2)
More than 50% of the content is in viewport 0 0 0 1 0
More than 20% of the content is in viewport 1 0 0 1 1
Whether or not it is currently in a high-speed network 0 1 0 0 1
Whether the current network speed is changed from high to low 0 0 1 0 0
Resources are not in cache 0 1 0 1 0
The number of times the ETag of the resource is changed 1 2 0 2 6
Whether the download of the resource would exceed 1 second 1 0 1 0 1
Total score 8 7 5 9 11
Link Tag type preload(3) prefetch(2) no action(1) preload(3) direct cache(4)
And secondly, judging that the proportion of each link in the visual area obtains a corresponding score, for example, judging that the proportion is not more than fifty percent, assigning a score of one, otherwise assigning a score of zero, judging that the proportion is not more than twenty percent, assigning a score of one, otherwise assigning a score of 0.
Thirdly, judging the current network state and assigning, for example, judging that the current network is assigned 1 score in a high-speed network (for example, a 4g network or a 5g network), otherwise assigning zero score, judging that the current network speed is assigned 1 score from high to low, otherwise assigning 0 score;
fourthly, judging that the resource is not in the cache, assigning a score, otherwise assigning a score of zero; whether the resource exists in the cache or not can be checked by an API related to the browser cache.
Fifthly, judging the number of times the ETag of the resource is changed, and assigning a value according to the number of times;
after each url_request request at the server, the server returns the page resource and ETag. ETag is a unique code that distinguishes the page resource. The ETag of the page resource will also be taken if the client requests it again. If the resource ETag at the server side changes, it indicates that the resource has been changed, and the resource is downloaded again from the server. If there is no change, the server returns a status code 304 indicating that the resource has not been changed. This field records the number of times the resource ETag is changed. When the resource is downloaded by the client after the server is changed. The count of this field is also incremented. The larger number indicates that the more easily the client will download the resource frequently.
Sixthly, judging whether the downloading time for downloading the resource exceeds 1 second, if so, assigning a score, otherwise, assigning a score of zero;
seventh, calculating the total score corresponding to each link, where in combination with table 1, the total score corresponding to link a is 8 points, the total score corresponding to link B is 7 points, the total score corresponding to link C is 5 points, the total score corresponding to link D is 9 points, and the total score corresponding to link E is 11 points.
Step seven, determining the download type corresponding to each link according to four download types predefined in table 2 by combining the total score obtained in the sixth step, and confirming that the download type of link A is preload, the download type of link B is prefect, the download type of link C is no action, the download type of link D is preload, and the download type of link C is direct cache through matching.
Table 2 correspondence between total score and download type
The method for determining the download type of the webpage resources analyzes the webpage resources and the download environment, and achieves the purpose that the webpage resources which are likely to be browsed to a cache in the future by a user are downloaded in advance when the network speed is high. When the user will browse the content of the web page, the downloaded web page resource can be obtained from the local end buffer memory, the speed of web page display is not affected by the bandwidth of the current network, and the user experience is obviously improved.
It should be noted that, in this embodiment, other judgment items except for the type of the web page resource and the number of times the ETag is changed all adopt a mode of assigning 1 or zero, and it is understood that the assigned specific value can be set according to the requirement of the user.
In some embodiments, referring to fig. 3, the present invention further provides a device 200 for determining a download type of a web page resource, where the device includes:
a first determining module 201, configured to obtain a type of a web resource, and determine a first score corresponding to the type of the web resource by using a first preset rule;
a second determining module 202, configured to obtain a duty ratio of the web page resource in the visible area, and determine a second score corresponding to the duty ratio by using a second preset rule;
a third determining module 203, configured to obtain a network state of a browser used when browsing a page, and determine a third score corresponding to the network state by using a third preset rule;
a fourth determining module 204, configured to obtain historical browsing information of the web page resource, and determine a fourth score corresponding to the historical browsing information by using a fourth preset rule;
a summarizing module 205 configured to summarize the first score, the second score, the third score, and the fourth score to generate a total score;
and the matching module 206 is configured to match the total score with different preset score intervals corresponding to a plurality of preset download types to determine a preset download type corresponding to the web page resource.
According to the webpage resource downloading type determining device, the obtained webpage resource type, the ratio of the webpage resource in the visible area, the network state of the browser used when browsing the webpage and the historical browsing information of the webpage resource are analyzed to generate a plurality of scores, the obtained scores are summarized to generate the total score, and finally the total score is matched with different preset score intervals corresponding to various preset downloading types to determine the preset downloading type corresponding to the webpage resource.
It should be noted that, for specific limitation of the device for determining the download type of the web page resource, reference may be made to limitation of the method for determining the download type of the web page resource in the above description, and no further description is given here. The above-mentioned various modules in the web resource download type determining device may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
According to another aspect of the present invention, there is provided a computer device, which may be a server, and an internal structure thereof is shown in fig. 4. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is for storing data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements the above-described method for determining a download type of a web page resource, specifically, the method includes the following steps:
acquiring the type of the webpage resource, and determining a first score corresponding to the type of the webpage resource by utilizing a first preset rule;
acquiring the duty ratio of the webpage resources in the visible area, and determining a second score corresponding to the duty ratio by using a second preset rule;
acquiring a network state of a browser used when browsing a page, and determining a third score corresponding to the network state by utilizing a third preset rule;
acquiring historical browsing information of the webpage resource, and determining a fourth score corresponding to the historical browsing information by utilizing a fourth preset rule;
summarizing the first score, the second score, the third score and the fourth score to generate a total score;
and matching the total score with different preset score intervals corresponding to the preset download types to determine the preset download type corresponding to the webpage resource.
According to still another aspect of the present invention, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the above-described web resource download type determination method, specifically comprising performing the steps of:
acquiring the type of the webpage resource, and determining a first score corresponding to the type of the webpage resource by utilizing a first preset rule;
acquiring the duty ratio of the webpage resources in the visible area, and determining a second score corresponding to the duty ratio by using a second preset rule;
acquiring a network state of a browser used when browsing a page, and determining a third score corresponding to the network state by utilizing a third preset rule;
acquiring historical browsing information of the webpage resource, and determining a fourth score corresponding to the historical browsing information by utilizing a fourth preset rule;
summarizing the first score, the second score, the third score and the fourth score to generate a total score;
and matching the total score with different preset score intervals corresponding to the preset download types to determine the preset download type corresponding to the webpage resource.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples merely represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the invention. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.

Claims (6)

1. A method for determining a download type of a web page resource, the method comprising:
acquiring the type of the webpage resource, and determining a first score corresponding to the type of the webpage resource by utilizing a first preset rule;
acquiring the duty ratio of the webpage resources in the visible area, and determining a second score corresponding to the duty ratio by using a second preset rule;
acquiring a network state of a browser used when browsing a page, and determining a third score corresponding to the network state by utilizing a third preset rule;
acquiring historical browsing information of the webpage resource, and determining a fourth score corresponding to the historical browsing information by utilizing a fourth preset rule;
summarizing the first score, the second score, the third score and the fourth score to generate a total score;
matching the total score with different preset score intervals corresponding to a plurality of preset download types to determine the preset download types corresponding to the webpage resources;
the step of determining the first score corresponding to the type of the webpage resource by using the first preset rule comprises the following steps:
defining different first preset scores for a plurality of preset types of webpage resources in advance;
matching the types of the webpage resources with a plurality of preset types, and taking a first preset score corresponding to the preset type as the first score;
the step of determining the second score corresponding to the duty ratio by using a second preset rule comprises the following steps:
judging whether the duty ratio exceeds a first preset duty ratio, if so, giving a second preset score, otherwise, giving a value of zero;
judging whether the duty ratio exceeds a second preset duty ratio, if so, giving a second preset score, otherwise, assigning zero, wherein the second preset duty ratio is larger than the first preset duty ratio;
adding the two assignments to obtain the second score;
the step of determining a third score corresponding to the network state by using a third preset rule comprises the following steps:
judging whether the network used by the browser is a high-speed network or not, if so, giving a third preset score, otherwise, giving a value of zero;
judging whether the speed change of the network used by the browser is from high to low, if so, giving a third preset score, otherwise, giving a value of zero;
adding the two assignments to obtain the third score;
the step of determining a fourth score corresponding to the historical browsing information by using a fourth preset rule comprises the following steps:
judging whether the webpage resources do not exist in the cache, if yes, giving a fourth preset score, otherwise, giving a value of zero;
judging whether the time for downloading the webpage resource in the previous time exceeds the preset time, if so, giving a fourth preset score, otherwise, assigning zero;
counting the number of modification times of the webpage resources in the historical webpage browsing process;
and taking the sum of the two assignments and the modification times as the fourth score.
2. The web resource download type determining method according to claim 1, wherein the step of summarizing the first score, the second score, the third score, and the fourth score to generate a total score comprises:
pre-defining preset weights for the first score, the second score, the third score and the fourth score respectively;
calculating products of the first score, the second score, the third score and the fourth score and corresponding preset weights respectively;
the sum of all products is taken as the total score.
3. The method for determining a download type of a web resource according to claim 1, wherein the preset download types include a first preset type, a second preset type, a third preset type and a fourth preset type, wherein the first preset type characterizes that the action of downloading the web resource to the cache is performed no matter whether the user browses the page, the second preset type characterizes that the action of downloading the web resource to the cache is performed immediately when the browser executes the page where the web resource is located, the third preset type characterizes that the browser is idle and then performs the action of downloading the web resource to the cache, and the fourth preset type characterizes that the web resource is downloaded only when the browser executes the code corresponding to the web resource.
4. A web resource download type determining apparatus, the apparatus comprising:
the first determining module is configured to acquire the type of the webpage resource and determine a first score corresponding to the type of the webpage resource by utilizing a first preset rule;
the second determining module is configured to acquire the duty ratio of the webpage resource in the visual area and determine a second score corresponding to the duty ratio by utilizing a second preset rule;
the third determining module is configured to acquire a network state of a browser used when browsing a page, and determine a third score corresponding to the network state by utilizing a third preset rule;
a fourth determining module, configured to obtain historical browsing information of the web page resource, and determine a fourth score corresponding to the historical browsing information by using a fourth preset rule;
a summarizing module configured to summarize the first score, the second score, the third score, and the fourth score to generate a total score;
the matching module is configured to match the total score with different preset score intervals corresponding to a plurality of preset download types so as to determine the preset download type corresponding to the webpage resource;
the first determination module is further configured to:
defining different first preset scores for a plurality of preset types of webpage resources in advance;
matching the types of the webpage resources with a plurality of preset types, and taking a first preset score corresponding to the preset type as the first score;
the second determination module is further configured to:
judging whether the duty ratio exceeds a first preset duty ratio, if so, giving a second preset score, otherwise, giving a value of zero;
judging whether the duty ratio exceeds a second preset duty ratio, if so, giving a second preset score, otherwise, assigning zero, wherein the second preset duty ratio is larger than the first preset duty ratio;
adding the two assignments to obtain the second score;
the third determination module is further configured to:
judging whether the network used by the browser is a high-speed network or not, if so, giving a third preset score, otherwise, giving a value of zero;
judging whether the speed change of the network used by the browser is from high to low, if so, giving a third preset score, otherwise, giving a value of zero;
adding the two assignments to obtain the third score;
the fourth determination module is further configured to:
judging whether the webpage resources do not exist in the cache, if yes, giving a fourth preset score, otherwise, giving a value of zero;
judging whether the time for downloading the webpage resource in the previous time exceeds the preset time, if so, giving a fourth preset score, otherwise, assigning zero;
counting the number of modification times of the webpage resources in the historical webpage browsing process;
and taking the sum of the two assignments and the modification times as the fourth score.
5. A computer device, comprising:
at least one processor; and
a memory storing a computer program executable in the processor, the processor executing the method of any of claims 1-3 when the program is executed.
6. A computer readable storage medium storing a computer program, characterized in that the computer program, when executed by a processor, performs the method of any of claims 1-3.
CN202210108290.6A 2022-01-28 2022-01-28 Webpage resource downloading type determining method, device, equipment and medium Active CN114491344B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210108290.6A CN114491344B (en) 2022-01-28 2022-01-28 Webpage resource downloading type determining method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210108290.6A CN114491344B (en) 2022-01-28 2022-01-28 Webpage resource downloading type determining method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN114491344A CN114491344A (en) 2022-05-13
CN114491344B true CN114491344B (en) 2024-01-26

Family

ID=81476687

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210108290.6A Active CN114491344B (en) 2022-01-28 2022-01-28 Webpage resource downloading type determining method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN114491344B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115065620B (en) * 2022-06-20 2023-08-22 中国平安财产保险股份有限公司 Network monitoring method, device, equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110110194A (en) * 2019-04-29 2019-08-09 百度在线网络技术(北京)有限公司 A kind of resource acquiring method, server, client and electronic equipment
CN110472142A (en) * 2019-07-19 2019-11-19 平安科技(深圳)有限公司 Historical viewings Webpage searching method, device, storage medium and computer equipment
CN112685666A (en) * 2020-12-28 2021-04-20 北京三快在线科技有限公司 Page loading method and device, storage medium and electronic equipment
CN113468448A (en) * 2020-03-31 2021-10-01 腾讯科技(深圳)有限公司 Page rendering method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110110194A (en) * 2019-04-29 2019-08-09 百度在线网络技术(北京)有限公司 A kind of resource acquiring method, server, client and electronic equipment
CN110472142A (en) * 2019-07-19 2019-11-19 平安科技(深圳)有限公司 Historical viewings Webpage searching method, device, storage medium and computer equipment
CN113468448A (en) * 2020-03-31 2021-10-01 腾讯科技(深圳)有限公司 Page rendering method and device
CN112685666A (en) * 2020-12-28 2021-04-20 北京三快在线科技有限公司 Page loading method and device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN114491344A (en) 2022-05-13

Similar Documents

Publication Publication Date Title
US9450803B2 (en) Efficient delivery of content by virtualization of dynamic interaction with the document object model
US9916285B2 (en) Generating a preview of a web page for a mobile terminal
US10009439B1 (en) Cache preloading
US9075893B1 (en) Providing files with cacheable portions
KR102151457B1 (en) Method and apparatus for reducing page load time in a communication system
US8675011B2 (en) Displaying items in an application window
CN107315646B (en) Method and device for controlling data flow between page components
US20130088510A1 (en) Displaying items in an application window
US10158691B2 (en) Method and apparatus for providing network resources at intermediary server
US9679075B1 (en) Efficient delivery of animated image files
CN114491344B (en) Webpage resource downloading type determining method, device, equipment and medium
US9645984B2 (en) Efficient delivery of content by virtualization of static interaction with the document object model
CN113382083A (en) Webpage screenshot method and device
CN113641924B (en) Webpage interactive time point detection method and device, electronic equipment and storage medium
CN114969611A (en) Webpage printing method, device, equipment and medium
CN112672187B (en) Page generation method and device, computer equipment and readable storage medium
CN107592553B (en) Image compression agent balance processing method and device
Rey et al. Towards a Performance Optimization of Mobile Automated Fingerprint Identification System (MAFIS) for the Philippine National Police
CN112433784A (en) Page loading method, device, equipment and storage medium
US20150089559A1 (en) Method and system for managing display of web-based content on portable communication devices
CN113987388A (en) Text display method and device and electronic equipment
CN113934954A (en) Webpage first screen rendering method and device in application program
US9223758B1 (en) Determining a language encoding data setting for a web page, and applications thereof
Rey Performance Optimization of Mobile Automated Biometric Identification System (MABIS) for Philippine Law Enforcement Agency
CN111079050B (en) Page information acquisition method, page information acquisition device and computer storage medium

Legal Events

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