CN108536617B - Cache management method, medium, system and electronic device - Google Patents

Cache management method, medium, system and electronic device Download PDF

Info

Publication number
CN108536617B
CN108536617B CN201810295031.2A CN201810295031A CN108536617B CN 108536617 B CN108536617 B CN 108536617B CN 201810295031 A CN201810295031 A CN 201810295031A CN 108536617 B CN108536617 B CN 108536617B
Authority
CN
China
Prior art keywords
interface
data
cache
configuration information
deleting
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810295031.2A
Other languages
Chinese (zh)
Other versions
CN108536617A (en
Inventor
谢家全
林耀华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wangyibao Co ltd
Original Assignee
Wangyibao Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wangyibao Co ltd filed Critical Wangyibao Co ltd
Priority to CN201810295031.2A priority Critical patent/CN108536617B/en
Publication of CN108536617A publication Critical patent/CN108536617A/en
Application granted granted Critical
Publication of CN108536617B publication Critical patent/CN108536617B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0891Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches using clearing, invalidating or resetting means
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0866Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches for peripheral storage systems, e.g. disk cache
    • G06F12/0871Allocation or management of cache space

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention provides a cache management method, which comprises the steps of obtaining an access request for accessing a first interface, determining at least one second interface associated with the first interface, and deleting at least part of cache data of the second interface. The method manages the data in the cache by using the relevance between the interfaces, so that the overdue data can be cleaned in the cache in time, and the access efficiency of the interfaces is improved. The embodiment of the invention also provides a computer readable storage medium, a cache management system and an electronic device.

Description

Cache management method, medium, system and electronic device
Technical Field
The embodiment of the invention relates to the technical field of Internet, in particular to a cache management method, a cache management medium, a cache management system and electronic equipment.
Background
This section is intended to provide a background or context to the embodiments of the invention that are recited in the claims. The description herein is not admitted to be prior art by inclusion in this section.
Cache (Cache) refers to a storage unit capable of exchanging high-speed data, which is prior to the exchange of data with a CPU, so that the speed is fast, in general, in development and application, more storage measures pointing to frequently accessed data are duplicates of acquired data, and prior to the access policy of actual data, the reading of the Cache is faster in speed, the experience is better, and when required data actually exists in the Cache, we refer to as hit.
However, in some cases, some data in the cache is already invalid, and a certain policy needs to be introduced to ensure that other programs cannot read the expired data.
The existing interface caching technology is realized based on HTTP, and the basic principle of the realization is that some key fields, such as timeout time, tag version, last modification date and the like, are added in the request and response headers of HTTP.
Disclosure of Invention
However, the existing interface cache strategy is basic, an idempotent interface can be cached, a non-idempotent interface is not cached, and in many scenes, the strategy cannot manage the cache well, and some invalid data cannot be deleted in time, so that the interface access efficiency is low.
Therefore, an improved cache management method is highly needed, which can solve the technical problem of low interface access efficiency in the prior art, and achieve the technical effects of managing cache data in a targeted manner and improving interface access efficiency.
In this context, embodiments of the present invention are intended to provide a cache management method, medium, system, and electronic device.
In a first aspect of embodiments of the present invention, a cache management method is provided, including obtaining an access request for accessing a first interface, determining at least one second interface associated with the first interface, and deleting at least part of cache data of the second interface.
According to an exemplary embodiment of the present invention, the determining at least one second interface associated with the first interface includes obtaining configuration information of the first interface, the configuration information including information of the at least one second interface associated with the first interface, and determining the at least one second interface according to the information of the at least one second interface.
According to an exemplary embodiment of the present invention, the configuration information further includes a deletion priority of the second interface, and the deleting at least a part of the cached data of the second interface includes, based on the configuration information, preferentially deleting the second interface with a higher deletion priority.
According to an exemplary embodiment of the present invention, in a case that the cache data of the second interface includes a plurality of sub data, the configuration information further includes identification information of the sub data of the second interface, and the deleting at least a part of the cache data of the second interface includes deleting a part of the sub data in the cache data of the second interface according to the identification information.
According to an exemplary embodiment of the invention, wherein the configuration information comprises an object structure stored as being made up of a plurality of key value pairs.
According to an exemplary embodiment of the present invention, the configuration information further includes at least one of a method type of the first interface, wherein the method type includes an idempotent method or a non-idempotent method, and/or an enable state of the first interface for caching data, and in a case of being in the non-enable state, the first interface for not caching data.
According to an exemplary embodiment of the present invention, in a case that the method of the first interface is an idempotent method, the method further includes, if the first interface data requested by the access request exists in a cache, updating the first interface data in the cache after responding to the access request using the data in the cache.
According to the exemplary embodiment of the present invention, the cache data of the first interface is stored in a key-value pair manner, and the name of the key includes a request address, a request header cookie, request parameters, and a method type.
In a second aspect of embodiments of the present invention there is provided a computer readable storage medium having stored thereon executable instructions which, when executed by a processing unit, cause the processing unit to perform a method according to any one of the methods described above.
In a third aspect of the embodiments of the present invention, a cache management system is provided, which includes an obtaining module, a determining module, and a deleting module. The acquisition module is used for acquiring an access request for accessing the first interface. A determination module to obtain at least one second interface associated with the first interface. And the deleting module is used for deleting at least part of the cache data of the second interface.
According to an exemplary embodiment of the invention, the determination module comprises an acquisition sub-module and a determination sub-module. The acquisition submodule is used for acquiring the configuration information of the first interface, wherein the configuration information comprises information of at least one second interface associated with the first interface. And the determining submodule is used for determining at least one second interface according to the information of the at least one second interface.
According to an exemplary embodiment of the present invention, the configuration information further includes a deletion priority of the second interface, and the deletion module includes a first deletion submodule configured to preferentially delete the second interface having a higher deletion priority based on the configuration information.
According to an exemplary embodiment of the present invention, in a case that the cache data of the second interface includes a plurality of sub data, the configuration information further includes identification information of the sub data of the second interface, and the deleting module includes a second deleting sub module, configured to delete a part of the sub data in the cache data of the second interface according to the identification information.
According to an exemplary embodiment of the invention, the configuration information comprises an object structure stored as being made up of a plurality of key value pairs.
According to an exemplary embodiment of the present invention, the configuration information further includes at least one of a method type of the first interface, wherein the method type includes an idempotent method or a non-idempotent method, and/or an enable state of the first interface for caching data, and in a case of being in the non-enable state, the first interface for not caching data.
According to an exemplary embodiment of the present invention, in a case that the method of the first interface is an idempotent method, the system further includes an updating module, configured to update the first interface data in the cache after responding to the access request by using the data in the cache if the first interface data requested by the access request exists in the cache.
According to the exemplary embodiment of the present invention, the cache data of the first interface is stored in a key-value pair manner, and the name of the key includes a request address, a request header cookie, request parameters, and a method type.
In a fourth aspect of embodiments of the present invention, there is provided an electronic device comprising a processing unit and a storage unit having stored thereon executable instructions that, when executed by the processing unit, cause the processing unit to perform any of the methods described above.
The method, the medium, the system and the electronic equipment can solve the technical problem of low interface access efficiency in the prior art, achieve the technical effects of pertinently managing the cache data and improving the interface access efficiency.
Drawings
The above and other objects, features and advantages of exemplary embodiments of the present invention will become readily apparent from the following detailed description read in conjunction with the accompanying drawings. Several embodiments of the invention are illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings and in which:
fig. 1 schematically shows a system architecture of an application cache management method according to an exemplary embodiment of the present invention;
FIG. 2 schematically illustrates a flow diagram of a cache management method according to an exemplary embodiment of the invention;
FIG. 3 schematically illustrates a flow chart of a method of determining at least one second interface associated with the first interface, according to an exemplary embodiment of the invention;
FIG. 4 schematically illustrates a computer-readable storage medium suitable for implementing a cache management method and system according to exemplary embodiments of the invention;
FIG. 5 schematically illustrates a block diagram of a cache management system according to an exemplary embodiment of the present invention;
FIG. 6 schematically illustrates a block diagram of a determination module according to an exemplary embodiment of the present invention;
FIG. 7 schematically illustrates a block diagram of a deletion module according to an exemplary embodiment of the present invention;
FIG. 8 schematically illustrates a block diagram of a cache management system according to another exemplary embodiment of the present invention; and
fig. 9 schematically illustrates an electronic device diagram suitable for implementing the cache management method and system according to an exemplary embodiment of the present invention.
In the drawings, the same or corresponding reference numerals indicate the same or corresponding parts.
Detailed Description
The principles and spirit of the present invention will be described with reference to a number of exemplary embodiments. It is understood that these embodiments are given solely for the purpose of enabling those skilled in the art to better understand and to practice the invention, and are not intended to limit the scope of the invention in any way. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
As will be appreciated by one skilled in the art, embodiments of the present invention may be embodied as a system, apparatus, device, method, or computer application. Accordingly, the present disclosure may be embodied in the form of: entirely hardware, entirely software (including firmware, resident software, micro-code, etc.), or a combination of hardware and software.
According to the embodiment of the invention, a cache management method, a cache management system and electronic equipment are provided.
In this document, it is to be understood that any number of elements in the figures are provided by way of illustration and not limitation, and any nomenclature is used for differentiation only and not in any limiting sense.
The principles and spirit of the present invention are explained in detail below with reference to several representative embodiments of the invention.
Summary of The Invention
The inventor finds that the existing interface caching strategy is basic, the caching can be performed on an idempotent interface, the caching is not performed on a non-idempotent interface, the strategy cannot manage the caching well in many scenes, and some failure data cannot be deleted in time, so that the interface access efficiency is low. The method provided by the embodiment of the invention achieves the technical effect of pertinently managing the cache data of different interfaces by acquiring the access request for accessing the first interface, determining at least one second interface associated with the first interface and deleting at least part of the cache data of the second interface.
Having described the general principles of the invention, various non-limiting embodiments of the invention are described in detail below.
Application scene overview
Referring initially to fig. 1, fig. 1 schematically illustrates a system architecture 100 for a cache management method according to an exemplary embodiment of the invention. It should be noted that fig. 1 is only an example of a system architecture to which the embodiments of the present disclosure may be applied to help those skilled in the art understand the technical content of the present disclosure, and does not mean that the embodiments of the present disclosure may not be applied to other devices, systems, environments or scenarios.
As shown in fig. 1, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, and so forth.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. Various applications may be installed on the terminal devices 101, 102, 103. The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like. The server 105 may be, for example, a server that provides various services through an interface.
It should be noted that the cache management method provided by the embodiment of the present disclosure may be generally executed by the server 105. Accordingly, the cache management system provided by the embodiments of the present disclosure may be generally disposed in the server 105. The cache management method provided by the embodiment of the present disclosure may also be executed by a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Accordingly, the cache management system provided by the embodiment of the present disclosure may also be disposed in a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, 103 and/or the server 105.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Exemplary method
In the following, in connection with the application scenario of fig. 1, a cache management method according to an exemplary embodiment of the present invention is described with reference to fig. 2. It should be noted that the above application scenarios are merely illustrated for the convenience of understanding the spirit and principles of the present invention, and the embodiments of the present invention are not limited in this respect. Rather, embodiments of the present invention may be applied to any scenario where applicable.
As shown in fig. 2, the method includes steps S210 to S230.
In step S210, an access request for accessing the first interface is acquired.
At step S220, at least one second interface associated with the first interface is determined.
In step S230, at least a part of the buffered data of the second interface is deleted.
The method can solve the problems that the existing interface cache strategy is basic, cache cannot be managed well, and some invalid data cannot be deleted in time, so that the interface access efficiency is low, and achieves the technical effect of pertinently managing the cache data of different interfaces.
According to the exemplary embodiment of the present invention, the electronic device may provide services through the interface, and different services may set different interfaces correspondingly, for example, when a user needs to query an account balance, the user may request to query the account balance by calling the balance query interface. After the query, the interface may store the query result in the cache, and when the same query request is received again, the interface may directly obtain the data from the cache without searching in the memory. However, since the data in the memory may change, the data in the cache may not change accordingly. For example, when the user calls another interface to transfer money, the account balance changes, and the balance information of the previous balance inquired by the user is still stored in the balance inquiry interface, and after the user performs the money transfer operation, it is obvious that the cached balance information is invalid and is different from the real balance information. Thus, there may be an out-of-date problem with the data in the cache.
According to the exemplary embodiment of the present invention, after the access request for accessing the first interface is obtained in step S210, step S220 is executed to determine at least one second interface associated with the first interface. Step S220 of the exemplary embodiment of the present invention will be described with reference to fig. 3.
Fig. 3 schematically shows a flow chart of a method of determining at least one second interface associated with the first interface according to an exemplary embodiment of the invention.
As shown in fig. 3, the method includes steps S310 and S320.
In step S310, configuration information of the first interface is obtained, where the configuration information includes information of at least one second interface associated with the first interface.
In step S320, at least one second interface is determined according to the information of the at least one second interface.
According to an exemplary embodiment of the invention, each interface is configured with respective configuration information in which information of at least one second interface associated with the first interface is documented. In step S310, the configuration information of the first interface may be obtained, and in step S320, at least one second interface associated with the first interface is determined according to the configuration information. When the subsequent step S230 is executed, the cache data of the second interfaces may be deleted.
For example, the first interface is a transfer interface, and when a user calls the first interface to transfer money, configuration information of the first interface is acquired, wherein the configuration information records information of at least one second interface associated with the transfer interface, such as information of a balance inquiry interface. The balance inquiry interface can be determined to be the second interface according to the configuration information of the first interface.
According to an exemplary embodiment of the present invention, the configuration information further includes a deletion priority of the second interface, and the deleting at least a part of the cached data of the second interface includes, based on the configuration information, preferentially deleting the second interface with a higher deletion priority. For example, when there are a plurality of second interfaces associated with the first interface, the data of the second interfaces may be sequentially deleted from high to low according to the deletion priority of each second interface described in the configuration information. When the computing resources are in shortage, the deletion sequence can be managed, the cache data of the important interfaces are deleted preferentially, and the reading of the expired data from the interfaces is avoided.
According to an exemplary embodiment of the present invention, in a case that the cache data of the second interface includes a plurality of sub data, the configuration information further includes identification information of the sub data of the second interface, and the deleting at least a part of the cache data of the second interface includes deleting a part of the sub data in the cache data of the second interface according to the identification information. For example, where the second interface comprises a balance query interface, the interface caches results of a previous query, including data such as a username, account balance, etc. When a user calls a transfer interface as a first interface, according to configuration information of the first interface, not only can the balance inquiry interface be determined to be a second interface, but also whether different subdata needs to be deleted can be determined according to identification information of subdata of the second interface in the configuration information, for example, account balance data in the subdata is determined to be subdata needing to be deleted, and a user name does not need to be deleted, so that part of subdata in cache data of the second interface is deleted.
According to an exemplary embodiment of the invention, wherein the configuration information comprises an object structure stored as being made up of a plurality of key value pairs. For example, the configuration information of one interface a may be configured in the form of:
Figure BDA0001618116670000081
Figure BDA0001618116670000091
wherein, the name field is the interface name, which indicates that the configuration information is the configuration information of the interface A; the influence field is an array, which indicates that the interface can be associated with the affected interface, namely, the interface affected by the interface A comprises an interface B and an interface C; method specifies the interface access mode, wherein the POST method is a non-idempotent method; the couldCache is a boolean value, and if false, no buffering is performed.
According to an exemplary embodiment of the present invention, one interface may include one or more methods.
According to an exemplary embodiment of the invention, the configuration information further comprises a method type of the first interface, wherein the method type comprises an idempotent method or a non-idempotent method. The idempotent method refers to a method that can be repeatedly performed using the same parameters and can obtain the same result. Idempotent methods do not affect the system state, and the same effect occurs from any multiple execution as from one execution. For example, the balance inquiry method returns the same result when executed one or more times, and has no influence on account data, the method belongs to an idempotent method, and the transfer method is a non-idempotent method.
According to an exemplary embodiment of the present invention, the configuration information further includes an enable state of the first interface for caching data, and in a case of being in a non-enable state, the first interface data is not cached. For example, some interfaces have data that is invalidated immediately after a single use, and therefore do not need to cache the data for that interface. The method provided by the embodiment of the disclosure can configure the interface configuration information of the data which does not need to be cached to enable the interface configuration information to be in a non-enabled state, thereby achieving the purpose of not caching the data.
According to an exemplary embodiment of the present invention, in a case that the method of the first interface is an idempotent method, the method further includes, if the first interface data requested by the access request exists in a cache, updating the first interface data in the cache after responding to the access request using the data in the cache. For example, caching data includes the number of accesses, which should be increased over multiple repeated accesses, although the method performed is idempotent. Therefore, after responding to the access request by using the data in the cache, the first interface data in the cache is updated.
According to the exemplary embodiment of the present invention, the cache data of the first interface is stored in a key-value pair manner, and the name of the key includes a request address, a request header cookie, request parameters, and a method type. For example, one account pipeline query interface may store multiple cache data from different request addresses, different times, different periods of data requested, and the like, and different methods may exist under the same interface, and the cache data of different methods are also different. The method provided by the embodiment of the disclosure can distinguish the cache data under the same interface according to a key value pair, where a key of one cache data may be, for example, "request address-request header cookie-request parameter-method type", where the request address is a network address of a requester, the request header cookie is attribute information for identifying the request, and the request parameter is a parameter related to request content, such as querying an account flow of the current month or querying an account flow of the last month, or querying an account flow of a half year, and the "current month", "last month", "half year" is the request parameter. The method of the embodiment of the disclosure can uniquely identify different cache data in the same interface.
The various methods provided by the exemplary embodiment of the present invention can flexibly configure the interface management rule according to the specific service condition, and can manage the cache data of the interface in a targeted manner, thereby effectively improving the access efficiency.
The embodiments disclosed by the invention can be combined at will or simply transformed to obtain the required processing strategy so as to realize better technical effect.
Exemplary Medium
The exemplary embodiments of this invention provide a computer-readable storage medium storing computer-executable instructions that, when executed by a processing unit, are configured to implement a cache management method as described in any of the above method embodiments.
In some possible embodiments, aspects of the present invention may also be implemented in the form of a program product including program code for causing an electronic device to perform the steps of the cache management method according to various exemplary embodiments of the present invention described in the above section "exemplary method" of this specification, when the program product is run on the electronic device, for example, the electronic device may perform step S210 as shown in fig. 2: acquiring an access request for accessing a first interface; step S220: determining at least one second interface associated with the first interface; step S230: and deleting at least part of the cache data of the second interface.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, 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.
As shown in fig. 4, a program product 400 for implementing a cache management method and system according to embodiments of the present invention is depicted, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on an electronic device. However, the program product of the present invention is not limited in this regard and, in the present document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the consumer electronic device, partly on a remote electronic device, or entirely on the remote electronic device or server. In the case of remote electronic devices, the remote electronic devices may be connected to the consumer electronic devices through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to external electronic devices (e.g., through the internet using an internet service provider).
Exemplary devices
Having described the media of an exemplary embodiment of the present invention, a cache management system of an exemplary embodiment of the present invention is next described with reference to FIG. 5.
Fig. 5 schematically shows a block diagram of a cache management system 500 according to an exemplary embodiment of the present invention.
As shown in fig. 5, the cache management system 500 includes an obtaining module 510, a determining module 520, and a deleting module 530.
The obtaining module 510, for example, performs operation S210 described above with reference to fig. 2, for obtaining an access request for accessing the first interface.
The determining module 520, for example performing operation S220 described above with reference to fig. 2, is configured to obtain at least one second interface associated with the first interface.
The deleting module 530, for example, performs the operation S230 described above with reference to fig. 2, to delete at least part of the cached data of the second interface.
Fig. 6 schematically shows a block diagram of the determination module 520 according to an exemplary embodiment of the present invention.
As shown in fig. 6, the determination module 520 includes an acquisition sub-module 610 and a determination sub-module 620.
The obtaining sub-module, for example, performs operation S310 described above with reference to fig. 3, to obtain configuration information of the first interface, where the configuration information includes information of at least one second interface associated with the first interface.
The determining sub-module, for example, performs operation S320 described above with reference to fig. 3, for determining the at least one second interface according to the information of the at least one second interface.
Fig. 7 schematically illustrates a block diagram of the deletion module 530 according to an exemplary embodiment of the present invention.
As shown in fig. 7, the deletion module 530 includes at least one of a first deletion submodule 710 or a second deletion submodule 720.
According to an exemplary embodiment of the invention, the configuration information further comprises a deletion priority of the second interface. A first deleting submodule 710, configured to preferentially delete the second interface with the higher deletion priority based on the configuration information.
According to an exemplary embodiment of the present invention, in a case that the cache data of the second interface includes a plurality of sub data, the configuration information further includes identification information of the second interface sub data. And the second deleting submodule 720 is configured to delete part of the sub data in the cache data of the second interface according to the identification information.
According to an exemplary embodiment of the invention, the configuration information comprises an object structure stored as being made up of a plurality of key value pairs.
According to an exemplary embodiment of the present invention, the configuration information further includes at least one of a method type of the first interface, wherein the method type includes an idempotent method or a non-idempotent method, and/or an enable state of the first interface for caching data, and in a case of being in the non-enable state, the first interface for not caching data.
According to an exemplary embodiment of the present invention, in case the method of the first interface is an idempotent method, the system may further comprise an update module.
Fig. 8 schematically shows a block diagram of a cache management system 800 according to another exemplary embodiment of the present invention.
As shown in fig. 8, the cache management system 800 further includes an update module 810 based on the embodiment illustrated in fig. 5.
An updating module 810, configured to update the first interface data in the cache after responding to the access request by using the data in the cache if the first interface data requested by the access request exists in the cache.
According to the exemplary embodiment of the present invention, the cache data of the first interface is stored in a key-value pair manner, and the name of the key includes a request address, a request header cookie, request parameters, and a method type.
Any number of modules, sub-modules, units, sub-units, or at least part of the functionality of any number thereof according to embodiments of the present disclosure may be implemented in one module. Any one or more of the modules, sub-modules, units, and sub-units according to the embodiments of the present disclosure may be implemented by being split into a plurality of modules. Any one or more of the modules, sub-modules, units, sub-units according to embodiments of the present disclosure may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in any other reasonable manner of hardware or firmware by integrating or packaging a circuit, or in any one of or a suitable combination of software, hardware, and firmware implementations. Alternatively, one or more of the modules, sub-modules, units, sub-units according to embodiments of the disclosure may be at least partially implemented as a computer program module, which when executed may perform the corresponding functions.
For example, any plurality of the obtaining module 510, the determining module 520, the deleting module 530, the obtaining sub-module 610, the determining sub-module 620, the first deleting sub-module 710, the second deleting sub-module 720, and the updating module 810 may be combined into one module to be implemented, or any one of the modules may be split into a plurality of modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of the other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the obtaining module 510, the determining module 520, the deleting module 530, the obtaining sub-module 610, the determining sub-module 620, the first deleting sub-module 710, the second deleting sub-module 720, and the updating module 810 may be at least partially implemented as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented by hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or implemented by any one of three implementations of software, hardware, and firmware, or in a suitable combination of any of them. Alternatively, at least one of the obtaining module 510, the determining module 520, the deleting module 530, the obtaining sub-module 610, the determining sub-module 620, the first deleting sub-module 710, the second deleting sub-module 720 and the updating module 810 may be at least partially implemented as a computer program module which, when executed, may perform a corresponding function.
Exemplary electronic device
Having described the method, medium, and apparatus of exemplary embodiments of the present invention, an electronic device of exemplary embodiments of the present invention is described next with reference to fig. 9.
Those skilled in the art will appreciate that aspects of the present invention may be implemented as a system, method, or application. Thus, various aspects of the invention may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects may be referred to herein generally as a "circuit," module, "" system "or" unit.
In some possible embodiments, an electronic device according to the invention may comprise at least one processing unit, and at least one memory unit. Wherein the storage unit stores program code that, when executed by the processing unit, causes the processing unit to perform the steps of the cache management method according to various exemplary embodiments of the present invention described in the above section "exemplary method" of the present specification. For example, the processing unit may perform step S210 as shown in fig. 2: acquiring an access request for accessing a first interface; step S220: determining at least one second interface associated with the first interface; step S230: and deleting at least part of the cache data of the second interface.
An electronic apparatus according to this embodiment of the present invention is described below with reference to fig. 9. The electronic device 900 shown in fig. 9 is only an example and should not bring any limitations to the functionality or scope of use of the embodiments of the present invention.
As shown in fig. 9, the electronic device 900 is represented in the form of a general-purpose electronic device. Components of electronic device 900 may include, but are not limited to: the at least one processing unit 910, the at least one memory unit 920, and a bus 930 that couples various system components including the memory unit 920 and the processing unit 910.
The bus 930 may include a data bus, an address bus, and a control bus.
The storage unit 920 may include volatile memory, such as a Random Access Memory (RAM)921 and/or a cache memory 922, and may further include a Read Only Memory (ROM) 923.
Storage unit 920 may also include programs/utilities 925 having a set (at least one) of program modules 924, such program modules 924 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
The electronic device 900 may also communicate with one or more external devices 940 (e.g., keyboard, pointing device, bluetooth device, etc.), which may be through an input/output (I/O) interface 950. Also, the electronic device 900 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet) via the network adapter 960. As shown, the network adapter 960 communicates with the other modules of the electronic device 900 via the bus 930. It should be appreciated that although not shown, other hardware and/or software modules may be used in conjunction with the electronic device 900, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
It should be noted that although several units/modules of the cache management system are mentioned in the above detailed description, such partitioning is merely exemplary and not mandatory. Indeed, the features and functionality of two or more of the units/modules described above may be embodied in one unit/module according to embodiments of the invention. Conversely, the features and functions of one unit/module described above may be further divided into embodiments by a plurality of units/modules.
Moreover, while the operations of the method of the invention are depicted in the drawings in a particular order, this does not require or imply that the operations must be performed in this particular order, or that all of the illustrated operations must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions.
While the spirit and principles of the invention have been described with reference to several particular embodiments, it is to be understood that the invention is not limited to the disclosed embodiments, nor is the division of aspects, which is for convenience only as the features in such aspects may not be combined to benefit. The invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.

Claims (14)

1. A cache management method, comprising:
acquiring an access request for accessing a first interface;
determining at least one second interface associated with the first interface; and
deleting at least part of the cache data of the second interface;
the determining at least one second interface associated with the first interface comprises:
acquiring configuration information of the first interface, wherein the configuration information comprises information of at least one second interface associated with the first interface; and
determining at least one second interface according to the information of the at least one second interface;
the configuration information further includes at least one of:
a method type of the first interface, wherein the method type comprises an idempotent method or a non-idempotent method;
and the enabling state of the cache data of the first interface does not cache the data of the first interface under the condition of being in the non-enabling state.
2. The method of claim 1, wherein the configuration information further comprises a deletion priority of the second interface, the deleting at least a portion of the cached data of the second interface comprising:
and based on the configuration information, preferentially deleting the second interface with higher deletion priority.
3. The method of claim 1, wherein in a case that the cached data of the second interface includes a plurality of sub-data, the configuration information further includes identification information of the sub-data of the second interface, and the deleting at least a portion of the cached data of the second interface includes:
and deleting part of sub data in the cache data of the second interface according to the identification information.
4. The method of claim 1, wherein the configuration information comprises an object structure stored as being comprised of a plurality of key value pairs.
5. The method of claim 1, wherein, in a case that the method of the first interface is an idempotent method, the method further comprises:
and if the first interface data requested by the access request exists in the cache, updating the first interface data in the cache after responding to the access request by using the data in the cache.
6. The method of claim 1, wherein the cached data of the first interface is stored as key-value pairs, the name of a key comprising a request address, a request header cookie, request parameters, and a method type.
7. A computer-readable storage medium having stored thereon executable instructions that, when executed by a processing unit, cause the processing unit to perform the method of any one of claims 1-6.
8. A cache management system, comprising:
the acquisition module is used for acquiring an access request for accessing the first interface;
a determining module, configured to obtain at least one second interface associated with the first interface; and
the deleting module is used for deleting at least part of the cache data of the second interface;
the determining module comprises: the acquisition submodule is used for acquiring configuration information of the first interface, wherein the configuration information comprises information of at least one second interface associated with the first interface;
the determining submodule is used for determining at least one second interface according to the information of the at least one second interface;
the configuration information further includes at least one of:
a method type of the first interface, wherein the method type comprises an idempotent method or a non-idempotent method;
and the enabling state of the cache data of the first interface does not cache the data of the first interface under the condition of being in the non-enabling state.
9. The system of claim 8, wherein the configuration information further comprises the second interface deletion priority, the deletion module comprising: and the first deleting submodule is used for preferentially deleting the second interface with higher deleting priority based on the configuration information.
10. The system of claim 8, wherein, in a case that the cache data of the second interface includes a plurality of sub data, the configuration information further includes identification information of the second interface sub data, and the deletion module includes: and the second deleting submodule is used for deleting partial sub-data in the cache data of the second interface according to the identification information.
11. The system of claim 8, wherein the configuration information comprises an object structure stored as being comprised of a plurality of key value pairs.
12. The system of claim 8, wherein, in the case that the method of the first interface is an idempotent method, the system further comprises: and the updating module is used for updating the first interface data in the cache after responding to the access request by using the data in the cache if the first interface data requested by the access request exists in the cache.
13. The system of claim 8, wherein the cached data of the first interface is stored as key-value pairs, the name of a key comprising a request address, a request header cookie, request parameters, and a method type.
14. An electronic device, comprising:
a processing unit; and
a storage unit having stored thereon executable instructions that, when executed by the processing unit, cause the processing unit to perform the method of any of claims 1-6.
CN201810295031.2A 2018-03-30 2018-03-30 Cache management method, medium, system and electronic device Active CN108536617B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810295031.2A CN108536617B (en) 2018-03-30 2018-03-30 Cache management method, medium, system and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810295031.2A CN108536617B (en) 2018-03-30 2018-03-30 Cache management method, medium, system and electronic device

Publications (2)

Publication Number Publication Date
CN108536617A CN108536617A (en) 2018-09-14
CN108536617B true CN108536617B (en) 2021-03-05

Family

ID=63481762

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810295031.2A Active CN108536617B (en) 2018-03-30 2018-03-30 Cache management method, medium, system and electronic device

Country Status (1)

Country Link
CN (1) CN108536617B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110650182B (en) * 2019-08-30 2023-03-07 深圳壹账通智能科技有限公司 Network caching method and device, computer equipment and storage medium
CN110807040B (en) * 2019-10-30 2023-03-24 北京达佳互联信息技术有限公司 Method, device, equipment and storage medium for managing data
CN113064551B (en) * 2020-05-15 2023-09-01 华为技术有限公司 Data writing, moving and cleaning information sending method and device and file system
CN111563216B (en) * 2020-07-16 2020-11-06 平安国际智慧城市科技股份有限公司 Local data caching method and device and related equipment
CN111984645B (en) * 2020-07-29 2023-11-24 北京字节跳动网络技术有限公司 Data processing method, device, medium and electronic equipment

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101557390A (en) * 2008-04-11 2009-10-14 北京闻言科技有限公司 Method for improving system performance by flexibly using cache technology
CN102263822A (en) * 2011-07-22 2011-11-30 北京星网锐捷网络技术有限公司 Distributed cache control method, system and device
CN102411598A (en) * 2011-07-29 2012-04-11 株洲南车时代电气股份有限公司 Method and system for realizing data consistency
CN102436443A (en) * 2010-09-29 2012-05-02 上海粱江通信系统股份有限公司 Method for improving processing performance of database-based service system
CN103490886A (en) * 2012-06-12 2014-01-01 阿里巴巴集团控股有限公司 Permission data validation method, device and system
CN103530349A (en) * 2013-09-30 2014-01-22 乐视致新电子科技(天津)有限公司 Method and equipment for cache updating
CN103645904A (en) * 2013-12-20 2014-03-19 北京京东尚科信息技术有限公司 Cache realization method of interface calling
CN106453667A (en) * 2016-12-20 2017-02-22 北京小米移动软件有限公司 Method and device for updating cached data
CN106599199A (en) * 2016-12-14 2017-04-26 国云科技股份有限公司 Data caching and synchronization method
CN106815287A (en) * 2016-12-06 2017-06-09 中国银联股份有限公司 A kind of buffer memory management method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9639466B2 (en) * 2012-10-30 2017-05-02 Nvidia Corporation Control mechanism for fine-tuned cache to backing-store synchronization

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101557390A (en) * 2008-04-11 2009-10-14 北京闻言科技有限公司 Method for improving system performance by flexibly using cache technology
CN102436443A (en) * 2010-09-29 2012-05-02 上海粱江通信系统股份有限公司 Method for improving processing performance of database-based service system
CN102263822A (en) * 2011-07-22 2011-11-30 北京星网锐捷网络技术有限公司 Distributed cache control method, system and device
CN102411598A (en) * 2011-07-29 2012-04-11 株洲南车时代电气股份有限公司 Method and system for realizing data consistency
CN103490886A (en) * 2012-06-12 2014-01-01 阿里巴巴集团控股有限公司 Permission data validation method, device and system
CN103530349A (en) * 2013-09-30 2014-01-22 乐视致新电子科技(天津)有限公司 Method and equipment for cache updating
CN103645904A (en) * 2013-12-20 2014-03-19 北京京东尚科信息技术有限公司 Cache realization method of interface calling
CN106815287A (en) * 2016-12-06 2017-06-09 中国银联股份有限公司 A kind of buffer memory management method and device
CN106599199A (en) * 2016-12-14 2017-04-26 国云科技股份有限公司 Data caching and synchronization method
CN106453667A (en) * 2016-12-20 2017-02-22 北京小米移动软件有限公司 Method and device for updating cached data

Also Published As

Publication number Publication date
CN108536617A (en) 2018-09-14

Similar Documents

Publication Publication Date Title
CN108536617B (en) Cache management method, medium, system and electronic device
US11711420B2 (en) Automated management of resource attributes across network-based services
RU2629448C2 (en) System and method of controlling and organizing web-browser cash
CN101930449B (en) Client, brokerage server and method for providing cloud storage
CN110019080B (en) Data access method and device
WO2020024895A1 (en) Method and apparatus for searching blockchain data, and storage medium
US9600486B2 (en) File system directory attribute correction
WO2020024898A1 (en) Method and apparatus for searching blockchain data, and storage medium
US20220229657A1 (en) Extensible resource compliance management
US20200104265A1 (en) Cache management
WO2020024899A1 (en) Blockchain data searching method and device, and storage medium
CN112395437B (en) 3D model loading method and device, electronic equipment and storage medium
US8725765B2 (en) Hierarchical registry federation
WO2020024902A1 (en) Method, device, and storage medium for searching for blockchain data
US11656972B1 (en) Paginating results obtained from separate programmatic interfaces
US10684898B2 (en) In-line event handlers across domains
CN110083509B (en) Method and device for arranging log data
CN113157628A (en) Storage system, data processing method and device, storage system and electronic equipment
CN113051244A (en) Data access method and device, and data acquisition method and device
CN114448976B (en) Method, device, equipment, medium and program product for assembling network message
CN111213130A (en) Performance improvements for decentralized location based deduplication
US11941074B2 (en) Fetching a query result using a query filter
CN112069185B (en) Index construction method and device, electronic equipment and medium
CN116820354B (en) Data storage method, data storage device and data storage system
CN117762898A (en) Data migration method, device, equipment and storage medium

Legal Events

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