CN114003593A - Method and device for clearing cache data, storage medium and electronic equipment - Google Patents

Method and device for clearing cache data, storage medium and electronic equipment Download PDF

Info

Publication number
CN114003593A
CN114003593A CN202111296860.0A CN202111296860A CN114003593A CN 114003593 A CN114003593 A CN 114003593A CN 202111296860 A CN202111296860 A CN 202111296860A CN 114003593 A CN114003593 A CN 114003593A
Authority
CN
China
Prior art keywords
cache
page
script
clearing
parameter
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.)
Granted
Application number
CN202111296860.0A
Other languages
Chinese (zh)
Other versions
CN114003593B (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.)
Beijing Soufun Science & Technology Development Co ltd
Original Assignee
Beijing Soufun Science & Technology Development 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 Beijing Soufun Science & Technology Development Co ltd filed Critical Beijing Soufun Science & Technology Development Co ltd
Priority to CN202111296860.0A priority Critical patent/CN114003593B/en
Publication of CN114003593A publication Critical patent/CN114003593A/en
Application granted granted Critical
Publication of CN114003593B publication Critical patent/CN114003593B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/215Improving data quality; Data cleansing, e.g. de-duplication, removing invalid entries or correcting typographical errors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The invention provides a method and a device for clearing cache data, a storage medium and electronic equipment, wherein the method comprises the following steps: in response to modification operation of a user on data information, determining an associated page set corresponding to the data information, wherein the associated page set comprises at least one associated page; determining each cache parameter corresponding to each associated page; for each cache parameter corresponding to each associated page, determining a cache type corresponding to the cache parameter, acquiring a preset clearing script corresponding to the cache type, and generating a clearing script corresponding to the cache parameter according to the preset clearing script; and executing the clearing script corresponding to each cache parameter corresponding to the associated interface for each associated interface so as to clear the cache data corresponding to the associated interface. By applying the method provided by the invention, the cache data does not need to be manually cleared, the human resources can be saved, the consumed time is short, the efficiency is high, and the accuracy of the cache data can be improved.

Description

Method and device for clearing cache data, storage medium and electronic equipment
Technical Field
The present invention relates to the field of internet technologies, and in particular, to a method and an apparatus for removing cache data, a storage medium, and an electronic device.
Background
In the operation and maintenance process of a website or an application system, in order to reduce the response time of the front end, the server generally caches various data information called by each page in advance, and when the front end requests the data information of the current page, the server can return the cached data of the page to the front end without accessing a database.
In an actual application scenario, a worker often modifies the content of each data information in the database, and after the worker modifies a certain data information, the worker needs to clear cache data of a page calling the data information in the server to cache the modified data information in order to avoid the server feeding back cache data before modification to the front end.
At present, generally, a worker manually determines a page related to modified data information and manually clears various cache data of the related page, the clearing process is complicated and time-consuming, and it is difficult to clear the cache in real time after the data information is changed, so that the accuracy of the information of the cache data acquired by the front end is low.
Disclosure of Invention
In view of this, the embodiment of the present invention provides a method for clearing cache data, so as to solve the problems of a complicated process and long time consumption of manually clearing a cache.
The embodiment of the invention also provides a device for clearing the cache data, which is used for ensuring the actual realization and application of the method.
In order to achieve the above purpose, the embodiments of the present invention provide the following technical solutions:
a method for clearing cache data comprises the following steps:
in response to modification operation of a user on data information, determining an associated page set corresponding to the data information, wherein the associated page set comprises at least one associated page;
determining each cache parameter corresponding to each associated page;
for each cache parameter corresponding to each associated page, determining a cache type corresponding to the cache parameter, acquiring a preset clearing script corresponding to the cache type, and generating a clearing script corresponding to the cache parameter according to the preset clearing script;
and executing the clearing script corresponding to each cache parameter corresponding to the associated interface for each associated interface so as to clear the cache data corresponding to the associated interface.
Optionally, the determining the associated page set corresponding to the data information includes:
determining each target page corresponding to the data information in each pre-configured system page, wherein the target page is a system page for calling the data information;
and taking each target page corresponding to the data information as an associated page to form the associated page set.
Optionally, the method for determining each cache parameter corresponding to each associated page includes:
for each associated page, obtaining each calling interface identifier, each database cache key value and each static cache address corresponding to the associated page from preset page information, and taking each calling interface identifier, each database cache key value and each static cache address corresponding to the associated page as each cache parameter corresponding to the associated page.
Optionally, in the method, the generating an erase script corresponding to the cache parameter according to the preset erase script includes:
determining a parameter placeholder in the preset clearing script;
and replacing the parameter placeholder in the preset clearing script with the cache parameter to obtain a replacing script corresponding to the preset clearing script, and taking the replacing script as the clearing script corresponding to the cache parameter.
The above method, optionally, further includes:
and generating a cache removal record corresponding to each association interface, and storing the cache removal record corresponding to each association interface.
A cache data eviction device, comprising:
the device comprises a first determining unit, a second determining unit and a processing unit, wherein the first determining unit is used for responding to modification operation of a user on data information and determining an associated page set corresponding to the data information, and the associated page set comprises at least one associated page;
a second determining unit, configured to determine each cache parameter corresponding to each associated page;
a third determining unit, configured to determine, for each cache parameter corresponding to each associated page, a cache type corresponding to the cache parameter, obtain a preset clear script corresponding to the cache type, and generate a clear script corresponding to the cache parameter according to the preset clear script;
and the clearing unit is used for executing the clearing script corresponding to each cache parameter corresponding to the associated interface for each associated interface so as to clear the cache data corresponding to the associated interface.
The above apparatus, optionally, the first determining unit includes:
the first determining subunit is configured to determine, in each pre-configured system page, each target page corresponding to the data information, where the target page is a system page for calling the data information;
and the second determining subunit is configured to use each target page corresponding to the data information as an associated page to form the associated page set.
The above apparatus, optionally, the second determining unit includes:
and the obtaining subunit is configured to, for each associated page, obtain, from preset page information, each calling interface identifier, each database cache key value, and each static cache address corresponding to the associated page, and use each calling interface identifier, each database cache key value, and each static cache address corresponding to the associated page as each cache parameter corresponding to the associated page.
A storage medium comprising stored instructions, wherein the instructions, when executed, control a device on which the storage medium is located to perform a method of flushing cached data as described above.
An electronic device comprising a memory, and one or more instructions, wherein the one or more instructions are stored in the memory and configured to be executed by one or more processors to perform the method of flushing cached data as described above.
Based on the foregoing, the method for clearing cache data provided in the embodiments of the present invention includes: in response to modification operation of a user on data information, determining an associated page set corresponding to the data information, wherein the associated page set comprises at least one associated page; determining each cache parameter corresponding to each associated page; for each cache parameter corresponding to each associated page, determining a cache type corresponding to the cache parameter, acquiring a preset clearing script corresponding to the cache type, and generating a clearing script corresponding to the cache parameter according to the preset clearing script; and executing the clearing script corresponding to each cache parameter corresponding to the associated interface for each associated interface so as to clear the cache data corresponding to the associated interface. By applying the method provided by the embodiment of the invention, after the data information is modified by a user, the clearing script corresponding to each cache parameter corresponding to each associated page related to the data information can be generated, and the cache data of each associated page can be cleared by executing each clearing script. The cache data of the pages are not required to be cleared manually, a large amount of human resources can be saved, the time consumption is short, the clearing efficiency is high, the relevant cache data can be cleared in time after the user modifies the data information, the real-time updating of the cache data corresponding to each page is favorably ensured, and the accuracy of the cache data acquired by the front end is further improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a method for removing cache data according to an embodiment of the present invention;
fig. 2 is a flowchart of another method for clearing cache data according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a device for removing cache data according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an apparatus for clearing cache data according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In this application, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
As known in the art, information display of front-end pages such as websites is usually implemented based on cache data of a server. When the user accesses the current page, the server can return the cache data corresponding to the current page to the front end and display the cache data to the user. If the relevant information is edited by staff in the background, such as editing or operation, and the like, if the cache data in the server is not updated, the front end is difficult to acquire the updated information data in time. Therefore, the cached data of each link is generally cleared manually by a worker, the process is complicated, time and labor are wasted, the working efficiency is low, the cache is difficult to clear in real time, and the accuracy of the cached data information is low.
Therefore, the embodiment of the invention provides a method for clearing cache data, which can automatically clear the cache data of an associated page after the data information is changed, save a large amount of human resources, has high working efficiency, can clear the cache in real time, and improves the information accuracy of the cache data.
An embodiment of the present invention provides a method for removing cache data, where the method is applicable to a system for removing cache data, and an execution subject of the method may be a processor of the system, and a flowchart of the method is shown in fig. 1, and includes:
s101: in response to modification operation of a user on data information, determining an associated page set corresponding to the data information, wherein the associated page set comprises at least one associated page;
in the method provided by the embodiment of the invention, after the user modifies the data information in the database, each associated page corresponding to the data information can be determined in each system page of the service system corresponding to the data information in response to the modification operation of the user. The modification operation may specifically be an operation in which the user clicks and saves after editing the data information in the background of the service system. The service system refers to a system for calling the data information to provide service for system customers, for example, the data information is related information of a building, the service system can be a room price inquiry system, and the associated page corresponding to the data information can be a detail page of a new room.
It should be noted that, in a specific implementation process, an associated page set corresponding to a certain data information may include only one associated page or may include multiple associated pages, which is determined by an actual call relationship, and does not affect the method implementation function provided in the embodiment of the present invention.
S102: determining each cache parameter corresponding to each associated page;
in the method provided by the embodiment of the present invention, the data acquisition logic of each system page may be combed in advance, the cache source involved in the process of acquiring data by each system page is determined, and each cache parameter corresponding to each system page is configured in advance, where the cache parameter is a parameter used for indicating the location of a certain type of cache data, such as a cache address, an interface parameter, and the like. The cache parameters corresponding to each associated page may be obtained from the preconfigured information.
S103: for each cache parameter corresponding to each associated page, determining a cache type corresponding to the cache parameter, acquiring a preset clearing script corresponding to the cache type, and generating a clearing script corresponding to the cache parameter according to the preset clearing script;
in the method provided by the embodiment of the present invention, the preset clearing script corresponding to each cache type may be configured in advance according to the clearing rule of the cache data of each cache type. For example, for cache data stored in database form, a clearing script may be designed according to a clearing command of database data.
In the method provided by the embodiment of the present invention, for each cache parameter corresponding to each associated page, a preset clear script corresponding to each cache parameter may be determined according to a cache type corresponding to each cache parameter, and a clear script corresponding to each cache parameter is generated according to the preset clear script corresponding to each cache parameter.
S104: and executing the clearing script corresponding to each cache parameter corresponding to the associated interface for each associated interface so as to clear the cache data corresponding to the associated interface.
In the method provided by the embodiment of the invention, the clearing script corresponding to each cache parameter corresponding to each associated interface can be operated through the script execution command. And responding to the operation of the clearing script corresponding to the cache parameter, and clearing the cache data corresponding to the cache parameter, for example, if the cache parameter is an interface identifier and the corresponding cache type is an interface cache, and after the clearing script corresponding to the interface identifier is executed, clearing the cache data corresponding to the interface identifier. And after the clearing script corresponding to each cache parameter of each association interface is executed, the cache data of each cache type corresponding to each association page is cleared.
Based on the method provided by the embodiment of the invention, in response to the modification operation of a user on data information, determining an associated page set corresponding to the data information, wherein the associated page set comprises at least one associated page; determining each cache parameter corresponding to each associated page; for each cache parameter corresponding to each associated page, determining a cache type corresponding to the cache parameter, acquiring a preset clearing script corresponding to the cache type, and generating a clearing script corresponding to the cache parameter according to the preset clearing script; and executing the clearing script corresponding to each cache parameter corresponding to the associated interface for each associated interface so as to clear the cache data corresponding to the associated interface. By applying the method provided by the embodiment of the invention, after the user modifies the data information in the database, each associated page corresponding to the modified data information can be automatically determined, the clearing script corresponding to each cache parameter corresponding to each associated page can be generated, and the cache data of each associated page can be cleared by executing each clearing script. The method has the advantages that the page cache data can be automatically cleared, the time consumption is short, the clearing efficiency is high, the relevant cache data can be cleared in time after the user modifies the data information, the real-time updating of the cache data of the corresponding page is guaranteed, and the accuracy of the cache data acquired by the front end is improved. Secondly, the cache data of the page does not need to be cleared manually, so that a large amount of human resources can be saved.
Further, on the basis of the method shown in fig. 1, an embodiment of the present invention provides another method for clearing cache data, where in the method provided in the embodiment of the present invention, the step S101 of determining an associated page set corresponding to the data information includes:
determining each target page corresponding to the data information in each pre-configured system page, wherein the target page is a system page for calling the data information;
in the method provided by the embodiment of the invention, in the operation and maintenance process of the service system, the planning design is carried out on each system page displayed at the front end, and the data information called by each system page is recorded, specifically, the data information can be recorded correspondingly through the page identifier and the information identifier.
In the method provided by the embodiment of the invention, in the process of determining the associated page, matching can be performed in the pre-recorded information through the information identifier of the currently modified data information, and each system page corresponding to the information identifier is obtained as each target page corresponding to the data information.
And taking each target page corresponding to the data information as an associated page to form the associated page set.
In the method provided by the embodiment of the invention, each target page can be taken as an associated page, and each associated page forms an associated page set.
Based on the method provided by the embodiment of the invention, each associated page corresponding to the current modified data information can be determined through the pre-recorded information, the process is more convenient and faster, and the processing efficiency can be further improved.
To better explain the method provided by the embodiment of the present invention, on the basis of the method shown in fig. 1, the embodiment of the present invention provides another cache data clearing method, and in the method provided by the embodiment of the present invention, the process of determining each cache parameter corresponding to each associated page in step S102 includes:
for each associated page, obtaining each calling interface identifier, each database cache key value and each static cache address corresponding to the associated page from preset page information, and taking each calling interface identifier, each database cache key value and each static cache address corresponding to the associated page as each cache parameter corresponding to the associated page.
In the method provided by the embodiment of the invention, page information can be set in advance according to the acquisition path of the original data corresponding to the display content of each system page and the configuration condition of each involved link, and each cache parameter corresponding to each system page is configured in the page information, wherein each cache parameter mainly comprises three types of parameters including a calling interface identifier, a database cache key value and a static cache address.
In the method provided by the embodiment of the invention, the system page relates to cache data and comprises interface cache data of a calling interface, the calling interface identifier is an identifier of an interface called by the system page, and the interface called by the system page can be a directly called interface or an indirectly called interface.
In the method provided by the embodiment of the present invention, the cache data related to the system page includes a database cache, that is, a memory cache cached in the database, and the database storing the type of cache data may adopt a Key-Value database, that is, a database storing data by Key Value pairs. The method provided by the embodiment of the invention can adopt a Redis database. The database cache Key Value refers to a Key Value (Key) corresponding to a cache data Value (Value) stored in the database.
In the method provided by the embodiment of the invention, the cache data related to the system page also comprises a static cache, and the static cache address refers to a position address for storing the static cache data.
In the method provided by the embodiment of the invention, in the preset page information, the system page can be represented through the system page identifier so as to record each cache parameter corresponding to each system page. For each associated page corresponding to the current modified data information, matching can be performed in the preset page information through the associated page identifier corresponding to each associated page to determine the system page identifier matched with each associated page identifier, and the cache parameters such as each calling interface identifier, each database cache key value, each static cache address and the like corresponding to the matched system page identifier are used as each cache parameter corresponding to the associated page identifier.
It should be noted that, in the actual application process, there may be only one or a plurality of call interface identifiers corresponding to the associated page, and similarly, there may be only one or a plurality of static cache addresses respectively corresponding to the associated page, which is determined by the cache data source of the actual associated page, and the actual number of each type of cache parameter does not affect the method implementation function provided by the embodiment of the present invention.
On the other hand, it should be noted that the type of the specific cache parameter provided in the embodiment of the present invention is only to better illustrate a specific embodiment provided by the method provided by the present invention, and in a specific implementation process, the cache parameter corresponding to the associated page may only include one or more of the above various parameters. Each cache parameter corresponding to each system page configured in the page information is actually information required for removing each type of cache data of the system page, and specific configuration content can be determined according to actual removal requirements, for example, the page information may further include related information of a database account corresponding to the system page, which is used for removing the cache stored in the database. The specific parameter types and numbers corresponding to the system pages in the page information do not affect the implementation functions of the method provided by the embodiment of the invention.
On the basis of the method provided in the foregoing embodiment, in the method provided in the embodiment of the present invention, in the process of executing the clear script corresponding to each cache parameter corresponding to the associated interface in step S104, each clear script may be sequentially executed according to the type of the cache parameter, the clear script corresponding to the call interface identifier may be executed first, the interface cache is cleared, then the clear script corresponding to the database cache key value (Redis key value) is executed, the Redis cache is cleared, and finally the clear script corresponding to the static cache address is executed, and the static cache is cleared.
Further, on the basis of the method shown in fig. 1, in the method provided in the embodiment of the present invention, the process of generating the purge script corresponding to the cache parameter according to the preset purge script in step S103 includes:
determining a parameter placeholder in the preset clearing script;
in the method provided by the embodiment of the present invention, the preset purge script is set according to a purge rule for purging cache data of a corresponding cache type, when the cache data of a specific target is purged, a specific identifier that points to the purge target is required, when the preset purge script is configured, a position of the purge target may be indicated in the script, and the purge target is represented by a placeholder, for example, the preset purge script is "ABCDE 123 FG", where "123" is a parameter placeholder, and when the specific target is purged, a position corresponding to "123" in the script should be a parameter that indicates the purge target. The parameter placeholders contained in the preset clearing script can be determined according to the configuration condition of the preset clearing script.
And replacing the parameter placeholder in the preset clearing script with the cache parameter to obtain a replacing script corresponding to the preset clearing script, and taking the replacing script as the clearing script corresponding to the cache parameter.
In the method provided by the embodiment of the invention, the replacement operation of the parameter placeholder and the cache parameter can be executed, the parameter placeholder in the preset clearing script is replaced by the corresponding cache parameter, so as to perform parameter replacement on the preset clearing script, obtain the replaced replacing script, and the replacing script is used as the clearing script corresponding to the cache parameter. For example, the preset clearing script "ABCDE 123 FG" is a script for clearing an interface cache, the current cache parameter is a calling interface identifier, the specific parameter is "jiekou", the parameter placeholder "123" in the preset clearing script is replaced with the cache parameter "jiekou", so that a replacement script "ABCDEjiekouFG" is obtained, the replacement script is a clearing script corresponding to the calling interface identifier "jiekou", and the script is executed so that interface cache data corresponding to the interface with the interface identifier "jiekou" can be cleared.
It should be noted that the specific script and the specific identifier mentioned in the method provided by the embodiment of the present invention are only provided to better describe the script generation process in the method provided by the present invention, and the schematic example is provided, and the actual script content and the identifier content are not described.
Based on the method provided by the embodiment of the invention, the parameter placeholder is configured in the preset clearing script, the clearing script corresponding to the cache parameter can be quickly generated through parameter replacement, the process is more convenient and quicker, and the processing efficiency can be further improved.
Further, with reference to the flowchart shown in fig. 2, another method for clearing cache data according to an embodiment of the present invention is provided, where on the basis of the method shown in fig. 1, the method provided in the embodiment of the present invention further includes:
s105: and generating a cache removal record corresponding to each association interface, and storing the cache removal record corresponding to each association interface.
In the method provided by the embodiment of the present invention, after the cache data corresponding to each association interface is cleared, in the clearing process of the cache data, information such as cache content (data content of the cleared cache data), cache time (cache time of the cleared cache data), and clearing time corresponding to each association interface may be obtained to generate a cache clearing record corresponding to each association interface, and the cache clearing record corresponding to each association interface is stored in an assigned location of the database. The user can inquire the cache clearing record of each associated interface in the clearing process of the cache data through the front end, and the cache data, the cache time, the clearing time and other information corresponding to each associated page can be visually shown to the user in the front end interface.
Based on the method provided by the embodiment of the invention, the relevant information in the process of clearing the cache data can be recorded so as to be convenient for feedback to the user. The user can visually learn the information of the cache content, the cache time, the clearing time and the like of each page, and the use experience of the user can be further improved.
Corresponding to the method for removing cache data shown in fig. 1, an embodiment of the present invention further provides a device for removing cache data, which is used to implement the method shown in fig. 1 specifically, and a schematic structural diagram of the device is shown in fig. 3, where the device includes:
a first determining unit 201, configured to determine, in response to a modification operation performed on data information by a user, an associated page set corresponding to the data information, where the associated page set includes at least one associated page;
a second determining unit 202, configured to determine each cache parameter corresponding to each associated page;
a third determining unit 203, configured to determine, for each cache parameter corresponding to each associated page, a cache type corresponding to the cache parameter, obtain a preset clear script corresponding to the cache type, and generate a clear script corresponding to the cache parameter according to the preset clear script;
the clearing unit 204 is configured to, for each association interface, execute a clearing script corresponding to each cache parameter corresponding to the association interface, so as to clear cache data corresponding to the association interface.
Based on the device provided by the embodiment of the invention, in response to the modification operation of a user on data information, determining an associated page set corresponding to the data information, wherein the associated page set comprises at least one associated page; determining each cache parameter corresponding to each associated page; for each cache parameter corresponding to each associated page, determining a cache type corresponding to the cache parameter, acquiring a preset clearing script corresponding to the cache type, and generating a clearing script corresponding to the cache parameter according to the preset clearing script; and executing the clearing script corresponding to each cache parameter corresponding to the associated interface for each associated interface so as to clear the cache data corresponding to the associated interface. By applying the device provided by the embodiment of the invention, after the user modifies the data information in the database, each associated page corresponding to the modified data information can be automatically determined, the clearing script corresponding to each cache parameter corresponding to each associated page can be generated, and the cache data of each associated page can be cleared by executing each clearing script. The method has the advantages that the page cache data can be automatically cleared, the time consumption is short, the clearing efficiency is high, the relevant cache data can be cleared in time after the user modifies the data information, the real-time updating of the cache data of the corresponding page is guaranteed, and the accuracy of the cache data acquired by the front end is improved. Secondly, the cache data of the page does not need to be cleared manually, so that a large amount of human resources can be saved.
On the basis of the apparatus provided in the foregoing embodiment, in the apparatus provided in the embodiment of the present invention, the first determining unit 201 includes:
the first determining subunit is configured to determine, in each pre-configured system page, each target page corresponding to the data information, where the target page is a system page for calling the data information;
and the second determining subunit is configured to use each target page corresponding to the data information as an associated page to form the associated page set.
On the basis of the apparatus provided in the foregoing embodiment, in the apparatus provided in the embodiment of the present invention, the second determining unit 202 includes:
and the obtaining subunit is configured to, for each associated page, obtain, from preset page information, each calling interface identifier, each database cache key value, and each static cache address corresponding to the associated page, and use each calling interface identifier, each database cache key value, and each static cache address corresponding to the associated page as each cache parameter corresponding to the associated page.
In the apparatus provided in the foregoing embodiment, in the apparatus provided in the embodiment of the present invention, the third determining unit 203 includes:
a third determining subunit, configured to determine a parameter placeholder in the preset clearing script;
and the replacing subunit is used for replacing the parameter placeholder in the preset clearing script with the cache parameter to obtain a replacing script corresponding to the preset clearing script, and taking the replacing script as the clearing script corresponding to the cache parameter.
An embodiment of the present invention provides another apparatus for removing cache data, a schematic structural diagram of which is shown in fig. 4, and on the basis of the apparatus shown in fig. 3, the apparatus provided in the embodiment of the present invention further includes:
the recording unit 205 is configured to generate a cache removal record corresponding to each associated interface, and store the cache removal record corresponding to each associated interface.
The embodiment of the present invention further provides a storage medium, where the storage medium includes a stored instruction, and when the instruction runs, the device where the storage medium is located is controlled to execute the above method for clearing cache data.
An electronic device is provided in an embodiment of the present invention, and the structural diagram of the electronic device is shown in fig. 5, which specifically includes a memory 301 and one or more instructions 302, where the one or more instructions 302 are stored in the memory 301 and configured to be executed by one or more processors 303 to perform the following operations for the one or more instructions 302:
in response to modification operation of a user on data information, determining an associated page set corresponding to the data information, wherein the associated page set comprises at least one associated page;
determining each cache parameter corresponding to each associated page;
for each cache parameter corresponding to each associated page, determining a cache type corresponding to the cache parameter, acquiring a preset clearing script corresponding to the cache type, and generating a clearing script corresponding to the cache parameter according to the preset clearing script;
and executing the clearing script corresponding to each cache parameter corresponding to the associated interface for each associated interface so as to clear the cache data corresponding to the associated interface.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, the system or system embodiments are substantially similar to the method embodiments and therefore are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for related points. The above-described system and system embodiments are only illustrative, wherein the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method for removing cache data, comprising:
in response to modification operation of a user on data information, determining an associated page set corresponding to the data information, wherein the associated page set comprises at least one associated page;
determining each cache parameter corresponding to each associated page;
for each cache parameter corresponding to each associated page, determining a cache type corresponding to the cache parameter, acquiring a preset clearing script corresponding to the cache type, and generating a clearing script corresponding to the cache parameter according to the preset clearing script;
and executing the clearing script corresponding to each cache parameter corresponding to the associated interface for each associated interface so as to clear the cache data corresponding to the associated interface.
2. The method according to claim 1, wherein the determining the associated page set to which the data information corresponds comprises:
determining each target page corresponding to the data information in each pre-configured system page, wherein the target page is a system page for calling the data information;
and taking each target page corresponding to the data information as an associated page to form the associated page set.
3. The method according to claim 1, wherein the determining the respective cache parameter corresponding to each of the associated pages comprises:
for each associated page, obtaining each calling interface identifier, each database cache key value and each static cache address corresponding to the associated page from preset page information, and taking each calling interface identifier, each database cache key value and each static cache address corresponding to the associated page as each cache parameter corresponding to the associated page.
4. The method according to claim 1, wherein the generating of the erase script corresponding to the cache parameter according to the preset erase script comprises:
determining a parameter placeholder in the preset clearing script;
and replacing the parameter placeholder in the preset clearing script with the cache parameter to obtain a replacing script corresponding to the preset clearing script, and taking the replacing script as the clearing script corresponding to the cache parameter.
5. The method of claim 1, further comprising:
and generating a cache removal record corresponding to each association interface, and storing the cache removal record corresponding to each association interface.
6. An apparatus for flushing buffered data, comprising:
the device comprises a first determining unit, a second determining unit and a processing unit, wherein the first determining unit is used for responding to modification operation of a user on data information and determining an associated page set corresponding to the data information, and the associated page set comprises at least one associated page;
a second determining unit, configured to determine each cache parameter corresponding to each associated page;
a third determining unit, configured to determine, for each cache parameter corresponding to each associated page, a cache type corresponding to the cache parameter, obtain a preset clear script corresponding to the cache type, and generate a clear script corresponding to the cache parameter according to the preset clear script;
and the clearing unit is used for executing the clearing script corresponding to each cache parameter corresponding to the associated interface for each associated interface so as to clear the cache data corresponding to the associated interface.
7. The apparatus of claim 6, wherein the first determining unit comprises:
the first determining subunit is configured to determine, in each pre-configured system page, each target page corresponding to the data information, where the target page is a system page for calling the data information;
and the second determining subunit is configured to use each target page corresponding to the data information as an associated page to form the associated page set.
8. The apparatus of claim 6, wherein the second determining unit comprises:
and the obtaining subunit is configured to, for each associated page, obtain, from preset page information, each calling interface identifier, each database cache key value, and each static cache address corresponding to the associated page, and use each calling interface identifier, each database cache key value, and each static cache address corresponding to the associated page as each cache parameter corresponding to the associated page.
9. A storage medium comprising stored instructions, wherein the instructions, when executed, control a device on which the storage medium resides to perform a method of cache data eviction according to any of claims 1-5.
10. An electronic device comprising a memory and one or more instructions, wherein the one or more instructions are stored in the memory and configured to be executed by one or more processors to perform the method of cache data eviction according to any of claims 1-5.
CN202111296860.0A 2021-11-02 2021-11-02 Cache data clearing method and device, storage medium and electronic equipment Active CN114003593B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111296860.0A CN114003593B (en) 2021-11-02 2021-11-02 Cache data clearing method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111296860.0A CN114003593B (en) 2021-11-02 2021-11-02 Cache data clearing method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN114003593A true CN114003593A (en) 2022-02-01
CN114003593B CN114003593B (en) 2024-08-13

Family

ID=79927150

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111296860.0A Active CN114003593B (en) 2021-11-02 2021-11-02 Cache data clearing method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN114003593B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130226882A1 (en) * 2012-02-29 2013-08-29 International Business Machines Corporation Automatic table cleanup for relational databases
CN103559413A (en) * 2013-11-15 2014-02-05 北京搜房科技发展有限公司 Data processing method and device
US9292361B1 (en) * 2011-08-19 2016-03-22 Google Inc. Application program interface script caching and batching
WO2017092351A1 (en) * 2015-12-01 2017-06-08 乐视控股(北京)有限公司 Cache data update method and device
CN109918382A (en) * 2019-03-18 2019-06-21 Oppo广东移动通信有限公司 Data processing method, device, terminal and storage medium
CN110275877A (en) * 2019-06-24 2019-09-24 北京搜房科技发展有限公司 Data processing method and device
CN112199399A (en) * 2020-10-22 2021-01-08 支付宝(杭州)信息技术有限公司 Data processing method and device
CN112416201A (en) * 2020-11-26 2021-02-26 维沃移动通信有限公司 Application cache cleaning method and device, electronic equipment and medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9292361B1 (en) * 2011-08-19 2016-03-22 Google Inc. Application program interface script caching and batching
US20130226882A1 (en) * 2012-02-29 2013-08-29 International Business Machines Corporation Automatic table cleanup for relational databases
CN103559413A (en) * 2013-11-15 2014-02-05 北京搜房科技发展有限公司 Data processing method and device
WO2017092351A1 (en) * 2015-12-01 2017-06-08 乐视控股(北京)有限公司 Cache data update method and device
CN109918382A (en) * 2019-03-18 2019-06-21 Oppo广东移动通信有限公司 Data processing method, device, terminal and storage medium
CN110275877A (en) * 2019-06-24 2019-09-24 北京搜房科技发展有限公司 Data processing method and device
CN112199399A (en) * 2020-10-22 2021-01-08 支付宝(杭州)信息技术有限公司 Data processing method and device
CN112416201A (en) * 2020-11-26 2021-02-26 维沃移动通信有限公司 Application cache cleaning method and device, electronic equipment and medium

Also Published As

Publication number Publication date
CN114003593B (en) 2024-08-13

Similar Documents

Publication Publication Date Title
CN108549673A (en) Pre-add support method, client, server and the network system of web page resources
CN106682176A (en) Page loading method, equipment and device
WO2002101585A2 (en) Streaming of real-time data to a browser
CN114124490B (en) Method and device for publishing new media content, storage medium and electronic equipment
CN107729222A (en) User behavior statistical method, system, computer equipment and storage medium
CN114553960A (en) Data caching method, device, equipment and storage medium
CN105391774B (en) Resource request method and device based on amazon network server
CN109739906A (en) A kind of report form generation method and system
CN110413918B (en) Data transmission method, device, equipment and storage medium
CN113660359B (en) Domain name resolution record management method and device, storage medium and electronic equipment
CN114358742A (en) Workflow execution method, device, equipment and storage medium
CN114003593B (en) Cache data clearing method and device, storage medium and electronic equipment
CN113495783A (en) Service data processing method and device
CN112613275A (en) Receipt generation method and device, computer equipment and storage medium
CN111966931A (en) Rendering method and device of control
CN115963955A (en) Mobile terminal behavior data acquisition method and device
CN115757411A (en) Stock market information data management method, system, equipment and storage medium
US20220244975A1 (en) Method and system for generating natural language content from recordings of actions performed to execute workflows in an application
US20030135353A1 (en) User-executable method for complex model data analysis and associated system, computer device, and computer software program product
CN113656626A (en) Image data storage method and device, computer equipment and storage medium
CN109034982B (en) Method and device for accelerating processing of order information in ten-million-level order form
CN107679230B (en) Information processing method, system, medium, and computing device
CN115277388B (en) Network equipment management method and device, storage medium and electronic equipment
CN112015406A (en) Data processing method, page access method, device, terminal and server
CN113127056B (en) Information processing method, device, equipment and readable 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