CN116955867A - Resource pre-caching method and related device - Google Patents

Resource pre-caching method and related device Download PDF

Info

Publication number
CN116955867A
CN116955867A CN202310800512.5A CN202310800512A CN116955867A CN 116955867 A CN116955867 A CN 116955867A CN 202310800512 A CN202310800512 A CN 202310800512A CN 116955867 A CN116955867 A CN 116955867A
Authority
CN
China
Prior art keywords
page
resource
utilization rate
target object
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310800512.5A
Other languages
Chinese (zh)
Inventor
周立学
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Beijing Co Ltd
Original Assignee
Tencent Technology Beijing 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 Tencent Technology Beijing Co Ltd filed Critical Tencent Technology Beijing Co Ltd
Priority to CN202310800512.5A priority Critical patent/CN116955867A/en
Publication of CN116955867A publication Critical patent/CN116955867A/en
Pending legal-status Critical Current

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
    • 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/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • 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/451Execution arrangements for user interfaces
    • 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)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Human Computer Interaction (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the application discloses a resource pre-caching method and a related device, wherein the method comprises the following steps: acquiring resource cache reference information of a second page associated with the first page, determining an object identification result corresponding to the target object according to historical access information in the resource cache reference information, determining a page identification result corresponding to the first page according to main source page information in the resource cache reference information, and caching webpage resources of the second page under the condition that the target object is a common object of the second page and the first page is a main source page of the second page. Therefore, when the target object is a common object of the second page and the first page is a main source page of the second page, the webpage resources of the second page are cached, and directional pre-caching is realized.

Description

Resource pre-caching method and related device
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for pre-caching resources.
Background
Web page resource pre-caching is a technique for optimizing the user's web page access experience by pre-loading web page resources, such as images, CSS (Cascading Style Sheets) files, JS (Java Script) files, etc., of a web page prior to entering the web page, thereby increasing the loading speed of the web page.
In the related art, generally, after a certain web page is loaded, web page resources of web pages that may be displayed after the web page are cached. For example, assuming that a control for triggering the jump display of a second page is deployed in a first page, after the first page is loaded, the web page resource of the second page may be cached.
In many cases in practical applications, the user may not trigger a web page that enters the cached web resource, and related resources (e.g., network bandwidth, server resources, client resources, etc.) consumed by caching the web resource are wasted. Therefore, by adopting the related technology, the webpage resources of each webpage which is possibly displayed later are cached, so that a great amount of resource waste is easily generated.
Disclosure of Invention
The embodiment of the application provides a resource pre-caching method and a related device, which are used for realizing the directional pre-caching of webpage resources and reducing resource waste.
The first aspect of the present application provides a method for pre-caching resources, the method comprising:
acquiring resource cache reference information of a second page associated with the first page; the first page is a webpage page of which the target object is triggered to display currently, and a display trigger control of the second page is deployed in the first page; the resource cache reference information comprises historical access information of the target object to the second page and main source page information of the second page;
determining an object identification result corresponding to the target object according to the historical access information in the resource cache reference information;
determining a page identification result corresponding to the first page according to the main source page information in the resource cache reference information;
caching webpage resources of the second page under the condition that the object identification result indicates that the target object is a common object of the second page and the page identification result indicates that the first page is a main source page of the second page; and under the condition that the object identification result represents that the target object is not a common object of the second page or that the page identification result represents that the first page is not a main source page of the second page, the webpage resource of the second page is not cached.
The second aspect of the application provides a page display method, which is applied to electronic equipment, and comprises the following steps:
responding to a trigger display operation for the first page, and displaying the first page; the first page is associated with a target object, and a display trigger control of a second page is deployed in the first page; the webpage resources of the second page are determined whether to be cached in advance according to the resource cache reference information of the second page; the resource cache reference information of the second page comprises historical access information of the target object to the second page and main source page information of the second page; the history access information is used for determining whether the target object is a common object of the second page, and the main source page information is used for determining whether the first page is a main source page of the second page;
when the historical access information characterizes that the target object is a common object of the second page and the main source page information characterizes that the first page is a main source page of the second page, responding to a trigger display operation aiming at a display trigger control, and locally acquiring webpage resources of the second page from the electronic equipment; the webpage resources of the second page are cached in the electronic equipment in advance;
Under the condition that the historical access information represents that the target object is not a common object of the second page or the main source page information represents that the first page is not a main source page of the second page, responding to a trigger display operation aiming at a display trigger control, and requesting webpage resources of the second page from a server;
and displaying the second page based on the web page resource of the second page.
A third aspect of the present application provides a resource pre-caching apparatus, the apparatus comprising:
the information acquisition module is used for acquiring resource cache reference information of a second page associated with the first page; the first page is a webpage page of which the target object is triggered to display currently, and a display trigger control of the second page is deployed in the first page; the resource cache reference information comprises historical access information of the target object to the second page and main source page information of the second page;
the object type determining module is used for determining an object identification result corresponding to the target object according to the historical access information in the resource cache reference information;
the page type determining module is used for determining a page identification result corresponding to the first page according to the main source page information in the resource cache reference information;
The resource cache decision module is used for caching the webpage resources of the second page under the condition that the object identification result represents that the target object is a common object of the second page and the page identification result represents that the first page is a main source page of the second page; and under the condition that the object identification result represents that the target object is not a common object of the second page or that the page identification result represents that the first page is not a main source page of the second page, the webpage resource of the second page is not cached.
A fourth aspect of the present application provides a page display device deployed in an electronic apparatus, the device comprising:
the page display module is used for responding to the trigger display operation for the first page and displaying the first page; the first page is associated with a target object, and a display trigger control of a second page is deployed in the first page; the webpage resources of the second page are determined whether to be cached in advance according to the resource cache reference information of the second page; the resource cache reference information of the second page comprises historical access information of the target object to the second page and main source page information of the second page; the history access information is used for determining whether the target object is a common object of the second page, and the main source page information is used for determining whether the first page is a main source page of the second page;
The first resource obtaining module is used for responding to the trigger display operation aiming at the display trigger control to locally obtain the webpage resource of the second page from the electronic equipment under the condition that the historical access information characterizes that the target object is a common object of the second page and the main source page information characterizes that the first page is a main source page of the second page; the webpage resources of the second page are cached in the electronic equipment in advance;
the second resource obtaining module is used for responding to the trigger display operation aiming at the display trigger control and requesting the webpage resource of the second page to the server under the condition that the historical access information represents that the target object is not a common object of the second page or the main source page information represents that the first page is not a main source page of the second page;
and the page display module is also used for displaying the second page based on the webpage resources of the second page.
A fifth aspect of the application provides a computer apparatus comprising a processor and a memory:
the memory is used for storing a computer program;
the processor is configured to perform the steps of the resource pre-caching method according to the first aspect or the steps of the page display method according to the second aspect according to the computer program.
A sixth aspect of the present application provides a computer readable storage medium storing a computer program for executing the steps of the resource pre-caching method of the first aspect described above, or executing the steps of the page display method of the second aspect described above.
A seventh aspect of the application provides a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps of the resource pre-caching method described in the first aspect or performs the steps of the page display method described in the second aspect.
From the above technical solutions, the embodiment of the present application has the following advantages:
in the embodiment of the application, when a target object triggers the display of a first page, resource cache reference information of a second page (a display trigger control of the second page is deployed in the first page, that is, the second page can be triggered to be displayed through the first page) associated with the first page is obtained, whether the target object is a common object of the second page is determined according to historical access information of the target object to the second page in the resource cache reference information, and a page identification result corresponding to the first page is determined according to main source page information in the resource cache reference information, and when the object identification result represents that the target object is the common object of the second page and the page identification result represents that the first page is the main source page of the second page, web page resources of the second page are cached; and under the condition that the object identification result represents that the target object is not a common object of the second page or that the page identification result represents that the first page is not a main source page of the second page, the webpage resource of the second page is not cached.
Therefore, only when the target object is a common object of the second page and the first page is a main source page of the second page, the webpage resources of the second page are cached, namely, when the target object is determined to have a high probability of triggering the second page to be displayed through the first page, the webpage resources of the second page are cached, so that the directional pre-caching of the webpage resources is realized.
Drawings
FIG. 1a is a schematic diagram of a first page according to an embodiment of the present application;
FIG. 1b is a schematic diagram of a second page according to an embodiment of the present application;
FIG. 1c is a schematic diagram of another first page according to an embodiment of the present application;
FIG. 1d is a schematic diagram of another second page according to an embodiment of the present application;
fig. 2 is a schematic diagram of a scenario of a resource pre-caching method according to an embodiment of the present application;
FIG. 3 is a flowchart of a method for pre-caching resources according to an embodiment of the present application;
FIG. 4 is a flowchart of another method for pre-caching resources according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a statistical distribution of source pages according to an embodiment of the present application;
FIG. 6 is a flowchart of a process for adjusting access expiration and primary source pages according to an embodiment of the present application;
FIG. 7 is a flowchart of a method for displaying a page according to an embodiment of the present application;
FIG. 8 is a schematic structural diagram of a resource pre-caching device according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of a page display device according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of a terminal device according to an embodiment of the present application;
fig. 11 is a schematic structural diagram of a server according to an embodiment of the present application.
Detailed Description
In order to make the present application better understood by those skilled in the art, the following description will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The terms "first," "second," "third," "fourth" and the like in the description and in the claims and in the above drawings, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In the web page resource pre-caching scheme provided in the related art, generally, after a web page is loaded, web page resources of web pages that may be displayed after the web page are cached. For example, assuming that a control for triggering the jump display of a second page is deployed in a first page, after the first page is loaded, the web page resource of the second page may be cached.
Referring specifically to fig. 1a, a schematic diagram of a first page according to an embodiment of the present application is shown. The first page is a video playing page, the first page comprises a display trigger control of the second page, the second page is assumed to be a shopping page, the first page is provided with a control A in the form of a shopping cart icon for triggering and skipping to display the second page, when an object is used for watching the video played by the first page, the control A can be clicked and skipped to the second page for browsing or shopping, and the second page can be seen in fig. 1b, which is a schematic diagram of the second page provided by the embodiment of the application.
Referring to fig. 1c, a schematic diagram of another first page according to an embodiment of the present application is shown. The first page is a selected page, the first page includes a display trigger control of the second page, the second page is assumed to be an active page, the first page is provided with a control B in the form of an active bubble for triggering and skipping to display the second page, when the selected content of the first page is browsed by using the object, the control B can be clicked and skipped to the second page browsing related activity, and the second page can refer to fig. 1d, which is a schematic diagram of another second page provided by the embodiment of the present application.
However, the user object may not click on the control a or the control B, that is, the user object may simply browse the current first page and not enter the second page, and if the related art web page resource pre-caching scheme is adopted, resources related to caching the web page resources of the second page are wasted, such as related network bandwidth, server resources, client resources, and the like are wasted.
It should be understood that in many cases in practical applications, the first page may include a plurality of second pages, where web page resources of the plurality of second pages need to be cached when related technologies are adopted, but the usage object may not trigger the plurality of second pages entering the cached web page resources, where related resources (such as network bandwidth, server resources, client resources, etc.) consumed by caching the web page resources of the plurality of second pages are wasted. Therefore, by adopting the related technology, the webpage resources of each second page which is possibly displayed later are cached, so that a great amount of resource waste is easy to generate.
In order to solve the above technical problems, an embodiment of the present application provides a method for pre-caching resources and a related device, where the method includes: acquiring resource cache reference information of a second page associated with a first page, wherein the first page is a webpage page of which a target object is currently triggered to display, a display trigger control of the second page is deployed in the first page, and the resource cache reference information comprises historical access information of the target object to the second page and main source page information of the second page; determining an object recognition result corresponding to the target object according to the historical access information in the resource cache reference information, determining a page recognition result corresponding to the first page according to the main source page information in the resource cache reference information, and caching the webpage resource of the second page under the condition that the object recognition result represents that the target object is a common object of the second page and the page recognition result represents that the first page is a main source page of the second page; and under the condition that the object identification result represents that the target object is not a common object of the second page or that the page identification result represents that the first page is not a main source page of the second page, the webpage resource of the second page is not cached.
As an example, when the first page is a video playing page and the second page is a shopping page, acquiring historical access information and main source page information of the second page, and judging whether a target object is a common object or not through the historical access information, namely judging whether the user can enter the second page frequently or not; meanwhile, whether the first page is the main source interface is determined by the main source page information, that is, whether the user can often enter the second page through the first page is determined, for example, if a selected shopping page is further used as a third page, the third page also includes a display trigger control of the second page, the user may jump into the second page through the third page, and may not jump into the second page from the first page.
When the target object is a common object, the user is considered to enter the second page frequently, and when the first page is a main source page, the user is considered to enter the second page frequently through the first page jump, and when the user triggers the display of the first page, the webpage resource of the second page needs to be cached in advance, so that the directional pre-caching of the webpage resource is realized.
Therefore, only when the target object is a common object of the second page and the first page is a main source page of the second page, the webpage resources of the second page are cached, namely, when the target object is determined to have a high probability of triggering the second page to be displayed through the first page, the webpage resources of the second page are cached, so that the directional pre-caching of the webpage resources is realized.
Referring to fig. 2, the diagram is a schematic view of a scenario of a resource pre-caching method according to an embodiment of the present application, where the application scenario includes a terminal device 200.
The terminal device 200 acquires resource cache reference information of a second page associated with the first page; the first page is a webpage page of which the target object is triggered to display currently, and a display trigger control of the second page is deployed in the first page; the resource cache reference information comprises historical access information of the target object to the second page and main source page information of the second page. As an example, assuming that the first page is a and the second page is B, a display trigger control K of the second page B is disposed in the first page a, and if the target object has previously accessed B, relevant access information is recorded as history access information; when the target object triggers the display of a first page associated with a second page, the historical access information may be correspondingly obtained, and primary source page information for the second page B may be obtained, which may, for example, characterize that the second page B is entered primarily through the first page a.
The terminal device 200 determines an object recognition result corresponding to the target object according to the history access information in the resource cache reference information. As an example, the number of accesses or the access time may be used as the history access information, and when the target object does not access the second page, the number of accesses may be 0, or there is no access time, and the target object is not a common object of the second page; when the target object accesses the preset times or has the preset number of access time data, the target object can be considered as a common object of the second page; when the target object accesses the preset times within the preset time or the target object accesses the second page, the target object may be considered as a common object of the second page, and the condition of whether the target object is the common object of the second page is not specifically limited herein, and may be specifically determined according to practical application.
The terminal device 200 determines a page identification result corresponding to the first page according to the main source page information in the resource cache reference information. As an example, access channels of a plurality of users to the second page may be counted in advance, and if the statistics characterize that the second page B is accessed mainly through the display trigger control K of the first page a, the first page a may be used as a main source page; if a third page C exists, and the statistical result indicates that the second page B is mainly accessed through the third page C, the third page C can be used as a main source page; or the first page a and the third page C are both main source pages for accessing the second page B, which are not particularly limited herein.
The terminal equipment 200 caches the webpage resources of the second page under the condition that the object identification result represents that the target object is a common object of the second page and the page identification result represents that the first page is a main source page of the second page; and under the condition that the object identification result represents that the target object is not a common object of the second page or that the page identification result represents that the first page is not a main source page of the second page, the webpage resource of the second page is not cached. As an example, when the first page a is a main source page accessing the second page B and the target object is a common object of the second page B, web page resources of the second page need to be cached in advance.
Therefore, only when the target object is a common object of the second page and the first page is a main source page of the second page, the webpage resources of the second page are cached, namely, when the target object is determined to have a high probability of triggering the second page to be displayed through the first page, the webpage resources of the second page are cached, so that the directional pre-caching of the webpage resources is realized.
The resource pre-caching method provided by the embodiment of the application can be applied to terminal equipment with data processing capability, wherein the terminal equipment comprises, but is not limited to, mobile phones, tablets, computers, intelligent cameras, intelligent voice interaction equipment, intelligent household appliances, vehicle-mounted terminals, aircrafts and the like. The terminal device and the server may be directly or indirectly connected through wired or wireless communication, and the present application is not limited herein.
The related data collection and processing in the application should be strictly according to the requirements of relevant national laws and regulations when the example is applied, obtain the informed consent or independent consent of the main body of personal information, and develop the subsequent data use and processing behaviors within the authorized range of laws and regulations and the main body of personal information.
Next, a specific description is given below of the resource pre-caching method provided by the embodiment of the present application from the perspective of the terminal device.
Referring to fig. 3, the flowchart of a method for pre-caching resources according to an embodiment of the present application is shown.
The resource pre-caching method provided by the embodiment of the application specifically comprises the following steps:
s301: resource cache reference information of a second page associated with the first page is acquired.
The first page is a webpage page of which the target object is triggered to display currently, and a display trigger control of the second page is deployed in the first page; the resource cache reference information comprises historical access information of the target object to the second page and main source page information of the second page.
The target object means a use object for browsing or operating the first page.
The first page means a web page that the target object currently triggers to display.
The second page means a web page associated with the first page, wherein the first page is provided with a display trigger control of the second page, that is, any web page that can be triggered to display by the first page can be regarded as the second page.
Displaying the trigger control means a control that causes a trigger operation in response to a target object to jump from a first page into a second page.
It should be appreciated that when the target object is on the first page, before caching the web page resources of the second page associated with the first page, the resource caching information needs to be acquired, and whether the web page resources of the second page need to be pre-cached or not is analyzed according to the resource caching information.
S302: and determining an object identification result corresponding to the target object according to the historical access information in the resource cache reference information.
The history access information means information that the target object accesses the second page within a preset time. As an example, the history access information may be access information of accessing the second page last time, or may be access times, access frequencies, etc. within a preset time, which are not limited herein.
The object recognition result corresponding to the target object is used for representing whether the target object is a common object of the second page. The common object means an object satisfying the common access condition for the access condition of the second page, as an example, assuming that the common access condition is a preset number of times in a preset period (for example, in a month of the last month), the preset number of times may be, for example, 10 times, assuming that the target object a accesses the second page 11 times in a month of the last month (exceeds the preset number of times), and the target object B accesses the second page 2 times in a month of the last month (does not exceed the preset number of times), the target object a is considered as the common object.
It should be appreciated that, based on the historical access information, whether the target object is a common object of the second page is determined, and when the target object is not a common access object, that is, the target object does not access the second page frequently or not, the web page resources of the second page may not be pre-cached, so as to reduce resource waste caused by caching the web page resources.
S303: and determining a page identification result corresponding to the first page according to the main source page information in the resource cache reference information.
The page identification result corresponding to the first page is used for indicating whether the first page is a main source page of the second page. The primary source page means a source page that is a primary jump into the second page, and as an example, assuming that the second page can be entered through the source page A, B, C, the probability of entering the second page through the source page a is 10%, the probability of entering the second page through the source page B is 40%, and the probability of entering the second page through the source page C is 50%, the source page B and the source page C can be regarded as primary source pages.
The main source page information means related information as a main source page. As an example, the primary source page information may include a device number, a secondary page tag, a primary source page tag, a page access time, etc., without limitation.
It should be understood that, whether the first page is the main source page of the second page is determined by the main source page information, so as to determine whether to pre-cache the web page resources of the second page, and if the first page is not the main source page of the second page, the web page resources of the second page may not be pre-cached, so as to reduce resource waste caused by caching the web page resources.
S304: and caching the webpage resources of the second page under the condition that the object identification result indicates that the target object is a common object of the second page and the page identification result indicates that the first page is a main source page of the second page.
As an example, when the target object is a common object of the second page, it may be understood that the target object may access the second page one or more times in the near future; when the first page is the main source page of the second page, it can be understood that the second page is accessed mainly through the first page, that is, the target object accesses the second page once or multiple times through the first page, and in this case, in order to improve the experience of the user, after the loading of the first page is completed, the webpage resource of the second page needs to be cached, so as to realize directional resource pre-caching.
S305: and under the condition that the object identification result represents that the target object is not a common object of the second page or that the page identification result represents that the first page is not a main source page of the second page, the webpage resource of the second page is not cached.
It should be understood that when the target object is not a common object of the second page, it may be understood that the target object may not enter the second page frequently, and when the first page is not a main source page of the second page, it may be understood that the target object may not enter the second page through the first page, that is, the target object may not enter the second page, so after loading of the first page is completed, it is not necessary to cache the web page resources of the second page, so as to reduce resource waste caused by caching the web page resources of the second page.
In the embodiment of the application, when a target object triggers the display of a first page, resource cache reference information of a second page (a display trigger control of the second page is deployed in the first page, that is, the second page can be triggered to be displayed through the first page) associated with the first page is obtained, whether the target object is a common object of the second page is determined according to historical access information of the target object to the second page in the resource cache reference information, and a page identification result corresponding to the first page is determined according to main source page information in the resource cache reference information, and when the object identification result represents that the target object is the common object of the second page and the page identification result represents that the first page is the main source page of the second page, web page resources of the second page are cached; and under the condition that the object identification result represents that the target object is not a common object of the second page or that the page identification result represents that the first page is not a main source page of the second page, the webpage resource of the second page is not cached.
Therefore, only when the target object is a common object of the second page and the first page is a main source page of the second page, the webpage resources of the second page are cached, namely, when the target object is determined to have a high probability of triggering the second page to be displayed through the first page, the webpage resources of the second page are cached, so that the directional pre-caching of the webpage resources is realized.
Based on the resource pre-caching method provided in the above embodiment, since the object recognition result corresponding to the target object is determined according to the history access information in the resource cache reference information, in order to further describe the process of obtaining the history access information, the history access information may be obtained specifically by the following manner:
a1: and acquiring a history access record corresponding to the second page from the webpage access database.
The webpage access database is used for storing historical access records corresponding to webpage pages in a target application, and the target application is used for comprising a first page and a second page.
As an example, the historical access record corresponding to the webpage at least comprises the latest access time of the target object to the webpage. In another possible implementation manner, the history access record corresponding to the web page may further include, but is not limited to, a target device identifier, a web page identifier of the web page, and is not limited herein.
The target equipment identifier is randomly generated when the target object accesses the webpage of the target application for the first time; the webpage identification of the webpage means the identification of the webpage accessed by the target object; the latest access time means the time when the target object accessed the web page last time relative to the current time.
For example, the target device identification is assumed to be AA123, the web page is assumed to be the second page, the web page identification of the web page is XXXX, and the last access time is 20XX years, 6 months, 3 days, 10:30.
a2: and acquiring the latest access time of the target object to the second page from the history access record corresponding to the second page as history access information.
In order to ensure the security and privacy of the target object information, in the embodiment of the present application, the target device identifier is randomly generated when the target object accesses the web page of the target application for the first time, and is stored locally for the unique identifier of the target device used as the target object, so as to facilitate the subsequent determination of whether the target object is a common object. As an example, assuming that the target object information is KKK, when the target object accesses the web page of the target application for the first time, a target device identifier CCC is randomly generated for the target device used by the target object, and is used as a unique identifier for representing the target object, and the security and privacy of the target object information are protected by using the target device identifier CCC to replace the target object information KKK.
According to the embodiment of the application, the latest access time of the target object to the second page is used as the historical access information, so that whether the target object accesses the second page in a near period of time can be judged, and whether the target object is a common object can be judged, and the accuracy of the judgment result of the common object is improved, so that whether the webpage resources of the second page need to be cached in advance or not can be determined later, and the directional pre-caching is realized.
In one possible implementation, when the latest access time is the historical access information, step S302 may specifically include:
b1: and under the condition that the latest access time of the target object to the second page meets the access expiration condition corresponding to the second page, determining that the object identification result corresponding to the target object represents that the target object is a common object of the second page.
The access expiration condition is determined according to the access expiration time corresponding to the second page.
B2: and under the condition that the latest access time of the target object to the second page does not meet the access expiration condition, determining that the object identification result corresponding to the target object represents that the target object is not a common object of the second page.
It should be understood that, in order to further improve accuracy of directional pre-caching and improve utilization rate of cache resources, specifically, the access expiration time period may be set to determine whether the target object is a common object. As an example, assume that the last visit time is 20XX years 6 months 3 days 10:30, current time is 20XX years, 6 months, 10 days: 30, the access expiration time is 1 month, and then the latest access time is within the access expiration time, and the target object can be considered as a common object.
As an example, the access expiration time corresponding to the second page may be determined by:
c1: and executing the operation of calculating the utilization rate once every preset time.
Among other possible implementations, the utilization calculation operation may specifically include:
step 1: and acquiring the number of times of caching the webpage resources of the second page when triggering the display of the webpage associated with the second page as the first number of times.
Wherein the web page associated with the second page means the web page on which the display trigger control of the second page is deployed.
It should be appreciated that in some cases, when the web page associated with the second page is displayed using the object trigger, the web page resources of the second page are pre-cached, and thus, the number of pre-caches of the web page resources of the second page may be counted as the first number.
Step 2: and acquiring the number of times of displaying the second page based on the cached webpage resource as the second number of times.
As an example, the second number of times may be the number of times the second page is displayed based on the cache resource, or may be the number of times the cache resource is used when the second page is accessed for the first time, which is not particularly limited herein.
It will be appreciated that when a web page is triggered by a web page associated with a second page, the web page resource is invoked and displayed using the object after the web page resource has been pre-cached. The number of times the second page is displayed based on the pre-cached web page resource is the second number of times.
Step 3: and determining the cache resource utilization rate corresponding to the utilization rate calculation operation according to the first times and the second times.
Cache resource utilization means the extent to which cached resources are used. Specifically, the ratio between the second number of times and the first number of times can be calculated as the cache resource utilization rate corresponding to the current utilization rate calculation operation, and it can be understood that although the web page resource of the second page is cached, the target object may not access the second page for multiple times, so in order to improve the accuracy of directional pre-caching, when the access expiration time is set, adjustment needs to be performed based on the cache resource utilization rate so as to determine whether the target object is a common object.
C2: if the utilization rate of the cache resources corresponding to the utilization rate calculation operation is higher than the utilization rate of the cache resources corresponding to the previous utilization rate calculation operation, the access expiration time corresponding to the previous utilization rate calculation operation is used as the basic access expiration time corresponding to the current utilization rate calculation operation, the basic access expiration time is reduced, and the access expiration time corresponding to the current utilization rate calculation operation is obtained.
And C3: if the cache resource utilization rate corresponding to the current utilization rate calculation operation is lower than the cache resource utilization rate corresponding to the previous utilization rate calculation operation, taking the access expiration time corresponding to the previous utilization rate calculation operation as the target access expiration time corresponding to the second page, and stopping executing the subsequent utilization rate calculation operation.
It should be noted that, the determining manner of the access expiration time corresponding to the second page provided by the embodiment of the present application may be specifically executed by a remote data center.
The basic access expiration time corresponding to the first utilization rate calculation operation is the initial access expiration time. As a possible implementation manner, the initial access expiration duration may be specifically set to one year, and the adjustment is performed based on the initial access expiration duration to obtain the target access expiration duration. Specifically, after the first utilization rate calculation operation is completed, the initial access expiration time (365 days) can be used as a basic access expiration time corresponding to the first utilization rate calculation operation, and then seven days are reduced on the basis of the basic access expiration time to obtain an access expiration time (such as 358 days) corresponding to the first utilization rate calculation operation; further, performing a second utilization rate calculation operation, if the utilization rate of the cache resource corresponding to the second utilization rate calculation operation is higher than the utilization rate of the cache resource corresponding to the first utilization rate calculation operation, taking the access expiration time length (such as 358 days) corresponding to the first utilization rate calculation operation as a basic access expiration time length corresponding to the second utilization rate calculation operation, and reducing seven days on the basis of the basic access expiration time length to obtain the access expiration time length (such as 351 days) corresponding to the second utilization rate calculation operation; and the like, until the utilization rate of the cache resource corresponding to a certain utilization rate calculation operation is lower than the utilization rate of the cache resource corresponding to a previous utilization rate calculation operation, at this time, the access expiration time corresponding to the previous utilization rate calculation operation can be used as the target access expiration time corresponding to the second page.
It can be understood that, since the gradual decrease trend of the expiration duration of the access is a trend similar to a parabola, that is, the resource utilization rate gradually increases first and gradually decreases after reaching the maximum value, when the cache resource utilization rate corresponding to the current utilization rate calculation operation is higher than the cache resource utilization rate corresponding to the previous utilization rate calculation operation, the cache resource utilization rate is considered to be improved, the expiration duration of the access can be continuously reduced, so as to continuously improve the utilization rate of the cache resource, to improve the accuracy of determining the common object, to further improve the accuracy of directional pre-caching, and to reduce the waste of the cache resource.
Based on the resource pre-caching method provided in the above embodiment, since the page identification result corresponding to the first page is determined according to the main source page information in the resource cache reference information, in order to further explain the determination process of the main source page information, the main source page information may be determined by the following manner:
it should be noted that, the determination manner of the main source page information provided by the embodiment of the present application may be specifically executed by a remote data center.
D1: and acquiring historical access records corresponding to the second page from a plurality of devices installed with the target application.
The target application comprises a first page and a second page, and the history access record corresponding to the second page comprises a source page according to which the second page is accessed.
It should be understood that there is more than one way to enter the second page, and there is more than one corresponding source page, so that it is necessary to determine the history of access records of the second page corresponding to each of the plurality of devices installed with the target application, so as to facilitate the subsequent determination of the main source page of the second page.
D2: and counting the source page distribution condition of the second pages according to the acquired historical access records corresponding to the second pages.
The source page distribution condition comprises coverage rates corresponding to source pages associated with the second page. Coverage means the number of usage objects entering the second page through the source page associated with the second page, for example, assuming that the number of usage objects entering the second page from source page a is 10, the number of usage objects entering the second page from source page B is 90, the coverage of source page a is 10, and the coverage of source page B is 90%.
It will be appreciated that by determining the coverage of the individual source pages, it can be determined through which source pages the use object is predominantly entering the second page.
D3: determining a source page with the corresponding coverage rate meeting a preset coverage condition as a main source page of the second page according to the source page distribution condition; and generating main source page information according to the webpage identification of the main source page.
It should be understood that by taking the source page meeting the preset coverage condition as the main source page of the second page, that is, the object will enter the second page mainly through the main source page, the web page resources of the second page may not be cached in advance for the non-main source page, so as to realize directional pre-caching of the resources and reduce resource waste.
In the embodiment of the application, the source pages meeting the preset coverage conditions are used as the main source pages of the second page by determining the distribution condition of the source pages, so that the conditions of needing to be cached in advance and not needing to be cached in advance can be determined, the resource directional pre-caching is realized, and the resource waste caused by the web page resources not needing to be cached is reduced.
As a possible implementation manner, to further illustrate the determination process of the main source page, step D3 may specifically include:
E1: and arranging the source pages in the source page distribution condition according to the sequence of the coverage rate from large to small.
E2: calculating the sum of coverage rates corresponding to the first i-1 source pages respectively, and taking the sum as a first sum; calculating the sum of coverage rates corresponding to the first i source pages respectively, and taking the sum as a second sum; i is an integer greater than 1.
E3: if the first sum value is smaller than or equal to the coverage rate threshold corresponding to the second page, and the second sum value is larger than the coverage rate threshold, the first i-1 source pages are determined to be main source pages.
For example, assume that the coverage threshold corresponding to the second page is 80%, the source pages include five source pages a, B, C, D, and E, and the coverage of each source page is a:15%, B:5%, C:25%, D:35%, E:20%. The five coverage rates are ordered in order from big to small, D:35%, C:25%, E:20%, A:15%, B:5%. Assuming that the sum of the coverage rates corresponding to the first 4 source pages is calculated to obtain a first sum of 80%, and the coverage rate sum corresponding to the first 5 source pages is calculated to obtain a second sum of 100%, wherein the first sum is equal to the coverage rate threshold value, and the second sum is larger than the coverage rate threshold value, so that the four source pages D, C, E and A are used as main source pages, and the B is not used as main source pages.
The first sum value and the second sum value are calculated respectively, and the main source page is determined according to the first sum value and the second sum value, so that the range that a user object possibly enters the second page through the source page is determined, the accuracy of the determined main source page is ensured, the conditions of needing pre-caching and not needing pre-caching are determined accordingly, the resource directional pre-caching is realized, and the resource waste caused by the web page resource which does not need caching is reduced.
As a possible implementation manner, the coverage threshold corresponding to the second page may be specifically determined by:
it should be noted that, the determination manner of the main source page information provided by the embodiment of the present application may be specifically executed by a remote data center.
F1: and executing the operation of calculating the utilization rate once every preset time.
The utilization calculation operation includes: acquiring the number of times of caching the webpage resources of the second page when triggering the display of the webpage associated with the second page as the first number of times; acquiring the number of times of displaying a second page based on the cached webpage resource as a second number of times; and determining the cache resource utilization rate corresponding to the utilization rate calculation operation according to the first times and the second times. The operation of calculating the utilization rate in the embodiment of the present application is the same as that of steps 1 to 3 in the above embodiment, and therefore will not be described in detail.
F2: if the utilization rate of the cache resources corresponding to the current utilization rate calculation operation is higher than the utilization rate of the cache resources corresponding to the previous utilization rate calculation operation, taking the coverage rate threshold corresponding to the previous utilization rate calculation operation as the basic coverage rate threshold corresponding to the current utilization rate calculation operation, and reducing the basic coverage rate threshold to obtain the coverage rate threshold corresponding to the current utilization rate calculation operation.
The basic coverage rate threshold corresponding to the first utilization rate calculation operation is an initial coverage rate threshold. As one example, the initial coverage threshold may be 100%.
F3: if the utilization rate of the cache resources corresponding to the current utilization rate calculation operation is lower than the utilization rate of the cache resources corresponding to the previous utilization rate calculation operation, taking the coverage rate threshold corresponding to the previous utilization rate calculation operation as the target coverage rate threshold corresponding to the second page, and stopping executing the subsequent utilization rate calculation operation.
The basic coverage rate threshold corresponding to the first utilization rate calculation operation is an initial coverage rate threshold. As one possible implementation, the initial coverage threshold may be specifically set to 100%, and the adjustment is performed based on the initial coverage threshold to obtain the target coverage threshold.
Specifically, after the first utilization rate calculation operation is completed, the initial coverage rate threshold (100%) can be used as a basic coverage rate threshold corresponding to the first utilization rate calculation operation, and then 1 percentage point is reduced on the basis of the basic coverage rate threshold to obtain a coverage rate threshold (such as 99%) corresponding to the first utilization rate calculation operation; further, executing a second utilization rate calculation operation, and if the utilization rate of the cache resource corresponding to the second utilization rate calculation operation is higher than the utilization rate of the cache resource corresponding to the first utilization rate calculation operation, taking a coverage rate threshold (such as 99%) corresponding to the first utilization rate calculation operation as a basic coverage rate threshold corresponding to the second utilization rate calculation operation, and reducing 1 percentage point on the basis of the basic coverage rate threshold to obtain a coverage rate threshold (such as 98%) corresponding to the second utilization rate calculation operation; and the like, until the utilization rate of the cache resource corresponding to a certain utilization rate calculation operation is lower than the utilization rate of the cache resource corresponding to a previous utilization rate calculation operation, at this time, the coverage rate threshold corresponding to the previous utilization rate calculation operation can be used as the target coverage rate threshold corresponding to the second page.
It should be appreciated that the cache resource utilization is parabolic with the coverage threshold, i.e., as the coverage threshold gradually decreases, the cache resource utilization gradually increases and gradually decreases after reaching a maximum. Therefore, when the utilization rate of the cache resource corresponding to the current utilization rate calculation operation is higher than that of the cache resource corresponding to the previous utilization rate calculation operation, the utilization rate of the cache resource is considered to be improved, the coverage rate threshold can be continuously reduced, so that the utilization rate of the cache resource can be continuously improved, the accuracy of determining the main source page is improved, the accuracy of directional pre-caching is further improved, and the waste of the cache resource is reduced.
Based on the resource pre-caching method provided in the foregoing embodiment, an embodiment of the present application further provides a resource pre-caching method, and referring to fig. 4, the fig. is a flowchart of another resource pre-caching method provided in the embodiment of the present application.
The resource pre-caching method of the embodiment of the application specifically comprises the following steps:
s401: and acquiring historical access information of the second page, and judging whether the target object is a common object of the second page.
In order to obtain the history access information, when the user accesses the web page using the object, a random device identifier is generated from the web page, the device identifier is used to indicate the device used by the user object, and the access information of the user object is stored according to the device identifier, as shown in table 1 below:
Table 1: accessing information
Field name Meaning of field Field effect
PageId Webpage identification Marking current web page
DeviceId Device identification Page randomly generated device identification for marking device information
LastVisitTime Time of last access The time the device last accessed this page
As an example, assuming that the web page is the second page, the access information acquiring process mainly includes the following steps:
g1: checking whether the local storage device identifier exists or not, if not, randomly generating a device identifier, and storing the device identifier to the local.
And G2: and entering a second page, and storing the equipment identifier and the webpage identifier of the second page into a database as a piece of data by using the current time of the object accessing the second page.
And G3: when the object is used to enter the page again, the equipment identifier and the webpage identifier of the second page are transmitted to the database, and the access time of the second page is updated according to the equipment identifier and the webpage identifier of the second page.
It should be understood that, the device identifier, the web page identifier of the second page, the current time of accessing the second page by using the object constitutes the access information and is stored in the database, when the device is the target device and the object is the target object, the history access information is the target device identifier, the web page identifier of the second page and the latest access time of accessing the second page by the target object.
After the access information is obtained based on the steps G1 to G3, the latest access time of the target device (i.e., the target object) on the second page may be obtained, and if the target object accesses the second page within N days recently, it is determined that the target object is a common object of the second page, and the second page may be accessed.
S402: and acquiring the main source page information of the second page, and judging whether the first page is the main source page of the second page.
It should be noted that, in order to determine the information of the main source page, it is necessary to acquire the information of the first page on the second page and analyze the distribution of the first page. The fields related to the information of the first page are shown in table 2:
table 1: source page field
Field name Meaning of field Field effect
DeviceId Device identification Randomly generated device identification for marking devices
PageId Webpage identification of current page Marking a second page
ReferencePageId Web page identification of last page Marking a first page
VisitTime Page access time Marking the time at which a jump from a first page into a second page occurs
As an example, the obtaining of the source page information may include:
h1: and when the first page puts in the second page, adding the information of the first page to the link of the second page. For example: the second page is addressed https:// example. Com assuming that the first page is a play detail page with PageId pagedetail. Placing the PageId of the first page into the parameters of the second page link is https:// example. Com? reference_page_id=page_detail.
H2: a second page is entered from the new drop link.
And H3: and checking whether the local storage device number exists in the second page, and if not, randomly generating a device number and storing the device number to the local.
H4: and acquiring the device number DeviceId from the local in the second page, acquiring the PageId of the current page, acquiring the PageId of the source page as the parameter ReferencePageId according to the parameter ReferencePageid in the link, and acquiring the current time as the page access time VisitTime. The data is stored in a database as an access data from the first page.
Further, the primary source page of the plurality of source pages of the second page may be determined by:
i1: and counting the distribution of source pages of the current page in a month.
Referring to fig. 5, a schematic diagram of a statistical distribution of source pages according to an embodiment of the present application is shown. As an example, a statistical distribution of source pages of second page a and second page B over a period of one month may be obtained. As shown in connection with fig. 5, it is assumed that the second page a includes source pages M1, M2, M3, M4, the probability of M1 is 10%, the probability of M2 is 20%, the probability of M3 is 30%, and the probability of M4 is 40%; the second page B includes source pages N1, N2, N3, N4, N1 with a probability of 8%, N2 with a probability of 22%, N3 with a probability of 32%, and N4 with a probability of 38%.
I2: distributed data is deduplicated according to DeviceId.
And I3: setting the coverage rate R of main source pages, and judging which source pages are added together to reach the coverage rate R, wherein the source pages are used as main source pages of the current page.
S403: and executing the related caching strategy based on the code of the pre-cached second page resource injected in the first page.
Specifically, the code for pre-caching the second page resource needs to be injected into the first page of all sources of the second page, and the method mainly comprises the following steps:
j1: the cache policy configuration for adding the second page mainly includes the following fields shown in table 3:
table 3: cache policy configuration field
J2: when the object is used to enter the first page, the caching strategy of the second page is pulled, wherein the caching strategy comprises the time of the last access of the object to the second page, the distribution of the source page and the distribution probability.
S404: and judging whether the webpage resources of the second page need to be pre-cached.
The judging process specifically may include the steps of:
k1: and adding the last time the using object accesses the second page and the access expiration time in the second page cache policy, comparing with the current time, and if the time the using object accesses the second page is not expired, considering the using object as a common object. As an example, assuming that the last visit time is 6 months 1 day, the visit expiration time is 7 days, and the current time is 6 months 7 days, then the last visit time and the visit expiration time are added to be 6 months 8 days, and the current time does not exceed 6 months 8 days, then the usage object is considered to be a common object.
K2: and determining a main source page within the coverage range according to the maximum coverage range of the source page, judging whether the current first page belongs to the range of the main source page, and if so, considering the current first page as the main source page.
S405: if the currently used object is a common object and the current first page is the main source page of the second page, the web page resource of the second page is pre-cached.
In a possible implementation manner, the access expiration time and the primary source page may be adjusted by calculating the cache resource utilization ratio of the cache resource when accessing the second page, referring to fig. 6, which is a flowchart of an adjustment process for accessing the expiration time and the primary source page provided by an embodiment of the present application, and in conjunction with fig. 6, the method specifically may include the following steps:
and calculating the ratio between the first times of caching the second page resources by the first page and the second times of using the cache resources when the second page is accessed for the first time in the preset time, and taking the ratio as the cache resource utilization rate of the cache resources. And adjusting the access expiration time of the used object and the coverage rate of the main source page according to the cache resource utilization rate so as to achieve the maximum cache resource utilization rate.
S601: the initial access expiration time (SinceLastVisitTime) was set to one year, and the initial coverage threshold (reportencoverrate) for the primary source page was 100%.
S602: a first number of times that a second page resource is cached is collected in a first page.
After the first page caches the second page resource successfully, the cached variable of the resource is injected into the global variable of the second page, and whether cache information is used when the second page is accessed is judged. And injecting a version number into the code when the second page packs resources each time, storing the version number into the local, comparing the current version number with the local version number, and judging whether the access is the first access page or not.
S603: a second number of times that the cache resource was used when the second page was first accessed is obtained.
S604: and calculating the cache resource utilization rate of the cache resource according to the acquired first times and second times, and storing the cache resource utilization rate into a database.
S605: judging whether the utilization rate of the cache resources is greater than the utilization rate of the last cache resources, if so, executing a step S606; if not, go to step S607.
S606: and recording the access expiration time under the maximum resource utilization rate and the coverage rate threshold of the main source page, and keeping unchanged.
S607: reducing the access expiration time by 7 days; the coverage threshold of the primary source page is reduced by 1 percentage point. Steps S602 to S605 are then performed.
Wherein the cache resource utilization of the cache resource is calculated again after 7 days.
If the cache resource utilization is improved compared with the initial cache resource utilization, the access expiration time and the coverage rate threshold of the main source page are reduced again. Step S607 is repeated until the resource utilization is increased to the maximum.
S608: when the business of the main source page is adjusted, repeating the steps S601-S607, and calculating the new access expiration time and the coverage rate threshold of the main source page.
Specifically, based on the expiration time of access being one year (365 days), the initial coverage rate threshold of the main source page is 100%, after the calculation operation of the first cache resource utilization rate is completed in steps S602 to S604, the initial expiration time of access (365 days) can be used as the basic expiration time of access, the initial coverage rate threshold (100%) is used as the basic coverage rate threshold, then the access expiration time corresponding to the first cache resource utilization rate is obtained by reducing for seven days on the basis of the basic expiration time (358 days, for example), and the coverage rate threshold (99%) of the first cache resource utilization rate object is obtained by reducing by 1 percentage point on the basis of the basic coverage rate threshold; further, executing steps S602 to S604, and determining whether the second cache resource utilization rate is higher than the first cache resource utilization rate through step S605, if yes, taking an access expiration time (for example 358 days) corresponding to the first utilization rate calculation operation as a basic access expiration time corresponding to the second utilization rate calculation operation, reducing seven days on the basis of the basic access expiration time (for example 358 days) to obtain an access expiration time (for example 351 days) corresponding to the second cache resource utilization rate, and taking a coverage rate threshold (99%) corresponding to the first utilization rate calculation operation as a basic coverage rate threshold corresponding to the second utilization rate calculation operation to obtain a coverage rate threshold (for example 98%) corresponding to the second cache resource utilization rate; and the like, until the utilization rate of the cache resource at a certain time is lower than the utilization rate of the cache resource at the previous time, at this time, the access expiration time and the coverage rate threshold corresponding to the utilization rate of the cache resource at the previous time can be used as the target access expiration time and the target coverage rate threshold corresponding to the second page.
In the embodiment of the application, the access expiration time and the main source page are adjusted by caching the resource utilization rate, so that whether the target object is a common object and whether the first page is a main source page of the second page can be further and accurately determined, and the webpage resources of the second page can be conveniently cached under the condition that the target object is the common object of the second page and the first page is the main source page of the second page, thereby realizing directional pre-caching, being different from the prior art that the webpage resources of the second page are completely cached, and reducing the resource waste caused by caching the webpage resources.
Meanwhile, the access expiration time and the main source page are adjusted through the cache resource utilization rate, so that the utilization rate of the cache resource can be improved, and the network bandwidth and the server resource are saved.
Based on the resource pre-caching method provided by the embodiment, the embodiment of the application also provides a page display method, referring to fig. 7, which is a flowchart of the page display method provided by the embodiment of the application, where the method is applied to an electronic device and may include:
s701: responding to a trigger display operation for the first page, and displaying the first page; the first page is associated with a target object, and a display trigger control of the second page is deployed in the first page.
The webpage resources of the second page are determined whether to be cached in advance according to the resource cache reference information of the second page; the resource cache reference information of the second page comprises historical access information of the target object to the second page and main source page information of the second page; the history access information is used for determining whether the target object is a common object of the second page, and the main source page information is used for determining whether the first page is a main source page of the second page.
S702: and under the condition that the historical access information characterizes that the target object is a common object of the second page and the main source page information characterizes that the first page is a main source page of the second page, responding to the trigger display operation aiming at the display trigger control, and locally acquiring the webpage resource of the second page from the electronic equipment.
The webpage resource of the second page is cached in the electronic equipment in advance.
It should be noted that, when the history access information indicates that the target object is a common object of the second page and the main source page information indicates that the first page is a main source page of the second page, the electronic device may cache the web page resource of the second page in advance; accordingly, when the trigger display operation of the display trigger control for triggering the second page to be displayed in the first page is detected, the webpage resource of the second page cached in advance can be directly obtained from the electronic equipment.
S703: in response to a trigger display operation for the display trigger control, requesting web page resources of the second page from the server, where the historical access information characterizes that the target object is not a common object of the second page, or the primary source page information characterizes that the first page is not a primary source page of the second page.
It should be noted that, when the history access information indicates that the target object is not a common object of the second page or the main source page information indicates that the first page is not a main source page of the second page, the electronic device will not cache the web page resource of the second page in advance; accordingly, when the trigger display operation for the display trigger control is detected, the electronic device needs to send a web resource acquisition request to the server to request to acquire the web resource of the second page, and the server can correspondingly return the web resource of the second page to the electronic device in response to the web resource acquisition request.
S704: and displaying the second page based on the web page resource of the second page.
Finally, the electronic device may display the second page based on web page resources of the second page obtained from the local or server.
As an example, as shown in fig. 1a and fig. 1b, when the target object clicks on the video to be watched, the target terminal may respond to the trigger display operation of the target object for the video playing page (i.e. the first page), and display the video playing page (i.e. the first page) as shown in fig. 1a, where the video playing page is deployed with a control a in the form of a shopping cart icon for triggering to skip to display the second page, then the target terminal may determine whether to pre-cache the web page resources of the second page according to the resource cache reference information of the second page, so as to implement directional pre-cache, that is, if the target object is a common object of a non-second page, or if the first page is not a main source page of the second page, then it is considered that the target object may not click on the control a and enter the second page (as shown in fig. 1 b), and after the target object enters the first page, the web page resources of the second page do not need to be pre-cached, so as to reduce resource waste caused by caching the web page resources; if the target object is a common object of the second page and the first page is a main source page of the second page, then it is considered that the target object may click the control a to enter the second page (as shown in fig. 1 b), and after the target object enters the first page, the web page resource of the second page needs to be pre-cached to realize directional pre-caching.
It should be understood that if the target object is a common object that is not the second page, or the first page is not the main source page of the second page, the display operation of the target object for the control a may be directly responded, the web page resource of the second page may be requested to the server, and the second page may be displayed.
According to the method, the first page is displayed by responding to the triggering operation of the target object on the first page, the first page comprises the display triggering control of the second page, and the webpage resources of the second page are cached only when the target object is a common object of the second page and the first page is a main source page of the second page, namely, when the target object is determined to have a high probability of triggering the second page to be displayed through the first page, the webpage resources of the second page are cached, so that the directional pre-caching of the webpage resources is realized.
Based on the resource pre-caching method provided by the embodiment, the embodiment of the application also provides a resource pre-caching device, and referring to fig. 8, the diagram is a schematic structural diagram of the resource pre-caching device provided by the embodiment of the application. The resource pre-caching apparatus 800 may include:
An information obtaining module 801, configured to obtain resource cache reference information of a second page associated with the first page; the first page is a webpage page of which the target object is triggered to display currently, and a display trigger control of the second page is deployed in the first page; the resource cache reference information comprises historical access information of the target object to the second page and main source page information of the second page;
an object type determining module 802, configured to determine an object recognition result corresponding to the target object according to the historical access information in the resource cache reference information;
a page type determining module 803, configured to determine a page identification result corresponding to the first page according to the main source page information in the resource cache reference information;
the resource cache decision module 804 is configured to cache a web page resource of the second page when the object recognition result indicates that the target object is a common object of the second page and the page recognition result indicates that the first page is a main source page of the second page; and under the condition that the object identification result represents that the target object is not a common object of the second page or that the page identification result represents that the first page is not a main source page of the second page, the webpage resource of the second page is not cached.
As one example, the history access information is obtained by:
the first acquisition module is used for acquiring a history access record corresponding to the second page from the webpage access database; the webpage access database is used for storing a historical access record corresponding to a webpage in a target application, the target application comprises a first webpage and a second webpage, the historical access record corresponding to the webpage comprises a target equipment identifier, a webpage identifier of the webpage and the latest access time of a target object to the webpage, and the target equipment identifier is randomly generated when the target object accesses the webpage of the target application for the first time;
the second acquisition module is used for acquiring the latest access time of the target object to the second page from the history access record corresponding to the second page as history access information.
As one example, the object type determination module 802 includes:
the first judging unit is used for determining whether the latest access time meets the access unexpired condition corresponding to the second page according to the latest access time of the target object to the second page and the access expiration time corresponding to the second page;
the object type determining unit is used for determining that the target object is a common object of the second page if the target object is the common object of the second page; if not, determining that the target object is not the common object of the second page.
As an example, the access expiration time corresponding to the second page is determined by:
the execution module is used for executing the utilization rate calculation operation once every preset time; the utilization calculation operation includes: acquiring the number of times of caching the webpage resources of the second page when triggering the display of the webpage associated with the second page as the first number of times; acquiring the number of times of displaying a second page based on the cached webpage resource as a second number of times; determining the cache resource utilization rate corresponding to the utilization rate calculation operation according to the first times and the second times;
the first access expiration time determining module is used for taking the access expiration time corresponding to the previous utilization rate computing operation as the basic access expiration time corresponding to the current utilization rate computing operation if the utilization rate of the cache resource corresponding to the current utilization rate computing operation is higher than the utilization rate of the cache resource corresponding to the previous utilization rate computing operation, and reducing the basic access expiration time to obtain the access expiration time corresponding to the current utilization rate computing operation; the basic access expiration time corresponding to the first utilization rate calculation operation is the initial access expiration time;
and the second access expiration time determining module is used for taking the access expiration time corresponding to the previous utilization rate computing operation as the target access expiration time corresponding to the second page and stopping executing the subsequent utilization rate computing operation if the utilization rate of the cache resource corresponding to the current utilization rate computing operation is lower than the utilization rate of the cache resource corresponding to the previous utilization rate computing operation.
As one example, the primary source page information is determined by:
the third acquisition module is used for acquiring historical access records corresponding to the second page from a plurality of devices provided with target applications; the target application comprises a first page and a second page, and the history access record corresponding to the second page comprises a source page according to which the second page is accessed;
the statistics module is used for counting the source page distribution situation of the second pages according to the acquired historical access records corresponding to the second pages; the source page distribution condition comprises coverage rates corresponding to the source pages associated with the second page;
the main source page information determining module is used for determining a source page with the corresponding coverage rate meeting the preset coverage condition according to the source page distribution condition, and the source page is used as a main source page of the second page; and generating main source page information according to the webpage identification of the main source page.
As one example, the primary source page information determination module includes:
the ordering unit is used for ordering the source pages in the source page distribution condition according to the sequence of the corresponding coverage rate from large to small;
The computing unit is used for computing the sum value of the coverage rates corresponding to the previous i-1 source pages respectively, and taking the sum value as a first sum value; calculating the sum of coverage rates corresponding to the first i source pages respectively, and taking the sum as a second sum; i is an integer greater than 1;
the main source page information determining unit is used for determining the first i-1 source pages as main source pages if the first sum value is smaller than or equal to the coverage rate threshold corresponding to the second page and the second sum value is larger than the coverage rate threshold.
As one example, the coverage threshold for the second page is determined by:
the execution module is used for executing the utilization rate calculation operation once every preset time; the utilization calculation operation includes: acquiring the number of times of caching the webpage resources of the second page when triggering the display of the webpage associated with the second page as the first number of times; acquiring the number of times of displaying a second page based on the cached webpage resource as a second number of times; determining the cache resource utilization rate corresponding to the utilization rate calculation operation according to the first times and the second times;
the first coverage rate threshold determining module is used for taking the coverage rate threshold corresponding to the previous utilization rate computing operation as the basic coverage rate threshold corresponding to the current utilization rate computing operation and reducing the basic coverage rate threshold if the utilization rate of the cache resource corresponding to the current utilization rate computing operation is higher than the utilization rate of the cache resource corresponding to the previous utilization rate computing operation, so as to obtain the coverage rate threshold corresponding to the current utilization rate computing operation; the basic coverage rate threshold corresponding to the first utilization rate calculation operation is an initial coverage rate threshold;
And the second coverage rate threshold determining module is used for taking the coverage rate threshold corresponding to the previous utilization rate computing operation as the target coverage rate threshold corresponding to the second page and stopping executing the subsequent utilization rate computing operation if the utilization rate of the cache resource corresponding to the current utilization rate computing operation is lower than the utilization rate of the cache resource corresponding to the previous utilization rate computing operation.
The resource pre-caching device provided by the embodiment of the application has the same beneficial effects as the resource pre-caching method provided by the embodiment, so that the description is omitted.
Referring to fig. 9, the schematic diagram of a page display device and the structure thereof according to an embodiment of the present application are shown.
Based on the page display method provided in the foregoing embodiment, the embodiment of the present application further provides a page display device, where the device 900 is disposed in an electronic apparatus, and includes:
a page display module 901, configured to display a first page in response to a trigger display operation for the first page; the first page is associated with a target object, and a display trigger control of a second page is deployed in the first page; the webpage resources of the second page are determined whether to be cached in advance according to the resource cache reference information of the second page; the resource cache reference information of the second page comprises historical access information of the target object to the second page and main source page information of the second page; the history access information is used for determining whether the target object is a common object of the second page, and the main source page information is used for determining whether the first page is a main source page of the second page;
The first resource obtaining module 902 is configured to, when the historical access information indicates that the target object is a common object of the second page and the primary source page information indicates that the first page is a primary source page of the second page, locally obtain, in response to a trigger display operation for the display trigger control, a web resource of the second page from the electronic device; the webpage resources of the second page are cached in the electronic equipment in advance;
the second resource obtaining module 903 is configured to respond to a trigger display operation for displaying a trigger control, where the historical access information indicates that the target object is not a common object of the second page, or that the primary source page information indicates that the first page is not a primary source page of the second page, and request a web resource of the second page from the server;
the page display module 901 is further configured to display a second page based on the web page resource of the second page.
The page display device provided by the embodiment of the application has the same beneficial effects as the page display method provided by the embodiment, so that the description is omitted.
The embodiment of the application also provides a computer device, which can be a terminal device or a server, and the terminal device and the server provided by the embodiment of the application are introduced from the aspect of hardware materialization.
Referring to fig. 10, fig. 10 is a schematic structural diagram of a terminal device according to an embodiment of the present application. As shown in fig. 10, for convenience of explanation, only the portions related to the embodiments of the present application are shown, and specific technical details are not disclosed, please refer to the method portions of the embodiments of the present application. The terminal may be any terminal device including a mobile phone, a tablet computer, a personal digital assistant (pda), a Point of Sales (POS), a vehicle-mounted computer, and the like, taking the terminal as an example of a computer:
fig. 10 is a block diagram showing a part of the structure of a computer related to a terminal provided by an embodiment of the present application. Referring to fig. 10, a computer includes: radio Frequency (RF) circuitry 1210, memory 1220, input unit 1230 (including touch panel 1231 and other input devices 1232), display unit 1240 (including display panel 1241), sensors 1250, audio circuitry 1260 (which may connect speaker 1261 and microphone 1262), wireless fidelity (wireless fidelity, wiFi) module 1270, processor 1280, and power supply 1290. Those skilled in the art will appreciate that the computer architecture shown in fig. 10 is not limiting and that more or fewer components than shown may be included, or that certain components may be combined, or that different arrangements of components may be utilized.
Memory 1220 may be used to store software programs and modules, and processor 1280 may execute the various functional applications and data processing of the computer by executing the software programs and modules stored in memory 1220. The memory 1220 may mainly include a storage program area that may store an operating system, application programs required for at least one function (such as a sound playing function, an image playing function, etc.), and a storage data area; the storage data area may store data created according to the use of the computer (such as audio data, phonebooks, etc.), and the like. In addition, memory 1220 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
Processor 1280 is a control center of the computer and connects various parts of the entire computer using various interfaces and lines, performing various functions of the computer and processing data by running or executing software programs and/or modules stored in memory 1220, and invoking data stored in memory 1220. In the alternative, processor 1280 may include one or more processing units; preferably, the processor 1280 may integrate an application processor and a modem processor, wherein the application processor primarily handles operating systems, user interfaces, application programs, etc., and the modem processor primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 1280.
In an embodiment of the present application, the processor 1280 included in the terminal further has the following functions:
acquiring resource cache reference information of a second page associated with the first page; the first page is a webpage page of which the target object is triggered to display currently, and a display trigger control of the second page is deployed in the first page; the resource cache reference information comprises historical access information of the target object to the second page and main source page information of the second page;
determining an object identification result corresponding to the target object according to the historical access information in the resource cache reference information;
determining a page identification result corresponding to the first page according to the main source page information in the resource cache reference information;
caching webpage resources of the second page under the condition that the object identification result indicates that the target object is a common object of the second page and the page identification result indicates that the first page is a main source page of the second page; and if the object identification result indicates that the target object is not a common object of the second page or the page identification result indicates that the first page is not a main source page of the second page, not caching the webpage resource of the second page.
Optionally, the processor 1280 is further configured to execute a step of any implementation manner of the resource pre-caching method provided by the embodiment of the present application, or execute a step of any implementation manner of the page display method provided by the embodiment of the present application.
Referring to fig. 11, fig. 11 is a schematic structural diagram of a server 1300 according to an embodiment of the present application. The server 1300 may vary considerably in configuration or performance and may include one or more central processing units (central processing units, CPU) 1322 (e.g., one or more processors) and memory 1332, one or more storage media 1330 (e.g., one or more mass storage devices) storing applications 1342 or data 1344. Wherein the memory 1332 and storage medium 1330 may be transitory or persistent. The program stored on the storage medium 1330 may include one or more modules (not shown), each of which may include a series of instruction operations on a server. Further, the central processor 1322 may be configured to communicate with the storage medium 1330, and execute a series of instruction operations in the storage medium 1330 on the server 1300.
The server 1300 may also include one or more power sources 1326, one or more wired or wireless network interfaces 1350,one or more input/output interfaces 1358, and/or one or more operating systems, e.g., windows Server TM ,Mac OS X TM ,Unix TM ,Linux TM ,FreeBSD TM Etc.
The steps performed by the server in the above embodiments may be based on the server structure shown in fig. 11.
Wherein CPU 1322 is configured to perform the following steps:
acquiring resource cache reference information of a second page associated with the first page; the first page is a webpage page of which the target object is triggered to display currently, and a display trigger control of the second page is deployed in the first page; the resource cache reference information comprises historical access information of the target object to the second page and main source page information of the second page;
determining an object identification result corresponding to the target object according to the historical access information in the resource cache reference information;
determining a page identification result corresponding to the first page according to the main source page information in the resource cache reference information;
caching webpage resources of the second page under the condition that the object identification result indicates that the target object is a common object of the second page and the page identification result indicates that the first page is a main source page of the second page; and if the object identification result indicates that the target object is not a common object of the second page or the page identification result indicates that the first page is not a main source page of the second page, not caching the webpage resource of the second page.
Optionally, CPU 1322 may be further configured to perform steps of any implementation of a method for pre-caching resources provided by an embodiment of the present application, or perform steps of any implementation of a method for displaying pages provided by an embodiment of the present application.
The embodiment of the application also provides a computer readable storage medium for storing a computer program for executing any one of the resource pre-caching methods described in the foregoing embodiments.
Embodiments of the present application also provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform any one of the resource pre-caching methods described in the foregoing respective embodiments.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media in which a computer program can be stored.
It should be understood that in the present application, "at least one (item)" means one or more, and "a plurality" means two or more. "and/or" for describing the association relationship of the association object, the representation may have three relationships, for example, "a and/or B" may represent: only a, only B and both a and B are present, wherein a, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (one) of a, b or c may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural.
The above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (13)

1. A method for pre-caching resources, the method comprising:
acquiring resource cache reference information of a second page associated with the first page; the first page is a webpage page of which the target object is triggered to display currently, and a display trigger control of the second page is deployed in the first page; the resource cache reference information comprises historical access information of the target object to the second page and main source page information of the second page;
determining an object identification result corresponding to the target object according to the historical access information in the resource cache reference information;
Determining a page identification result corresponding to the first page according to the main source page information in the resource cache reference information;
caching webpage resources of the second page under the condition that the object identification result indicates that the target object is a common object of the second page and the page identification result indicates that the first page is a main source page of the second page; and if the object identification result indicates that the target object is not a common object of the second page or the page identification result indicates that the first page is not a main source page of the second page, not caching the webpage resource of the second page.
2. The method of claim 1, wherein the historical access information is obtained by:
acquiring a history access record corresponding to the second page from a webpage access database; the webpage access database is used for storing a historical access record corresponding to a webpage in a target application, the target application comprises the first webpage and the second webpage, and the historical access record corresponding to the webpage at least comprises the latest access time of the target object to the webpage;
And acquiring the latest access time of the target object to the second page from the history access record corresponding to the second page as the history access information.
3. The method of claim 2, wherein the historical access record corresponding to the web page further comprises a target device identification; the target device identification is randomly generated when the target object accesses the webpage of the target application for the first time.
4. The method according to claim 2, wherein the determining the object recognition result corresponding to the target object according to the historical access information in the resource cache reference information includes:
determining that an object identification result corresponding to the target object represents that the target object is a common object of the second page under the condition that the latest access time of the target object to the second page meets the access expiration condition corresponding to the second page; the access expiration condition is determined according to the access expiration time corresponding to the second page;
and under the condition that the latest access time of the target object to the second page does not meet the access expiration condition, determining that the object identification result corresponding to the target object represents that the target object is not a common object of the second page.
5. The method of claim 4, wherein the access expiration time for the second page is determined by:
executing the operation of calculating the utilization rate once every preset time length; the utilization calculation operation includes: acquiring the number of times of caching the webpage resources of the second page when triggering the display of the webpage associated with the second page as a first number of times; acquiring the number of times of displaying the second page based on the cached webpage resource as a second number of times; determining the cache resource utilization rate corresponding to the utilization rate calculation operation at this time according to the first times and the second times;
if the cache resource utilization rate corresponding to the utilization rate calculation operation is higher than the cache resource utilization rate corresponding to the previous utilization rate calculation operation, taking the access expiration time corresponding to the previous utilization rate calculation operation as the basic access expiration time corresponding to the current utilization rate calculation operation, and reducing the basic access expiration time to obtain the access expiration time corresponding to the current utilization rate calculation operation; the basic access expiration time corresponding to the first time of the utilization rate calculation operation is the initial access expiration time;
If the cache resource utilization rate corresponding to the utilization rate calculation operation is lower than the cache resource utilization rate corresponding to the previous utilization rate calculation operation, taking the access expiration time corresponding to the previous utilization rate calculation operation as the target access expiration time corresponding to the second page, and stopping executing the subsequent utilization rate calculation operation.
6. The method of claim 1, wherein the primary source page information is determined by:
acquiring historical access records corresponding to the second page from a plurality of devices installed with target applications; the target application comprises the first page and the second page, and the history access record corresponding to the second page comprises a source page according to which the second page is accessed;
counting the source page distribution condition of the second pages according to the acquired historical access records corresponding to the second pages; the source page distribution condition comprises coverage rates corresponding to source pages associated with the second page;
determining a source page with the corresponding coverage rate meeting a preset coverage condition as a main source page of the second page according to the source page distribution condition; and generating the main source page information according to the webpage identification of the main source page.
7. The method of claim 6, wherein the determining, according to the source page distribution, the source page with the coverage rate meeting the preset coverage condition as the main source page of the second page includes:
arranging the source pages in the source page distribution condition according to the sequence of the coverage rate from big to small;
calculating the sum value of coverage rates corresponding to the source pages of the previous i-1 as a first sum value; calculating the sum of coverage rates corresponding to the source pages in the first i steps as a second sum; the i is an integer greater than 1;
and if the first sum value is smaller than or equal to a coverage rate threshold corresponding to the second page, and the second sum value is larger than the coverage rate threshold, determining that the first i-1 source pages are the main source pages.
8. The method of claim 7, wherein the coverage threshold for the second page is determined by:
executing the operation of calculating the utilization rate once every preset time length; the utilization calculation operation includes: acquiring the number of times of caching the webpage resources of the second page when triggering the display of the webpage associated with the second page as a first number of times; acquiring the number of times of displaying the second page based on the cached webpage resource as a second number of times; determining the cache resource utilization rate corresponding to the utilization rate calculation operation at this time according to the first times and the second times;
If the cache resource utilization rate corresponding to the utilization rate calculation operation at the present time is higher than the cache resource utilization rate corresponding to the utilization rate calculation operation at the previous time, taking a coverage rate threshold corresponding to the utilization rate calculation operation at the previous time as a basic coverage rate threshold corresponding to the utilization rate calculation operation at the present time, and reducing the basic coverage rate threshold to obtain a coverage rate threshold corresponding to the utilization rate calculation operation at the present time; the basic coverage rate threshold corresponding to the first utilization rate calculation operation is an initial coverage rate threshold;
and if the cache resource utilization rate corresponding to the utilization rate calculation operation is lower than the cache resource utilization rate corresponding to the previous utilization rate calculation operation, taking the coverage rate threshold corresponding to the previous utilization rate calculation operation as the target coverage rate threshold corresponding to the second page, and stopping executing the subsequent utilization rate calculation operation.
9. A method for displaying a page, the method comprising:
responding to a trigger display operation for a first page, and displaying the first page; the first page is associated with a target object, and a display trigger control of a second page is deployed in the first page; the webpage resources of the second page determine whether to cache in advance according to the resource cache reference information of the second page; the resource cache reference information of the second page comprises historical access information of the target object to the second page and main source page information of the second page; the history access information is used for determining whether the target object is a common object of the second page, and the main source page information is used for determining whether the first page is a main source page of the second page;
When the historical access information indicates that the target object is a common object of the second page and the main source page information indicates that the first page is a main source page of the second page, responding to a trigger display operation aiming at the display trigger control, and locally acquiring webpage resources of the second page from the electronic equipment; the webpage resources of the second page are cached in the electronic equipment in advance;
in the case that the historical access information characterizes that the target object is not a common object of the second page or the primary source page information characterizes that the first page is not a primary source page of the second page, responding to a trigger display operation for the display trigger control, and requesting webpage resources of the second page from a server;
and displaying the second page based on the webpage resource of the second page.
10. A resource pre-caching apparatus, the apparatus comprising:
the information acquisition module is used for acquiring resource cache reference information of a second page associated with the first page; the first page is a webpage page of which the target object is triggered to display currently, and a display trigger control of the second page is deployed in the first page; the resource cache reference information comprises historical access information of the target object to the second page and main source page information of the second page;
The object type determining module is used for determining an object recognition result corresponding to the target object according to the historical access information in the resource cache reference information;
the page type determining module is used for determining a page identification result corresponding to the first page according to the main source page information in the resource cache reference information;
the resource cache decision module is used for caching the webpage resources of the second page under the condition that the object identification result represents that the target object is a common object of the second page and the page identification result represents that the first page is a main source page of the second page; and if the object identification result indicates that the target object is not a common object of the second page or the page identification result indicates that the first page is not a main source page of the second page, not caching the webpage resource of the second page.
11. A page display device, disposed on an electronic device, the device comprising:
the page display module is used for responding to the trigger display operation for the first page and displaying the first page; the first page is associated with a target object, and a display trigger control of a second page is deployed in the first page; the webpage resources of the second page determine whether to cache in advance according to the resource cache reference information of the second page; the resource cache reference information of the second page comprises historical access information of the target object to the second page and main source page information of the second page; the history access information is used for determining whether the target object is a common object of the second page, and the main source page information is used for determining whether the first page is a main source page of the second page;
The first resource obtaining module is used for responding to the trigger display operation aiming at the display trigger control and locally obtaining the webpage resource of the second page from the electronic equipment under the condition that the historical access information indicates that the target object is a common object of the second page and the main source page information indicates that the first page is a main source page of the second page; the webpage resources of the second page are cached in the electronic equipment in advance;
the second resource obtaining module is used for responding to the trigger display operation aiming at the display trigger control and requesting the webpage resource of the second page to the server under the condition that the historical access information indicates that the target object is not a common object of the second page or the main source page information indicates that the first page is not a main source page of the second page;
the page display module is further configured to display the second page based on the web page resource of the second page.
12. A computer device, the computer device comprising a processor and a memory;
the memory is used for storing a computer program;
The processor is configured to execute the resource pre-caching method of any one of claims 1 to 8 or the page display method of claim 9 according to the computer program.
13. A computer-readable storage medium storing a computer program for executing the resource pre-caching method of any one of claims 1 to 8 or the page display method of claim 9.
CN202310800512.5A 2023-06-30 2023-06-30 Resource pre-caching method and related device Pending CN116955867A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310800512.5A CN116955867A (en) 2023-06-30 2023-06-30 Resource pre-caching method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310800512.5A CN116955867A (en) 2023-06-30 2023-06-30 Resource pre-caching method and related device

Publications (1)

Publication Number Publication Date
CN116955867A true CN116955867A (en) 2023-10-27

Family

ID=88459552

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310800512.5A Pending CN116955867A (en) 2023-06-30 2023-06-30 Resource pre-caching method and related device

Country Status (1)

Country Link
CN (1) CN116955867A (en)

Similar Documents

Publication Publication Date Title
CN109947668B (en) Method and device for storing data
US9641468B2 (en) Method, server, client, and system for releasing instant messaging key-value data
CN107896243B (en) Acceleration method and device for network data loading, storage medium and mobile terminal
WO2021068488A1 (en) Blockchain-based log processing method and apparatus, computer device, and storage medium
US11586585B2 (en) Method and system for historical call lookup in distributed file systems
CN110727727B (en) Statistical method and device for database
CN111400334B (en) Data processing method, data processing device, storage medium and electronic device
CN113420051B (en) Data query method and device, electronic equipment and storage medium
CN111859132A (en) Data processing method and device, intelligent equipment and storage medium
CN112434015B (en) Data storage method and device, electronic equipment and medium
CN109857760A (en) Quick response search method and device, computer installation and storage medium
CN108154376B (en) Data processing method and device
CN111740868A (en) Alarm data processing method and device and storage medium
US11983169B2 (en) Optimization of database write operations by combining and parallelizing operations based on a hash value of primary keys
CN114840565A (en) Sampling query method, device, electronic equipment and computer readable storage medium
CN116991800A (en) File acquisition system, method, device, computer equipment and storage medium
US20210064592A1 (en) Computer storage and retrieval mechanisms using distributed probabilistic counting
CN116955867A (en) Resource pre-caching method and related device
CN111104408A (en) Data exchange method and device based on map data and storage medium
US20150347112A1 (en) Providing data analytics for cohorts
CN110223108B (en) Click through rate prediction method, device and equipment
CN114528274A (en) Authority management method and related device
US9177255B1 (en) Cloud systems and methods for determining the probability that a second application is installed based on installation characteristics
CN114327372B (en) Quality requirement configuration method, device, equipment and medium
CN114185949A (en) Information registration method, information registration apparatus, computer device, storage medium, and program product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication