Cache status identification acquisition method, device, computer equipment and storage medium

By searching and saving the cache status identifier in memory, local storage and server side, the problem of low cache status identifier availability and acquisition efficiency is solved, and efficient cache status identifier acquisition is achieved under different devices and user operations.

CN114780890BActive Publication Date: 2025-09-23JINTENG TECH INFORMATION (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210492893.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-07
Publication Date
2025-09-23
Estimated Expiration
2042-05-07

AI Technical Summary

Technical Problem

In the prior art, the availability and acquisition efficiency of cache status identifiers are low, especially when the user changes the device or clears the cache, they cannot be obtained. In addition, storage on the server side increases development workload and reduces efficiency.

Method used

The cache status identifier is searched in the memory, local storage and server side in turn to determine whether its value is the initial value. If it is not the initial value, it is saved to the memory or local storage to implement the cache status identifier acquisition method.

Benefits of technology

The availability and acquisition efficiency of cache status identification are improved, which avoids unavailability problems caused by users changing devices or clearing caches and reduces development workload.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114780890B_ABST
    Figure CN114780890B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses a cache status identifier acquisition method, device, computer equipment and storage medium. The present application is applied to the field of data acquisition technology, which includes: acquiring the information of the page to be loaded according to the page loading instruction, and searching in the memory whether there is a cache status identifier corresponding to the information of the page to be loaded; if not, searching in the local memory whether there is a cache status identifier; if not, sending a cache status identifier query request to the server side, so that the server side obtains the cache status identifier from the preset storage area according to the cache status identifier query request; receiving the cache status identifier sent by the server side, and judging whether the cache status value corresponding to the cache status identifier is the cache status initial value; if not, saving the cache status identifier to the memory and / or local storage according to the cache status identifier saving method. The embodiment of the present application can improve the availability and acquisition efficiency of the cache status identifier.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of data acquisition technology, and in particular to a cache status identifier acquisition method, apparatus, computer equipment, and storage medium. Background Art

[0002] Some cache status identifiers are usually used when the front-end loads a page. In the existing technology, on the one hand, the cache status identifier is stored in the current terminal cache, but if the user changes the device, the cache status identifier will become unavailable. At the same time, the cache status identifier is easily cleared by the user by clearing the cache or reinstalling the APP, which will also result in the inability to obtain the cache status identifier, that is, the availability of the cache status identifier is low; on the other hand, the cache status identifier will also be stored on the server side, but different interfaces need to be developed for different cache status identifiers, which not only increases the development workload, but also reduces the efficiency of obtaining the cache status identifier to a certain extent. Summary of the Invention

[0003] The embodiments of the present invention provide a method, apparatus, computer device and storage medium for obtaining a cache status identifier, aiming to solve the problem of low availability and acquisition efficiency of existing cache status identifiers.

[0004] In a first aspect, an embodiment of the present invention provides a method for obtaining a cache status identifier, comprising:

[0005] If a page loading instruction is received, the information of the page to be loaded is obtained according to the page loading instruction, and a cache status identifier corresponding to the information of the page to be loaded is searched in the memory;

[0006] If the cache status identifier does not exist in the memory, searching the local memory for the cache status identifier;

[0007] If the cache status identifier does not exist in the local memory, sending a cache status identifier query request to the server, so that the server obtains the cache status identifier from a preset storage area according to the cache status identifier query request;

[0008] receiving the cache status identifier sent by the server, and determining whether the cache status value corresponding to the cache status identifier is a cache status initial value;

[0009] If the cache status value is not the cache status initial value, the cache status identifier is saved to the memory and / or the local storage according to a cache status identifier saving method.

[0010] In a second aspect, an embodiment of the present invention further provides a cache status identifier acquisition device, comprising:

[0011] a first search unit configured to, upon receiving a page loading instruction, obtain information of a page to be loaded according to the page loading instruction, and search in a memory for a cache status identifier corresponding to the information of the page to be loaded;

[0012] a second searching unit, configured to search a local memory for the cache status identifier if the cache status identifier does not exist in the memory;

[0013] A first acquiring unit is configured to send a cache status identifier query request to a server if the cache status identifier does not exist in the local memory, so that the server acquires the cache status identifier from a preset storage area according to the cache status identifier query request;

[0014] a judging unit, configured to receive the cache status identifier sent by the server, and judge whether the cache status value corresponding to the cache status identifier is an initial cache status value;

[0015] The first saving unit is configured to save the cache status identifier to the memory and / or the local storage according to a cache status identifier saving method if the cache status value is not the cache status initial value.

[0016] In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the above method when executing the computer program.

[0017] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program can implement the above method when executed by a processor.

[0018] The embodiment of the present invention provides a cache status identifier acquisition method, device, computer equipment and storage medium. The method includes: if a page loading instruction is received, then the page information to be loaded is obtained according to the page loading instruction, and the cache status identifier corresponding to the page information to be loaded is searched in the memory; if the cache status identifier does not exist in the memory, then the cache status identifier is searched in the local memory; if the cache status identifier does not exist in the local memory, then a cache status identifier query request is sent to the server side, so that the server side obtains the cache status identifier from the preset storage area according to the cache status identifier query request; the cache status identifier sent by the server side is received, and it is determined whether the cache status value corresponding to the cache status identifier is the cache status initial value; if the cache status value is not the cache status initial value, then the cache status identifier is saved to the memory and / or the local memory according to the cache status identifier saving method. The technical solution of the embodiment of the present invention can improve the availability and acquisition efficiency of the cache status identifier by searching and obtaining the cache status identifier from the memory, local memory and server side in sequence. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0020] Figure 1 A schematic diagram of a process for obtaining a cache status identifier provided by an embodiment of the present invention;

[0021] Figure 2 A schematic block diagram of a cache status identifier acquisition device provided by an embodiment of the present invention; and

[0022] Figure 3 A schematic block diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0023] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0024] It will be understood that when used in this specification and the appended claims, the terms “comprises” and “comprising” indicate the presence of described features, integers, steps, operations, elements and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.

[0025] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the present invention. As used in the specification and appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms unless the context clearly indicates otherwise.

[0026] It should be further understood that the term "and / or" used in the present description and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

[0027] As used in this specification and the appended claims, the term "if" can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.

[0028] See also Figure 1 , Figure 1 This is a flow chart of the cache status identifier acquisition method provided by an embodiment of the present invention. The cache status identifier acquisition method of the embodiment of the present invention can be applied to terminals, such as smart phones, laptops, desktop computers, notebook computers and other intelligent terminal devices, and the cache status identifier acquisition method is implemented by an application installed on the terminal, thereby improving the availability and acquisition efficiency of the cache status identifier. The cache status identifier acquisition method is described in detail below. Figure 1 As shown, the method includes the following steps S100-S140.

[0029] S100: If a page loading instruction is received, obtain information of the page to be loaded according to the page loading instruction, and search in the memory for a cache status identifier corresponding to the information of the page to be loaded.

[0030] In an embodiment of the present invention, when a user clicks a jump button in a front-end page, the sending of a page loading instruction is triggered. The front-end page receives the page loading instruction and obtains information about the page to be loaded according to the page loading instruction. After obtaining the information about the page to be loaded, the field name is obtained from the information about the page to be loaded, wherein the field name corresponds one-to-one to the key name of the cache status identifier corresponding to the information about the page to be loaded; and the cache status identifier is searched in the memory according to the field name.

[0031] S110: If the cache status identifier does not exist in the memory, search the local storage for the cache status identifier.

[0032] In an embodiment of the present invention, a search is made in the memory to determine whether the cache status identifier exists. If the cache status identifier does not exist in the memory, it indicates that the user has changed the device or reinstalled the APP, or has cleared the cache status identifier by clearing the cache. Then, a search is made in the local memory to determine whether the cache status identifier exists, wherein the local memory is LocalStorage, which is a persistent storage method, that is, it can be permanently stored unless manually deleted. Understandably, if the cache status identifier exists in the memory, the cache status identifier is directly obtained from the memory for use by the front-end page. It should be noted that in other embodiments of the invention, the local memory may also be other memories, such as SessionStorage, Cookie, and IndexDB.

[0033] S120: If the cache status identifier does not exist in the local memory, send a cache status identifier query request to the server, so that the server obtains the cache status identifier from a preset storage area according to the cache status identifier query request.

[0034] In an embodiment of the present invention, a search is performed in the local memory to determine whether the cache status identifier exists. If the cache status identifier exists in the local memory, the cache status identifier and the key name corresponding to the cache status identifier are obtained from the local memory; the cache status identifier and the key name are saved to the memory in the form of a key-value pair; if the cache status identifier does not exist in the local memory, a cache status identifier query request is sent to the server side, so that the server side obtains the cache status identifier from a preset storage area according to the cache status identifier query request, wherein the preset storage area includes a Redis cache and a database. Specifically, the server side searches the Redis cache for whether the cache status identifier exists according to the cache status identifier query request. If the cache status identifier does not exist in the Redis cache, the server side searches the database for whether the cache status identifier exists. If the cache status identifier exists in the database, the cache status identifier is obtained from the database. Understandably, if the cache status identifier exists in the Redis cache, the cache status identifier is obtained from the Redis cache. It should be noted that in the embodiment of the present invention, the database is a MySQL database, and the server side can run on any mainstream platform. In other embodiments, it can also be a database such as Oracle, Sybase, DB2 and SQL server.

[0035] S130: Receive the cache status identifier sent by the server, and determine whether the cache status value corresponding to the cache status identifier is an initial cache status value.

[0036] In an embodiment of the present invention, after the server obtains the cache status identifier from the preset storage area, it will send the obtained cache status identifier to the front-end page. The front-end page receives the cache status identifier and determines whether the cache status identifier is the cache status initial value; if the cache status identifier is the cache status initial value, it indicates that the user has not visited the page to be loaded. For example, if the user enters the account opening process for the first time, the cache status identifier and the key name corresponding to the cache status identifier are saved to the memory.

[0037] S140: If the cache status value is not the cache status initial value, save the cache status identifier to the memory and / or the local storage according to a cache status identifier saving method.

[0038] In an embodiment of the present invention, if the cache status value is not the cache status initial value, it indicates that the user has also visited the page to be loaded. For example, the user is opening an account and has already operated to the second step in the account opening process. Then, the cache status identifier and the key name corresponding to the cache status identifier are saved to the memory, and it is determined whether the cache status value is the cache status final value; if the cache status identifier is the cache status final value, it indicates that the state is permanently valid unless deleted. For example, the user has successfully opened an account, then the cache status identifier and the key name corresponding to the cache status identifier are saved to the local memory. Understandably, if the cache status identifier is not the cache status final value, it indicates that there is no need to write the cache status identifier to the local memory, and the cache status identifier is directly used for the front-end page. It should be noted that in an embodiment of the present invention, the cache status identifier is an enumerable type. For example, it can be enumerated as a cache status initial value, a cache status final value, and a cache status intermediate value. In actual applications, the function that implements the enumeration function is Enumerate, which enumerates the cache status identifier through Enumerate, making the cache status identifier concise and easy to set and read. It should also be noted that in an embodiment of the present invention, after the cache status identifier and the key name corresponding to the cache status identifier are saved to the local memory, the information of the page to be loaded will be updated according to the cache status identifier; the page will be loaded and displayed according to the updated information of the page to be loaded. For example, if the user enters the account opening page for the second time, the cache status identifier is the final state value of the cache status, and the user will be shown that the account has been opened.

[0039] Figure 2 FIG is a schematic block diagram of a cache status identifier acquisition device 200 provided by an embodiment of the present invention. Figure 2 As shown, corresponding to the above cache status identifier acquisition method, the present invention also provides a cache status identifier acquisition device 200. The cache status identifier acquisition device 200 includes a unit for executing the above cache status identifier acquisition method, and the device can be configured in a terminal. Specifically, please refer to Figure 2 The cache status identifier acquisition device 200 includes a first search unit 201 , a second search unit 202 , a first acquisition unit 203 , a judgment unit 204 and a first storage unit 205 .

[0040] Among them, the first search unit 201 is used to obtain the page information to be loaded according to the page loading instruction if a page loading instruction is received, and to search in the memory whether there is a cache status identifier corresponding to the page information to be loaded; the second search unit 202 is used to search in the local memory whether there is the cache status identifier if the cache status identifier does not exist in the memory; the first acquisition unit 203 is used to send a cache status identifier query request to the server side if the cache status identifier does not exist in the local memory, so that the server side obtains the cache status identifier from the preset storage area according to the cache status identifier query request; the judgment unit 204 is used to receive the cache status identifier sent by the server side, and to judge whether the cache status value corresponding to the cache status identifier is the cache status initial value; the first saving unit 205 is used to save the cache status identifier to the memory and / or the local memory according to the cache status identifier saving method if the cache status value is not the cache status initial value.

[0041] In some embodiments, such as this embodiment, the first searching unit 201 includes a first acquiring subunit 2011 and a first searching subunit 2012 .

[0042] Among them, the first acquisition sub-unit 2011 is used to obtain the field name from the page information to be loaded, wherein the field name corresponds one-to-one to the key name of the cache status identifier corresponding to the page information to be loaded; the first search sub-unit 2012 is used to search whether the cache status identifier exists in the memory according to the field name.

[0043] In some embodiments, such as this embodiment, the first acquiring unit 203 includes a second acquiring subunit 2031 .

[0044] The second obtaining subunit 2031 is configured to send a cache status identifier query request to the server, so that the server obtains the cache status identifier from the Redis cache or database according to the cache status identifier query request.

[0045] In some embodiments, such as this embodiment, the first storage unit 205 includes a determination subunit 2051 and a storage subunit 2052 .

[0046] Among them, the judgment subunit 2051 is used to save the cache status identifier and the key name corresponding to the cache status identifier to the memory if the cache status identifier is not the cache status initial value, and judge whether the cache status value is the cache status final value; the saving subunit 2052 is used to save the cache status identifier and the key name corresponding to the cache status identifier to the local memory if the cache status identifier is the cache status final value.

[0047] In some embodiments, such as this embodiment, the cache status identifier acquisition device 200 further includes a second acquisition unit 206 , a second storage unit 207 , a third storage unit 208 , an update unit 209 and a loading and display unit 210 .

[0048] Among them, the second acquisition unit 206 is used to obtain the cache status identifier and the key name corresponding to the cache status identifier from the local memory if the cache status identifier exists in the local memory; the second saving unit 207 is used to save the cache status identifier and the key name to the memory in the form of a key-value pair; the third saving unit 208 is used to save the cache status identifier and the key name corresponding to the cache status identifier to the memory if the cache status identifier is the cache status initial value; the update unit 209 is used to update the page information to be loaded according to the cache status identifier; the loading and display unit 210 is used to load and display the page according to the updated page information to be loaded.

[0049] The specific implementation of the cache status identifier acquisition device 200 in the embodiment of the present invention corresponds to the above-mentioned cache status identifier acquisition method, which will not be described in detail here.

[0050] The cache status identification acquisition device can be implemented in the form of a computer program. The computer program can be used in Figure 3 Runs on the computer device shown.

[0051] See also Figure 3 , Figure 3 3 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device 300 is a terminal, which can be an electronic device with communication functions such as a smart phone, desktop computer, laptop computer, tablet computer, etc.

[0052] See Figure 3 The computer device 300 includes a processor 302 , a memory, and a network interface 305 connected via a system bus 301 , wherein the memory may include a storage medium 303 and an internal memory 304 .

[0053] The storage medium 303 may store an operating system 3031 and a computer program 3032. When the computer program 3032 is executed, the processor 302 may execute a cache status identification acquisition method.

[0054] The processor 302 is used to provide computing and control capabilities to support the operation of the entire computer device 300.

[0055] The internal memory 304 provides an environment for the operation of the computer program 3032 in the storage medium 303. When the computer program 3032 is executed by the processor 302, the processor 302 can execute a cache status identification acquisition method.

[0056] The network interface 305 is used to communicate with other devices through the network. Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 300 to which the solution of the present application is applied. The specific computer device 300 may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0057] Among them, the processor 302 is used to run the computer program 3032 stored in the memory to implement the following steps: if a page loading instruction is received, the page information to be loaded is obtained according to the page loading instruction, and the memory is searched for a cache status identifier corresponding to the page information to be loaded; if the cache status identifier does not exist in the memory, the local memory is searched for a cache status identifier; if the cache status identifier does not exist in the local memory, a cache status identifier query request is sent to the server side, so that the server side obtains the cache status identifier from a preset storage area according to the cache status identifier query request; the cache status identifier sent by the server side is received, and it is determined whether the cache status value corresponding to the cache status identifier is the cache status initial value; if the cache status value is not the cache status initial value, the cache status identifier is saved to the memory and / or the local memory according to the cache status identifier saving method.

[0058] In certain embodiments, such as the present embodiment, when the processor 302 implements the step of searching in the memory for a cache status identifier corresponding to the page information to be loaded, it specifically implements the following steps: obtaining a field name from the page information to be loaded, wherein the field name corresponds one-to-one to the key name of the cache status identifier corresponding to the page information to be loaded; and searching in the memory for a cache status identifier according to the field name.

[0059] In certain embodiments, such as the present embodiment, when the processor 302 implements the step of sending a cache status identifier query request to the server side so that the server side obtains the cache status identifier from a preset storage area according to the cache status identifier query request, it specifically implements the following steps: sending a cache status identifier query request to the server side so that the server side obtains the cache status identifier from the Redis cache or database according to the cache status identifier query request.

[0060] In certain embodiments, such as the present embodiment, when the processor 302 implements the step of saving the cache status identifier to the memory and / or the local memory according to the cache status identifier saving method if the cache status value is not the cache status initial value, it specifically implements the following steps: if the cache status identifier is not the cache status initial value, the cache status identifier and the key name corresponding to the cache status identifier are saved to the memory, and it is determined whether the cache status value is the cache status final state value; if the cache status identifier is the cache status final state value, the cache status identifier and the key name corresponding to the cache status identifier are saved to the local memory.

[0061] In some embodiments, such as the present embodiment, after the processor 302 implements the step of searching in the local memory for the presence of the cache status identifier, the specific implementation also includes the following steps: if the cache status identifier exists in the local memory, obtaining the cache status identifier and the key name corresponding to the cache status identifier from the local memory; and saving the cache status identifier and the key name in the form of a key-value pair to the memory.

[0062] In some embodiments, such as the present embodiment, after the processor 302 implements the step of determining whether the cache status identifier is the cache status initial value, the specific implementation also includes the following steps: if the cache status identifier is the cache status initial value, then the cache status identifier and the key name corresponding to the cache status identifier are saved to the memory.

[0063] In certain embodiments, such as the present embodiment, after the processor 302 implements the step of saving the cache status identifier to the memory and / or the local storage according to the cache status identifier saving method if the cache status value is not the cache status initial value, the specific implementation also includes the following steps: updating the to-be-loaded page information according to the cache status identifier; loading the page according to the updated to-be-loaded page information and displaying it.

[0064] It should be understood that in the embodiment of the present application, the processor 302 may be a central processing unit (CPU), and the processor 302 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0065] Those skilled in the art will appreciate that all or part of the steps in the method of the above-described embodiment can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. The computer program is executed by at least one processor in the computer system to implement the steps in the method of the above-described embodiment.

[0066] Therefore, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program. The computer program is executed by at least one processor in the computer system to implement the process steps of the embodiment of the cache status identification acquisition method described above.

[0067] The storage medium may be any computer-readable storage medium that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk.

[0068] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the composition and steps of each example according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0069] In the several embodiments provided herein, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the various units is merely a logical functional division, and actual implementation may employ other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be omitted or not implemented.

[0070] The steps in the methods of the embodiments of the present invention may be adjusted in order, combined, or deleted as needed. The units in the devices of the embodiments of the present invention may be combined, divided, or deleted as needed. Furthermore, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit.

[0071] If this integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the existing technology, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, terminal, or network device, etc.) to execute all or part of the steps of the method described in various embodiments of the present invention.

[0072] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0073] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, to the extent such changes and modifications fall within the scope of the claims and their equivalents, the present invention is intended to encompass such changes and modifications.

[0074] The foregoing description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art will readily conceive of various equivalent modifications or substitutions within the technical scope disclosed herein, and such modifications or substitutions are intended to be encompassed within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of protection of the claims.

Claims

1. A method for obtaining a cache status identifier, characterized in that: include: If a page loading instruction is received, the information of the page to be loaded is obtained according to the page loading instruction, and a cache status identifier corresponding to the information of the page to be loaded is searched in the memory; If the cache status identifier does not exist in the memory, searching the local memory for the cache status identifier; If the cache status identifier does not exist in the local memory, sending a cache status identifier query request to the server, so that the server obtains the cache status identifier from a preset storage area according to the cache status identifier query request; receiving the cache status identifier sent by the server, and determining whether the cache status value corresponding to the cache status identifier is the cache status initial value; If the cache status value is not the cache status initial value, saving the cache status identifier to the memory and / or the local storage according to a cache status identifier saving method; If the cache status value is not the cache status initial value, saving the cache status identifier to the memory and / or the local storage according to a cache status identifier saving method includes: If the cache status identifier is not the cache status initial value, saving the cache status identifier and the key name corresponding to the cache status identifier to the memory, and determining whether the cache status value is the cache status final value; If the cache status identifier is the cache status final state value, the cache status identifier and the key name corresponding to the cache status identifier are saved in the local memory.

2. The cache status identification acquisition method according to claim 1, characterized in that: The searching in the memory for whether there is a cache status identifier corresponding to the page information to be loaded includes: Acquire a field name from the to-be-loaded page information, wherein the field name corresponds one-to-one to a key name of a cache status identifier corresponding to the to-be-loaded page information; The cache status identifier is searched in the memory according to the field name.

3. The cache status identification acquisition method according to claim 1, characterized in that: The sending of a cache status identifier query request to the server, so that the server obtains the cache status identifier from a preset storage area according to the cache status identifier query request, includes: A cache status identifier query request is sent to the server, so that the server obtains the cache status identifier from the Redis cache or database according to the cache status identifier query request.

4. The method for obtaining a cache status identifier according to claim 1, wherein: After searching the local memory for the cache status identifier, the method further includes: If the cache status identifier exists in the local memory, obtaining the cache status identifier and a key name corresponding to the cache status identifier from the local memory; The cache status identifier and the key name are saved in the memory in the form of a key-value pair.

5. The method for obtaining a cache status identifier according to claim 1, wherein: After determining whether the cache status identifier is the cache status initial value, the method further includes: If the cache status identifier is the cache status initial value, the cache status identifier and the key name corresponding to the cache status identifier are saved in the memory.

6. The method for obtaining a cache status identifier according to claim 1, wherein: If the cache status value is not the cache status initial value, after saving the cache status identifier to the memory and / or the local storage according to the cache status identifier saving method, the method further includes: Updating the to-be-loaded page information according to the cache status identifier; The page is loaded and displayed according to the updated information of the page to be loaded.

7. A cache status identification acquisition device, characterized in that: include: a first search unit configured to, upon receiving a page loading instruction, obtain information of a page to be loaded according to the page loading instruction, and search in a memory for a cache status identifier corresponding to the information of the page to be loaded; a second searching unit, configured to search a local memory for the cache status identifier if the cache status identifier does not exist in the memory; A first acquiring unit is configured to send a cache status identifier query request to a server if the cache status identifier does not exist in the local memory, so that the server acquires the cache status identifier from a preset storage area according to the cache status identifier query request; a judging unit, configured to receive the cache status identifier sent by the server, and judge whether the cache status value corresponding to the cache status identifier is an initial cache status value; a first saving unit, configured to save the cache status identifier to the memory and / or the local storage according to a cache status identifier saving method if the cache status value is not the cache status initial value; Wherein, the first storage unit includes: a judging subunit, configured to, if the cache status identifier is not the cache status initial value, save the cache status identifier and the key name corresponding to the cache status identifier to the memory, and judge whether the cache status value is the cache status final value; The saving subunit is configured to save the cache status identifier and a key name corresponding to the cache status identifier to the local memory if the cache status identifier is the cache status final state value.

8. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the cache status identification acquisition method according to any one of claims 1 to 6 when executing the computer program.

9. A computer-readable storage medium, characterized in that The storage medium stores a computer program, and when the computer program is executed by a processor, the method for obtaining a cache status identifier according to any one of claims 1 to 6 can be implemented.

Citation Information

Patent Citations

  • Page data acquiring method and device

    CN105786844A

  • Method and device for synchronizing data, electronic equipment and computer readable medium

    CN110633324A