CN114461950A - Global caching method and device, electronic equipment and storage medium - Google Patents

Global caching method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114461950A
CN114461950A CN202210113641.2A CN202210113641A CN114461950A CN 114461950 A CN114461950 A CN 114461950A CN 202210113641 A CN202210113641 A CN 202210113641A CN 114461950 A CN114461950 A CN 114461950A
Authority
CN
China
Prior art keywords
user
browsed
page
network page
network
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
CN202210113641.2A
Other languages
Chinese (zh)
Inventor
王文华
朱雨凡
宋杨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
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 Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN202210113641.2A priority Critical patent/CN114461950A/en
Publication of CN114461950A publication Critical patent/CN114461950A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching

Landscapes

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

Abstract

The invention discloses a global caching method, a global caching device, electronic equipment and a storage medium. The method comprises the following steps: determining a network page to be browsed by a user; determining whether the network page to be browsed by the user is the network page browsed by the user for the first time; if so, setting a routing identifier corresponding to the network page browsed by the user for the first time as a first identifier, and performing global caching on the network page browsed by the user for the first time through a page caching mechanism. By the method, global caching can be realized in a high concurrency scene, and the load pressure of a system is effectively relieved through a page caching mechanism.

Description

Global caching method and device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a global caching method and device, electronic equipment and a storage medium.
Background
With the popularization of smart phones, the types and functions of mobile terminal applications are more and more abundant, the service functions tend to be complicated, and the quick update and iteration are performed, so that the second killing and the first-buying scene also become one of the services which are valued by e-commerce.
Under the second killing scene, the system load pressure is large due to high concurrency in a short time, a user request is blocked, request resources cannot be acquired, the page loading speed and the smoothness of operation are influenced, and the user experience is poor.
In the prior art, the application global caching mode implemented based on the Vue framework is mainly to refresh a page in forward and not to refresh the page in backward. The method still needs to interact with the server when advancing every time, re-renders the page and requests the interface, greatly influences the system performance, and lacks certain applicability to the E-commerce second-killing high-concurrency scene.
Disclosure of Invention
The embodiment of the invention provides a global caching method, a global caching device, electronic equipment and a storage medium, and aims to overcome the defect that the existing caching method cannot be applied to high-concurrency scenes.
According to an aspect of the present invention, a global caching method is provided, including:
determining a network page to be browsed by a user;
determining whether the network page to be browsed by the user is the network page browsed by the user for the first time;
if so, setting a routing identifier corresponding to the network page browsed by the user for the first time as a first identifier, and performing global caching on the network page browsed by the user for the first time through a page caching mechanism.
According to another aspect of the present invention, there is provided a global caching apparatus, including:
the first determining module is used for determining a network page to be browsed by a user;
the second determining module is used for determining whether the network page to be browsed by the user is the network page browsed by the user for the first time;
and if so, setting the routing identifier corresponding to the network page browsed by the user for the first time as a first identifier, and globally caching the network page browsed by the user for the first time through a page caching mechanism.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the global caching method according to any one of the embodiments of the invention.
According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to implement a global caching method according to any one of the embodiments of the present invention when the computer instructions are executed.
According to the technical scheme of the embodiment of the invention, whether the network page to be browsed by the user is the network page browsed by the user for the first time is determined; the network page browsed by the user for the first time is globally cached through a page caching mechanism, the problem that the existing global caching method cannot be suitable for high-concurrency scenes is solved, and the beneficial effects that the system load pressure is effectively reduced and the method is suitable for the high-concurrency scenes are achieved.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present invention, nor do they necessarily limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flowchart of a global caching method according to a first embodiment of the present invention;
fig. 2 is a schematic flowchart of a global caching method according to a second embodiment of the present invention;
fig. 3 is a flowchart illustrating a global caching method according to an exemplary embodiment of the present invention;
fig. 4 is a schematic flowchart illustrating a process of determining whether a network page is cached in a global caching method according to an exemplary embodiment of the present invention;
fig. 5 is a schematic flowchart of updating a cache in a global caching method according to an exemplary embodiment of the present invention;
fig. 6 is a schematic structural diagram of a global cache apparatus according to a third embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device of a global caching method according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention. It should be understood that the various steps recited in the method embodiments of the present invention may be performed in a different order and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the invention is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or 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.
It is noted that references to "a", "an", and "the" modifications in the present invention are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that reference to "one or more" unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present invention are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
Example one
Fig. 1 is a schematic flow chart of a global caching method according to a first embodiment of the present invention, where the method is applicable to a situation in which a network page is globally cached in a high concurrency scenario, and particularly, for a situation in which a page related to browsing and purchasing a commodity is globally cached in a commodity second killing and rob-purchasing scenario, the method may be executed by a global caching device, where the device may be implemented by software and/or hardware and is generally integrated on an electronic device, and in this embodiment, the electronic device includes but is not limited to: a computer device.
As shown in fig. 1, a global caching method provided in an embodiment of the present invention includes the following steps:
s110, determining a network page to be browsed by the user.
The web page may be a page in any application software, preferably, the web page may be a page in an H5 application, and the H5 application may be understood as an APP developed by html 5. In one embodiment, the web page may be a product detail page in the H5 application, and the user may enter the product detail page from the home page of the H5 application, and information such as a product name, a product picture, a product description, a product price, and a product stock may be displayed in the product detail page.
In this embodiment, the web page to be browsed by the user may be determined before the user enters the web page. Optionally, the electronic device may be triggered to determine the web page to be browsed by the user when the user clicks a web page to be entered, that is, a product detail page, on the APP home page.
Here, the manner in which the web page to be browsed by the user is determined is not limited, and alternatively, the determination may be made based on a network address or an identification number.
S120, determining whether the network page to be browsed by the user is the network page browsed by the user for the first time.
In this embodiment, a persistent associated array localStorage is introduced into an application, and a webpage browsing history of a user is compared with a routing guard parameter analysis value, so that a network page browsed by the user for the first time can be determined.
The localStorage is a persistent association array, the array is indexed by using character strings, the stored values are in the form of character strings, the stored data is permanent, and unless the Web application deletes the stored data intentionally or the user deletes the stored data through browser configuration, the data is kept on the user-related user equipment and never expires.
Further, the determining whether the web page to be browsed by the user is the web page browsed by the user for the first time includes: and determining whether the network page to be browsed by the user is the network page browsed by the user for the first time or not according to the parameter analysis value of the route guard and the webpage browsing history storage record of the user.
The web browsing history of the user may record the web browsing history of all users, and when a web page is browsed by the user, the web page may be recorded as browsed. It should be noted that the web browsing history of the user obtained here is authorized by the user.
In this embodiment, the address of the web page to be browsed by the user is obtained through the to parameter analysis value of the route guardian router.
The route guardian is also called a global preposition guardian, and can register by using router. When a navigation triggers, the global preposition guard can be invoked in the creation order. In the parameter list of the function, to denotes the target route object to be entered and from denotes the route object that the current navigation is leaving.
Specifically, the determining, through the parameter analysis value of the route guard and the web browsing history storage record of the user, whether the web page to be browsed by the user is the web page browsed by the user for the first time includes: acquiring the address of the network page to be browsed by the user through the parameter analysis value of the route guard; acquiring a webpage browsing history storage record of a user, wherein the webpage browsing history storage record is stored through persistent associated data; inquiring whether the address of the current network page is included in the webpage browsing history storage record or not; if not, determining that the current network page is the network page browsed by the user for the first time.
The web browsing history of the user can be stored through the localStorage, the network address to be browsed by the user is compared with the web browsing history data of the user stored in the localStorage, and if the address of the web page to be browsed by the user is not found in the web browsing history data of the user stored in the localStorage, the web page to be browsed by the user can be determined to be the web page browsed by the user for the first time.
It should be noted that, since localStorage storage data is permanent, in order to avoid confusion of user browsing, the stored content of the device can be cleared at a specific time when the user accesses the application software. Wherein the specific time point can be a user entering a mall home page.
And S130, if so, setting a routing identifier corresponding to the network page browsed by the user for the first time as a first identifier, and performing global caching on the network page browsed by the user for the first time through a page caching mechanism.
In this embodiment, if it is determined that the web page to be browsed by the user is the web page browsed by the user for the first time, the routing identifier needs to be set first, and then the page is rendered, the interface is requested, and data is acquired from the server side.
In this embodiment, in the process of browsing a web page when a user enters the web page, the web page may be globally cached through a page caching mechanism. The page caching mechanism may be stored in a computer memory, and a specific storage process of the computer memory is not described in detail herein.
An Vue cache mechanism keep-alive can be introduced into the project entry file App. That is, after Vue cache mechanism keep-alive is introduced, the web page browsed by the user for the first time can be captured and cached in the browsing process.
Vue is a progressive framework for building user interfaces, unlike other large frameworks, Vue is designed to be applied layer by layer from the bottom up. On one hand, the core library of Vue only focuses on the view layer, which is not only easy to be used, but also convenient for integration with a third party library or an existing project; on the other hand, Vue is also fully capable of providing drivers for complex single page applications when used in conjunction with modern tool chains and various supporting class libraries.
The route identifier may be route meta information of the routing module, and the route meta information may include, for example, a title of the network page, whether to cache, and the like. In this embodiment, the caching of the network page may be implemented by setting the routing identifier in cooperation with a page caching mechanism.
The first identifier may be understood as an identifier, and the first identifier may be used to characterize that the web page is cached. Illustratively, the first identifier may be false.
Further, if the network page to be browsed by the user is not the network page browsed by the user for the first time, determining that the network page to be browsed by the user is a cached network page, and setting a routing identifier corresponding to the cached network page as a second identifier.
The second identifier may be understood as an identifier different from the first identifier, and the second identifier may be used to characterize that the web page is cached. Illustratively, the second identifier may be true.
The global caching method provided by the embodiment of the invention comprises the steps of firstly determining a network page to be browsed by a user; then determining whether the network page to be browsed by the user is the network page browsed by the user for the first time; and finally, if so, globally caching the network page browsed by the user for the first time through a page caching mechanism, and setting a routing identifier corresponding to the cached network page as a second identifier. By utilizing the method, the active triggering can be realized through application software, the dependence on the mobile application is completely avoided, and the problems that the network pages in the purchase-limited technology are all passively cached, the dependence on the mobile application is high, and the initiative of the application cache is determined are solved, so that the method can be suitable for an embedded environment and has certain popularization and reference significance for accessing other third-party channels in the later period; the method is suitable for construction of the second-killing-high concurrent scene of the E-commerce platform, can effectively reduce the load pressure of the system through a page cache mechanism, and improves the performance of the system.
Example two
Fig. 2 is a schematic flow chart of a global caching method according to a second embodiment of the present invention, where the second embodiment is optimized based on the foregoing embodiments. In the embodiment, the global caching method is further expanded. Please refer to the first embodiment for a detailed description of the present embodiment.
As shown in fig. 2, a global caching method provided in the second embodiment of the present invention includes the following steps:
s210, determining a network page to be browsed by the user.
S220, determining whether the network page to be browsed by the user is the network page browsed by the user for the first time; if yes, go to S230; if not, go to step S240.
S230, setting a routing identifier corresponding to the network page browsed by the user for the first time as a first identifier, and performing global caching on the network page browsed by the user for the first time through a page caching mechanism.
S240, determining that the network page to be browsed by the user is a cached network page, and setting a set routing identifier corresponding to the cached network page as a second identifier. S250, determining whether to cache the network page browsed by the user according to the route identification corresponding to the network page browsed by the user. The web page browsed by the user can be a commodity detail page in a commodity second killing scene.
In one embodiment, after the user enters the commodity detail page, the cache update of the network page can be triggered by setting a signal value by using a Vuex state manager and an activated method according to the route identifier.
Further, the determining whether to cache the web page browsed by the user according to the route identifier corresponding to the web page browsed by the user includes: if the routing identifier corresponding to the network page browsed by the user is the first identifier, determining that the network page browsed by the user is an uncached network page; and if the routing identifier corresponding to the network page browsed by the user is the second identifier, determining that the network page browsed by the user is a cached network page.
Further, determining whether the cached network page needs to be cached; if so, performing global management on the preset function setting signal value in the cached page through a global state manager to update the cache.
The update cache can be understood as a local update cache, and the update cache can be locally updated according to an application scene. For example, when the application scene is a commodity killing scene, the commodity inventory information in the commodity detail page may be locally updated and cached.
The global state manager Vuex is a state management model developed specifically for vue. It takes the state of all components of the centralized storage management application and ensures that the state changes in a predictable way with corresponding rules. The preset function may be an activated hook function of a cached page.
In one embodiment, if the cached web page does not need to be updated, the cached web page may be obtained from the computer memory of the user and the cached web page may be displayed.
Further, the globally managing the signal value set by the global state manager and the preset function in the cached page to update the cache includes: setting a signal value by a global state manager; triggering to acquire the update information of the network page from the server side according to the signal value through the activated hook function in the cached page; and updating the cache of the network page according to the updating information.
The update information may include multiple kinds of information, different update information may be set for different example scenarios, and different update information may correspond to different signal values. For example, the updated information may be updated inventory information of the goods, updated price information of the goods, order status information of the goods, and the like.
The signal values set by different instance scenes in the high-concurrency killing process are different, and the different signal values can be globally managed through the global state manager.
The global caching method provided by the second embodiment of the invention embodies the caching process. By using the method, local cache updating can be performed according to the application scene, interaction with the server side is reduced, the request pressure of the server is further relieved, and the condition that a user is slow in loading when browsing the network page is improved.
The embodiment of the invention provides a specific implementation mode on the basis of the technical scheme of each embodiment.
Fig. 3 is a schematic flowchart of a global caching method according to an exemplary embodiment of the present invention, and as shown in fig. 3, a caching mechanism is first introduced into an entry file app. vue of a front-end Vue frame of H5, and a route identifier is added to a route module Vue; then judging whether the page is cached or not according to the routing identifier; and finally, when the user browses the page, according to the route identification, setting a signal value through Vuex + activated () to perform local updating of cache according to the application scene.
Fig. 4 is a schematic flowchart of a process of determining whether a network page is cached in a global caching method according to an exemplary embodiment of the present invention, and as shown in fig. 4, a specific process of determining whether a network page is cached and setting a route identifier is as follows: the route guardian router. Querying whether a page path exists in localStorage; if so, indicating that the network page is a page which is not entered by the user for the first time, setting a routing identifier as true, entering the page, and displaying the page through caching; if not, the network page is a page which is entered by the user for the first time, the route identifier is set to be false, localStorage storage is carried out on the page path, and page caching is carried out after the page is entered.
Fig. 5 is a schematic flow chart of updating a cache in a global caching method according to an exemplary embodiment of the present invention, as shown in fig. 5, after a user enters a page, determining whether a routing identifier is true, if so, determining that a network page is a cached page, and determining whether the cached page needs to be cached and updated, if so, updating the cache according to a signal value set by Vue + activated (), that is, performing global management by using a global state manager and a preset function setting signal value in the cached page to update the cache; if not, acquiring a network page from the computer memory for displaying; and if the routing identifier is not true, determining that the network page is an uncached page, and acquiring the initialized network page from the server side.
The global caching method provided by the exemplary embodiment of the present invention mainly utilizes a caching mechanism and a routing module of a front end Vue frame to control caching opportunities by combining with a user H5 page browsing history. In order to meet the use of the e-commerce platform in a second-highest concurrent scene, the request pressure of a server is further relieved, the condition that the page loading is slow when a user browses is improved, the use experience of the user is improved, H5 cache is performed when the user browses the page for the first time, and when the user browses for the second time, H5 updates local cache according to an application scene, so that the interaction with the server side is reduced.
EXAMPLE III
Fig. 6 is a schematic structural diagram of a global caching apparatus according to a third embodiment of the present invention, where the apparatus is applicable to a situation in which a network page is globally cached in a high concurrency scenario, and particularly, a situation in which a page is globally cached when a related commodity is browsed and purchased in a commodity second killing and robbery scenario, where the apparatus may be implemented by software and/or hardware and is generally integrated on an electronic device.
As shown in fig. 6, the apparatus includes: a first determination module 110, a second determination module 120, and a caching module 130.
A first determining module 110, configured to determine a web page to be browsed by a user;
a second determining module 120, configured to determine whether the web page to be browsed by the user is a web page browsed by the user for the first time;
and the caching module 130 is configured to set, if yes, a routing identifier corresponding to the network page first browsed by the user as a first identifier, and perform global caching on the network page first browsed by the user through a page caching mechanism.
In this embodiment, the apparatus first determines, through the first determining module 110, a web page to be browsed by the user; then, determining whether the web page to be browsed by the user is the web page browsed by the user for the first time through a second determining module 120; and finally, if so, the cache module 130 is used to set the routing identifier corresponding to the network page browsed by the user for the first time as the first identifier, and perform global cache on the network page browsed by the user for the first time through a page cache mechanism.
The embodiment provides a global caching device, which can implement global caching in a high concurrency scene, and effectively reduce system load pressure through a page caching mechanism.
Further, the apparatus further includes a third determining module configured to: if not, determining that the network page to be browsed by the user is a cached network page, and setting a routing identifier corresponding to the cached network page as a second identifier.
On the basis of the above optimization, the second determining module 120 is configured to: and determining whether the network page to be browsed by the user is the network page browsed by the user for the first time or not according to the parameter analysis value of the route guard and the webpage browsing history storage record of the user.
Based on the above technical solution, the second determining module 120 determines whether the web page to be browsed by the user is the web page browsed by the user for the first time according to the parameter analysis value of the route guard and the web browsing history storage record of the user, including: acquiring the address of the network page to be browsed by the user through the parameter analysis value of the route guard; acquiring a webpage browsing history storage record of a user; inquiring whether the address of the current network page is included in the webpage browsing history storage record or not; if not, determining that the current network page is the network page browsed by the user for the first time.
Further, the apparatus further includes a caching module configured to: and determining whether to cache the network page browsed by the user according to the route identifier corresponding to the network page browsed by the user.
Further, the caching module is specifically configured to: if the routing identifier corresponding to the network page browsed by the user is the first identifier, determining that the network page browsed by the user is an uncached network page; and if the routing identifier corresponding to the network page browsed by the user is the second identifier, determining that the network page browsed by the user is a cached network page.
Further, the apparatus further includes an update cache module, configured to: determining whether the cached network page needs to be cached; if so, performing global management through a global state manager and a preset function setting signal value in the cached page to update the cache.
Further, the updating the cache module performs global management through a global state manager and a preset function setting signal value in the cached page to update the cache, including: setting a signal value by a global state manager; triggering to acquire the update information of the network page from the server side according to the signal value through the activated hook function in the cached page; and updating the cache of the network page according to the updating information.
The global cache device can execute the global cache method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
Example four
FIG. 7 illustrates a schematic diagram of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 7, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a Read Only Memory (ROM)12, a Random Access Memory (RAM)13, and the like, wherein the memory stores a computer program executable by the at least one processor, and the processor 11 can perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM)12 or the computer program loaded from a storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data necessary for the operation of the electronic apparatus 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
A number of components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, or the like; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, or the like. The processor 11 performs the various methods and processes described above, such as the global caching method.
In some embodiments, the global caching method may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the global caching method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the global caching method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on a machine, as a stand-alone software package partly on a machine and partly on a remote machine or entirely on a remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A global caching method, comprising:
determining a network page to be browsed by a user;
determining whether the network page to be browsed by the user is the network page browsed by the user for the first time;
if so, setting a routing identifier corresponding to the network page browsed by the user for the first time as a first identifier, and performing global caching on the network page browsed by the user for the first time through a page caching mechanism.
2. The method of claim 1, further comprising:
if not, determining that the network page to be browsed by the user is a cached network page, and setting a routing identifier corresponding to the cached network page as a second identifier.
3. The method of claim 1, wherein the determining whether the web page to be browsed by the user is a web page browsed by the user for the first time comprises:
and determining whether the network page to be browsed by the user is the network page browsed by the user for the first time or not according to the parameter analysis value of the route guard and the webpage browsing history storage record of the user.
4. The method of claim 1, wherein determining whether the web page to be browsed by the user is the web page browsed for the first time by the user according to the parameter resolution value of the routing guard and the web page browsing history storage record of the user comprises:
acquiring the address of the network page to be browsed by the user through the parameter analysis value of the route guard;
acquiring a webpage browsing history storage record of a user, wherein the webpage browsing history storage record is stored through persistent associated data;
inquiring whether the address of the current network page is included in the webpage browsing history storage record or not;
if not, determining that the current network page is the network page browsed by the user for the first time.
5. The method of claim 1, further comprising:
and determining whether to cache the network page browsed by the user according to the route identifier corresponding to the network page browsed by the user.
6. The method of claim 5, wherein the determining whether to cache the web page browsed by the user according to the routing identifier corresponding to the web page browsed by the user comprises:
if the routing identifier corresponding to the network page browsed by the user is the first identifier, determining that the network page browsed by the user is an uncached network page;
and if the routing identifier corresponding to the network page browsed by the user is the second identifier, determining that the network page browsed by the user is a cached network page.
7. The method of claim 6, further comprising:
determining whether the cached network page needs to be cached;
if so, performing global management through a global state manager and a preset function setting signal value in the cached page to update the cache.
8. The method of claim 7, wherein globally managing to update the cache via a global state manager and a preset function set signal value in the cached page comprises:
setting a signal value by a global state manager;
triggering to acquire the update information of the network page from a server side according to the signal value through the activated hook function in the cached page;
and updating the cache of the network page according to the updating information.
9. A global caching apparatus, comprising:
the first determining module is used for determining a network page to be browsed by a user;
the second determining module is used for determining whether the network page to be browsed by the user is the network page browsed by the user for the first time;
and if so, setting a routing identifier corresponding to the network page browsed by the user for the first time as a first identifier, and performing global caching on the network page browsed by the user for the first time through a page caching mechanism.
10. An electronic device, characterized in that the electronic device comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the global caching method of any one of claims 1 to 7.
CN202210113641.2A 2022-01-30 2022-01-30 Global caching method and device, electronic equipment and storage medium Pending CN114461950A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210113641.2A CN114461950A (en) 2022-01-30 2022-01-30 Global caching method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210113641.2A CN114461950A (en) 2022-01-30 2022-01-30 Global caching method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114461950A true CN114461950A (en) 2022-05-10

Family

ID=81411778

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210113641.2A Pending CN114461950A (en) 2022-01-30 2022-01-30 Global caching method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114461950A (en)

Similar Documents

Publication Publication Date Title
CN113010818A (en) Access current limiting method and device, electronic equipment and storage medium
CN112612546A (en) Page loading method and device, electronic equipment and storage medium
CN113778644B (en) Task processing method, device, equipment and storage medium
CN113760977A (en) Information query method, device, equipment and storage medium
EP3642727B1 (en) Resource pre-fetch using age threshold
CN114138397B (en) Page display method and device, electronic equipment and storage medium
CN113722007B (en) Configuration method, device and system of VPN branch equipment
CN114461950A (en) Global caching method and device, electronic equipment and storage medium
CN115905322A (en) Service processing method and device, electronic equipment and storage medium
CN114861097A (en) Browser caching method and device, electronic equipment and storage medium
CN113138943B (en) Method and device for processing request
CN113360528A (en) Data query method and device based on multi-level cache
CN113760568A (en) Data processing method and device
CN113449230A (en) Method and system for determining exposure element, client and server
CN112699116A (en) Data processing method and system
CN117573267A (en) Application program data display method, system, electronic equipment and storage medium
CN116383537B (en) Page data preloading method, device, equipment and storage medium
CN114500438B (en) File sharing method and device, electronic equipment and storage medium
US20240089339A1 (en) Caching across multiple cloud environments
CN116578800A (en) Page rendering method and device, electronic equipment and computer readable storage medium
CN117891792A (en) Database data sharing method and device, electronic equipment and storage medium
CN113779450A (en) Page access method and page access device
CN116186450A (en) Micro front-end application system, application rendering method, device and storage medium
CN116414728A (en) Data cache optimization method and device, electronic equipment and medium
CN115344801A (en) Method, device, equipment and medium for updating webpage link

Legal Events

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